diff --git a/m78-all/private-knowledge/.gitignore b/m78-all/private-knowledge/.gitignore new file mode 100644 index 000000000..6dc90ad1b --- /dev/null +++ b/m78-all/private-knowledge/.gitignore @@ -0,0 +1,26 @@ +*.bak +build_info.properties +.classpath +dependency-reduced-pom.xml +*.diff +.DS_Store + +# IDEA +.idea/ +*.iml +logs/ +log/ + +# eclipse (Scala IDE) +.project +.settings/ +.tags* +target/ +test-output/ +nohup* +*.log +*.swp +*.pyc +.sbtserver* +/.java-version +/private-knowledge-server/src/main/resources/athena/athena_module.md diff --git a/m78-all/private-knowledge/Dockerfile b/m78-all/private-knowledge/Dockerfile new file mode 100644 index 000000000..a9070bd12 --- /dev/null +++ b/m78-all/private-knowledge/Dockerfile @@ -0,0 +1,13 @@ +FROM openjdk:8 + +ENV APP_HOME /opt/app + +RUN mkdir -p ${APP_HOME} + +RUN echo 'Asia/Shanghai' >/etc/timezone + +COPY private-knowledge-server/target/private-knowledge-server-*.jar ${APP_HOME}/private-knowledge-server.jar + +WORKDIR ${APP_HOME} + +ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar private-knowledge-server.jar"] \ No newline at end of file diff --git a/m78-all/private-knowledge/mybatis-flex.config b/m78-all/private-knowledge/mybatis-flex.config new file mode 100644 index 000000000..a6524481c --- /dev/null +++ b/m78-all/private-knowledge/mybatis-flex.config @@ -0,0 +1 @@ +processor.enable=true \ No newline at end of file diff --git a/m78-all/private-knowledge/pom.xml b/m78-all/private-knowledge/pom.xml new file mode 100644 index 000000000..f882c10e7 --- /dev/null +++ b/m78-all/private-knowledge/pom.xml @@ -0,0 +1,146 @@ + + + + 4.0.0 + run.mone.privateknowledge + private-knowledge + 1.0-SNAPSHOT-SNAPSHOT + pom + + + private-knowledge-api + private-knowledge-common + private-knowledge-service + private-knowledge-server + + + + org.springframework.boot + spring-boot-starter-parent + 2.3.12.RELEASE + + + + + + run.mone + infra-result + 1.4-SNAPSHOT + + + com.xiaomi.youpin + aop + 1.4-SNAPSHOT + + + com.xiaomi.youpin + common + 1.7-SNAPSHOT + + + ch.qos.logback + logback-classic + 1.1.2 + + + ch.qos.logback + logback-core + 1.1.2 + + + org.apache.dubbo + dubbo + 2.7.12-mone-v20-SNAPSHOT + + + com.xiaomi.mone + dubbo-auth + 2.7.12-SNAPSHOT + + + com.xiaomi.mone + dubbo-trace + 2.7.12-SNAPSHOT + + + com.alibaba + dubbo-registry-nacos + 1.2.1-mone-SNAPSHOT + + + com.alibaba.spring + spring-context-support + 1.0.10 + + + com.alibaba.nacos + nacos-spring-context + 0.3.6-mone-SNAPSHOT + + + com.alibaba.nacos + nacos-client + 1.2.1-mone-v7-SNAPSHOT + + + com.alibaba.nacos + nacos-api + 1.2.1-mone-v3-SNAPSHOT + + + com.mybatis-flex + mybatis-flex-spring-boot-starter + 1.7.3 + + + com.mybatis-flex + mybatis-flex-codegen + 1.7.8 + + + org.apache.commons + commons-math3 + 3.6.1 + + + redis.clients + jedis + 2.9.0 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + true + true + UTF-8 + + + ${project.basedir}/src/main/java + + + + + + + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + diff --git a/m78-all/private-knowledge/private-knowledge-api/pom.xml b/m78-all/private-knowledge/private-knowledge-api/pom.xml new file mode 100644 index 000000000..b272520b8 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/pom.xml @@ -0,0 +1,38 @@ + + + + + private-knowledge + run.mone.privateknowledge + 1.0-SNAPSHOT-SNAPSHOT + + 4.0.0 + + private-knowledge-api + + + + + + run.mone + infra-result + + + + com.xiaomi.youpin + common + + + + org.projectlombok + lombok + 1.18.20 + + + + + + + \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/DemoProvider.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/DemoProvider.java new file mode 100644 index 000000000..0fbf1b965 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/DemoProvider.java @@ -0,0 +1,11 @@ +package run.mone.knowledge.api; + +import com.xiaomi.data.push.common.Health; +import run.mone.knowledge.api.dto.DemoReqDto; +import run.mone.knowledge.api.dto.DemoResDto; +import com.xiaomi.youpin.infra.rpc.Result; + +public interface DemoProvider { + + Result query(DemoReqDto reqDto); +} \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/DubboHealthProvider.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/DubboHealthProvider.java new file mode 100644 index 000000000..11bc0f3c5 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/DubboHealthProvider.java @@ -0,0 +1,9 @@ +package run.mone.knowledge.api; + +import com.xiaomi.youpin.infra.rpc.Result; +import com.xiaomi.data.push.common.Health; + +public interface DubboHealthProvider { + + Result health(); +} \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/IKnowledgeVectorProvider.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/IKnowledgeVectorProvider.java new file mode 100644 index 000000000..8a06654b6 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/IKnowledgeVectorProvider.java @@ -0,0 +1,27 @@ +package run.mone.knowledge.api; + +import com.xiaomi.youpin.infra.rpc.Result; +import run.mone.knowledge.api.dto.KnowledgeVectorDto; +import run.mone.knowledge.api.dto.SimilarKnowledgeVectorQry; +import run.mone.knowledge.api.dto.SimilarKnowledgeVectorRsp; + +import java.util.List; + +/** + * @author wmin + * @date 2024/2/5 + */ +public interface IKnowledgeVectorProvider { + + Result insertOrUpdateKnowledgeVector(KnowledgeVectorDto param); + + Result deleteKnowledgeVector(KnowledgeVectorDto param); + + /** + * 查询相似的topN条向量数据 + * @param qry + * @return + */ + Result> qrySimilarKnowledgeVector(SimilarKnowledgeVectorQry qry); + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/constant/CommonConstant.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/constant/CommonConstant.java new file mode 100644 index 000000000..a97b8a2e0 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/constant/CommonConstant.java @@ -0,0 +1,11 @@ +package run.mone.knowledge.api.constant; + +/** + * @author wmin + * @date 2024/2/5 + */ +public class CommonConstant { + + public static final String PRIVATE_KNOWLEDGE_BASE_REDIS_PREFIX = "private_knowledge_base_"; + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/DemoReqDto.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/DemoReqDto.java new file mode 100644 index 000000000..25ed6394e --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/DemoReqDto.java @@ -0,0 +1,10 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; +import lombok.ToString; + +@ToString +@Data +public class DemoReqDto { + private Long id; +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/DemoResDto.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/DemoResDto.java new file mode 100644 index 000000000..de6ec8fa5 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/DemoResDto.java @@ -0,0 +1,11 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; +import lombok.ToString; + +@ToString +@Data +public class DemoResDto { + private String test1; + private String test2; +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeTagInfo.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeTagInfo.java new file mode 100644 index 000000000..5401fad2f --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeTagInfo.java @@ -0,0 +1,13 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; + +/** + * @author wmin + * @date 2024/2/5 + */ +@Data +public class KnowledgeTagInfo { + private Integer tagIndex; + private String tagValue; +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDetailDto.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDetailDto.java new file mode 100644 index 000000000..8c3ab3ad1 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDetailDto.java @@ -0,0 +1,37 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; +import run.mone.knowledge.api.enums.KnowledgeTypeEnum; + + +/** + * @author wmin + * @date 2024/2/5 + */ +@Data +public class KnowledgeVectorDetailDto { + + /** + * @see KnowledgeTypeEnum + */ + private String type; + + private String tag1; + + private String tag2; + + private String tag3; + + private String tag4; + + private String tag5; + + private String tag6; + + private String tag7; + + private String content; + + private double[] vector; + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDetailFullDto.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDetailFullDto.java new file mode 100644 index 000000000..b599e4cc5 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDetailFullDto.java @@ -0,0 +1,29 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author wmin + * @date 2024/2/19 + */ +@Data +public class KnowledgeVectorDetailFullDto { + + private KnowledgeVectorDetailDto detailDto; + + private String type; + + //完整的tags,七层 + private List fullTags; + + private String groupTag; + + private String leafTag; + + private int groupTagIndex; + + private int leafTagIndex; + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDto.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDto.java new file mode 100644 index 000000000..133dd0974 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/KnowledgeVectorDto.java @@ -0,0 +1,35 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; +import run.mone.knowledge.api.enums.KnowledgeTypeEnum; + +import java.util.List; + + +/** + * @author wmin + * @date 2024/2/5 + */ +@Data +public class KnowledgeVectorDto { + + /** + * @see KnowledgeTypeEnum + */ + private String type; + + /** + * todo 是否需要向量化处理,true则DetailDto中content必传,false则vector必传 + */ + private boolean needEmbedding; + + private List knowledgeVectorDetailDtoList; + + /** + * 是否强制删除 + * 默认false,软删,对于软删的meta,不再insert or update其关联的detail + * 编程助手upload code场景,需要强制删除,因为后续同一个group id可能需要更新 + */ + private boolean forceDelete; + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorFullQry.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorFullQry.java new file mode 100644 index 000000000..ef8590f1f --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorFullQry.java @@ -0,0 +1,21 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author wmin + * @date 2024/2/19 + */ +@Data +public class SimilarKnowledgeVectorFullQry { + + private SimilarKnowledgeVectorQry vectorQry; + + private List tags; + + private String groupTag; + + private String leafTag; +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorQry.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorQry.java new file mode 100644 index 000000000..59c208db4 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorQry.java @@ -0,0 +1,26 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author wmin + * @date 2024/2/5 + */ +@Data +public class SimilarKnowledgeVectorQry { + + private String type; + + private List tagsInfoList; + + private String questionContent; + + private double[] questionVector; + + private Integer topN; + + private Double similarity; + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorRsp.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorRsp.java new file mode 100644 index 000000000..446750b1d --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/SimilarKnowledgeVectorRsp.java @@ -0,0 +1,21 @@ +package run.mone.knowledge.api.dto; + +import lombok.Builder; +import lombok.Data; + + +/** + * @author wmin + * @date 2024/2/5 + */ +@Data +@Builder +public class SimilarKnowledgeVectorRsp { + + private Double similarity; + + private String group; + + private String leaf; + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/TagsFullInfo.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/TagsFullInfo.java new file mode 100644 index 000000000..3bdd1cc2e --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/TagsFullInfo.java @@ -0,0 +1,21 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author wmin + * @date 2024/2/22 + */ +@Data +public class TagsFullInfo { + + private TagsInfo tagsInfo; + + private List tags; + + private String groupTag; + + private String leafTag; +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/TagsInfo.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/TagsInfo.java new file mode 100644 index 000000000..616e0fa5e --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/TagsInfo.java @@ -0,0 +1,24 @@ +package run.mone.knowledge.api.dto; + +import lombok.Data; + +/** + * @author wmin + * @date 2024/2/22 + */ +@Data +public class TagsInfo { + private String tag1; + + private String tag2; + + private String tag3; + + private String tag4; + + private String tag5; + + private String tag6; + + private String tag7; +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/VectorData.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/VectorData.java new file mode 100644 index 000000000..6253e4a50 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/VectorData.java @@ -0,0 +1,68 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.knowledge.api.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.tuple.Pair; + +import java.io.Serializable; + +/** + * @author shanwb + * @date 2024-02-06 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class VectorData implements Serializable { + + public static String SPLIT_CHAR = "_#_"; + + private String type; + + /** + * 向量元数据倒数第二级节点,比如:文件id、模块id等 + */ + private String group; + + /** + * 向量元数据叶子节点,比如文本块id、类id等 + */ + private String leaf; + + private double[] vector; + + private Double similarity; + + public String getGroupKey() { + return makeGroupKey(type, group); + } + + public static String makeGroupKey(String type, String group) { + return type + SPLIT_CHAR + group; + } + + public static Pair parseGroupKey(String groupKey) { + String[] arr = groupKey.split(SPLIT_CHAR); + return Pair.of(arr[0], arr[1]); + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/VectorLimits.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/VectorLimits.java new file mode 100644 index 000000000..0589a48f1 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/VectorLimits.java @@ -0,0 +1,44 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.knowledge.api.dto; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author shanwb + * @date 2024-02-06 + */ +@Data +@Builder +public class VectorLimits implements Serializable { + + private Integer topN = 3; + + private Double similarity; + + public Integer getRealTopN() { + if (null == similarity && null == topN) { + this.setTopN(3); + } + + return getTopN(); + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/embedding/SimilarQry.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/embedding/SimilarQry.java new file mode 100644 index 000000000..8a9965b8f --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/embedding/SimilarQry.java @@ -0,0 +1,21 @@ +package run.mone.knowledge.api.dto.embedding; + +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +/** + * @author wmin + * @date 2024/2/6 + */ +@Data +@Builder +public class SimilarQry { + + private String questionContent; + + private List baseList; + + private Integer limit = 1; +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/embedding/SimilarQryBase.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/embedding/SimilarQryBase.java new file mode 100644 index 000000000..ac9b31944 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/dto/embedding/SimilarQryBase.java @@ -0,0 +1,18 @@ +package run.mone.knowledge.api.dto.embedding; + +import lombok.Builder; +import lombok.Data; + +/** + * @author wmin + * @date 2024/2/6 + */ +@Data +@Builder +public class SimilarQryBase { + + private Long id; + + private byte[] embedding; + +} diff --git a/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/enums/KnowledgeTypeEnum.java b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/enums/KnowledgeTypeEnum.java new file mode 100644 index 000000000..8e5baf877 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-api/src/main/java/run/mone/knowledge/api/enums/KnowledgeTypeEnum.java @@ -0,0 +1,56 @@ +package run.mone.knowledge.api.enums; + +/** + * @author goodjava@qq.com + * @date 2024/1/15 14:44 + */ +public enum KnowledgeTypeEnum { + + //项目代码 project-module-class + project_code("project_code", 1, 2), + //普通文档 knowledgeBase-file-block + normal_document("normal_document", 1, 2); + + private String typeName; + private int groupTagIndex; + private int leafTagIndex; + + KnowledgeTypeEnum(String typeName, int groupTagIndex, int leafTagIndex) { + this.typeName = typeName; + this.groupTagIndex = groupTagIndex; + this.leafTagIndex = leafTagIndex; + } + + public String getTypeName() { + return typeName; + } + + public int getGroupTagIndex() { + return groupTagIndex; + } + + public int getLeafTagIndex() { + return leafTagIndex; + } + + //判断某个string是否属于当前enum(class) + public static boolean isEnumValueValid(String value) { + for (KnowledgeTypeEnum enumValue : KnowledgeTypeEnum.values()) { + if (enumValue.typeName.equals(value)) { + return true; + } + } + return false; + } + + //根据传入的typeName获取该enum(class) + public static KnowledgeTypeEnum getEnumByTypeName(String typeName) { + for (KnowledgeTypeEnum enumValue : KnowledgeTypeEnum.values()) { + if (enumValue.typeName.equals(typeName)) { + return enumValue; + } + } + return null; + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-common/pom.xml b/m78-all/private-knowledge/private-knowledge-common/pom.xml new file mode 100644 index 000000000..adee59787 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-common/pom.xml @@ -0,0 +1,26 @@ + + + + + private-knowledge + run.mone.privateknowledge + 1.0-SNAPSHOT-SNAPSHOT + + 4.0.0 + + private-knowledge-common + + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + + \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-common/src/main/java/run/mone/knowledge/common/Constant.java b/m78-all/private-knowledge/private-knowledge-common/src/main/java/run/mone/knowledge/common/Constant.java new file mode 100644 index 000000000..cc42b74ea --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-common/src/main/java/run/mone/knowledge/common/Constant.java @@ -0,0 +1,9 @@ +package run.mone.knowledge.common; + + +/** + * @author bot + */ +public class Constant { + public final static int DEF_DUBBO_TIMEOUT = 30000; +} \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/pom.xml b/m78-all/private-knowledge/private-knowledge-server/pom.xml new file mode 100644 index 000000000..9877a0956 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/pom.xml @@ -0,0 +1,142 @@ + + + + private-knowledge + run.mone.privateknowledge + 1.0-SNAPSHOT-SNAPSHOT + + 4.0.0 + + private-knowledge-server + + + + + private-knowledge-service + run.mone.privateknowledge + 1.0-SNAPSHOT-SNAPSHOT + + + com.xiaomi.mone + dubbo-trace + + + org.springframework.boot + spring-boot-starter-test + + + com.xiaomi.youpin + aop + + + com.alibaba + dubbo-registry-nacos + + + com.alibaba.spring + spring-context-support + + + com.alibaba.nacos + nacos-spring-context + + + com.alibaba.nacos + nacos-client + + + + + + + + + src/main/resources + true + + + src/main/resources/META-INF + true + + app.properties + + META-INF/ + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.7.5 + + run.mone.knowledge.server.PrivateKnowledgeBootstrap + + + + + repackage + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + + + + + + dev + + dev + + + true + + + + src/main/resources/config/dev.properties + + + + + + staging + + staging + + + + src/main/resources/config/staging.properties + + + + + + online + + online + + + + src/main/resources/config/online.properties + + + + + + + + \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/PrivateKnowledgeBootstrap.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/PrivateKnowledgeBootstrap.java new file mode 100644 index 000000000..3fc00e9a1 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/PrivateKnowledgeBootstrap.java @@ -0,0 +1,29 @@ +package run.mone.knowledge.server; + +import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan; +import org.mybatis.spring.annotation.MapperScan; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; + +/** + * @author bot + */ +@EnableAutoConfiguration +@ComponentScan(basePackages = {"run.mone", "com.xiaomi.youpin", "com.xiaomi.data.push.redis"}) +@DubboComponentScan(basePackages = "run.mone") +@MapperScan("run.mone.knowledge.service.dao") +public class PrivateKnowledgeBootstrap { + private static final Logger logger = LoggerFactory.getLogger(PrivateKnowledgeBootstrap.class); + + public static void main(String... args) { + try { + SpringApplication.run(PrivateKnowledgeBootstrap.class, args); + } catch (Throwable throwable) { + logger.error(throwable.getMessage(), throwable); + System.exit(-1); + } + } +} \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/DataSourceConfig.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/DataSourceConfig.java new file mode 100644 index 000000000..e7dc8cd57 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/DataSourceConfig.java @@ -0,0 +1,49 @@ +package run.mone.knowledge.server.config; + +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.sql.DataSource; + +@Configuration +public class DataSourceConfig { + + @Value("${db_pwd}") + private String db_pwd; + + @Value("${db_url}") + private String db_url; + + @Value("${db_user_name}") + private String db_user_name; + + @Value("${db_maximumPoolSize:10}") + private int maximumPoolSize; + + @Value("${db_minimumIdle:5}") + private int minimumIdle; + + @Bean + public DataSource getDataSource() { + HikariConfig config = new HikariConfig(); + config.setJdbcUrl(db_url); + config.setUsername(db_user_name); + config.setPassword(db_pwd); + config.setMaximumPoolSize(maximumPoolSize); + config.setMinimumIdle(minimumIdle); + + // 连接超时时间(毫秒) + config.setConnectionTimeout(30 * 1000); + // 连接空闲超时时间(毫秒) + config.setIdleTimeout(600 * 1000); + // 每次执行SQL前是否自动检查连接有效性 + config.setConnectionTestQuery("SELECT 1"); + // 连接池名称,方便监控和日志记录 + config.setPoolName("M78KnowledgeDataSource"); + + return new HikariDataSource(config); + } +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/DubboConfiguration.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/DubboConfiguration.java new file mode 100644 index 000000000..d62af8c55 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/DubboConfiguration.java @@ -0,0 +1,60 @@ +package run.mone.knowledge.server.config; + +import com.google.common.collect.Maps; +import com.xiaomi.youpin.dubbo.common.DubboYoupinVersion; +import org.apache.commons.lang3.StringUtils; +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.ProtocolConfig; +import org.apache.dubbo.config.RegistryConfig; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class DubboConfiguration { + + @Value("${app.name}") + private String appName; + @Value("${dubbo.protocol.port}") + private int port; + + @Value("${server.port}") + private String httpGateWayPort; + + @Value("${dubbo.registry.address}") + private String regAddress; + + @Bean + public ApplicationConfig applicationConfig() { + ApplicationConfig applicationConfig = new ApplicationConfig(); + applicationConfig.setName(appName); + applicationConfig.setParameters(Maps.newHashMap()); + applicationConfig.getParameters().put("http_gateway_port", httpGateWayPort); + applicationConfig.getParameters().put("dubbo_version", new DubboYoupinVersion().toString()); + String prometheusPort = System.getenv("PROMETHEUS_PORT"); + if (StringUtils.isEmpty(prometheusPort)) { + prometheusPort = "4444"; + } + applicationConfig.getParameters().put("prometheus_port", prometheusPort); + applicationConfig.setQosEnable(false); + return applicationConfig; + } + + @Bean + public RegistryConfig registryConfig() { + RegistryConfig registryConfig = new RegistryConfig(); + registryConfig.setAddress(regAddress); + return registryConfig; + } + + @Bean + public ProtocolConfig protocolConfig() { + ProtocolConfig protocolConfig = new ProtocolConfig(); + protocolConfig.setPort(port); + protocolConfig.setTransporter("netty4"); + protocolConfig.setThreadpool("fixed"); + protocolConfig.setThreads(200); + return protocolConfig; + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/MybatisFlexConfiguration.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/MybatisFlexConfiguration.java new file mode 100644 index 000000000..287f00ffc --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/MybatisFlexConfiguration.java @@ -0,0 +1,25 @@ +package run.mone.knowledge.server.config; + +import com.mybatisflex.core.audit.AuditManager; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Configuration; + +/** + * @author HawickMason@xiaomi.com + * @date 1/10/24 3:40 PM + */ +@Configuration +@Slf4j +public class MybatisFlexConfiguration { + + public MybatisFlexConfiguration() { + //开启审计功能 + AuditManager.setAuditEnable(true); + + //设置 SQL 审计收集器 + AuditManager.setMessageCollector(auditMessage -> + log.info("sql audit :{}, cost: {}ms", auditMessage.getFullSql() + , auditMessage.getElapsedTime()) + ); + } +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/NacosConfiguration.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/NacosConfiguration.java new file mode 100644 index 000000000..5b95db9ff --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/config/NacosConfiguration.java @@ -0,0 +1,14 @@ +package run.mone.knowledge.server.config; + +import com.alibaba.nacos.api.annotation.NacosProperties; +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.alibaba.nacos.spring.context.annotation.config.EnableNacosConfig; +import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableNacosConfig(globalProperties = @NacosProperties(serverAddr = "${nacos.config.addrs}")) +@NacosPropertySource(dataId = "private-knowledge", autoRefreshed = true) +public class NacosConfiguration { + +} \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/controller/KnowledgeVectorController.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/controller/KnowledgeVectorController.java new file mode 100644 index 000000000..4af546305 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/controller/KnowledgeVectorController.java @@ -0,0 +1,47 @@ +package run.mone.knowledge.server.controller; + +import com.xiaomi.youpin.infra.rpc.Result; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import run.mone.knowledge.api.IKnowledgeVectorProvider; +import run.mone.knowledge.api.dto.KnowledgeVectorDto; +import run.mone.knowledge.api.dto.SimilarKnowledgeVectorQry; +import run.mone.knowledge.api.dto.SimilarKnowledgeVectorRsp; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @author wmin + * @date 2024/2/20 + */ +@Slf4j +@RestController +@RequestMapping(value = "/api/knowledgeVector") +public class KnowledgeVectorController { + + @Resource + private IKnowledgeVectorProvider knowledgeVectorProvider; + + @PostMapping(value = "/addOrUpdate") + public Result insertOrUpdateKnowledgeVector(@RequestBody KnowledgeVectorDto knowledgeVectorDto, HttpServletRequest request) { + log.info("insertOrUpdateKnowledgeVector req:{}", knowledgeVectorDto.getKnowledgeVectorDetailDtoList().size()); + return knowledgeVectorProvider.insertOrUpdateKnowledgeVector(knowledgeVectorDto); + } + + @PostMapping(value = "/qrySimilar") + public Result> qrySimilarKnowledgeVector(@RequestBody SimilarKnowledgeVectorQry similarKnowledgeVectorQry, HttpServletRequest request) { + log.info("qrySimilarKnowledgeVector req:{}", similarKnowledgeVectorQry); + return knowledgeVectorProvider.qrySimilarKnowledgeVector(similarKnowledgeVectorQry); + } + + @PostMapping(value = "/delete") + public Result deleteKnowledgeVector(@RequestBody KnowledgeVectorDto knowledgeVectorDto, HttpServletRequest request) { + log.info("deleteKnowledgeVector req:{}", knowledgeVectorDto); + return knowledgeVectorProvider.deleteKnowledgeVector(knowledgeVectorDto); + } +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/controller/TestController.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/controller/TestController.java new file mode 100644 index 000000000..ed0509e55 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/controller/TestController.java @@ -0,0 +1,46 @@ +package run.mone.knowledge.server.controller; + +import com.xiaomi.data.push.redis.Redis; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@Slf4j +@RestController +@RequestMapping(value = "/api") +public class TestController { + + + @Autowired + private Redis redis; + + /** + * 进程心跳调用 + * + * @return + */ + @RequestMapping(value = "/isOk") + public String isOk() { + return "ok"; + } + + //从redis中读取指定key的值 + @RequestMapping(value = "/getValueFromRedis", method = RequestMethod.GET) + public ResponseEntity getValueFromRedis(@RequestParam("key") String key) { + String value = redis.get(key); + return value != null ? ResponseEntity.ok(value) : ResponseEntity.notFound().build(); + } + + //按指定key value写入redis + @RequestMapping(value = "/setValueToRedis", method = RequestMethod.POST) + public ResponseEntity setValueToRedis(@RequestParam("key") String key, @RequestParam("value") String value) { + redis.set(key, value); + return ResponseEntity.ok().build(); + } + + +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/DemoProviderImpl.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/DemoProviderImpl.java new file mode 100644 index 000000000..130f4c07f --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/DemoProviderImpl.java @@ -0,0 +1,32 @@ +package run.mone.knowledge.server.provider; + +import run.mone.knowledge.api.DemoProvider; +import run.mone.knowledge.api.dto.DemoReqDto; +import run.mone.knowledge.api.dto.DemoResDto; +import run.mone.knowledge.common.Constant; +import run.mone.knowledge.service.DemoService; +import com.xiaomi.youpin.infra.rpc.Result; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @author bot + */ +@Slf4j +@SuppressWarnings(value = "checkstyle:MagicNumber") +@DubboService(timeout = Constant.DEF_DUBBO_TIMEOUT, group = "${dubbo.group}") +public class DemoProviderImpl implements DemoProvider { + + @Autowired + private DemoService demoService; + + @Override + public Result query(DemoReqDto reqDto) { + //参数校验,用户信息校验等 + log.info("DemoProvider.query请求 reqDto={}", reqDto); + Result result = demoService.query(reqDto); + log.info("DemoProvider.query响应 result={}", result); + return result; + } +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/DubboHealthProviderImpl.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/DubboHealthProviderImpl.java new file mode 100644 index 000000000..3fb064df5 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/DubboHealthProviderImpl.java @@ -0,0 +1,24 @@ +package run.mone.knowledge.server.provider; + +import com.xiaomi.data.push.common.Health; +import run.mone.knowledge.api.DubboHealthProvider; +import run.mone.knowledge.common.Constant; +import com.xiaomi.youpin.infra.rpc.Result; +import com.xiaomi.youpin.qps.QpsAop; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.beans.factory.annotation.Autowired; + +@DubboService(timeout = Constant.DEF_DUBBO_TIMEOUT, group = "${dubbo.group}", version="1.0") +@Slf4j +public class DubboHealthProviderImpl implements DubboHealthProvider { + + @Autowired + private QpsAop qpsAop; + + @Override + public Result health() { + long qps = qpsAop.getQps(); + return Result.success(new Health("0.0.1", "2019-11-11", qps)); + } +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/KnowledgeVectorProviderImpl.java b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/KnowledgeVectorProviderImpl.java new file mode 100644 index 000000000..f3bc8eaa0 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/java/run/mone/knowledge/server/provider/KnowledgeVectorProviderImpl.java @@ -0,0 +1,370 @@ +package run.mone.knowledge.server.provider; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.core.util.UpdateEntity; +import com.xiaomi.youpin.infra.rpc.Result; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import run.mone.knowledge.api.IKnowledgeVectorProvider; +import run.mone.knowledge.api.enums.KnowledgeTypeEnum; +import run.mone.knowledge.api.dto.*; +import run.mone.knowledge.service.EmbeddingService; +import run.mone.knowledge.service.OzVectorDbService; +import run.mone.knowledge.service.RedisVectorService; +import run.mone.knowledge.service.dao.entity.VKnowledgeVectorDetailPo; +import run.mone.knowledge.service.dao.entity.VKnowledgeVectorMetaPo; +import run.mone.knowledge.service.dao.mapper.VKnowledgeVectorDetailMapper; +import run.mone.knowledge.service.dao.mapper.VKnowledgeVectorMetaMapper; +import run.mone.knowledge.service.exceptions.ExCodes; +import run.mone.knowledge.service.impl.VectorDtoTruncateService; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author wmin + * @date 2024/2/5 + */ +@Slf4j +@DubboService(interfaceClass = IKnowledgeVectorProvider.class, group = "${dubbo.group}", version = "1.0") +public class KnowledgeVectorProviderImpl implements IKnowledgeVectorProvider { + + public static Gson gson = new Gson(); + + @Resource + private VKnowledgeVectorDetailMapper detailMapper; + @Resource + private VKnowledgeVectorMetaMapper metaMapper; + @Autowired + private RedisVectorService redisVectorService; + @Autowired + private EmbeddingService embeddingService; + @Autowired + private OzVectorDbService ozVectorDbService; + + @Autowired + private VectorDtoTruncateService vectorDtoTruncateService; + + + @Transactional + @Override + public Result insertOrUpdateKnowledgeVector(KnowledgeVectorDto param) { + Pair checkRst = checkKnowledgeVectorDto(param, "insertOrUpdate"); + if (!checkRst.getKey()) { + return Result.fail(ExCodes.STATUS_BAD_REQUEST, checkRst.getValue()); + } + List vectorDataList = new ArrayList<>(); + + List knowledgeVectorDetailDtoList = param.getKnowledgeVectorDetailDtoList(); + KnowledgeTypeEnum typeEnum = KnowledgeTypeEnum.getEnumByTypeName(param.getType()); + + Pair tagsCheckRst = Pair.of(true, ""); + + for (KnowledgeVectorDetailDto detailDto : knowledgeVectorDetailDtoList){ + KnowledgeVectorDetailFullDto fullDto = vectorDtoTruncateService.getFullDto(detailDto, typeEnum); + log.info("insertOrUpdateKnowledgeVector fullDto: {}", fullDto.getFullTags()); + if (StringUtils.isBlank(fullDto.getGroupTag()) || StringUtils.isBlank(fullDto.getLeafTag())){ + log.error("tagsCheckRst failed, tags:{}", fullDto.getFullTags()); + tagsCheckRst = Pair.of(false, "groupTag/leafTag is empty. tags:"+fullDto.getFullTags()); + break; + } + + VKnowledgeVectorMetaPo vectorMeta = vectorDtoTruncateService.convertVectorMetaDtoToPo(fullDto); + Integer metaId = insertOrGetMeta(vectorMeta); + log.info("insertOrGetMeta id:{}", metaId); + if (metaId == -1){ + continue; + } + VKnowledgeVectorDetailPo vectorDetail = vectorDtoTruncateService.convertVectorDetailDtoToPo(fullDto); + vectorDetail.setMetaId(metaId); + //查询是否已有 + VKnowledgeVectorDetailPo dbVectorDetail = detailMapper.selectOneByQuery( + QueryWrapper.create().eq("type", vectorDetail.getType()).eq("meta_id", metaId).eq("leaf_tag", vectorDetail.getLeafTag()) + ); + Date currentTime = new Date(); + if (dbVectorDetail!=null){ + VKnowledgeVectorDetailPo updatePO = UpdateEntity.of(VKnowledgeVectorDetailPo.class, dbVectorDetail.getId()); + updatePO.setContent(vectorDetail.getContent()); + updatePO.setVector(vectorDetail.getVector()); + vectorDetail.setGmtModified(currentTime); + detailMapper.update(updatePO); + log.info("detail update :{}", dbVectorDetail.getId()); + } else { + vectorDetail.setGmtCreate(currentTime); + vectorDetail.setGmtModified(currentTime); + vectorDetail.setEmbeddingStatus(2); + detailMapper.insert(vectorDetail); + log.info("detail insert :{}", vectorDetail.getId()); + } + + VectorData vectorData = VectorData.builder(). + type(vectorMeta.getType()). + group(vectorMeta.getGroupTag()). + leaf(vectorDetail.getLeafTag()). + vector(detailDto.getVector()).build(); + vectorDataList.add(vectorData); + } + if (tagsCheckRst.getKey()){ + redisVectorService.updateVectorByLeaf(vectorDataList); + return Result.success(true); + } + return Result.fail(ExCodes.STATUS_BAD_REQUEST, tagsCheckRst.getValue()); + } + + private Integer insertOrGetMeta(VKnowledgeVectorMetaPo vectorMeta){ + QueryWrapper queryWrapper = QueryWrapper.create(). + eq("type", vectorMeta.getType()). + eq("tag1", vectorMeta.getTag1()). + eq("group_tag", vectorMeta.getGroupTag()); + List metas = metaMapper.selectListByQuery(queryWrapper); + if (CollectionUtils.isEmpty(metas)){ + log.info("empty meta db,{},{},{}", vectorMeta.getType(), vectorMeta.getTag1(), vectorMeta.getGroupTag()); + vectorMeta.setGmtCreate(new Date()); + vectorMeta.setGmtModified(new Date()); + metaMapper.insert(vectorMeta); + return vectorMeta.getId(); + } else { + if (metas.get(0).getDeleted() == 1){ + log.warn("meta is deleted. id:{}", metas.get(0).getId()); + return -1; + } + return metas.get(0).getId(); + } + } + + + @Transactional + @Override + public Result deleteKnowledgeVector(KnowledgeVectorDto param) { + Pair checkRst = checkKnowledgeVectorDto(param, "delete"); + if (!checkRst.getKey()) { + return Result.fail(ExCodes.STATUS_BAD_REQUEST, checkRst.getValue()); + } + + List knowledgeVectorDetailDtoList = param.getKnowledgeVectorDetailDtoList(); + KnowledgeTypeEnum typeEnum = KnowledgeTypeEnum.getEnumByTypeName(param.getType()); + + List vectorMetas = new ArrayList<>(); + for (KnowledgeVectorDetailDto detailDto : knowledgeVectorDetailDtoList) { + KnowledgeVectorDetailFullDto fullDto = vectorDtoTruncateService.getFullDto(detailDto, typeEnum); + + //删除leafTag + if (StringUtils.isNotBlank(fullDto.getLeafTag())){ + VKnowledgeVectorDetailPo vectorDetail = detailMapper.selectOneByQuery( + QueryWrapper.create().eq("type", param.getType()).eq("leaf_tag", fullDto.getLeafTag()) + ); + if (vectorDetail!=null){ + log.info("delete vectorDetail id:{}, count:{}", vectorDetail.getId(), detailMapper.deleteById(vectorDetail.getId())); + } + VectorData vectorData = VectorData.builder(). + type(fullDto.getType()). + group(fullDto.getGroupTag()) + .leaf(fullDto.getLeafTag()).build(); + boolean redisDel = redisVectorService.deleteByLeaf(Arrays.asList(vectorData)); + log.info("delete redis leaf group_leaf:{}, rst:{}", fullDto.getGroupTag()+"_"+fullDto.getLeafTag(), redisDel); + } + //删除单个groupTag + else if (StringUtils.isNotBlank(fullDto.getGroupTag())){ + VKnowledgeVectorMetaPo vectorMeta = metaMapper.selectOneByQuery( + QueryWrapper.create().eq("type", fullDto.getType()).eq("group_tag", fullDto.getGroupTag()).eq("deleted", 0) + ); + if (vectorMeta==null){ + log.warn("can not find groupTag:{}", fullDto.getGroupTag()); + continue; + } + vectorMetas.add(vectorMeta); + } else { + StringBuilder qryTags = new StringBuilder(detailDto.getTag1()); + //从meta表中查询所有符合条件的group + QueryWrapper queryWrapper = QueryWrapper.create(). + eq("type", fullDto.getType()). + eq("deleted", 0). + eq("tag1", detailDto.getTag1()); + if (StringUtils.isNotBlank(detailDto.getTag2())){ + queryWrapper.eq("tag2", detailDto.getTag2()); + qryTags.append("_"+detailDto.getTag2()); + } + if (StringUtils.isNotBlank(detailDto.getTag3())){ + queryWrapper.eq("tag3", detailDto.getTag3()); + qryTags.append("_"+detailDto.getTag3()); + } + if (StringUtils.isNotBlank(detailDto.getTag4())){ + queryWrapper.eq("tag4", detailDto.getTag4()); + qryTags.append("_"+detailDto.getTag4()); + } + + List metaList = metaMapper.selectListByQuery(queryWrapper); + if (CollectionUtils.isEmpty(metaList)){ + log.warn("can not find qryTags:{}", qryTags); + continue; + } + log.info("qryTags:{}, ids:{}", qryTags, metaList.stream().map(i ->i.getId()).collect(Collectors.toList())); + vectorMetas.addAll(metaList); + } + } + if (CollectionUtils.isEmpty(vectorMetas)){ + log.info("There is no vectorMetas to delete"); + return Result.success(true); + } + List metaIds = vectorMetas.stream().map(i -> i.getId()).collect(Collectors.toList()); + log.info("preparing to delete from db metaIds:{}", metaIds); + int detailCount = detailMapper.deleteByQuery(QueryWrapper.create().eq("type", param.getType()).in("meta_id", metaIds)); + int metaCount = param.isForceDelete() ? metaMapper.deleteBatchByIds(metaIds) : metaMapper.softDelete(metaIds); + log.info("delete from db detailCount:{},metaCount:{},isForceDelete:{}", detailCount, metaCount, param.isForceDelete()); + List groupKeyList = vectorMetas.stream().map(i -> VectorData.makeGroupKey(i.getType(), i.getGroupTag())).collect(Collectors.toList()); + log.info("delete from redis groupKeyList:{}, rst:{}", groupKeyList, redisVectorService.deleteByGroup(groupKeyList)); + return Result.success(true); + } + + + @Override + public Result> qrySimilarKnowledgeVector(SimilarKnowledgeVectorQry qry) { + Pair checkRst = checkSimilarKnowledgeVectorQry(qry); + if (!checkRst.getKey()) { + return Result.fail(ExCodes.STATUS_BAD_REQUEST, checkRst.getValue()); + } + + KnowledgeTypeEnum typeEnum = KnowledgeTypeEnum.getEnumByTypeName(qry.getType()); + + List vectorDataList = new ArrayList<>(); + + List tagsInfoList = qry.getTagsInfoList(); + + for (TagsInfo tagsInfo : tagsInfoList){ + TagsFullInfo fullQry = vectorDtoTruncateService.getSimilarKnowledgeVectorFullQry(tagsInfo, typeEnum); + //是否为leafTag范围的查询 + if (StringUtils.isNotBlank(fullQry.getLeafTag())){ + VKnowledgeVectorDetailPo vectorDetail = detailMapper.selectOneByQuery( + QueryWrapper.create().eq("type", qry.getType()).eq("leaf_tag", fullQry.getLeafTag()) + ); + if (vectorDetail==null){ + return Result.fail(ExCodes.STATUS_BAD_REQUEST, "Can't find leafTag[" + fullQry.getLeafTag() + "]"); + } + VKnowledgeVectorMetaPo vectorMeta = metaMapper.selectOneByQuery( QueryWrapper.create().eq("id", vectorDetail.getMetaId()).eq("deleted", 0)); + vectorDataList.add( + VectorData.builder(). + group(vectorMeta.getGroupTag()). + leaf(vectorDetail.getLeafTag()). + vector(gson.fromJson(vectorDetail.getVector(), new TypeToken() {}.getType())).build() + ); + + } //是否为单个groupTag的查询 + else if (StringUtils.isNotBlank(fullQry.getGroupTag())){ + VKnowledgeVectorMetaPo vectorMeta = metaMapper.selectOneByQuery( + QueryWrapper.create().eq("type", qry.getType()).eq("group_tag", fullQry.getGroupTag()).eq("deleted", 0) + ); + if (vectorMeta==null){ + log.warn("Can't find groupTag[{}]", fullQry.getGroupTag()); + continue; + } + log.info("db meta id:{},groupTag:{}", vectorMeta.getId(), vectorMeta.getGroupTag()); + vectorDataList.addAll(redisVectorService.listByGroup(Arrays.asList(VectorData.makeGroupKey(vectorMeta.getType(), vectorMeta.getGroupTag())))); + + } else { + StringBuilder qryTags = new StringBuilder(tagsInfo.getTag1()); + //从meta表中查询所有符合条件的group + QueryWrapper queryWrapper = QueryWrapper.create(). + eq("deleted", 0). + eq("type", qry.getType()). + eq("tag1", tagsInfo.getTag1()); + if (StringUtils.isNotBlank(tagsInfo.getTag2())){ + queryWrapper.eq("tag2", tagsInfo.getTag2()); + qryTags.append("_"+tagsInfo.getTag2()); + } + if (StringUtils.isNotBlank(tagsInfo.getTag3())){ + queryWrapper.eq("tag3", tagsInfo.getTag3()); + qryTags.append("_"+tagsInfo.getTag3()); + } + if (StringUtils.isNotBlank(tagsInfo.getTag4())){ + queryWrapper.eq("tag4", tagsInfo.getTag4()); + qryTags.append("_"+tagsInfo.getTag4()); + } + + List metaList = metaMapper.selectListByQuery(queryWrapper); + if (CollectionUtils.isEmpty(metaList)){ + log.warn("Can't find tag[{}]", qryTags); + continue; + } + List groupList = metaList.stream().map(i -> VectorData.makeGroupKey(i.getType(), i.getGroupTag())).collect(Collectors.toList()); + vectorDataList.addAll(redisVectorService.listByGroup(groupList)); + } + } + if (CollectionUtils.isEmpty(vectorDataList)){ + return Result.fail(ExCodes.STATUS_BAD_REQUEST, "Can't find any tag"); + } + log.info("qry from vectorDataList.size:{}", vectorDataList.size()); + + + //questionContent向量化 + double[] queryVector = StringUtils.isBlank(qry.getQuestionContent())?qry.getQuestionVector():embeddingService.getEmbeddingArr(qry.getQuestionContent()); + if (queryVector == null){ + return Result.fail(ExCodes.STATUS_INTERNAL_ERROR, "questionContent embedding error"); + } + + //cosineSimilarity + VectorLimits limits = VectorLimits.builder().similarity(qry.getSimilarity()).topN(qry.getTopN()).build(); + List topNData = ozVectorDbService.cosineSimilarity(queryVector, vectorDataList, limits); + + List rstList = topNData.stream().map(i -> + SimilarKnowledgeVectorRsp.builder().group(i.getGroup()).leaf(i.getLeaf()).similarity(i.getSimilarity()).build() + ).collect(Collectors.toList()); + + log.info("qryKnowledgeVector rst:{}", rstList); + return Result.success(rstList); + } + + + private Pair checkSimilarKnowledgeVectorQry(SimilarKnowledgeVectorQry param) { + if (null == param || CollectionUtils.isEmpty(param.getTagsInfoList())) { + return Pair.of(false, "param is invalid"); + } + if (!KnowledgeTypeEnum.isEnumValueValid(param.getType())) { + return Pair.of(false, "type is invalid"); + } + if (null == param.getQuestionVector() && StringUtils.isBlank(param.getQuestionContent())) { + return Pair.of(false, "question is empty"); + } + List tagsInfoList = param.getTagsInfoList(); + for (TagsInfo tagsInfo : tagsInfoList){ + if (null == tagsInfo || StringUtils.isBlank(tagsInfo.getTag1())){ + return Pair.of(false, "tagsInfoList is invalid"); + } + } + return Pair.of(true, ""); + } + + private Pair checkKnowledgeVectorDto(KnowledgeVectorDto param, String operateType) { + if (null == param || CollectionUtils.isEmpty(param.getKnowledgeVectorDetailDtoList())) { + return Pair.of(false, "param is empty"); + } + + if (!KnowledgeTypeEnum.isEnumValueValid(param.getType())) { + return Pair.of(false, "type is invalid"); + } + List knowledgeVectorDetailDtoList = param.getKnowledgeVectorDetailDtoList(); + + for (KnowledgeVectorDetailDto detailDto : knowledgeVectorDetailDtoList){ + if (StringUtils.isBlank(detailDto.getTag1())){ + return Pair.of(false, "tag1 is empty"); + } + if ("insertOrUpdate".equals(operateType)){ + if (param.isNeedEmbedding() && StringUtils.isBlank(detailDto.getContent())){ + return Pair.of(false, "content is empty"); + } + if (!param.isNeedEmbedding() && null == detailDto.getVector()){ + return Pair.of(false, "vector is empty"); + } + } + } + return Pair.of(true, ""); + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/application.properties b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/application.properties new file mode 100644 index 000000000..3bde886d4 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/application.properties @@ -0,0 +1,23 @@ +#server +app.name=@app.name@ +server.type=@server.type@ +server.port=@server.port@ +server.debug=@server.debug@ + +dubbo.group=@dubbo.group@ +dubbo.protocol.port=@dubbo.protocol.port@ +dubbo.registry.address=@dubbo.registry.address@ +nacos.config.addrs=@nacos.config.addrs@ + +log.path=@log.path@ + +db_url=@db_url@ +db_user_name=@db_user_name@ +db_pwd=@db_pwd@ + +# redis info +spring.redis=@spring.redis@ +redis.cluster.pwd=@redis.cluster.pwd@ +redis.cluster=@redis.cluster@ + +token.server=@token.server@ \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/dev.properties b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/dev.properties new file mode 100644 index 000000000..ee8ba1f43 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/dev.properties @@ -0,0 +1,23 @@ +#server +app.name=private-knowledge +server.type=dev +server.port=8083 +server.debug=true + +dubbo.group=dev +dubbo.protocol.port=-1 +dubbo.registry.address=nacos://localhost:80 +nacos.config.addrs=localhost:80 + +log.path=/tmp + +db_url=jdbc:mysql://localhost:13306/mione_z?characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&useServerPrepStmts=false&rewriteBatchedStatements=true +db_user_name=X +db_pwd=X + +# redis info +spring.redis=localhost:22122 +redis.cluster.pwd=X +redis.cluster=false + +token.server=http://localhost:80 \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/online.properties b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/online.properties new file mode 100644 index 000000000..50bea1c80 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/online.properties @@ -0,0 +1,23 @@ +#server +app.name=private-knowledge +server.type=online +server.port=8083 +server.debug=true + +dubbo.group=online +dubbo.protocol.port=-1 +dubbo.registry.address=nacos://localhost:80 +nacos.config.addrs=localhost:80 + +log.path=/home/work/log + +db_url=jdbc:mysql://localhost:63306/mione_knowledge?characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&serverTimezone=UTC +db_user_name=X +db_pwd=X + +# redis info +spring.redis=localhost:5100 +redis.cluster.pwd=X +redis.cluster=true + +token.server=http://localhost:80 \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/staging.properties b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/staging.properties new file mode 100644 index 000000000..53ad87a69 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/config/staging.properties @@ -0,0 +1,23 @@ +#server +app.name=private-knowledge +server.type=staging +server.port=8083 +server.debug=true + +dubbo.group=staging +dubbo.protocol.port=-1 +dubbo.registry.address=nacos://localhostv:80 +nacos.config.addrs=localhost:80 + +log.path=/home/work/log + +db_url=jdbc:mysql://localhost:13306/mione_z?characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&useServerPrepStmts=false&rewriteBatchedStatements=true +db_user_name=X +db_pwd=X + +# redis info +spring.redis=localhost:22122 +redis.cluster.pwd=X +redis.cluster=false + +token.server=http://localhost:80 \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/dubbo.properties b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/dubbo.properties new file mode 100644 index 000000000..260d5cd2b --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/dubbo.properties @@ -0,0 +1 @@ +dubbo.trace.log.path=/home/work/log/dubbo/private-knowledge_ diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/logback.xml b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/logback.xml new file mode 100644 index 000000000..9538d657e --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/logback.xml @@ -0,0 +1,59 @@ + + + + + + + + + ${log.path}/private-knowledge/server.log + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + ${log.path}/private-knowledge/server.log.%d{yyyy-MM-dd-HH} + ${MAX_HISTORY} + + + + + 0 + 60000 + + + + + + ${log.path}/private-knowledge/error.log + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + ${log.path}/private-knowledge/error.log.%d{yyyy-MM-dd-HH} + ${MAX_HISTORY} + + + ERROR + ACCEPT + DENY + + + + + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + + + + + + + + + + + + + diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/sql/20240612.sql b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/sql/20240612.sql new file mode 100644 index 000000000..18337a7f5 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/sql/20240612.sql @@ -0,0 +1,3 @@ +ALTER TABLE v_knowledge_vector_meta ADD COLUMN `gmt_create` datetime DEFAULT NULL COMMENT '创建时间'; +ALTER TABLE v_knowledge_vector_meta ADD COLUMN `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间'; +ALTER TABLE v_knowledge_vector_meta ADD COLUMN `deleted` int(1) DEFAULT 0 COMMENT '0:未删除 1:已删除'; diff --git a/m78-all/private-knowledge/private-knowledge-server/src/main/resources/sql/init.sql b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/sql/init.sql new file mode 100644 index 000000000..ab70499be --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/main/resources/sql/init.sql @@ -0,0 +1,30 @@ +CREATE TABLE `v_knowledge_vector_meta` ( + `id` int NOT NULL AUTO_INCREMENT primary key, + `type` varchar(64) DEFAULT NULL COMMENT '知识库类型,normal_document、project_code', + `tag1` varchar(64) NOT NULL COMMENT 'tag1', + `tag2` varchar(64) DEFAULT '' COMMENT 'tag2', + `tag3` varchar(64) DEFAULT '' COMMENT 'tag3', + `tag4` varchar(64) DEFAULT '' COMMENT 'tag4', + `tag5` varchar(64) DEFAULT '' COMMENT 'tag5', + `tag6` varchar(64) DEFAULT '' COMMENT 'tag6', + `group_tag` varchar(64) NOT NULL COMMENT 'group节点tag', + INDEX (type, tag1, tag2, tag3, tag4, tag5, tag6), + INDEX type_group_tag_index (type, group_tag), + UNIQUE KEY type_group_tag_unique (type, group_tag) +) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='知识库向量元数据,仅存储至group节点级别(除leaf层级外,最多支持六层tag结构)'; + + +CREATE TABLE `v_knowledge_vector_detail` ( + `id` int NOT NULL AUTO_INCREMENT primary key, + `meta_id` int NOT NULL COMMENT 'v_knowledge_vector_meta的id', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `type` varchar(64) DEFAULT NULL COMMENT '知识库类型,normal_document、project_code', + `leaf_tag` varchar(64) NOT NULL COMMENT '叶子节点tag', + `content` text DEFAULT NULL COMMENT '区块/文件内容', + `embedding_status` int(11) NOT NULL DEFAULT '0' COMMENT '向量化状态0:未开始, 1:进行中, 2:已完成', + `vector` blob NOT NULL, + FOREIGN KEY (meta_id) REFERENCES v_knowledge_vector_meta (id), + INDEX type_leaf_tag_index (type, leaf_tag), + UNIQUE KEY type_leaf_tag_unique (type, leaf_tag) +) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='知识库向量详情,仅存储叶子节点'; diff --git a/m78-all/private-knowledge/private-knowledge-server/src/test/java/run/mone/test/DbCodegen.java b/m78-all/private-knowledge/private-knowledge-server/src/test/java/run/mone/test/DbCodegen.java new file mode 100644 index 000000000..8f9b749d6 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/test/java/run/mone/test/DbCodegen.java @@ -0,0 +1,76 @@ +package run.mone.test; + +import com.mybatisflex.codegen.Generator; +import com.mybatisflex.codegen.config.ColumnConfig; +import com.mybatisflex.codegen.config.GlobalConfig; +import com.mybatisflex.codegen.config.TableDefConfig; +import com.zaxxer.hikari.HikariDataSource; + + +/** + * @author wmin + * @date 2024/2/2 + */ +public class DbCodegen { + + private static String tableName = ""; + + public static void main(String[] args) { + //配置数据源 + HikariDataSource dataSource = new HikariDataSource(); + dataSource.setJdbcUrl("jdbc:mysql://localhost:13306/mione_z?characterEncoding=utf-8"); + dataSource.setUsername("X"); + dataSource.setPassword("X"); + + //创建配置内容,两种风格都可以。 + GlobalConfig globalConfig = createGlobalConfigUseStyle1(); + //GlobalConfig globalConfig = createGlobalConfigUseStyle2(); + + //通过 datasource 和 globalConfig 创建代码生成器 + Generator generator = new Generator(dataSource, globalConfig); + + //生成代码 + generator.generate(); + } + + public static GlobalConfig createGlobalConfigUseStyle1() { + //创建配置内容 + GlobalConfig globalConfig = new GlobalConfig(); + + //设置根包 + globalConfig.setBasePackage("run.mone.knowledge.service.dao"); + + //设置表前缀和只生成哪些表 + globalConfig.setGenerateTable("v_knowledge_vector_detail", "v_knowledge_vector_meta"); + + //设置生成 entity 并启用 Lombok + globalConfig.setEntityGenerateEnable(true); + globalConfig.setEntityWithLombok(true); + //设置项目的JDK版本,项目的JDK为14及以上时建议设置该项,小于14则可以不设置 + //globalConfig.setJdkVersion(17); + + //设置生成 mapper + globalConfig.setMapperGenerateEnable(true); + + String dir = "/Users/wmin/Documents/xiaomi-project/private-knowledge/private-knowledge-service/src/main/java"; +// String dir = "/Users/zhangzhiyong/IdeaProjects/ai/m78/m78-service/src/main/java"; + + globalConfig.getEntityConfig().setSourceDir(dir); + globalConfig.getMapperConfig().setSourceDir(dir); + + + //可以单独配置某个列 +// ColumnConfig columnConfig = new ColumnConfig(); +// columnConfig.setColumnName("tenant_id"); +// columnConfig.setLarge(true); +// columnConfig.setVersion(true); +// globalConfig.setColumnConfig("tb_account", columnConfig); + +// TableDefConfig tableDefConfig = new TableDefConfig(); +// tableDefConfig.setClassPrefix("KnowledgeVector"); + globalConfig.getTableDefConfig().setClassPrefix("KnowledgeVector"); + return globalConfig; + } + + +} diff --git a/m78-all/private-knowledge/private-knowledge-server/src/test/java/run/mone/test/VectorProviderTest.java b/m78-all/private-knowledge/private-knowledge-server/src/test/java/run/mone/test/VectorProviderTest.java new file mode 100644 index 000000000..3fda36171 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-server/src/test/java/run/mone/test/VectorProviderTest.java @@ -0,0 +1,84 @@ +package run.mone.test; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import run.mone.knowledge.api.IKnowledgeVectorProvider; +import run.mone.knowledge.api.dto.VectorData; +import run.mone.knowledge.api.enums.KnowledgeTypeEnum; +import run.mone.knowledge.api.dto.KnowledgeVectorDetailDto; +import run.mone.knowledge.api.dto.KnowledgeVectorDto; +import run.mone.knowledge.api.dto.SimilarKnowledgeVectorQry; +import run.mone.knowledge.server.PrivateKnowledgeBootstrap; +import run.mone.knowledge.service.RedisVectorService; + +import javax.annotation.Resource; +import java.util.Arrays; + +/** + * @author wmin + * @date 2024/2/19 + */ +@ExtendWith(SpringExtension.class) +@SpringBootTest(classes = PrivateKnowledgeBootstrap.class) +public class VectorProviderTest { + @Resource + private IKnowledgeVectorProvider knowledgeVectorProvider; + + @Autowired + private RedisVectorService redisVectorService; + + @Test + public void getGroupFromRedis() { + System.out.println(redisVectorService.listByGroup(Arrays.asList(VectorData.makeGroupKey(KnowledgeTypeEnum.project_code.getTypeName(),"tag21"), + VectorData.makeGroupKey(KnowledgeTypeEnum.project_code.getTypeName(),"tag22")))); + } + + @Test + public void insertKnowledgeVector() { + KnowledgeVectorDto param = new KnowledgeVectorDto(); + param.setType(KnowledgeTypeEnum.project_code.getTypeName()); + KnowledgeVectorDetailDto detailDto = new KnowledgeVectorDetailDto(); + detailDto.setTag1("tag1"); + detailDto.setTag2("tag21"); + detailDto.setTag3("tag31"); + detailDto.setContent("tomato-番茄"); + KnowledgeVectorDetailDto detailDto2 = new KnowledgeVectorDetailDto(); + detailDto2.setTag1("tag1"); + detailDto2.setTag2("tag22"); + detailDto2.setTag3("tag32"); + detailDto2.setContent("banana香蕉"); + param.setKnowledgeVectorDetailDtoList(Arrays.asList(detailDto, detailDto2)); + System.out.println(knowledgeVectorProvider.insertOrUpdateKnowledgeVector(param)); + } + + @Test + public void deleteKnowledgeVector() { + KnowledgeVectorDto param = new KnowledgeVectorDto(); + param.setType(KnowledgeTypeEnum.project_code.getTypeName()); + KnowledgeVectorDetailDto detailDto = new KnowledgeVectorDetailDto(); + detailDto.setTag1("tag1"); + detailDto.setTag2("tag21"); + detailDto.setTag3("tag31"); +// KnowledgeVectorDetailDto detailDto2 = new KnowledgeVectorDetailDto(); +// detailDto2.setTag1("tag1"); +// detailDto2.setTag2("tag22"); +// detailDto2.setTag3("tag32"); + param.setKnowledgeVectorDetailDtoList(Arrays.asList(detailDto)); + System.out.println(knowledgeVectorProvider.deleteKnowledgeVector(param)); + } + + @Test + public void qrySimilarKnowledgeVector() { + SimilarKnowledgeVectorQry param = new SimilarKnowledgeVectorQry(); + param.setType(KnowledgeTypeEnum.project_code.getTypeName()); + //param.setTag1("tag1"); + //param.setTag2("tag22"); + //param.setTag3("tag32"); + param.setQuestionContent("banana"); + System.out.println(knowledgeVectorProvider.qrySimilarKnowledgeVector(param)); + } +} + diff --git a/m78-all/private-knowledge/private-knowledge-service/pom.xml b/m78-all/private-knowledge/private-knowledge-service/pom.xml new file mode 100644 index 000000000..765777a24 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/pom.xml @@ -0,0 +1,79 @@ + + + + private-knowledge + run.mone.privateknowledge + 1.0-SNAPSHOT-SNAPSHOT + + 4.0.0 + + private-knowledge-service + + + + + private-knowledge-api + run.mone.privateknowledge + 1.0-SNAPSHOT-SNAPSHOT + + + org.apache.dubbo + dubbo + + + org.springframework.boot + spring-boot-starter-web + + + + private-knowledge-common + run.mone.privateknowledge + 1.0-SNAPSHOT-SNAPSHOT + + + com.alibaba.nacos + nacos-api + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-jdbc + + + com.mybatis-flex + mybatis-flex-spring-boot-starter + + + com.mybatis-flex + mybatis-flex-codegen + + + run.mone + redis + 1.8-inner-SNAPSHOT + + + org.apache.commons + commons-math3 + + + com.alibaba.fastjson2 + fastjson2 + 2.0.26 + + + + run.mone + http + 1.4-SNAPSHOT + + + + + + \ No newline at end of file diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/DemoService.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/DemoService.java new file mode 100644 index 000000000..0eccf4ac0 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/DemoService.java @@ -0,0 +1,29 @@ +package run.mone.knowledge.service; + +import run.mone.knowledge.api.dto.DemoReqDto; +import run.mone.knowledge.api.dto.DemoResDto; +import run.mone.knowledge.service.dao.DemoDao; +import run.mone.knowledge.service.dao.entity.DemoEntity; +import run.mone.knowledge.service.rpc.DemoDepRpc; +import run.mone.knowledge.service.rpc.dto.DemoDepReqDto; +import run.mone.knowledge.service.rpc.dto.DemoDepResDto; +import com.xiaomi.youpin.infra.rpc.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class DemoService { + + @Autowired + private DemoDepRpc demoDepRpc; + @Autowired + private DemoDao demoDao; + + public Result query(DemoReqDto reqDto) { + //rpc远程调用 + DemoDepResDto rpcResDto = demoDepRpc.remoteReq(DemoDepReqDto.build(reqDto)); + //持久化实体查询 + DemoEntity entity = demoDao.getById(reqDto.getId()); + return Result.success(entity.buildDemoResDto(rpcResDto)); + } +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/EmbeddingService.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/EmbeddingService.java new file mode 100644 index 000000000..9cbd11516 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/EmbeddingService.java @@ -0,0 +1,55 @@ +package run.mone.knowledge.service; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.xiaomi.data.push.client.HttpClientV2; +import com.xiaomi.youpin.infra.rpc.Result; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import run.mone.knowledge.service.exceptions.ExCodes; + +import java.util.*; + +/** + * @author wmin + * @date 2024/2/6 + */ +@Service +@Slf4j +public class EmbeddingService { + + public static Gson gson = new Gson(); + + @Value("${token.server}") + private String tokenServer; + + public String getEmbeddingStr(String input) { + try { + Map headers = new HashMap<>(); + headers.put("content-type", "application/json"); + Map post = new HashMap<>(); + post.put("data", input); + return HttpClientV2.post(String.format("%s/embedding", tokenServer), gson.toJson(post), headers, 100000); + } catch (Exception e) { + log.error("getEmbedding error {}", e); + return null; + } + } + + public double[] getEmbeddingArr(String input) { + try { + String inputEmbedding = getEmbeddingStr(input); + if (StringUtils.isBlank(inputEmbedding)){ + log.error("http call error"); + return null; + } + return gson.fromJson(inputEmbedding, new TypeToken() {}.getType()); + } catch (Exception e) { + log.error("getEmbedding error {}", e); + return null; + } + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/OzVectorDbService.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/OzVectorDbService.java new file mode 100644 index 000000000..14e8682a9 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/OzVectorDbService.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.knowledge.service; + +import run.mone.knowledge.api.dto.VectorData; +import run.mone.knowledge.api.dto.VectorLimits; + +import java.util.List; + +/** + * @author shanwb + * @date 2024-02-06 + */ +public interface OzVectorDbService { + + /** + * 查找topN 相似向量结果 + * + * @param queryVector + * @param vectorDataList + * @param limits + * @return + */ + List cosineSimilarity(double[] queryVector, List vectorDataList, VectorLimits limits); + + + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/RedisVectorService.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/RedisVectorService.java new file mode 100644 index 000000000..78b05e79c --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/RedisVectorService.java @@ -0,0 +1,68 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.knowledge.service; + +import run.mone.knowledge.api.dto.VectorData; + +import java.util.List; +import java.util.Map; + +/** + * @author shanwb + * @date 2024-02-06 + */ +public interface RedisVectorService { + String SPLIT_CHAR = "_#_"; + + /** + * 存储向量化结果,注意会按group进行全量覆盖,确保传递的是group下的全量数据 + * + * @param vectorDataList + * @return + */ + boolean storeVectorByGroup(List vectorDataList); + + /** + * 按叶子节点进行向量更新 + * + * @param vectorDataList + * @return + */ + boolean updateVectorByLeaf(List vectorDataList); + + /** + * 按group查询所有向量结果 + * + * @param groupKeyList + * @return + */ + List listByGroup(List groupKeyList); + + + /** + * 生成一个映射,其键是字符串,值是另一个映射,该映射的键是字符串,值是双精度数组,根据提供的分组列表进行组织。 + */ + Map> listByGroup2(List groupKeyList); + + boolean deleteByGroup(List groupKeyList); + + boolean deleteByLeaf(List vectorDataList); + + + + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/common/CommonUtils.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/common/CommonUtils.java new file mode 100644 index 000000000..cf1b02ecf --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/common/CommonUtils.java @@ -0,0 +1,25 @@ +package run.mone.knowledge.service.common; + +/** + * @author wmin + * @date 2024/2/6 + */ +public class CommonUtils { + + /** + * 将字符串转为double数组 + * @param str [1.2,3.2] + * @return + */ + public static double[] parseDoubleArray(String str) { + // 移除首尾的方括号并使用逗号分割字符串 + String[] parts = str.substring(1, str.length() - 1).split(","); + double[] result = new double[parts.length]; + for (int i = 0; i < parts.length; i++) { + // 将每个字符串转换为 double 类型 + result[i] = Double.parseDouble(parts[i]); + } + return result; + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/DemoDao.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/DemoDao.java new file mode 100644 index 000000000..bea81f919 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/DemoDao.java @@ -0,0 +1,13 @@ +package run.mone.knowledge.service.dao; + +import run.mone.knowledge.service.dao.entity.DemoEntity; +import org.springframework.stereotype.Repository; + +@Repository +public class DemoDao { + + public DemoEntity getById(Long id) { + return DemoEntity.build(); + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/DemoEntity.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/DemoEntity.java new file mode 100644 index 000000000..e322f927a --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/DemoEntity.java @@ -0,0 +1,27 @@ +package run.mone.knowledge.service.dao.entity; + +import run.mone.knowledge.api.dto.DemoResDto; +import run.mone.knowledge.service.rpc.dto.DemoDepResDto; +import lombok.Data; +import lombok.ToString; + +@Data +@ToString +public class DemoEntity { + + private String test2; + + public DemoResDto buildDemoResDto(DemoDepResDto rpcResDto) { + DemoResDto dto = new DemoResDto(); + dto.setTest1(rpcResDto.getTest1()); + dto.setTest2(test2); + return dto; + } + + public static DemoEntity build() { + DemoEntity entity = new DemoEntity(); + entity.test2 = "hello world"; + return entity; + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/M78Test.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/M78Test.java new file mode 100644 index 000000000..67a3b9cf6 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/M78Test.java @@ -0,0 +1,60 @@ +package run.mone.knowledge.service.dao.entity; + +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.KeyType; +import com.mybatisflex.annotation.Table; +import java.io.Serializable; +import java.math.BigInteger; +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 实体类。 + * + * @author wmin + * @since 2024-02-04 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Table(value = "m78_test") +public class M78Test implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @Id(keyType = KeyType.Auto) + private BigInteger id; + + /** + * 创建时间 + */ + private LocalDateTime gmtCreate; + + /** + * 创建者 + */ + private String creator; + + /** + * 原文本 + */ + private String textBefore; + + /** + * 脱敏后文本 + */ + private String textAfter; + + /** + * 状态, 0: 失败, 1:成功 + */ + private Integer status; + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/VKnowledgeVectorDetailPo.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/VKnowledgeVectorDetailPo.java new file mode 100644 index 000000000..23ef84dac --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/VKnowledgeVectorDetailPo.java @@ -0,0 +1,66 @@ +package run.mone.knowledge.service.dao.entity; + +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.KeyType; +import com.mybatisflex.annotation.Table; +import java.io.Serializable; +import java.util.Date; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 实体类。 + * + * @author wmin + * @since 2024-02-19 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Table(value = "v_knowledge_vector_detail") +public class VKnowledgeVectorDetailPo implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @Id(keyType = KeyType.Auto) + private Integer id; + + private Integer metaId; + + private String type; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + /** + * 叶子节点tag + */ + private String leafTag; + + /** + * 区块/文件内容 + */ + private String content; + + /** + * 向量化状态0:未开始, 1:进行中, 2:已完成 + */ + private Integer embeddingStatus; + + private String vector; + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/VKnowledgeVectorMetaPo.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/VKnowledgeVectorMetaPo.java new file mode 100644 index 000000000..312f042bf --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/entity/VKnowledgeVectorMetaPo.java @@ -0,0 +1,87 @@ +package run.mone.knowledge.service.dao.entity; + +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.KeyType; +import com.mybatisflex.annotation.Table; +import java.io.Serializable; +import java.util.Date; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 实体类。 + * + * @author wmin + * @since 2024-02-19 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Table(value = "v_knowledge_vector_meta") +public class VKnowledgeVectorMetaPo implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @Id(keyType = KeyType.Auto) + private Integer id; + + private String type; + + /** + * tag1 + */ + private String tag1; + + /** + * tag2 + */ + private String tag2; + + /** + * tag3 + */ + private String tag3; + + /** + * tag4 + */ + private String tag4; + + /** + * tag5 + */ + private String tag5; + + /** + * tag6 + */ + private String tag6; + + /** + * group节点tag + */ + private String groupTag; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + /** + * 0:未删除 1:已删除 + */ + private int deleted; + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/M78TestMapper.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/M78TestMapper.java new file mode 100644 index 000000000..7577c8822 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/M78TestMapper.java @@ -0,0 +1,14 @@ +package run.mone.knowledge.service.dao.mapper; + +import com.mybatisflex.core.BaseMapper; +import run.mone.knowledge.service.dao.entity.M78Test; + +/** + * 映射层。 + * + * @author wmin + * @since 2024-02-04 + */ +public interface M78TestMapper extends BaseMapper { + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/VKnowledgeVectorDetailMapper.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/VKnowledgeVectorDetailMapper.java new file mode 100644 index 000000000..e9c89eecb --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/VKnowledgeVectorDetailMapper.java @@ -0,0 +1,14 @@ +package run.mone.knowledge.service.dao.mapper; + +import com.mybatisflex.core.BaseMapper; +import run.mone.knowledge.service.dao.entity.VKnowledgeVectorDetailPo; + +/** + * 映射层。 + * + * @author wmin + * @since 2024-02-19 + */ +public interface VKnowledgeVectorDetailMapper extends BaseMapper { + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/VKnowledgeVectorMetaMapper.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/VKnowledgeVectorMetaMapper.java new file mode 100644 index 000000000..14f06de58 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/dao/mapper/VKnowledgeVectorMetaMapper.java @@ -0,0 +1,28 @@ +package run.mone.knowledge.service.dao.mapper; + +import com.mybatisflex.core.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; +import run.mone.knowledge.service.dao.entity.VKnowledgeVectorMetaPo; + +import java.util.List; + +/** + * 映射层。 + * + * @author wmin + * @since 2024-02-19 + */ +public interface VKnowledgeVectorMetaMapper extends BaseMapper { + + @Update({ + "" + }) + int softDelete(@Param("ids") List ids); + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/exceptions/ExCodes.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/exceptions/ExCodes.java new file mode 100644 index 000000000..b6531aed6 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/exceptions/ExCodes.java @@ -0,0 +1,31 @@ +package run.mone.knowledge.service.exceptions; + +import com.xiaomi.youpin.infra.rpc.errors.ErrorCode; +import com.xiaomi.youpin.infra.rpc.errors.ErrorScope; + +/** + * @author HawickMason@xiaomi.com + * @date 1/11/24 11:20 + */ +public class ExCodes { + + + public static final ErrorScope DEFAULT_ERROR_SCOPE = ErrorScope.createOnce(0); + public static final ErrorCode STATUS_FORBIDDEN = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 403); + + public static final ErrorCode STATUS_CONFLICT = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 409); + + public static final ErrorCode STATUS_TOO_MANY_REQUESTS = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 429); + + public static final ErrorCode STATUS_INTERNAL_ERROR = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 500); + + public static final ErrorCode STATUS_INNER_QUERY_ERROR = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 600); + + public static final ErrorCode STATUS_BAD_REQUEST = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 400); + + public static final ErrorCode STATUS_METHOD_NOT_ALLOWED = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 405); + + public static final ErrorCode STATUS_NOT_FOUND = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 404); + + public static final ErrorCode STATUS_INVALID_ARGUMENT = ErrorCode.createOnce(DEFAULT_ERROR_SCOPE, 408); +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/OzVectorDbServiceImpl.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/OzVectorDbServiceImpl.java new file mode 100644 index 000000000..e8120ebe8 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/OzVectorDbServiceImpl.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.knowledge.service.impl; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.math3.linear.ArrayRealVector; +import org.apache.commons.math3.linear.RealVector; +import org.springframework.stereotype.Service; +import run.mone.knowledge.api.dto.VectorData; +import run.mone.knowledge.api.dto.VectorLimits; +import run.mone.knowledge.service.OzVectorDbService; + +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author shanwb + * @date 2024-02-06 + */ +@Service +@Slf4j +public class OzVectorDbServiceImpl implements OzVectorDbService { + + @Override + public List cosineSimilarity(double[] queryVector, List vectorDataList, VectorLimits limits) { + List topVectorList = vectorDataList.parallelStream().map(v -> { + double similarity = cosineSimilarity(queryVector, v.getVector()); + v.setSimilarity(similarity); + return v; + }).filter(v -> { + if (null != limits.getSimilarity()) { + return v.getSimilarity() > limits.getSimilarity(); + } + return true; + }).sorted(Comparator.comparingDouble(VectorData::getSimilarity).reversed()) + .limit(null == limits.getRealTopN() ? Long.MAX_VALUE : limits.getRealTopN()) + .collect(Collectors.toList()); + + return topVectorList; + } + + public static double cosineSimilarity(double[] vectorA, double[] vectorB) { + RealVector a = new ArrayRealVector(vectorA); + RealVector b = new ArrayRealVector(vectorB); + return a.cosine(b); + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/RedisVectorServiceImpl.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/RedisVectorServiceImpl.java new file mode 100644 index 000000000..eff908187 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/RedisVectorServiceImpl.java @@ -0,0 +1,229 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.knowledge.service.impl; + +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.xiaomi.data.push.redis.Redis; +import org.apache.commons.lang3.tuple.Pair; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.knowledge.api.dto.VectorData; +import run.mone.knowledge.service.RedisVectorService; + +import java.lang.reflect.Type; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author shanwb + * @date 2024-02-06 + */ +@Service +@Slf4j +public class RedisVectorServiceImpl implements RedisVectorService { + @Autowired + private Redis redis; + + private Gson gson = new Gson(); + + private static Type typeOfT = new TypeToken>() { + }.getType(); + + + //将List vectorDataList 转换为Map> dataMap 并存入redis (class) + @Override + public boolean storeVectorByGroup(List vectorDataList) { + Map> dataMap = new HashMap<>(); + + for (VectorData vectorData : vectorDataList) { + String outerKey = vectorData.getGroupKey(); + String innerKey = vectorData.getLeaf(); + double[] values = vectorData.getVector(); + + if (!dataMap.containsKey(outerKey)) { + dataMap.put(outerKey, new HashMap<>()); + } + + dataMap.get(outerKey).put(innerKey, values); + } + + for (Map.Entry> entry : dataMap.entrySet()) { + String groupKey = entry.getKey(); + Map data = entry.getValue(); + String jsonData = gson.toJson(data); + + redis.set(groupKey, jsonData); + } + + return true; + } + + /** + * 更新向量结果 + * + * @param vectorDataList 向量数据列表 + * @return 是否更新成功 + */ + @Override + public boolean updateVectorByLeaf(List vectorDataList) { + Map> dataMap = new HashMap<>(); + + for (VectorData vectorData : vectorDataList) { + String outerKey = vectorData.getGroupKey(); + String innerKey = vectorData.getLeaf(); + double[] values = vectorData.getVector(); + + if (!dataMap.containsKey(outerKey)) { + dataMap.put(outerKey, new HashMap<>()); + } + + dataMap.get(outerKey).put(innerKey, values); + } + + //查询已存在向量结果 + Map> existsDataMap = listByGroup2(new ArrayList<>(dataMap.keySet())); + + //更新向量结果 + for (Map.Entry> entry : dataMap.entrySet()) { + String groupKey = entry.getKey(); + Map updateData = entry.getValue(); + Map existsData = existsDataMap.get(groupKey); + if (null != existsData) { + existsData.putAll(updateData); + } else { + existsDataMap.put(groupKey, updateData); + } + } + + //更新回redis + for (Map.Entry> entry : existsDataMap.entrySet()) { + String groupKey = entry.getKey(); + Map data = entry.getValue(); + String jsonData = gson.toJson(data); + + redis.set(groupKey, jsonData); + } + + return true; + } + + @Override + public List listByGroup(List groupKeyList) { + List vectorDataList = new ArrayList<>(); + Map groupListResult = redis.mget(groupKeyList); + if (null == groupListResult) { + return Lists.newArrayList(); + } + + for (Map.Entry entry : groupListResult.entrySet()) { + String groupKey = entry.getKey(); + Pair pair = VectorData.parseGroupKey(groupKey); + String value = entry.getValue(); + + Map map = gson.fromJson(value, typeOfT); + if (null == map || map.isEmpty()){ + continue; + } + for (Map.Entry en : map.entrySet()) { + VectorData vectorData = new VectorData(); + vectorData.setType(pair.getKey()); + vectorData.setGroup(pair.getValue()); + vectorData.setLeaf(en.getKey()); + vectorData.setVector(en.getValue()); + + vectorDataList.add(vectorData); + } + } + + return vectorDataList; + } + + /** + * 根据提供的分组列表从Redis中获取数据,将每个分组的JSON字符串转换为Map并返回一个嵌套的Map结构。 + */ + @Override + public Map> listByGroup2(List groupKeyList) { + Map> resultMap = new HashMap<>(); + Map groupListResult = redis.mget(groupKeyList); + if (null == groupListResult) { + return resultMap; + } + + for (Map.Entry entry : groupListResult.entrySet()) { + String groupKey = entry.getKey(); + String value = entry.getValue(); + + Map map = gson.fromJson(value, typeOfT); + resultMap.put(groupKey, map); + } + + return resultMap; + } + + //基于VectorData的group列表进行redis数据删除,入参是List groupList (class) + @Override + public boolean deleteByGroup(List groupKeyList) { + for (String groupKey : groupKeyList) { + redis.del(groupKey); + } + return true; + } + + //基于VectorData的leaf列表进行redis数据删除,需要基于入参聚合出group集合,然后从redis中查出数据,并基于leaf进行数据删除,入参是List vectorDataList (class) + @Override + public boolean deleteByLeaf(List vectorDataList) { + // 聚合出group集合 + Set groupKeySet = vectorDataList.stream() + .map(VectorData::getGroupKey) + .collect(Collectors.toSet()); + + // 从redis中查出数据 + Map> groupDataMap = listByGroup2(new ArrayList<>(groupKeySet)); + + // 基于leaf进行数据删除 + vectorDataList.forEach(vectorData -> { + String groupKey = vectorData.getGroupKey(); + String leaf = vectorData.getLeaf(); + Map leafMap = groupDataMap.get(groupKey); + if (leafMap != null) { + leafMap.remove(leaf); + } + }); + + // 更新回redis + groupDataMap.forEach((groupKey, leafMap) -> { + if (null==leafMap || leafMap.isEmpty()) { + redis.del(groupKey); + } else { + String jsonData = gson.toJson(leafMap); + redis.set(groupKey, jsonData); + } + }); + + return true; + } + + + + + //根据VectorData的leaf属性列表获取向量数据列表,redis中的key是VectorData的group属性入参是List (class) + + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/VectorDtoTruncateService.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/VectorDtoTruncateService.java new file mode 100644 index 000000000..2e570adf1 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/impl/VectorDtoTruncateService.java @@ -0,0 +1,102 @@ +package run.mone.knowledge.service.impl; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.knowledge.api.dto.*; +import run.mone.knowledge.api.enums.KnowledgeTypeEnum; +import run.mone.knowledge.service.EmbeddingService; +import run.mone.knowledge.service.dao.entity.VKnowledgeVectorDetailPo; +import run.mone.knowledge.service.dao.entity.VKnowledgeVectorMetaPo; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * @author wmin + * @date 2024/2/19 + */ +@Service +@Slf4j +public class VectorDtoTruncateService { + + public static Gson gson = new Gson(); + @Autowired + private EmbeddingService embeddingService; + + + /** + * 将qry入参转换为解析出leafTag和groupTag的fullDto + */ + public TagsFullInfo getSimilarKnowledgeVectorFullQry(TagsInfo qry, KnowledgeTypeEnum typeEnum) { + List tags = Arrays.asList(qry.getTag1(), qry.getTag2(), qry.getTag3(), qry.getTag4(), qry.getTag5(), qry.getTag6(), qry.getTag7()); + TagsFullInfo fullQry = new TagsFullInfo(); + fullQry.setTags(tags); + fullQry.setLeafTag(tags.get(typeEnum.getLeafTagIndex())); + fullQry.setGroupTag(tags.get(typeEnum.getGroupTagIndex())); + return fullQry; + } + + /** + * 将detail入参转换为解析出leafTag和groupTag的fullDto + */ + public KnowledgeVectorDetailFullDto getFullDto(KnowledgeVectorDetailDto detailDto, KnowledgeTypeEnum typeEnum) { + List tags = Arrays.asList(detailDto.getTag1(), detailDto.getTag2(), detailDto.getTag3(), detailDto.getTag4(), detailDto.getTag5(), detailDto.getTag6(), detailDto.getTag7()); + KnowledgeVectorDetailFullDto fullDto = new KnowledgeVectorDetailFullDto(); + fullDto.setType(typeEnum.getTypeName()); + fullDto.setDetailDto(detailDto); + fullDto.setFullTags(tags); + fullDto.setLeafTag(tags.get(typeEnum.getLeafTagIndex())); + fullDto.setGroupTag(tags.get(typeEnum.getGroupTagIndex())); + fullDto.setGroupTagIndex(typeEnum.getGroupTagIndex()); + fullDto.setLeafTagIndex(typeEnum.getLeafTagIndex()); + return fullDto; + } + + + /** + * 将VectorMeta dto转换为数据库PO + */ + public VKnowledgeVectorMetaPo convertVectorMetaDtoToPo(KnowledgeVectorDetailFullDto fullDto) { + KnowledgeVectorDetailDto detailDto = fullDto.getDetailDto(); + VKnowledgeVectorMetaPo vectorMeta = new VKnowledgeVectorMetaPo(); + vectorMeta.setType(fullDto.getType()); + vectorMeta.setTag1(detailDto.getTag1()); + int sum = fullDto.getGroupTagIndex() + 1; + int count = 0; + if (StringUtils.isNotBlank(detailDto.getTag2()) && ++count < sum) vectorMeta.setTag2(detailDto.getTag2()); + if (StringUtils.isNotBlank(detailDto.getTag3()) && ++count < sum) vectorMeta.setTag3(detailDto.getTag3()); + if (StringUtils.isNotBlank(detailDto.getTag4()) && ++count < sum) vectorMeta.setTag4(detailDto.getTag4()); + if (StringUtils.isNotBlank(detailDto.getTag5()) && ++count < sum) vectorMeta.setTag5(detailDto.getTag5()); + if (StringUtils.isNotBlank(detailDto.getTag6()) && ++count < sum) vectorMeta.setTag6(detailDto.getTag6()); + vectorMeta.setGroupTag(fullDto.getGroupTag()); + return vectorMeta; + } + + /** + * 将VectorDetail dto转换为数据库PO + */ + public VKnowledgeVectorDetailPo convertVectorDetailDtoToPo(KnowledgeVectorDetailFullDto fullDto) { + KnowledgeVectorDetailDto detailDto = fullDto.getDetailDto(); + VKnowledgeVectorDetailPo vectorMeta = new VKnowledgeVectorDetailPo(); + vectorMeta.setContent(detailDto.getContent()); + vectorMeta.setGmtCreate(new Date()); + vectorMeta.setLeafTag(fullDto.getLeafTag()); + vectorMeta.setType(fullDto.getType()); + if (detailDto.getVector() != null) { + vectorMeta.setVector(gson.toJson(detailDto.getVector())); + } + //todo 异步 + if (StringUtils.isNotBlank(detailDto.getContent())) { + String inputEmbedding = embeddingService.getEmbeddingStr(detailDto.getContent()); + vectorMeta.setVector(inputEmbedding); + detailDto.setVector(gson.fromJson(inputEmbedding, new TypeToken() { + }.getType())); + } + return vectorMeta; + } +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/DemoDepRpc.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/DemoDepRpc.java new file mode 100644 index 000000000..8e02f3086 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/DemoDepRpc.java @@ -0,0 +1,20 @@ +package run.mone.knowledge.service.rpc; + +import run.mone.knowledge.service.rpc.dto.DemoDepReqDto; +import run.mone.knowledge.service.rpc.dto.DemoDepResDto; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +public class DemoDepRpc { + + public DemoDepResDto remoteReq(DemoDepReqDto reqDto) { + log.info("DemoDepRpc.remoteReq 请求{}", reqDto); + //远程接口请求和响应要转换dto + DemoDepResDto resDto = DemoDepResDto.build(); + log.info("DemoDepRpc.remoteReq 响应{}", resDto); + return resDto; + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/dto/DemoDepReqDto.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/dto/DemoDepReqDto.java new file mode 100644 index 000000000..655952517 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/dto/DemoDepReqDto.java @@ -0,0 +1,19 @@ +package run.mone.knowledge.service.rpc.dto; + +import run.mone.knowledge.api.dto.DemoReqDto; +import lombok.Data; +import lombok.ToString; + +@ToString +@Data +public class DemoDepReqDto { + + private Long id; + + public static DemoDepReqDto build(DemoReqDto reqDto) { + DemoDepReqDto demoDepReqDto = new DemoDepReqDto(); + demoDepReqDto.id = reqDto.getId(); + return demoDepReqDto; + } + +} diff --git a/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/dto/DemoDepResDto.java b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/dto/DemoDepResDto.java new file mode 100644 index 000000000..2c7824d61 --- /dev/null +++ b/m78-all/private-knowledge/private-knowledge-service/src/main/java/run/mone/knowledge/service/rpc/dto/DemoDepResDto.java @@ -0,0 +1,17 @@ +package run.mone.knowledge.service.rpc.dto; + +import lombok.Data; +import lombok.ToString; + +@ToString +@Data +public class DemoDepResDto { + + private String test1; + + public static DemoDepResDto build() { + DemoDepResDto resDto = new DemoDepResDto(); + resDto.test1 = "test1"; + return resDto; + } +} diff --git a/m78-all/z-desensitization/.gitignore b/m78-all/z-desensitization/.gitignore new file mode 100644 index 000000000..6f91ee198 --- /dev/null +++ b/m78-all/z-desensitization/.gitignore @@ -0,0 +1,24 @@ +*.bak +build_info.properties +.classpath +dependency-reduced-pom.xml +*.diff +.DS_Store + +# IDEA +.idea/ +*.iml +logs/ +log/ + +# eclipse (Scala IDE) +.project +.settings/ +.tags* +target/ +test-output/ +nohup* +*.log +*.swp +*.pyc +.sbtserver* \ No newline at end of file diff --git a/m78-all/z-desensitization/README.md b/m78-all/z-desensitization/README.md new file mode 100644 index 000000000..34cd855e9 --- /dev/null +++ b/m78-all/z-desensitization/README.md @@ -0,0 +1,5 @@ +# 概述 ++ 用来测试mesh方案的代码 ++ springboot 2.2 的版本 ++ 测试 ++ curl http://127.0.0.1:8085/md5 \ No newline at end of file diff --git a/m78-all/z-desensitization/pom.xml b/m78-all/z-desensitization/pom.xml new file mode 100644 index 000000000..9f63998ac --- /dev/null +++ b/m78-all/z-desensitization/pom.xml @@ -0,0 +1,166 @@ + + + + 4.0.0 + run.mone.z + z-desensitization + 1.0-SNAPSHOT + pom + + + z-desensitization-api + z-desensitization-domain + z-desensitization-infrastructure + z-desensitization-app + z-desensitization-server + + + + + + org.springframework.boot + spring-boot-starter-web + 2.7.7 + + + org.springframework.boot + spring-boot-starter-logging + 2.7.7 + + + org.springframework.boot + spring-boot-starter-test + 2.7.7 + + + org.yaml + snakeyaml + + + + + com.fasterxml.jackson.core + jackson-core + 2.13.4 + + + io.netty + netty-all + 4.1.52.Final + + + org.codehaus.mojo + animal-sniffer-annotations + 1.19 + + + com.google.code.gson + gson + 2.8.6 + + + org.slf4j + slf4j-api + 1.7.36 + compile + + + cglib + cglib-nodep + 3.3.0 + + + commons-codec + commons-codec + 1.11 + + + org.apache.commons + commons-lang3 + 3.7 + + + com.google.errorprone + error_prone_annotations + 2.4.0 + runtime + + + com.google.guava + guava + 31.0.1-jre + compile + + + com.caucho + hessian + 4.0.65 + + + org.apache.httpcomponents + httpclient + 4.5.5 + + + org.apache.httpcomponents + httpcore + 4.4.9 + + + com.fasterxml.jackson.core + jackson-databind + 2.13.4 + compile + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 1.8 + 1.8 + true + true + UTF-8 + + + ${project.basedir}/src/main/java + + + + + + run.mone + jarcheck-maven-plugin + 1.4-SNAPSHOT + + + package + + jarCheck + + + + + + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + diff --git a/m78-all/z-desensitization/z-desensitization-api/pom.xml b/m78-all/z-desensitization/z-desensitization-api/pom.xml new file mode 100644 index 000000000..bd97d35b2 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-api/pom.xml @@ -0,0 +1,28 @@ + + + + + z-desensitization + run.mone.z + 1.0-SNAPSHOT + + 4.0.0 + + z-desensitization-api + + + + + + run.mone + infra-result + 1.4-SNAPSHOT + + + + + + + \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/bo/DesensitizeReq.java b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/bo/DesensitizeReq.java new file mode 100644 index 000000000..0463748f4 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/bo/DesensitizeReq.java @@ -0,0 +1,68 @@ +package run.mone.z.desensitization.api.bo; + +import java.io.Serializable; +import java.util.List; + +/** + * @author wmin + * @date 2023/11/14 + */ +public class DesensitizeReq implements Serializable { + private String text; + private List sensitiveWordConfigBo; + private Boolean aiDesensitizeFlag; + + private Boolean needExtract; + + private String langType; + + private String username; + + public String getLangType() { + return langType; + } + + public void setLangType(String langType) { + this.langType = langType; + } + + public Boolean getNeedExtract() { + return needExtract; + } + + public void setNeedExtract(Boolean needExtract) { + this.needExtract = needExtract; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public List getSensitiveWordConfigBo() { + return sensitiveWordConfigBo; + } + + public void setSensitiveWordConfigBo(List sensitiveWordConfigBo) { + this.sensitiveWordConfigBo = sensitiveWordConfigBo; + } + + public Boolean getAiDesensitizeFlag() { + return aiDesensitizeFlag; + } + + public void setAiDesensitizeFlag(Boolean aiDesensitizeFlag) { + this.aiDesensitizeFlag = aiDesensitizeFlag; + } +} diff --git a/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/bo/SensitiveWordConfigBo.java b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/bo/SensitiveWordConfigBo.java new file mode 100644 index 000000000..231cce020 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/bo/SensitiveWordConfigBo.java @@ -0,0 +1,51 @@ +package run.mone.z.desensitization.api.bo; + +import run.mone.z.desensitization.api.common.SensitiveWordTypeEnum; + +import java.io.Serializable; + +/** + * @author wmin + * @date 2023/11/14 + */ +public class SensitiveWordConfigBo implements Serializable { + /** + * @see SensitiveWordTypeEnum + */ + private Integer type; + private String content; + private Boolean isRegexMatch; + private Boolean isCaseSensitive; + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Boolean getRegexMatch() { + return isRegexMatch; + } + + public void setRegexMatch(Boolean regexMatch) { + isRegexMatch = regexMatch; + } + + public Boolean getCaseSensitive() { + return isCaseSensitive; + } + + public void setCaseSensitive(Boolean caseSensitive) { + isCaseSensitive = caseSensitive; + } +} diff --git a/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/common/CodeTypeEnum.java b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/common/CodeTypeEnum.java new file mode 100644 index 000000000..b7d6e4e38 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/common/CodeTypeEnum.java @@ -0,0 +1,20 @@ +package run.mone.z.desensitization.api.common; + +/** + * @author wmin + * @date 2023/6/5 + */ +public enum CodeTypeEnum { + CLASS("class"), + METHOD("method"); + + private String type; + + public String getType() { + return type; + } + + CodeTypeEnum(String type) { + this.type = type; + } +} diff --git a/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/common/SensitiveWordTypeEnum.java b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/common/SensitiveWordTypeEnum.java new file mode 100644 index 000000000..9b80663e8 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/common/SensitiveWordTypeEnum.java @@ -0,0 +1,35 @@ +package run.mone.z.desensitization.api.common; + +public enum SensitiveWordTypeEnum { + All(0, "不限制"), + FiledKey(1, "属性名"), + FiledValue(2, "属性值"); + public final int code; + public final String description; + + SensitiveWordTypeEnum(int code, String description) { + this.code = code; + this.description = description; + } + + public int getCode() { + return code; + } + + public String getDescription() { + return description; + } + + public static boolean check(Integer type){ + if(type==null){ + return false; + } + SensitiveWordTypeEnum[] values = SensitiveWordTypeEnum.values(); + for (SensitiveWordTypeEnum envEnum : values) { + if(type==envEnum.getCode()){ + return true; + } + } + return false; + } +} diff --git a/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/service/CodeDesensitizeService.java b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/service/CodeDesensitizeService.java new file mode 100644 index 000000000..7f033d16e --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/service/CodeDesensitizeService.java @@ -0,0 +1,25 @@ +package run.mone.z.desensitization.api.service; + +import com.xiaomi.youpin.infra.rpc.Result; +import run.mone.z.desensitization.api.bo.DesensitizeReq; + +/** + * @author wmin + * @date 2023/6/5 + */ +public interface CodeDesensitizeService { + + /** + * @param codeSnippet 纯代码片段 + * @return + */ + Result codeDesensitize(String codeSnippet); + + /** + * @param text 包含代码片段的文本 + * @return + */ + Result textDesensitize(String text); + + Result textDesensitizeWithAi(DesensitizeReq req); +} diff --git a/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/service/DubboHealthService.java b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/service/DubboHealthService.java new file mode 100644 index 000000000..b3766d70f --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-api/src/main/java/run/mone/z/desensitization/api/service/DubboHealthService.java @@ -0,0 +1,10 @@ +package run.mone.z.desensitization.api.service; + + +import com.xiaomi.youpin.infra.rpc.Result; + +public interface DubboHealthService { + + Result health(); + +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/pom.xml b/m78-all/z-desensitization/z-desensitization-app/pom.xml new file mode 100644 index 000000000..2132d9c50 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/pom.xml @@ -0,0 +1,56 @@ + + + z-desensitization + run.mone.z + 1.0-SNAPSHOT + + 4.0.0 + z-desensitization-app + + + + + z-desensitization-api + run.mone.z + 1.0-SNAPSHOT + + + + z-desensitization-domain + run.mone.z + 1.0-SNAPSHOT + + + + org.antlr + antlr4-runtime + 4.7.1 + + + org.antlr + antlr4 + 4.7.1 + + + + com.github.javaparser + javaparser-core + 3.23.1 + + + com.sun + tools + 1.8 + system + ${java.home}/../lib/tools.jar + + + org.jetbrains + annotations + 24.1.0 + test + + + + diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/Field.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/Field.java new file mode 100644 index 000000000..2b85f018f --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/Field.java @@ -0,0 +1,22 @@ +package run.mone.antlr.golang; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author goodjava@qq.com + * @date 2024/2/1 22:47 + */ +@Data +@Builder +public class Field implements Serializable { + + public String k; + + public String v; + + public String type; + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoCode.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoCode.java new file mode 100644 index 000000000..8d205040c --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoCode.java @@ -0,0 +1,107 @@ +package run.mone.antlr.golang; + +import lombok.extern.slf4j.Slf4j; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.ParseTreeWalker; +import org.antlr.v4.runtime.tree.TerminalNode; + +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author goodjava@qq.com + * @date 2024/1/29 16:56 + */ +@Slf4j +public class GoCode { + + + public static ParseResult parse(String code) { + GoLexer lexer = new GoLexer(new ANTLRInputStream(code)); + CommonTokenStream tokens = new CommonTokenStream(lexer); + GoParser parser = new GoParser(tokens); + + parser.addErrorListener(new BaseErrorListener() { + @Override + public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { + log.error("line:" + line + " msg:" + msg); + } + }); + + ParseTree tree = parser.sourceFile(); + ParseTreeWalker walker = new ParseTreeWalker(); + + List list = new ArrayList<>(); + + Map> map = new HashMap<>(); + + GoParserListener listener = new GoParserBaseListener() { + + @Override + public void enterCompositeLit(GoParser.CompositeLitContext ctx) { + // 遍历所有的键值初始化 + for (GoParser.KeyedElementContext keyedElement : ctx.literalValue().elementList().keyedElement()) { + String key = keyedElement.key().getText(); + System.out.println("key:" + key + " value:" + keyedElement.element().getText()); + list.add(Field.builder().k(key).v(keyedElement.element().getText()).type("CompositeLit").build()); + } + } + + @Override + public void enterVarSpec(GoParser.VarSpecContext ctx) { + // 获取变量名 + String varName = ctx.identifierList().getText(); + // 获取变量的初始化值 + String varValue = ctx.expressionList().getText(); + list.add(Field.builder().k(varName).v(varValue).type("VarSpec").build()); + } + + + @Override + public void enterArguments(GoParser.ArgumentsContext ctx) { + int count = ctx.getChildCount(); + if (count == 3) { + list.add(Field.builder().k(ctx.getParent().getChild(0).getText()).v(ctx.getChild(1).getText()).type("method").build()); + } + } + + @Override + public void enterFunctionDecl(GoParser.FunctionDeclContext ctx) { + //解析方法名和参数名 + List pList = ctx.signature().parameters().parameterDecl(); + List l2 = pList.stream().map(it -> { + return it.identifierList().IDENTIFIER().stream().map(it2 -> it2.getText()).collect(Collectors.joining(",")); + }).collect(Collectors.toList()); + + map.put(ctx.getChild(1).getText(),l2); + } + + + @Override + public void enterMethodDecl(GoParser.MethodDeclContext ctx) { + // 检查是否是结构体的方法 + if (ctx.receiver() != null) { + //解析方法名和参数名 + List pList = ctx.signature().parameters().parameterDecl(); + List l2 = pList.stream().map(it -> { + return it.identifierList().IDENTIFIER().stream().map(it2 -> it2.getText()).collect(Collectors.joining(",")); + }).collect(Collectors.toList()); + //0 func 1 receiver 2 methodName + map.put(ctx.getChild(2).getText(),l2); + } + + } + }; + walker.walk(listener, tree); + return ParseResult.builder().fieldList(list).methodMap(map).build(); + } + + + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.interp b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.interp new file mode 100644 index 000000000..3a9e86363 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.interp @@ -0,0 +1,301 @@ +token literal names: +null +'break' +'default' +'func' +'interface' +'select' +'case' +'defer' +'go' +'map' +'struct' +'chan' +'else' +'goto' +'package' +'switch' +'const' +'fallthrough' +'if' +'range' +'type' +'continue' +'for' +'import' +'return' +'var' +'nil' +null +'(' +')' +'{' +'}' +'[' +']' +'=' +',' +';' +':' +'.' +'++' +'--' +':=' +'...' +'||' +'&&' +'==' +'!=' +'<' +'<=' +'>' +'>=' +'|' +'/' +'%' +'<<' +'>>' +'&^' +'~' +'!' +'+' +'-' +'^' +'*' +'&' +'<-' +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +BREAK +DEFAULT +FUNC +INTERFACE +SELECT +CASE +DEFER +GO +MAP +STRUCT +CHAN +ELSE +GOTO +PACKAGE +SWITCH +CONST +FALLTHROUGH +IF +RANGE +TYPE +CONTINUE +FOR +IMPORT +RETURN +VAR +NIL_LIT +IDENTIFIER +L_PAREN +R_PAREN +L_CURLY +R_CURLY +L_BRACKET +R_BRACKET +ASSIGN +COMMA +SEMI +COLON +DOT +PLUS_PLUS +MINUS_MINUS +DECLARE_ASSIGN +ELLIPSIS +LOGICAL_OR +LOGICAL_AND +EQUALS +NOT_EQUALS +LESS +LESS_OR_EQUALS +GREATER +GREATER_OR_EQUALS +OR +DIV +MOD +LSHIFT +RSHIFT +BIT_CLEAR +UNDERLYING +EXCLAMATION +PLUS +MINUS +CARET +STAR +AMPERSAND +RECEIVE +DECIMAL_LIT +BINARY_LIT +OCTAL_LIT +HEX_LIT +FLOAT_LIT +DECIMAL_FLOAT_LIT +HEX_FLOAT_LIT +IMAGINARY_LIT +RUNE_LIT +BYTE_VALUE +OCTAL_BYTE_VALUE +HEX_BYTE_VALUE +LITTLE_U_VALUE +BIG_U_VALUE +RAW_STRING_LIT +INTERPRETED_STRING_LIT +WS +COMMENT +TERMINATOR +LINE_COMMENT +NEWLINE +WS_NLSEMI +COMMENT_NLSEMI +LINE_COMMENT_NLSEMI +EOS +OTHER + +rule names: +BREAK +DEFAULT +FUNC +INTERFACE +SELECT +CASE +DEFER +GO +MAP +STRUCT +CHAN +ELSE +GOTO +PACKAGE +SWITCH +CONST +FALLTHROUGH +IF +RANGE +TYPE +CONTINUE +FOR +IMPORT +RETURN +VAR +NIL_LIT +IDENTIFIER +L_PAREN +R_PAREN +L_CURLY +R_CURLY +L_BRACKET +R_BRACKET +ASSIGN +COMMA +SEMI +COLON +DOT +PLUS_PLUS +MINUS_MINUS +DECLARE_ASSIGN +ELLIPSIS +LOGICAL_OR +LOGICAL_AND +EQUALS +NOT_EQUALS +LESS +LESS_OR_EQUALS +GREATER +GREATER_OR_EQUALS +OR +DIV +MOD +LSHIFT +RSHIFT +BIT_CLEAR +UNDERLYING +EXCLAMATION +PLUS +MINUS +CARET +STAR +AMPERSAND +RECEIVE +DECIMAL_LIT +BINARY_LIT +OCTAL_LIT +HEX_LIT +FLOAT_LIT +DECIMAL_FLOAT_LIT +HEX_FLOAT_LIT +HEX_MANTISSA +HEX_EXPONENT +IMAGINARY_LIT +RUNE +RUNE_LIT +BYTE_VALUE +OCTAL_BYTE_VALUE +HEX_BYTE_VALUE +LITTLE_U_VALUE +BIG_U_VALUE +RAW_STRING_LIT +INTERPRETED_STRING_LIT +WS +COMMENT +TERMINATOR +LINE_COMMENT +NEWLINE +UNICODE_VALUE +ESCAPED_VALUE +DECIMALS +OCTAL_DIGIT +HEX_DIGIT +BIN_DIGIT +EXPONENT +LETTER +UNICODE_DIGIT +UNICODE_LETTER +WS_NLSEMI +COMMENT_NLSEMI +LINE_COMMENT_NLSEMI +EOS +OTHER + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE +NLSEMI + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 92, 863, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 7, 28, 382, 10, 28, 12, 28, 14, 28, 385, 11, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 5, 66, 491, 10, 66, 3, 66, 7, 66, 494, 10, 66, 12, 66, 14, 66, 497, 11, 66, 5, 66, 499, 10, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 5, 67, 506, 10, 67, 3, 67, 6, 67, 509, 10, 67, 13, 67, 14, 67, 510, 3, 67, 3, 67, 3, 68, 3, 68, 5, 68, 517, 10, 68, 3, 68, 5, 68, 520, 10, 68, 3, 68, 6, 68, 523, 10, 68, 13, 68, 14, 68, 524, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 5, 69, 532, 10, 69, 3, 69, 6, 69, 535, 10, 69, 13, 69, 14, 69, 536, 3, 69, 3, 69, 3, 70, 3, 70, 5, 70, 543, 10, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 5, 71, 550, 10, 71, 3, 71, 5, 71, 553, 10, 71, 3, 71, 5, 71, 556, 10, 71, 3, 71, 3, 71, 3, 71, 5, 71, 561, 10, 71, 5, 71, 563, 10, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 5, 73, 571, 10, 73, 3, 73, 6, 73, 574, 10, 73, 13, 73, 14, 73, 575, 3, 73, 3, 73, 5, 73, 580, 10, 73, 3, 73, 7, 73, 583, 10, 73, 12, 73, 14, 73, 586, 11, 73, 5, 73, 588, 10, 73, 3, 73, 3, 73, 3, 73, 5, 73, 593, 10, 73, 3, 73, 7, 73, 596, 10, 73, 12, 73, 14, 73, 599, 11, 73, 5, 73, 601, 10, 73, 3, 74, 3, 74, 5, 74, 605, 10, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 614, 10, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 5, 76, 623, 10, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 5, 78, 633, 10, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 7, 83, 665, 10, 83, 12, 83, 14, 83, 668, 11, 83, 3, 83, 3, 83, 3, 83, 3, 83, 3, 84, 3, 84, 3, 84, 7, 84, 677, 10, 84, 12, 84, 14, 84, 680, 11, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 85, 6, 85, 687, 10, 85, 13, 85, 14, 85, 688, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 3, 86, 7, 86, 697, 10, 86, 12, 86, 14, 86, 700, 11, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 87, 6, 87, 708, 10, 87, 13, 87, 14, 87, 709, 3, 87, 3, 87, 3, 88, 3, 88, 3, 88, 3, 88, 7, 88, 718, 10, 88, 12, 88, 14, 88, 721, 11, 88, 3, 88, 3, 88, 3, 89, 5, 89, 726, 10, 89, 3, 89, 3, 89, 6, 89, 730, 10, 89, 13, 89, 14, 89, 731, 3, 89, 6, 89, 735, 10, 89, 13, 89, 14, 89, 736, 5, 89, 739, 10, 89, 3, 90, 3, 90, 3, 90, 3, 90, 5, 90, 745, 10, 90, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 5, 91, 773, 10, 91, 3, 92, 3, 92, 5, 92, 777, 10, 92, 3, 92, 7, 92, 780, 10, 92, 12, 92, 14, 92, 783, 11, 92, 3, 93, 3, 93, 3, 94, 3, 94, 3, 95, 3, 95, 3, 96, 3, 96, 5, 96, 793, 10, 96, 3, 96, 3, 96, 3, 97, 3, 97, 5, 97, 799, 10, 97, 3, 98, 3, 98, 3, 99, 3, 99, 3, 100, 6, 100, 806, 10, 100, 13, 100, 14, 100, 807, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 101, 7, 101, 816, 10, 101, 12, 101, 14, 101, 819, 11, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 102, 7, 102, 830, 10, 102, 12, 102, 14, 102, 833, 11, 102, 3, 102, 3, 102, 3, 103, 6, 103, 838, 10, 103, 13, 103, 14, 103, 839, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 7, 103, 847, 10, 103, 12, 103, 14, 103, 850, 11, 103, 3, 103, 3, 103, 3, 103, 5, 103, 855, 10, 103, 3, 103, 3, 103, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 5, 698, 817, 848, 2, 105, 4, 3, 6, 4, 8, 5, 10, 6, 12, 7, 14, 8, 16, 9, 18, 10, 20, 11, 22, 12, 24, 13, 26, 14, 28, 15, 30, 16, 32, 17, 34, 18, 36, 19, 38, 20, 40, 21, 42, 22, 44, 23, 46, 24, 48, 25, 50, 26, 52, 27, 54, 28, 56, 29, 58, 30, 60, 31, 62, 32, 64, 33, 66, 34, 68, 35, 70, 36, 72, 37, 74, 38, 76, 39, 78, 40, 80, 41, 82, 42, 84, 43, 86, 44, 88, 45, 90, 46, 92, 47, 94, 48, 96, 49, 98, 50, 100, 51, 102, 52, 104, 53, 106, 54, 108, 55, 110, 56, 112, 57, 114, 58, 116, 59, 118, 60, 120, 61, 122, 62, 124, 63, 126, 64, 128, 65, 130, 66, 132, 67, 134, 68, 136, 69, 138, 70, 140, 71, 142, 72, 144, 73, 146, 2, 148, 2, 150, 74, 152, 2, 154, 75, 156, 76, 158, 77, 160, 78, 162, 79, 164, 80, 166, 81, 168, 82, 170, 83, 172, 84, 174, 85, 176, 86, 178, 87, 180, 2, 182, 2, 184, 2, 186, 2, 188, 2, 190, 2, 192, 2, 194, 2, 196, 2, 198, 2, 200, 88, 202, 89, 204, 90, 206, 91, 208, 92, 4, 2, 3, 19, 3, 2, 51, 59, 3, 2, 50, 59, 4, 2, 68, 68, 100, 100, 4, 2, 81, 81, 113, 113, 4, 2, 90, 90, 122, 122, 4, 2, 82, 82, 114, 114, 4, 2, 45, 45, 47, 47, 3, 2, 98, 98, 4, 2, 36, 36, 94, 94, 4, 2, 11, 11, 34, 34, 4, 2, 12, 12, 15, 15, 5, 2, 12, 12, 15, 15, 41, 41, 11, 2, 36, 36, 41, 41, 94, 94, 99, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 3, 2, 50, 51, 4, 2, 71, 71, 103, 103, 4, 56, 2, 50, 2, 59, 2, 1634, 2, 1643, 2, 1778, 2, 1787, 2, 1986, 2, 1995, 2, 2408, 2, 2417, 2, 2536, 2, 2545, 2, 2664, 2, 2673, 2, 2792, 2, 2801, 2, 2920, 2, 2929, 2, 3048, 2, 3057, 2, 3176, 2, 3185, 2, 3304, 2, 3313, 2, 3432, 2, 3441, 2, 3560, 2, 3569, 2, 3666, 2, 3675, 2, 3794, 2, 3803, 2, 3874, 2, 3883, 2, 4162, 2, 4171, 2, 4242, 2, 4251, 2, 6114, 2, 6123, 2, 6162, 2, 6171, 2, 6472, 2, 6481, 2, 6610, 2, 6619, 2, 6786, 2, 6795, 2, 6802, 2, 6811, 2, 6994, 2, 7003, 2, 7090, 2, 7099, 2, 7234, 2, 7243, 2, 7250, 2, 7259, 2, 42530, 2, 42539, 2, 43218, 2, 43227, 2, 43266, 2, 43275, 2, 43474, 2, 43483, 2, 43506, 2, 43515, 2, 43602, 2, 43611, 2, 44018, 2, 44027, 2, 65298, 2, 65307, 2, 1186, 3, 1195, 3, 4200, 3, 4209, 3, 4338, 3, 4347, 3, 4408, 3, 4417, 3, 4562, 3, 4571, 3, 4850, 3, 4859, 3, 5202, 3, 5211, 3, 5330, 3, 5339, 3, 5714, 3, 5723, 3, 5826, 3, 5835, 3, 5938, 3, 5947, 3, 6370, 3, 6379, 3, 7250, 3, 7259, 3, 27234, 3, 27243, 3, 27474, 3, 27483, 3, 55248, 3, 55297, 3, 59730, 3, 59739, 3, 573, 2, 67, 2, 92, 2, 99, 2, 124, 2, 172, 2, 172, 2, 183, 2, 183, 2, 188, 2, 188, 2, 194, 2, 216, 2, 218, 2, 248, 2, 250, 2, 707, 2, 712, 2, 723, 2, 738, 2, 742, 2, 750, 2, 750, 2, 752, 2, 752, 2, 882, 2, 886, 2, 888, 2, 889, 2, 892, 2, 895, 2, 897, 2, 897, 2, 904, 2, 904, 2, 906, 2, 908, 2, 910, 2, 910, 2, 912, 2, 931, 2, 933, 2, 1015, 2, 1017, 2, 1155, 2, 1164, 2, 1329, 2, 1331, 2, 1368, 2, 1371, 2, 1371, 2, 1379, 2, 1417, 2, 1490, 2, 1516, 2, 1522, 2, 1524, 2, 1570, 2, 1612, 2, 1648, 2, 1649, 2, 1651, 2, 1749, 2, 1751, 2, 1751, 2, 1767, 2, 1768, 2, 1776, 2, 1777, 2, 1788, 2, 1790, 2, 1793, 2, 1793, 2, 1810, 2, 1810, 2, 1812, 2, 1841, 2, 1871, 2, 1959, 2, 1971, 2, 1971, 2, 1996, 2, 2028, 2, 2038, 2, 2039, 2, 2044, 2, 2044, 2, 2050, 2, 2071, 2, 2076, 2, 2076, 2, 2086, 2, 2086, 2, 2090, 2, 2090, 2, 2114, 2, 2138, 2, 2210, 2, 2230, 2, 2232, 2, 2239, 2, 2310, 2, 2363, 2, 2367, 2, 2367, 2, 2386, 2, 2386, 2, 2394, 2, 2403, 2, 2419, 2, 2434, 2, 2439, 2, 2446, 2, 2449, 2, 2450, 2, 2453, 2, 2474, 2, 2476, 2, 2482, 2, 2484, 2, 2484, 2, 2488, 2, 2491, 2, 2495, 2, 2495, 2, 2512, 2, 2512, 2, 2526, 2, 2527, 2, 2529, 2, 2531, 2, 2546, 2, 2547, 2, 2567, 2, 2572, 2, 2577, 2, 2578, 2, 2581, 2, 2602, 2, 2604, 2, 2610, 2, 2612, 2, 2613, 2, 2615, 2, 2616, 2, 2618, 2, 2619, 2, 2651, 2, 2654, 2, 2656, 2, 2656, 2, 2676, 2, 2678, 2, 2695, 2, 2703, 2, 2705, 2, 2707, 2, 2709, 2, 2730, 2, 2732, 2, 2738, 2, 2740, 2, 2741, 2, 2743, 2, 2747, 2, 2751, 2, 2751, 2, 2770, 2, 2770, 2, 2786, 2, 2787, 2, 2811, 2, 2811, 2, 2823, 2, 2830, 2, 2833, 2, 2834, 2, 2837, 2, 2858, 2, 2860, 2, 2866, 2, 2868, 2, 2869, 2, 2871, 2, 2875, 2, 2879, 2, 2879, 2, 2910, 2, 2911, 2, 2913, 2, 2915, 2, 2931, 2, 2931, 2, 2949, 2, 2949, 2, 2951, 2, 2956, 2, 2960, 2, 2962, 2, 2964, 2, 2967, 2, 2971, 2, 2972, 2, 2974, 2, 2974, 2, 2976, 2, 2977, 2, 2981, 2, 2982, 2, 2986, 2, 2988, 2, 2992, 2, 3003, 2, 3026, 2, 3026, 2, 3079, 2, 3086, 2, 3088, 2, 3090, 2, 3092, 2, 3114, 2, 3116, 2, 3131, 2, 3135, 2, 3135, 2, 3162, 2, 3164, 2, 3170, 2, 3171, 2, 3202, 2, 3202, 2, 3207, 2, 3214, 2, 3216, 2, 3218, 2, 3220, 2, 3242, 2, 3244, 2, 3253, 2, 3255, 2, 3259, 2, 3263, 2, 3263, 2, 3296, 2, 3296, 2, 3298, 2, 3299, 2, 3315, 2, 3316, 2, 3335, 2, 3342, 2, 3344, 2, 3346, 2, 3348, 2, 3388, 2, 3391, 2, 3391, 2, 3408, 2, 3408, 2, 3414, 2, 3416, 2, 3425, 2, 3427, 2, 3452, 2, 3457, 2, 3463, 2, 3480, 2, 3484, 2, 3507, 2, 3509, 2, 3517, 2, 3519, 2, 3519, 2, 3522, 2, 3528, 2, 3587, 2, 3634, 2, 3636, 2, 3637, 2, 3650, 2, 3656, 2, 3715, 2, 3716, 2, 3718, 2, 3718, 2, 3721, 2, 3722, 2, 3724, 2, 3724, 2, 3727, 2, 3727, 2, 3734, 2, 3737, 2, 3739, 2, 3745, 2, 3747, 2, 3749, 2, 3751, 2, 3751, 2, 3753, 2, 3753, 2, 3756, 2, 3757, 2, 3759, 2, 3762, 2, 3764, 2, 3765, 2, 3775, 2, 3775, 2, 3778, 2, 3782, 2, 3784, 2, 3784, 2, 3806, 2, 3809, 2, 3842, 2, 3842, 2, 3906, 2, 3913, 2, 3915, 2, 3950, 2, 3978, 2, 3982, 2, 4098, 2, 4140, 2, 4161, 2, 4161, 2, 4178, 2, 4183, 2, 4188, 2, 4191, 2, 4195, 2, 4195, 2, 4199, 2, 4200, 2, 4208, 2, 4210, 2, 4215, 2, 4227, 2, 4240, 2, 4240, 2, 4258, 2, 4295, 2, 4297, 2, 4297, 2, 4303, 2, 4303, 2, 4306, 2, 4348, 2, 4350, 2, 4682, 2, 4684, 2, 4687, 2, 4690, 2, 4696, 2, 4698, 2, 4698, 2, 4700, 2, 4703, 2, 4706, 2, 4746, 2, 4748, 2, 4751, 2, 4754, 2, 4786, 2, 4788, 2, 4791, 2, 4794, 2, 4800, 2, 4802, 2, 4802, 2, 4804, 2, 4807, 2, 4810, 2, 4824, 2, 4826, 2, 4882, 2, 4884, 2, 4887, 2, 4890, 2, 4956, 2, 4994, 2, 5009, 2, 5026, 2, 5111, 2, 5114, 2, 5119, 2, 5123, 2, 5742, 2, 5745, 2, 5761, 2, 5763, 2, 5788, 2, 5794, 2, 5868, 2, 5875, 2, 5882, 2, 5890, 2, 5902, 2, 5904, 2, 5907, 2, 5922, 2, 5939, 2, 5954, 2, 5971, 2, 5986, 2, 5998, 2, 6000, 2, 6002, 2, 6018, 2, 6069, 2, 6105, 2, 6105, 2, 6110, 2, 6110, 2, 6178, 2, 6265, 2, 6274, 2, 6278, 2, 6281, 2, 6314, 2, 6316, 2, 6316, 2, 6322, 2, 6391, 2, 6402, 2, 6432, 2, 6482, 2, 6511, 2, 6514, 2, 6518, 2, 6530, 2, 6573, 2, 6578, 2, 6603, 2, 6658, 2, 6680, 2, 6690, 2, 6742, 2, 6825, 2, 6825, 2, 6919, 2, 6965, 2, 6983, 2, 6989, 2, 7045, 2, 7074, 2, 7088, 2, 7089, 2, 7100, 2, 7143, 2, 7170, 2, 7205, 2, 7247, 2, 7249, 2, 7260, 2, 7295, 2, 7298, 2, 7306, 2, 7403, 2, 7406, 2, 7408, 2, 7411, 2, 7415, 2, 7416, 2, 7426, 2, 7617, 2, 7682, 2, 7959, 2, 7962, 2, 7967, 2, 7970, 2, 8007, 2, 8010, 2, 8015, 2, 8018, 2, 8025, 2, 8027, 2, 8027, 2, 8029, 2, 8029, 2, 8031, 2, 8031, 2, 8033, 2, 8063, 2, 8066, 2, 8118, 2, 8120, 2, 8126, 2, 8128, 2, 8128, 2, 8132, 2, 8134, 2, 8136, 2, 8142, 2, 8146, 2, 8149, 2, 8152, 2, 8157, 2, 8162, 2, 8174, 2, 8180, 2, 8182, 2, 8184, 2, 8190, 2, 8307, 2, 8307, 2, 8321, 2, 8321, 2, 8338, 2, 8350, 2, 8452, 2, 8452, 2, 8457, 2, 8457, 2, 8460, 2, 8469, 2, 8471, 2, 8471, 2, 8475, 2, 8479, 2, 8486, 2, 8486, 2, 8488, 2, 8488, 2, 8490, 2, 8490, 2, 8492, 2, 8495, 2, 8497, 2, 8507, 2, 8510, 2, 8513, 2, 8519, 2, 8523, 2, 8528, 2, 8528, 2, 8581, 2, 8582, 2, 11266, 2, 11312, 2, 11314, 2, 11360, 2, 11362, 2, 11494, 2, 11501, 2, 11504, 2, 11508, 2, 11509, 2, 11522, 2, 11559, 2, 11561, 2, 11561, 2, 11567, 2, 11567, 2, 11570, 2, 11625, 2, 11633, 2, 11633, 2, 11650, 2, 11672, 2, 11682, 2, 11688, 2, 11690, 2, 11696, 2, 11698, 2, 11704, 2, 11706, 2, 11712, 2, 11714, 2, 11720, 2, 11722, 2, 11728, 2, 11730, 2, 11736, 2, 11738, 2, 11744, 2, 11825, 2, 11825, 2, 12295, 2, 12296, 2, 12339, 2, 12343, 2, 12349, 2, 12350, 2, 12355, 2, 12440, 2, 12447, 2, 12449, 2, 12451, 2, 12540, 2, 12542, 2, 12545, 2, 12551, 2, 12591, 2, 12595, 2, 12688, 2, 12706, 2, 12732, 2, 12786, 2, 12801, 2, 13314, 2, 19895, 2, 19970, 2, 40919, 2, 40962, 2, 42126, 2, 42194, 2, 42239, 2, 42242, 2, 42510, 2, 42514, 2, 42529, 2, 42540, 2, 42541, 2, 42562, 2, 42608, 2, 42625, 2, 42655, 2, 42658, 2, 42727, 2, 42777, 2, 42785, 2, 42788, 2, 42890, 2, 42893, 2, 42928, 2, 42930, 2, 42937, 2, 43001, 2, 43011, 2, 43013, 2, 43015, 2, 43017, 2, 43020, 2, 43022, 2, 43044, 2, 43074, 2, 43125, 2, 43140, 2, 43189, 2, 43252, 2, 43257, 2, 43261, 2, 43261, 2, 43263, 2, 43263, 2, 43276, 2, 43303, 2, 43314, 2, 43336, 2, 43362, 2, 43390, 2, 43398, 2, 43444, 2, 43473, 2, 43473, 2, 43490, 2, 43494, 2, 43496, 2, 43505, 2, 43516, 2, 43520, 2, 43522, 2, 43562, 2, 43586, 2, 43588, 2, 43590, 2, 43597, 2, 43618, 2, 43640, 2, 43644, 2, 43644, 2, 43648, 2, 43697, 2, 43699, 2, 43699, 2, 43703, 2, 43704, 2, 43707, 2, 43711, 2, 43714, 2, 43714, 2, 43716, 2, 43716, 2, 43741, 2, 43743, 2, 43746, 2, 43756, 2, 43764, 2, 43766, 2, 43779, 2, 43784, 2, 43787, 2, 43792, 2, 43795, 2, 43800, 2, 43810, 2, 43816, 2, 43818, 2, 43824, 2, 43826, 2, 43868, 2, 43870, 2, 43879, 2, 43890, 2, 44004, 2, 44034, 2, 55205, 2, 55218, 2, 55240, 2, 55245, 2, 55293, 2, 63746, 2, 64111, 2, 64114, 2, 64219, 2, 64258, 2, 64264, 2, 64277, 2, 64281, 2, 64287, 2, 64287, 2, 64289, 2, 64298, 2, 64300, 2, 64312, 2, 64314, 2, 64318, 2, 64320, 2, 64320, 2, 64322, 2, 64323, 2, 64325, 2, 64326, 2, 64328, 2, 64435, 2, 64469, 2, 64831, 2, 64850, 2, 64913, 2, 64916, 2, 64969, 2, 65010, 2, 65021, 2, 65138, 2, 65142, 2, 65144, 2, 65278, 2, 65315, 2, 65340, 2, 65347, 2, 65372, 2, 65384, 2, 65472, 2, 65476, 2, 65481, 2, 65484, 2, 65489, 2, 65492, 2, 65497, 2, 65500, 2, 65502, 2, 2, 3, 13, 3, 15, 3, 40, 3, 42, 3, 60, 3, 62, 3, 63, 3, 65, 3, 79, 3, 82, 3, 95, 3, 130, 3, 252, 3, 642, 3, 670, 3, 674, 3, 722, 3, 770, 3, 801, 3, 818, 3, 834, 3, 836, 3, 843, 3, 850, 3, 887, 3, 898, 3, 927, 3, 930, 3, 965, 3, 970, 3, 977, 3, 1026, 3, 1183, 3, 1202, 3, 1237, 3, 1242, 3, 1277, 3, 1282, 3, 1321, 3, 1330, 3, 1381, 3, 1538, 3, 1848, 3, 1858, 3, 1879, 3, 1890, 3, 1897, 3, 2050, 3, 2055, 3, 2058, 3, 2058, 3, 2060, 3, 2103, 3, 2105, 3, 2106, 3, 2110, 3, 2110, 3, 2113, 3, 2135, 3, 2146, 3, 2168, 3, 2178, 3, 2208, 3, 2274, 3, 2292, 3, 2294, 3, 2295, 3, 2306, 3, 2327, 3, 2338, 3, 2363, 3, 2434, 3, 2489, 3, 2496, 3, 2497, 3, 2562, 3, 2562, 3, 2578, 3, 2581, 3, 2583, 3, 2585, 3, 2587, 3, 2613, 3, 2658, 3, 2686, 3, 2690, 3, 2718, 3, 2754, 3, 2761, 3, 2763, 3, 2790, 3, 2818, 3, 2871, 3, 2882, 3, 2903, 3, 2914, 3, 2932, 3, 2946, 3, 2963, 3, 3074, 3, 3146, 3, 3202, 3, 3252, 3, 3266, 3, 3316, 3, 4101, 3, 4153, 3, 4229, 3, 4273, 3, 4306, 3, 4330, 3, 4357, 3, 4392, 3, 4434, 3, 4468, 3, 4472, 3, 4472, 3, 4485, 3, 4532, 3, 4547, 3, 4550, 3, 4572, 3, 4572, 3, 4574, 3, 4574, 3, 4610, 3, 4627, 3, 4629, 3, 4653, 3, 4738, 3, 4744, 3, 4746, 3, 4746, 3, 4748, 3, 4751, 3, 4753, 3, 4767, 3, 4769, 3, 4778, 3, 4786, 3, 4832, 3, 4871, 3, 4878, 3, 4881, 3, 4882, 3, 4885, 3, 4906, 3, 4908, 3, 4914, 3, 4916, 3, 4917, 3, 4919, 3, 4923, 3, 4927, 3, 4927, 3, 4946, 3, 4946, 3, 4959, 3, 4963, 3, 5122, 3, 5174, 3, 5193, 3, 5196, 3, 5250, 3, 5297, 3, 5318, 3, 5319, 3, 5321, 3, 5321, 3, 5506, 3, 5552, 3, 5594, 3, 5597, 3, 5634, 3, 5681, 3, 5702, 3, 5702, 3, 5762, 3, 5804, 3, 5890, 3, 5915, 3, 6306, 3, 6369, 3, 6401, 3, 6401, 3, 6850, 3, 6906, 3, 7170, 3, 7178, 3, 7180, 3, 7216, 3, 7234, 3, 7234, 3, 7284, 3, 7313, 3, 8194, 3, 9115, 3, 9346, 3, 9541, 3, 12290, 3, 13360, 3, 17410, 3, 17992, 3, 26626, 3, 27194, 3, 27202, 3, 27232, 3, 27346, 3, 27375, 3, 27394, 3, 27441, 3, 27458, 3, 27461, 3, 27493, 3, 27513, 3, 27519, 3, 27537, 3, 28418, 3, 28486, 3, 28498, 3, 28498, 3, 28565, 3, 28577, 3, 28642, 3, 28642, 3, 28674, 3, 34798, 3, 34818, 3, 35572, 3, 45058, 3, 45059, 3, 48130, 3, 48236, 3, 48242, 3, 48254, 3, 48258, 3, 48266, 3, 48274, 3, 48283, 3, 54274, 3, 54358, 3, 54360, 3, 54430, 3, 54432, 3, 54433, 3, 54436, 3, 54436, 3, 54439, 3, 54440, 3, 54443, 3, 54446, 3, 54448, 3, 54459, 3, 54461, 3, 54461, 3, 54463, 3, 54469, 3, 54471, 3, 54535, 3, 54537, 3, 54540, 3, 54543, 3, 54550, 3, 54552, 3, 54558, 3, 54560, 3, 54587, 3, 54589, 3, 54592, 3, 54594, 3, 54598, 3, 54600, 3, 54600, 3, 54604, 3, 54610, 3, 54612, 3, 54951, 3, 54954, 3, 54978, 3, 54980, 3, 55004, 3, 55006, 3, 55036, 3, 55038, 3, 55062, 3, 55064, 3, 55094, 3, 55096, 3, 55120, 3, 55122, 3, 55152, 3, 55154, 3, 55178, 3, 55180, 3, 55210, 3, 55212, 3, 55236, 3, 55238, 3, 55245, 3, 59394, 3, 59590, 3, 59650, 3, 59717, 3, 60930, 3, 60933, 3, 60935, 3, 60961, 3, 60963, 3, 60964, 3, 60966, 3, 60966, 3, 60969, 3, 60969, 3, 60971, 3, 60980, 3, 60982, 3, 60985, 3, 60987, 3, 60987, 3, 60989, 3, 60989, 3, 60996, 3, 60996, 3, 61001, 3, 61001, 3, 61003, 3, 61003, 3, 61005, 3, 61005, 3, 61007, 3, 61009, 3, 61011, 3, 61012, 3, 61014, 3, 61014, 3, 61017, 3, 61017, 3, 61019, 3, 61019, 3, 61021, 3, 61021, 3, 61023, 3, 61023, 3, 61025, 3, 61025, 3, 61027, 3, 61028, 3, 61030, 3, 61030, 3, 61033, 3, 61036, 3, 61038, 3, 61044, 3, 61046, 3, 61049, 3, 61051, 3, 61054, 3, 61056, 3, 61056, 3, 61058, 3, 61067, 3, 61069, 3, 61085, 3, 61091, 3, 61093, 3, 61095, 3, 61099, 3, 61101, 3, 61117, 3, 2, 4, 42712, 4, 42754, 4, 46902, 4, 46914, 4, 47135, 4, 47138, 4, 52899, 4, 63490, 4, 64031, 4, 912, 2, 4, 3, 2, 2, 2, 2, 6, 3, 2, 2, 2, 2, 8, 3, 2, 2, 2, 2, 10, 3, 2, 2, 2, 2, 12, 3, 2, 2, 2, 2, 14, 3, 2, 2, 2, 2, 16, 3, 2, 2, 2, 2, 18, 3, 2, 2, 2, 2, 20, 3, 2, 2, 2, 2, 22, 3, 2, 2, 2, 2, 24, 3, 2, 2, 2, 2, 26, 3, 2, 2, 2, 2, 28, 3, 2, 2, 2, 2, 30, 3, 2, 2, 2, 2, 32, 3, 2, 2, 2, 2, 34, 3, 2, 2, 2, 2, 36, 3, 2, 2, 2, 2, 38, 3, 2, 2, 2, 2, 40, 3, 2, 2, 2, 2, 42, 3, 2, 2, 2, 2, 44, 3, 2, 2, 2, 2, 46, 3, 2, 2, 2, 2, 48, 3, 2, 2, 2, 2, 50, 3, 2, 2, 2, 2, 52, 3, 2, 2, 2, 2, 54, 3, 2, 2, 2, 2, 56, 3, 2, 2, 2, 2, 58, 3, 2, 2, 2, 2, 60, 3, 2, 2, 2, 2, 62, 3, 2, 2, 2, 2, 64, 3, 2, 2, 2, 2, 66, 3, 2, 2, 2, 2, 68, 3, 2, 2, 2, 2, 70, 3, 2, 2, 2, 2, 72, 3, 2, 2, 2, 2, 74, 3, 2, 2, 2, 2, 76, 3, 2, 2, 2, 2, 78, 3, 2, 2, 2, 2, 80, 3, 2, 2, 2, 2, 82, 3, 2, 2, 2, 2, 84, 3, 2, 2, 2, 2, 86, 3, 2, 2, 2, 2, 88, 3, 2, 2, 2, 2, 90, 3, 2, 2, 2, 2, 92, 3, 2, 2, 2, 2, 94, 3, 2, 2, 2, 2, 96, 3, 2, 2, 2, 2, 98, 3, 2, 2, 2, 2, 100, 3, 2, 2, 2, 2, 102, 3, 2, 2, 2, 2, 104, 3, 2, 2, 2, 2, 106, 3, 2, 2, 2, 2, 108, 3, 2, 2, 2, 2, 110, 3, 2, 2, 2, 2, 112, 3, 2, 2, 2, 2, 114, 3, 2, 2, 2, 2, 116, 3, 2, 2, 2, 2, 118, 3, 2, 2, 2, 2, 120, 3, 2, 2, 2, 2, 122, 3, 2, 2, 2, 2, 124, 3, 2, 2, 2, 2, 126, 3, 2, 2, 2, 2, 128, 3, 2, 2, 2, 2, 130, 3, 2, 2, 2, 2, 132, 3, 2, 2, 2, 2, 134, 3, 2, 2, 2, 2, 136, 3, 2, 2, 2, 2, 138, 3, 2, 2, 2, 2, 140, 3, 2, 2, 2, 2, 142, 3, 2, 2, 2, 2, 144, 3, 2, 2, 2, 2, 150, 3, 2, 2, 2, 2, 154, 3, 2, 2, 2, 2, 156, 3, 2, 2, 2, 2, 158, 3, 2, 2, 2, 2, 160, 3, 2, 2, 2, 2, 162, 3, 2, 2, 2, 2, 164, 3, 2, 2, 2, 2, 166, 3, 2, 2, 2, 2, 168, 3, 2, 2, 2, 2, 170, 3, 2, 2, 2, 2, 172, 3, 2, 2, 2, 2, 174, 3, 2, 2, 2, 2, 176, 3, 2, 2, 2, 2, 178, 3, 2, 2, 2, 3, 200, 3, 2, 2, 2, 3, 202, 3, 2, 2, 2, 3, 204, 3, 2, 2, 2, 3, 206, 3, 2, 2, 2, 3, 208, 3, 2, 2, 2, 4, 210, 3, 2, 2, 2, 6, 218, 3, 2, 2, 2, 8, 226, 3, 2, 2, 2, 10, 231, 3, 2, 2, 2, 12, 241, 3, 2, 2, 2, 14, 248, 3, 2, 2, 2, 16, 253, 3, 2, 2, 2, 18, 259, 3, 2, 2, 2, 20, 262, 3, 2, 2, 2, 22, 266, 3, 2, 2, 2, 24, 273, 3, 2, 2, 2, 26, 278, 3, 2, 2, 2, 28, 283, 3, 2, 2, 2, 30, 288, 3, 2, 2, 2, 32, 296, 3, 2, 2, 2, 34, 303, 3, 2, 2, 2, 36, 309, 3, 2, 2, 2, 38, 323, 3, 2, 2, 2, 40, 326, 3, 2, 2, 2, 42, 332, 3, 2, 2, 2, 44, 337, 3, 2, 2, 2, 46, 348, 3, 2, 2, 2, 48, 352, 3, 2, 2, 2, 50, 359, 3, 2, 2, 2, 52, 368, 3, 2, 2, 2, 54, 372, 3, 2, 2, 2, 56, 378, 3, 2, 2, 2, 58, 388, 3, 2, 2, 2, 60, 390, 3, 2, 2, 2, 62, 394, 3, 2, 2, 2, 64, 396, 3, 2, 2, 2, 66, 400, 3, 2, 2, 2, 68, 402, 3, 2, 2, 2, 70, 406, 3, 2, 2, 2, 72, 408, 3, 2, 2, 2, 74, 410, 3, 2, 2, 2, 76, 412, 3, 2, 2, 2, 78, 414, 3, 2, 2, 2, 80, 416, 3, 2, 2, 2, 82, 421, 3, 2, 2, 2, 84, 426, 3, 2, 2, 2, 86, 429, 3, 2, 2, 2, 88, 433, 3, 2, 2, 2, 90, 436, 3, 2, 2, 2, 92, 439, 3, 2, 2, 2, 94, 442, 3, 2, 2, 2, 96, 445, 3, 2, 2, 2, 98, 447, 3, 2, 2, 2, 100, 450, 3, 2, 2, 2, 102, 452, 3, 2, 2, 2, 104, 455, 3, 2, 2, 2, 106, 457, 3, 2, 2, 2, 108, 459, 3, 2, 2, 2, 110, 461, 3, 2, 2, 2, 112, 464, 3, 2, 2, 2, 114, 467, 3, 2, 2, 2, 116, 470, 3, 2, 2, 2, 118, 472, 3, 2, 2, 2, 120, 474, 3, 2, 2, 2, 122, 476, 3, 2, 2, 2, 124, 478, 3, 2, 2, 2, 126, 480, 3, 2, 2, 2, 128, 482, 3, 2, 2, 2, 130, 484, 3, 2, 2, 2, 132, 498, 3, 2, 2, 2, 134, 502, 3, 2, 2, 2, 136, 514, 3, 2, 2, 2, 138, 528, 3, 2, 2, 2, 140, 542, 3, 2, 2, 2, 142, 562, 3, 2, 2, 2, 144, 564, 3, 2, 2, 2, 146, 600, 3, 2, 2, 2, 148, 602, 3, 2, 2, 2, 150, 613, 3, 2, 2, 2, 152, 619, 3, 2, 2, 2, 154, 626, 3, 2, 2, 2, 156, 632, 3, 2, 2, 2, 158, 634, 3, 2, 2, 2, 160, 639, 3, 2, 2, 2, 162, 644, 3, 2, 2, 2, 164, 651, 3, 2, 2, 2, 166, 662, 3, 2, 2, 2, 168, 673, 3, 2, 2, 2, 170, 686, 3, 2, 2, 2, 172, 692, 3, 2, 2, 2, 174, 707, 3, 2, 2, 2, 176, 713, 3, 2, 2, 2, 178, 738, 3, 2, 2, 2, 180, 744, 3, 2, 2, 2, 182, 746, 3, 2, 2, 2, 184, 774, 3, 2, 2, 2, 186, 784, 3, 2, 2, 2, 188, 786, 3, 2, 2, 2, 190, 788, 3, 2, 2, 2, 192, 790, 3, 2, 2, 2, 194, 798, 3, 2, 2, 2, 196, 800, 3, 2, 2, 2, 198, 802, 3, 2, 2, 2, 200, 805, 3, 2, 2, 2, 202, 811, 3, 2, 2, 2, 204, 825, 3, 2, 2, 2, 206, 854, 3, 2, 2, 2, 208, 858, 3, 2, 2, 2, 210, 211, 7, 100, 2, 2, 211, 212, 7, 116, 2, 2, 212, 213, 7, 103, 2, 2, 213, 214, 7, 99, 2, 2, 214, 215, 7, 109, 2, 2, 215, 216, 3, 2, 2, 2, 216, 217, 8, 2, 2, 2, 217, 5, 3, 2, 2, 2, 218, 219, 7, 102, 2, 2, 219, 220, 7, 103, 2, 2, 220, 221, 7, 104, 2, 2, 221, 222, 7, 99, 2, 2, 222, 223, 7, 119, 2, 2, 223, 224, 7, 110, 2, 2, 224, 225, 7, 118, 2, 2, 225, 7, 3, 2, 2, 2, 226, 227, 7, 104, 2, 2, 227, 228, 7, 119, 2, 2, 228, 229, 7, 112, 2, 2, 229, 230, 7, 101, 2, 2, 230, 9, 3, 2, 2, 2, 231, 232, 7, 107, 2, 2, 232, 233, 7, 112, 2, 2, 233, 234, 7, 118, 2, 2, 234, 235, 7, 103, 2, 2, 235, 236, 7, 116, 2, 2, 236, 237, 7, 104, 2, 2, 237, 238, 7, 99, 2, 2, 238, 239, 7, 101, 2, 2, 239, 240, 7, 103, 2, 2, 240, 11, 3, 2, 2, 2, 241, 242, 7, 117, 2, 2, 242, 243, 7, 103, 2, 2, 243, 244, 7, 110, 2, 2, 244, 245, 7, 103, 2, 2, 245, 246, 7, 101, 2, 2, 246, 247, 7, 118, 2, 2, 247, 13, 3, 2, 2, 2, 248, 249, 7, 101, 2, 2, 249, 250, 7, 99, 2, 2, 250, 251, 7, 117, 2, 2, 251, 252, 7, 103, 2, 2, 252, 15, 3, 2, 2, 2, 253, 254, 7, 102, 2, 2, 254, 255, 7, 103, 2, 2, 255, 256, 7, 104, 2, 2, 256, 257, 7, 103, 2, 2, 257, 258, 7, 116, 2, 2, 258, 17, 3, 2, 2, 2, 259, 260, 7, 105, 2, 2, 260, 261, 7, 113, 2, 2, 261, 19, 3, 2, 2, 2, 262, 263, 7, 111, 2, 2, 263, 264, 7, 99, 2, 2, 264, 265, 7, 114, 2, 2, 265, 21, 3, 2, 2, 2, 266, 267, 7, 117, 2, 2, 267, 268, 7, 118, 2, 2, 268, 269, 7, 116, 2, 2, 269, 270, 7, 119, 2, 2, 270, 271, 7, 101, 2, 2, 271, 272, 7, 118, 2, 2, 272, 23, 3, 2, 2, 2, 273, 274, 7, 101, 2, 2, 274, 275, 7, 106, 2, 2, 275, 276, 7, 99, 2, 2, 276, 277, 7, 112, 2, 2, 277, 25, 3, 2, 2, 2, 278, 279, 7, 103, 2, 2, 279, 280, 7, 110, 2, 2, 280, 281, 7, 117, 2, 2, 281, 282, 7, 103, 2, 2, 282, 27, 3, 2, 2, 2, 283, 284, 7, 105, 2, 2, 284, 285, 7, 113, 2, 2, 285, 286, 7, 118, 2, 2, 286, 287, 7, 113, 2, 2, 287, 29, 3, 2, 2, 2, 288, 289, 7, 114, 2, 2, 289, 290, 7, 99, 2, 2, 290, 291, 7, 101, 2, 2, 291, 292, 7, 109, 2, 2, 292, 293, 7, 99, 2, 2, 293, 294, 7, 105, 2, 2, 294, 295, 7, 103, 2, 2, 295, 31, 3, 2, 2, 2, 296, 297, 7, 117, 2, 2, 297, 298, 7, 121, 2, 2, 298, 299, 7, 107, 2, 2, 299, 300, 7, 118, 2, 2, 300, 301, 7, 101, 2, 2, 301, 302, 7, 106, 2, 2, 302, 33, 3, 2, 2, 2, 303, 304, 7, 101, 2, 2, 304, 305, 7, 113, 2, 2, 305, 306, 7, 112, 2, 2, 306, 307, 7, 117, 2, 2, 307, 308, 7, 118, 2, 2, 308, 35, 3, 2, 2, 2, 309, 310, 7, 104, 2, 2, 310, 311, 7, 99, 2, 2, 311, 312, 7, 110, 2, 2, 312, 313, 7, 110, 2, 2, 313, 314, 7, 118, 2, 2, 314, 315, 7, 106, 2, 2, 315, 316, 7, 116, 2, 2, 316, 317, 7, 113, 2, 2, 317, 318, 7, 119, 2, 2, 318, 319, 7, 105, 2, 2, 319, 320, 7, 106, 2, 2, 320, 321, 3, 2, 2, 2, 321, 322, 8, 18, 2, 2, 322, 37, 3, 2, 2, 2, 323, 324, 7, 107, 2, 2, 324, 325, 7, 104, 2, 2, 325, 39, 3, 2, 2, 2, 326, 327, 7, 116, 2, 2, 327, 328, 7, 99, 2, 2, 328, 329, 7, 112, 2, 2, 329, 330, 7, 105, 2, 2, 330, 331, 7, 103, 2, 2, 331, 41, 3, 2, 2, 2, 332, 333, 7, 118, 2, 2, 333, 334, 7, 123, 2, 2, 334, 335, 7, 114, 2, 2, 335, 336, 7, 103, 2, 2, 336, 43, 3, 2, 2, 2, 337, 338, 7, 101, 2, 2, 338, 339, 7, 113, 2, 2, 339, 340, 7, 112, 2, 2, 340, 341, 7, 118, 2, 2, 341, 342, 7, 107, 2, 2, 342, 343, 7, 112, 2, 2, 343, 344, 7, 119, 2, 2, 344, 345, 7, 103, 2, 2, 345, 346, 3, 2, 2, 2, 346, 347, 8, 22, 2, 2, 347, 45, 3, 2, 2, 2, 348, 349, 7, 104, 2, 2, 349, 350, 7, 113, 2, 2, 350, 351, 7, 116, 2, 2, 351, 47, 3, 2, 2, 2, 352, 353, 7, 107, 2, 2, 353, 354, 7, 111, 2, 2, 354, 355, 7, 114, 2, 2, 355, 356, 7, 113, 2, 2, 356, 357, 7, 116, 2, 2, 357, 358, 7, 118, 2, 2, 358, 49, 3, 2, 2, 2, 359, 360, 7, 116, 2, 2, 360, 361, 7, 103, 2, 2, 361, 362, 7, 118, 2, 2, 362, 363, 7, 119, 2, 2, 363, 364, 7, 116, 2, 2, 364, 365, 7, 112, 2, 2, 365, 366, 3, 2, 2, 2, 366, 367, 8, 25, 2, 2, 367, 51, 3, 2, 2, 2, 368, 369, 7, 120, 2, 2, 369, 370, 7, 99, 2, 2, 370, 371, 7, 116, 2, 2, 371, 53, 3, 2, 2, 2, 372, 373, 7, 112, 2, 2, 373, 374, 7, 107, 2, 2, 374, 375, 7, 110, 2, 2, 375, 376, 3, 2, 2, 2, 376, 377, 8, 27, 2, 2, 377, 55, 3, 2, 2, 2, 378, 383, 5, 194, 97, 2, 379, 382, 5, 194, 97, 2, 380, 382, 5, 196, 98, 2, 381, 379, 3, 2, 2, 2, 381, 380, 3, 2, 2, 2, 382, 385, 3, 2, 2, 2, 383, 381, 3, 2, 2, 2, 383, 384, 3, 2, 2, 2, 384, 386, 3, 2, 2, 2, 385, 383, 3, 2, 2, 2, 386, 387, 8, 28, 2, 2, 387, 57, 3, 2, 2, 2, 388, 389, 7, 42, 2, 2, 389, 59, 3, 2, 2, 2, 390, 391, 7, 43, 2, 2, 391, 392, 3, 2, 2, 2, 392, 393, 8, 30, 2, 2, 393, 61, 3, 2, 2, 2, 394, 395, 7, 125, 2, 2, 395, 63, 3, 2, 2, 2, 396, 397, 7, 127, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 8, 32, 2, 2, 399, 65, 3, 2, 2, 2, 400, 401, 7, 93, 2, 2, 401, 67, 3, 2, 2, 2, 402, 403, 7, 95, 2, 2, 403, 404, 3, 2, 2, 2, 404, 405, 8, 34, 2, 2, 405, 69, 3, 2, 2, 2, 406, 407, 7, 63, 2, 2, 407, 71, 3, 2, 2, 2, 408, 409, 7, 46, 2, 2, 409, 73, 3, 2, 2, 2, 410, 411, 7, 61, 2, 2, 411, 75, 3, 2, 2, 2, 412, 413, 7, 60, 2, 2, 413, 77, 3, 2, 2, 2, 414, 415, 7, 48, 2, 2, 415, 79, 3, 2, 2, 2, 416, 417, 7, 45, 2, 2, 417, 418, 7, 45, 2, 2, 418, 419, 3, 2, 2, 2, 419, 420, 8, 40, 2, 2, 420, 81, 3, 2, 2, 2, 421, 422, 7, 47, 2, 2, 422, 423, 7, 47, 2, 2, 423, 424, 3, 2, 2, 2, 424, 425, 8, 41, 2, 2, 425, 83, 3, 2, 2, 2, 426, 427, 7, 60, 2, 2, 427, 428, 7, 63, 2, 2, 428, 85, 3, 2, 2, 2, 429, 430, 7, 48, 2, 2, 430, 431, 7, 48, 2, 2, 431, 432, 7, 48, 2, 2, 432, 87, 3, 2, 2, 2, 433, 434, 7, 126, 2, 2, 434, 435, 7, 126, 2, 2, 435, 89, 3, 2, 2, 2, 436, 437, 7, 40, 2, 2, 437, 438, 7, 40, 2, 2, 438, 91, 3, 2, 2, 2, 439, 440, 7, 63, 2, 2, 440, 441, 7, 63, 2, 2, 441, 93, 3, 2, 2, 2, 442, 443, 7, 35, 2, 2, 443, 444, 7, 63, 2, 2, 444, 95, 3, 2, 2, 2, 445, 446, 7, 62, 2, 2, 446, 97, 3, 2, 2, 2, 447, 448, 7, 62, 2, 2, 448, 449, 7, 63, 2, 2, 449, 99, 3, 2, 2, 2, 450, 451, 7, 64, 2, 2, 451, 101, 3, 2, 2, 2, 452, 453, 7, 64, 2, 2, 453, 454, 7, 63, 2, 2, 454, 103, 3, 2, 2, 2, 455, 456, 7, 126, 2, 2, 456, 105, 3, 2, 2, 2, 457, 458, 7, 49, 2, 2, 458, 107, 3, 2, 2, 2, 459, 460, 7, 39, 2, 2, 460, 109, 3, 2, 2, 2, 461, 462, 7, 62, 2, 2, 462, 463, 7, 62, 2, 2, 463, 111, 3, 2, 2, 2, 464, 465, 7, 64, 2, 2, 465, 466, 7, 64, 2, 2, 466, 113, 3, 2, 2, 2, 467, 468, 7, 40, 2, 2, 468, 469, 7, 96, 2, 2, 469, 115, 3, 2, 2, 2, 470, 471, 7, 128, 2, 2, 471, 117, 3, 2, 2, 2, 472, 473, 7, 35, 2, 2, 473, 119, 3, 2, 2, 2, 474, 475, 7, 45, 2, 2, 475, 121, 3, 2, 2, 2, 476, 477, 7, 47, 2, 2, 477, 123, 3, 2, 2, 2, 478, 479, 7, 96, 2, 2, 479, 125, 3, 2, 2, 2, 480, 481, 7, 44, 2, 2, 481, 127, 3, 2, 2, 2, 482, 483, 7, 40, 2, 2, 483, 129, 3, 2, 2, 2, 484, 485, 7, 62, 2, 2, 485, 486, 7, 47, 2, 2, 486, 131, 3, 2, 2, 2, 487, 499, 7, 50, 2, 2, 488, 495, 9, 2, 2, 2, 489, 491, 7, 97, 2, 2, 490, 489, 3, 2, 2, 2, 490, 491, 3, 2, 2, 2, 491, 492, 3, 2, 2, 2, 492, 494, 9, 3, 2, 2, 493, 490, 3, 2, 2, 2, 494, 497, 3, 2, 2, 2, 495, 493, 3, 2, 2, 2, 495, 496, 3, 2, 2, 2, 496, 499, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 498, 487, 3, 2, 2, 2, 498, 488, 3, 2, 2, 2, 499, 500, 3, 2, 2, 2, 500, 501, 8, 66, 2, 2, 501, 133, 3, 2, 2, 2, 502, 503, 7, 50, 2, 2, 503, 508, 9, 4, 2, 2, 504, 506, 7, 97, 2, 2, 505, 504, 3, 2, 2, 2, 505, 506, 3, 2, 2, 2, 506, 507, 3, 2, 2, 2, 507, 509, 5, 190, 95, 2, 508, 505, 3, 2, 2, 2, 509, 510, 3, 2, 2, 2, 510, 508, 3, 2, 2, 2, 510, 511, 3, 2, 2, 2, 511, 512, 3, 2, 2, 2, 512, 513, 8, 67, 2, 2, 513, 135, 3, 2, 2, 2, 514, 516, 7, 50, 2, 2, 515, 517, 9, 5, 2, 2, 516, 515, 3, 2, 2, 2, 516, 517, 3, 2, 2, 2, 517, 522, 3, 2, 2, 2, 518, 520, 7, 97, 2, 2, 519, 518, 3, 2, 2, 2, 519, 520, 3, 2, 2, 2, 520, 521, 3, 2, 2, 2, 521, 523, 5, 186, 93, 2, 522, 519, 3, 2, 2, 2, 523, 524, 3, 2, 2, 2, 524, 522, 3, 2, 2, 2, 524, 525, 3, 2, 2, 2, 525, 526, 3, 2, 2, 2, 526, 527, 8, 68, 2, 2, 527, 137, 3, 2, 2, 2, 528, 529, 7, 50, 2, 2, 529, 534, 9, 6, 2, 2, 530, 532, 7, 97, 2, 2, 531, 530, 3, 2, 2, 2, 531, 532, 3, 2, 2, 2, 532, 533, 3, 2, 2, 2, 533, 535, 5, 188, 94, 2, 534, 531, 3, 2, 2, 2, 535, 536, 3, 2, 2, 2, 536, 534, 3, 2, 2, 2, 536, 537, 3, 2, 2, 2, 537, 538, 3, 2, 2, 2, 538, 539, 8, 69, 2, 2, 539, 139, 3, 2, 2, 2, 540, 543, 5, 142, 71, 2, 541, 543, 5, 144, 72, 2, 542, 540, 3, 2, 2, 2, 542, 541, 3, 2, 2, 2, 543, 544, 3, 2, 2, 2, 544, 545, 8, 70, 2, 2, 545, 141, 3, 2, 2, 2, 546, 555, 5, 184, 92, 2, 547, 549, 7, 48, 2, 2, 548, 550, 5, 184, 92, 2, 549, 548, 3, 2, 2, 2, 549, 550, 3, 2, 2, 2, 550, 552, 3, 2, 2, 2, 551, 553, 5, 192, 96, 2, 552, 551, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 556, 3, 2, 2, 2, 554, 556, 5, 192, 96, 2, 555, 547, 3, 2, 2, 2, 555, 554, 3, 2, 2, 2, 556, 563, 3, 2, 2, 2, 557, 558, 7, 48, 2, 2, 558, 560, 5, 184, 92, 2, 559, 561, 5, 192, 96, 2, 560, 559, 3, 2, 2, 2, 560, 561, 3, 2, 2, 2, 561, 563, 3, 2, 2, 2, 562, 546, 3, 2, 2, 2, 562, 557, 3, 2, 2, 2, 563, 143, 3, 2, 2, 2, 564, 565, 7, 50, 2, 2, 565, 566, 9, 6, 2, 2, 566, 567, 5, 146, 73, 2, 567, 568, 5, 148, 74, 2, 568, 145, 3, 2, 2, 2, 569, 571, 7, 97, 2, 2, 570, 569, 3, 2, 2, 2, 570, 571, 3, 2, 2, 2, 571, 572, 3, 2, 2, 2, 572, 574, 5, 188, 94, 2, 573, 570, 3, 2, 2, 2, 574, 575, 3, 2, 2, 2, 575, 573, 3, 2, 2, 2, 575, 576, 3, 2, 2, 2, 576, 587, 3, 2, 2, 2, 577, 584, 7, 48, 2, 2, 578, 580, 7, 97, 2, 2, 579, 578, 3, 2, 2, 2, 579, 580, 3, 2, 2, 2, 580, 581, 3, 2, 2, 2, 581, 583, 5, 188, 94, 2, 582, 579, 3, 2, 2, 2, 583, 586, 3, 2, 2, 2, 584, 582, 3, 2, 2, 2, 584, 585, 3, 2, 2, 2, 585, 588, 3, 2, 2, 2, 586, 584, 3, 2, 2, 2, 587, 577, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 601, 3, 2, 2, 2, 589, 590, 7, 48, 2, 2, 590, 597, 5, 188, 94, 2, 591, 593, 7, 97, 2, 2, 592, 591, 3, 2, 2, 2, 592, 593, 3, 2, 2, 2, 593, 594, 3, 2, 2, 2, 594, 596, 5, 188, 94, 2, 595, 592, 3, 2, 2, 2, 596, 599, 3, 2, 2, 2, 597, 595, 3, 2, 2, 2, 597, 598, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 600, 573, 3, 2, 2, 2, 600, 589, 3, 2, 2, 2, 601, 147, 3, 2, 2, 2, 602, 604, 9, 7, 2, 2, 603, 605, 9, 8, 2, 2, 604, 603, 3, 2, 2, 2, 604, 605, 3, 2, 2, 2, 605, 606, 3, 2, 2, 2, 606, 607, 5, 184, 92, 2, 607, 149, 3, 2, 2, 2, 608, 614, 5, 132, 66, 2, 609, 614, 5, 134, 67, 2, 610, 614, 5, 136, 68, 2, 611, 614, 5, 138, 69, 2, 612, 614, 5, 140, 70, 2, 613, 608, 3, 2, 2, 2, 613, 609, 3, 2, 2, 2, 613, 610, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 613, 612, 3, 2, 2, 2, 614, 615, 3, 2, 2, 2, 615, 616, 7, 107, 2, 2, 616, 617, 3, 2, 2, 2, 617, 618, 8, 75, 2, 2, 618, 151, 3, 2, 2, 2, 619, 622, 7, 41, 2, 2, 620, 623, 5, 180, 90, 2, 621, 623, 5, 156, 78, 2, 622, 620, 3, 2, 2, 2, 622, 621, 3, 2, 2, 2, 623, 624, 3, 2, 2, 2, 624, 625, 7, 41, 2, 2, 625, 153, 3, 2, 2, 2, 626, 627, 5, 152, 76, 2, 627, 628, 3, 2, 2, 2, 628, 629, 8, 77, 2, 2, 629, 155, 3, 2, 2, 2, 630, 633, 5, 158, 79, 2, 631, 633, 5, 160, 80, 2, 632, 630, 3, 2, 2, 2, 632, 631, 3, 2, 2, 2, 633, 157, 3, 2, 2, 2, 634, 635, 7, 94, 2, 2, 635, 636, 5, 186, 93, 2, 636, 637, 5, 186, 93, 2, 637, 638, 5, 186, 93, 2, 638, 159, 3, 2, 2, 2, 639, 640, 7, 94, 2, 2, 640, 641, 7, 122, 2, 2, 641, 642, 5, 188, 94, 2, 642, 643, 5, 188, 94, 2, 643, 161, 3, 2, 2, 2, 644, 645, 7, 94, 2, 2, 645, 646, 7, 119, 2, 2, 646, 647, 5, 188, 94, 2, 647, 648, 5, 188, 94, 2, 648, 649, 5, 188, 94, 2, 649, 650, 5, 188, 94, 2, 650, 163, 3, 2, 2, 2, 651, 652, 7, 94, 2, 2, 652, 653, 7, 87, 2, 2, 653, 654, 5, 188, 94, 2, 654, 655, 5, 188, 94, 2, 655, 656, 5, 188, 94, 2, 656, 657, 5, 188, 94, 2, 657, 658, 5, 188, 94, 2, 658, 659, 5, 188, 94, 2, 659, 660, 5, 188, 94, 2, 660, 661, 5, 188, 94, 2, 661, 165, 3, 2, 2, 2, 662, 666, 7, 98, 2, 2, 663, 665, 10, 9, 2, 2, 664, 663, 3, 2, 2, 2, 665, 668, 3, 2, 2, 2, 666, 664, 3, 2, 2, 2, 666, 667, 3, 2, 2, 2, 667, 669, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 669, 670, 7, 98, 2, 2, 670, 671, 3, 2, 2, 2, 671, 672, 8, 83, 2, 2, 672, 167, 3, 2, 2, 2, 673, 678, 7, 36, 2, 2, 674, 677, 10, 10, 2, 2, 675, 677, 5, 182, 91, 2, 676, 674, 3, 2, 2, 2, 676, 675, 3, 2, 2, 2, 677, 680, 3, 2, 2, 2, 678, 676, 3, 2, 2, 2, 678, 679, 3, 2, 2, 2, 679, 681, 3, 2, 2, 2, 680, 678, 3, 2, 2, 2, 681, 682, 7, 36, 2, 2, 682, 683, 3, 2, 2, 2, 683, 684, 8, 84, 2, 2, 684, 169, 3, 2, 2, 2, 685, 687, 9, 11, 2, 2, 686, 685, 3, 2, 2, 2, 687, 688, 3, 2, 2, 2, 688, 686, 3, 2, 2, 2, 688, 689, 3, 2, 2, 2, 689, 690, 3, 2, 2, 2, 690, 691, 8, 85, 3, 2, 691, 171, 3, 2, 2, 2, 692, 693, 7, 49, 2, 2, 693, 694, 7, 44, 2, 2, 694, 698, 3, 2, 2, 2, 695, 697, 11, 2, 2, 2, 696, 695, 3, 2, 2, 2, 697, 700, 3, 2, 2, 2, 698, 699, 3, 2, 2, 2, 698, 696, 3, 2, 2, 2, 699, 701, 3, 2, 2, 2, 700, 698, 3, 2, 2, 2, 701, 702, 7, 44, 2, 2, 702, 703, 7, 49, 2, 2, 703, 704, 3, 2, 2, 2, 704, 705, 8, 86, 3, 2, 705, 173, 3, 2, 2, 2, 706, 708, 9, 12, 2, 2, 707, 706, 3, 2, 2, 2, 708, 709, 3, 2, 2, 2, 709, 707, 3, 2, 2, 2, 709, 710, 3, 2, 2, 2, 710, 711, 3, 2, 2, 2, 711, 712, 8, 87, 3, 2, 712, 175, 3, 2, 2, 2, 713, 714, 7, 49, 2, 2, 714, 715, 7, 49, 2, 2, 715, 719, 3, 2, 2, 2, 716, 718, 10, 12, 2, 2, 717, 716, 3, 2, 2, 2, 718, 721, 3, 2, 2, 2, 719, 717, 3, 2, 2, 2, 719, 720, 3, 2, 2, 2, 720, 722, 3, 2, 2, 2, 721, 719, 3, 2, 2, 2, 722, 723, 8, 88, 3, 2, 723, 177, 3, 2, 2, 2, 724, 726, 7, 15, 2, 2, 725, 724, 3, 2, 2, 2, 725, 726, 3, 2, 2, 2, 726, 727, 3, 2, 2, 2, 727, 739, 7, 12, 2, 2, 728, 730, 7, 15, 2, 2, 729, 728, 3, 2, 2, 2, 730, 731, 3, 2, 2, 2, 731, 729, 3, 2, 2, 2, 731, 732, 3, 2, 2, 2, 732, 739, 3, 2, 2, 2, 733, 735, 7, 12, 2, 2, 734, 733, 3, 2, 2, 2, 735, 736, 3, 2, 2, 2, 736, 734, 3, 2, 2, 2, 736, 737, 3, 2, 2, 2, 737, 739, 3, 2, 2, 2, 738, 725, 3, 2, 2, 2, 738, 729, 3, 2, 2, 2, 738, 734, 3, 2, 2, 2, 739, 179, 3, 2, 2, 2, 740, 745, 10, 13, 2, 2, 741, 745, 5, 162, 81, 2, 742, 745, 5, 164, 82, 2, 743, 745, 5, 182, 91, 2, 744, 740, 3, 2, 2, 2, 744, 741, 3, 2, 2, 2, 744, 742, 3, 2, 2, 2, 744, 743, 3, 2, 2, 2, 745, 181, 3, 2, 2, 2, 746, 772, 7, 94, 2, 2, 747, 748, 7, 119, 2, 2, 748, 749, 5, 188, 94, 2, 749, 750, 5, 188, 94, 2, 750, 751, 5, 188, 94, 2, 751, 752, 5, 188, 94, 2, 752, 773, 3, 2, 2, 2, 753, 754, 7, 87, 2, 2, 754, 755, 5, 188, 94, 2, 755, 756, 5, 188, 94, 2, 756, 757, 5, 188, 94, 2, 757, 758, 5, 188, 94, 2, 758, 759, 5, 188, 94, 2, 759, 760, 5, 188, 94, 2, 760, 761, 5, 188, 94, 2, 761, 762, 5, 188, 94, 2, 762, 773, 3, 2, 2, 2, 763, 773, 9, 14, 2, 2, 764, 765, 5, 186, 93, 2, 765, 766, 5, 186, 93, 2, 766, 767, 5, 186, 93, 2, 767, 773, 3, 2, 2, 2, 768, 769, 7, 122, 2, 2, 769, 770, 5, 188, 94, 2, 770, 771, 5, 188, 94, 2, 771, 773, 3, 2, 2, 2, 772, 747, 3, 2, 2, 2, 772, 753, 3, 2, 2, 2, 772, 763, 3, 2, 2, 2, 772, 764, 3, 2, 2, 2, 772, 768, 3, 2, 2, 2, 773, 183, 3, 2, 2, 2, 774, 781, 9, 3, 2, 2, 775, 777, 7, 97, 2, 2, 776, 775, 3, 2, 2, 2, 776, 777, 3, 2, 2, 2, 777, 778, 3, 2, 2, 2, 778, 780, 9, 3, 2, 2, 779, 776, 3, 2, 2, 2, 780, 783, 3, 2, 2, 2, 781, 779, 3, 2, 2, 2, 781, 782, 3, 2, 2, 2, 782, 185, 3, 2, 2, 2, 783, 781, 3, 2, 2, 2, 784, 785, 9, 15, 2, 2, 785, 187, 3, 2, 2, 2, 786, 787, 9, 16, 2, 2, 787, 189, 3, 2, 2, 2, 788, 789, 9, 17, 2, 2, 789, 191, 3, 2, 2, 2, 790, 792, 9, 18, 2, 2, 791, 793, 9, 8, 2, 2, 792, 791, 3, 2, 2, 2, 792, 793, 3, 2, 2, 2, 793, 794, 3, 2, 2, 2, 794, 795, 5, 184, 92, 2, 795, 193, 3, 2, 2, 2, 796, 799, 5, 198, 99, 2, 797, 799, 7, 97, 2, 2, 798, 796, 3, 2, 2, 2, 798, 797, 3, 2, 2, 2, 799, 195, 3, 2, 2, 2, 800, 801, 9, 19, 2, 2, 801, 197, 3, 2, 2, 2, 802, 803, 9, 20, 2, 2, 803, 199, 3, 2, 2, 2, 804, 806, 9, 11, 2, 2, 805, 804, 3, 2, 2, 2, 806, 807, 3, 2, 2, 2, 807, 805, 3, 2, 2, 2, 807, 808, 3, 2, 2, 2, 808, 809, 3, 2, 2, 2, 809, 810, 8, 100, 3, 2, 810, 201, 3, 2, 2, 2, 811, 812, 7, 49, 2, 2, 812, 813, 7, 44, 2, 2, 813, 817, 3, 2, 2, 2, 814, 816, 10, 12, 2, 2, 815, 814, 3, 2, 2, 2, 816, 819, 3, 2, 2, 2, 817, 818, 3, 2, 2, 2, 817, 815, 3, 2, 2, 2, 818, 820, 3, 2, 2, 2, 819, 817, 3, 2, 2, 2, 820, 821, 7, 44, 2, 2, 821, 822, 7, 49, 2, 2, 822, 823, 3, 2, 2, 2, 823, 824, 8, 101, 3, 2, 824, 203, 3, 2, 2, 2, 825, 826, 7, 49, 2, 2, 826, 827, 7, 49, 2, 2, 827, 831, 3, 2, 2, 2, 828, 830, 10, 12, 2, 2, 829, 828, 3, 2, 2, 2, 830, 833, 3, 2, 2, 2, 831, 829, 3, 2, 2, 2, 831, 832, 3, 2, 2, 2, 832, 834, 3, 2, 2, 2, 833, 831, 3, 2, 2, 2, 834, 835, 8, 102, 3, 2, 835, 205, 3, 2, 2, 2, 836, 838, 9, 12, 2, 2, 837, 836, 3, 2, 2, 2, 838, 839, 3, 2, 2, 2, 839, 837, 3, 2, 2, 2, 839, 840, 3, 2, 2, 2, 840, 855, 3, 2, 2, 2, 841, 855, 7, 61, 2, 2, 842, 843, 7, 49, 2, 2, 843, 844, 7, 44, 2, 2, 844, 848, 3, 2, 2, 2, 845, 847, 11, 2, 2, 2, 846, 845, 3, 2, 2, 2, 847, 850, 3, 2, 2, 2, 848, 849, 3, 2, 2, 2, 848, 846, 3, 2, 2, 2, 849, 851, 3, 2, 2, 2, 850, 848, 3, 2, 2, 2, 851, 852, 7, 44, 2, 2, 852, 855, 7, 49, 2, 2, 853, 855, 7, 2, 2, 3, 854, 837, 3, 2, 2, 2, 854, 841, 3, 2, 2, 2, 854, 842, 3, 2, 2, 2, 854, 853, 3, 2, 2, 2, 855, 856, 3, 2, 2, 2, 856, 857, 8, 103, 4, 2, 857, 207, 3, 2, 2, 2, 858, 859, 3, 2, 2, 2, 859, 860, 3, 2, 2, 2, 860, 861, 8, 104, 4, 2, 861, 862, 8, 104, 3, 2, 862, 209, 3, 2, 2, 2, 57, 2, 3, 381, 383, 490, 495, 498, 505, 510, 516, 519, 524, 531, 536, 542, 549, 552, 555, 560, 562, 570, 575, 579, 584, 587, 592, 597, 600, 604, 613, 622, 632, 666, 676, 678, 688, 698, 709, 719, 725, 731, 736, 738, 744, 772, 776, 781, 792, 798, 807, 817, 831, 839, 848, 854, 5, 4, 3, 2, 2, 3, 2, 4, 2, 2] \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.java new file mode 100644 index 000000000..2e7528d4e --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.java @@ -0,0 +1,603 @@ +package run.mone.antlr.golang;// Generated from GoLexer.g4 by ANTLR 4.7.1 + +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class GoLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + BREAK=1, DEFAULT=2, FUNC=3, INTERFACE=4, SELECT=5, CASE=6, DEFER=7, GO=8, + MAP=9, STRUCT=10, CHAN=11, ELSE=12, GOTO=13, PACKAGE=14, SWITCH=15, CONST=16, + FALLTHROUGH=17, IF=18, RANGE=19, TYPE=20, CONTINUE=21, FOR=22, IMPORT=23, + RETURN=24, VAR=25, NIL_LIT=26, IDENTIFIER=27, L_PAREN=28, R_PAREN=29, + L_CURLY=30, R_CURLY=31, L_BRACKET=32, R_BRACKET=33, ASSIGN=34, COMMA=35, + SEMI=36, COLON=37, DOT=38, PLUS_PLUS=39, MINUS_MINUS=40, DECLARE_ASSIGN=41, + ELLIPSIS=42, LOGICAL_OR=43, LOGICAL_AND=44, EQUALS=45, NOT_EQUALS=46, + LESS=47, LESS_OR_EQUALS=48, GREATER=49, GREATER_OR_EQUALS=50, OR=51, DIV=52, + MOD=53, LSHIFT=54, RSHIFT=55, BIT_CLEAR=56, UNDERLYING=57, EXCLAMATION=58, + PLUS=59, MINUS=60, CARET=61, STAR=62, AMPERSAND=63, RECEIVE=64, DECIMAL_LIT=65, + BINARY_LIT=66, OCTAL_LIT=67, HEX_LIT=68, FLOAT_LIT=69, DECIMAL_FLOAT_LIT=70, + HEX_FLOAT_LIT=71, IMAGINARY_LIT=72, RUNE_LIT=73, BYTE_VALUE=74, OCTAL_BYTE_VALUE=75, + HEX_BYTE_VALUE=76, LITTLE_U_VALUE=77, BIG_U_VALUE=78, RAW_STRING_LIT=79, + INTERPRETED_STRING_LIT=80, WS=81, COMMENT=82, TERMINATOR=83, LINE_COMMENT=84, + NEWLINE=85, WS_NLSEMI=86, COMMENT_NLSEMI=87, LINE_COMMENT_NLSEMI=88, EOS=89, + OTHER=90; + public static final int + NLSEMI=1; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE", "NLSEMI" + }; + + public static final String[] ruleNames = { + "BREAK", "DEFAULT", "FUNC", "INTERFACE", "SELECT", "CASE", "DEFER", "GO", + "MAP", "STRUCT", "CHAN", "ELSE", "GOTO", "PACKAGE", "SWITCH", "CONST", + "FALLTHROUGH", "IF", "RANGE", "TYPE", "CONTINUE", "FOR", "IMPORT", "RETURN", + "VAR", "NIL_LIT", "IDENTIFIER", "L_PAREN", "R_PAREN", "L_CURLY", "R_CURLY", + "L_BRACKET", "R_BRACKET", "ASSIGN", "COMMA", "SEMI", "COLON", "DOT", "PLUS_PLUS", + "MINUS_MINUS", "DECLARE_ASSIGN", "ELLIPSIS", "LOGICAL_OR", "LOGICAL_AND", + "EQUALS", "NOT_EQUALS", "LESS", "LESS_OR_EQUALS", "GREATER", "GREATER_OR_EQUALS", + "OR", "DIV", "MOD", "LSHIFT", "RSHIFT", "BIT_CLEAR", "UNDERLYING", "EXCLAMATION", + "PLUS", "MINUS", "CARET", "STAR", "AMPERSAND", "RECEIVE", "DECIMAL_LIT", + "BINARY_LIT", "OCTAL_LIT", "HEX_LIT", "FLOAT_LIT", "DECIMAL_FLOAT_LIT", + "HEX_FLOAT_LIT", "HEX_MANTISSA", "HEX_EXPONENT", "IMAGINARY_LIT", "RUNE", + "RUNE_LIT", "BYTE_VALUE", "OCTAL_BYTE_VALUE", "HEX_BYTE_VALUE", "LITTLE_U_VALUE", + "BIG_U_VALUE", "RAW_STRING_LIT", "INTERPRETED_STRING_LIT", "WS", "COMMENT", + "TERMINATOR", "LINE_COMMENT", "NEWLINE", "UNICODE_VALUE", "ESCAPED_VALUE", + "DECIMALS", "OCTAL_DIGIT", "HEX_DIGIT", "BIN_DIGIT", "EXPONENT", "LETTER", + "UNICODE_DIGIT", "UNICODE_LETTER", "WS_NLSEMI", "COMMENT_NLSEMI", "LINE_COMMENT_NLSEMI", + "EOS", "OTHER" + }; + + private static final String[] _LITERAL_NAMES = { + null, "'break'", "'default'", "'func'", "'interface'", "'select'", "'case'", + "'defer'", "'go'", "'map'", "'struct'", "'chan'", "'else'", "'goto'", + "'package'", "'switch'", "'const'", "'fallthrough'", "'if'", "'range'", + "'type'", "'continue'", "'for'", "'import'", "'return'", "'var'", "'nil'", + null, "'('", "')'", "'{'", "'}'", "'['", "']'", "'='", "','", "';'", "':'", + "'.'", "'++'", "'--'", "':='", "'...'", "'||'", "'&&'", "'=='", "'!='", + "'<'", "'<='", "'>'", "'>='", "'|'", "'/'", "'%'", "'<<'", "'>>'", "'&^'", + "'~'", "'!'", "'+'", "'-'", "'^'", "'*'", "'&'", "'<-'" + }; + private static final String[] _SYMBOLIC_NAMES = { + null, "BREAK", "DEFAULT", "FUNC", "INTERFACE", "SELECT", "CASE", "DEFER", + "GO", "MAP", "STRUCT", "CHAN", "ELSE", "GOTO", "PACKAGE", "SWITCH", "CONST", + "FALLTHROUGH", "IF", "RANGE", "TYPE", "CONTINUE", "FOR", "IMPORT", "RETURN", + "VAR", "NIL_LIT", "IDENTIFIER", "L_PAREN", "R_PAREN", "L_CURLY", "R_CURLY", + "L_BRACKET", "R_BRACKET", "ASSIGN", "COMMA", "SEMI", "COLON", "DOT", "PLUS_PLUS", + "MINUS_MINUS", "DECLARE_ASSIGN", "ELLIPSIS", "LOGICAL_OR", "LOGICAL_AND", + "EQUALS", "NOT_EQUALS", "LESS", "LESS_OR_EQUALS", "GREATER", "GREATER_OR_EQUALS", + "OR", "DIV", "MOD", "LSHIFT", "RSHIFT", "BIT_CLEAR", "UNDERLYING", "EXCLAMATION", + "PLUS", "MINUS", "CARET", "STAR", "AMPERSAND", "RECEIVE", "DECIMAL_LIT", + "BINARY_LIT", "OCTAL_LIT", "HEX_LIT", "FLOAT_LIT", "DECIMAL_FLOAT_LIT", + "HEX_FLOAT_LIT", "IMAGINARY_LIT", "RUNE_LIT", "BYTE_VALUE", "OCTAL_BYTE_VALUE", + "HEX_BYTE_VALUE", "LITTLE_U_VALUE", "BIG_U_VALUE", "RAW_STRING_LIT", "INTERPRETED_STRING_LIT", + "WS", "COMMENT", "TERMINATOR", "LINE_COMMENT", "NEWLINE", "WS_NLSEMI", + "COMMENT_NLSEMI", "LINE_COMMENT_NLSEMI", "EOS", "OTHER" + }; + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public GoLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "GoLexer.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getChannelNames() { return channelNames; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\\\u035f\b\1\b\1\4"+ + "\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n"+ + "\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ + "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ + "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ + " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+ + "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ + "\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t"+ + "=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4"+ + "I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\t"+ + "T\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_"+ + "\4`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\3\2\3\2\3\2\3\2"+ + "\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3"+ + "\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7"+ + "\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3"+ + "\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r"+ + "\3\r\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+ + "\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\22"+ + "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23"+ + "\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\26"+ + "\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27"+ + "\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31"+ + "\3\31\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34"+ + "\3\34\7\34\u017e\n\34\f\34\16\34\u0181\13\34\3\34\3\34\3\35\3\35\3\36"+ + "\3\36\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3!\3!\3\"\3\"\3\"\3\"\3#\3#\3$\3"+ + "$\3%\3%\3&\3&\3\'\3\'\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3*\3*\3*\3+\3+\3+"+ + "\3+\3,\3,\3,\3-\3-\3-\3.\3.\3.\3/\3/\3/\3\60\3\60\3\61\3\61\3\61\3\62"+ + "\3\62\3\63\3\63\3\63\3\64\3\64\3\65\3\65\3\66\3\66\3\67\3\67\3\67\38\3"+ + "8\38\39\39\39\3:\3:\3;\3;\3<\3<\3=\3=\3>\3>\3?\3?\3@\3@\3A\3A\3A\3B\3"+ + "B\3B\5B\u01eb\nB\3B\7B\u01ee\nB\fB\16B\u01f1\13B\5B\u01f3\nB\3B\3B\3C"+ + "\3C\3C\5C\u01fa\nC\3C\6C\u01fd\nC\rC\16C\u01fe\3C\3C\3D\3D\5D\u0205\n"+ + "D\3D\5D\u0208\nD\3D\6D\u020b\nD\rD\16D\u020c\3D\3D\3E\3E\3E\5E\u0214\n"+ + "E\3E\6E\u0217\nE\rE\16E\u0218\3E\3E\3F\3F\5F\u021f\nF\3F\3F\3G\3G\3G\5"+ + "G\u0226\nG\3G\5G\u0229\nG\3G\5G\u022c\nG\3G\3G\3G\5G\u0231\nG\5G\u0233"+ + "\nG\3H\3H\3H\3H\3H\3I\5I\u023b\nI\3I\6I\u023e\nI\rI\16I\u023f\3I\3I\5"+ + "I\u0244\nI\3I\7I\u0247\nI\fI\16I\u024a\13I\5I\u024c\nI\3I\3I\3I\5I\u0251"+ + "\nI\3I\7I\u0254\nI\fI\16I\u0257\13I\5I\u0259\nI\3J\3J\5J\u025d\nJ\3J\3"+ + "J\3K\3K\3K\3K\3K\5K\u0266\nK\3K\3K\3K\3K\3L\3L\3L\5L\u026f\nL\3L\3L\3"+ + "M\3M\3M\3M\3N\3N\5N\u0279\nN\3O\3O\3O\3O\3O\3P\3P\3P\3P\3P\3Q\3Q\3Q\3"+ + "Q\3Q\3Q\3Q\3R\3R\3R\3R\3R\3R\3R\3R\3R\3R\3R\3S\3S\7S\u0299\nS\fS\16S\u029c"+ + "\13S\3S\3S\3S\3S\3T\3T\3T\7T\u02a5\nT\fT\16T\u02a8\13T\3T\3T\3T\3T\3U"+ + "\6U\u02af\nU\rU\16U\u02b0\3U\3U\3V\3V\3V\3V\7V\u02b9\nV\fV\16V\u02bc\13"+ + "V\3V\3V\3V\3V\3V\3W\6W\u02c4\nW\rW\16W\u02c5\3W\3W\3X\3X\3X\3X\7X\u02ce"+ + "\nX\fX\16X\u02d1\13X\3X\3X\3Y\5Y\u02d6\nY\3Y\3Y\6Y\u02da\nY\rY\16Y\u02db"+ + "\3Y\6Y\u02df\nY\rY\16Y\u02e0\5Y\u02e3\nY\3Z\3Z\3Z\3Z\5Z\u02e9\nZ\3[\3"+ + "[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3[\3"+ + "[\3[\5[\u0305\n[\3\\\3\\\5\\\u0309\n\\\3\\\7\\\u030c\n\\\f\\\16\\\u030f"+ + "\13\\\3]\3]\3^\3^\3_\3_\3`\3`\5`\u0319\n`\3`\3`\3a\3a\5a\u031f\na\3b\3"+ + "b\3c\3c\3d\6d\u0326\nd\rd\16d\u0327\3d\3d\3e\3e\3e\3e\7e\u0330\ne\fe\16"+ + "e\u0333\13e\3e\3e\3e\3e\3e\3f\3f\3f\3f\7f\u033e\nf\ff\16f\u0341\13f\3"+ + "f\3f\3g\6g\u0346\ng\rg\16g\u0347\3g\3g\3g\3g\3g\7g\u034f\ng\fg\16g\u0352"+ + "\13g\3g\3g\3g\5g\u0357\ng\3g\3g\3h\3h\3h\3h\3h\5\u02ba\u0331\u0350\2i"+ + "\4\3\6\4\b\5\n\6\f\7\16\b\20\t\22\n\24\13\26\f\30\r\32\16\34\17\36\20"+ + " \21\"\22$\23&\24(\25*\26,\27.\30\60\31\62\32\64\33\66\348\35:\36<\37"+ + "> @!B\"D#F$H%J&L\'N(P)R*T+V,X-Z.\\/^\60`\61b\62d\63f\64h\65j\66l\67n8"+ + "p9r:t;v|?~@\u0080A\u0082B\u0084C\u0086D\u0088E\u008aF\u008cG\u008e"+ + "H\u0090I\u0092\2\u0094\2\u0096J\u0098\2\u009aK\u009cL\u009eM\u00a0N\u00a2"+ + "O\u00a4P\u00a6Q\u00a8R\u00aaS\u00acT\u00aeU\u00b0V\u00b2W\u00b4\2\u00b6"+ + "\2\u00b8\2\u00ba\2\u00bc\2\u00be\2\u00c0\2\u00c2\2\u00c4\2\u00c6\2\u00c8"+ + "X\u00caY\u00ccZ\u00ce[\u00d0\\\4\2\3\23\3\2\63;\3\2\62;\4\2DDdd\4\2QQ"+ + "qq\4\2ZZzz\4\2RRrr\4\2--//\3\2bb\4\2$$^^\4\2\13\13\"\"\4\2\f\f\17\17\5"+ + "\2\f\f\17\17))\13\2$$))^^cdhhppttvvxx\3\2\629\5\2\62;CHch\3\2\62\63\4"+ + "\2GGgg\48\2\62\2;\2\u0662\2\u066b\2\u06f2\2\u06fb\2\u07c2\2\u07cb\2\u0968"+ + "\2\u0971\2\u09e8\2\u09f1\2\u0a68\2\u0a71\2\u0ae8\2\u0af1\2\u0b68\2\u0b71"+ + "\2\u0be8\2\u0bf1\2\u0c68\2\u0c71\2\u0ce8\2\u0cf1\2\u0d68\2\u0d71\2\u0de8"+ + "\2\u0df1\2\u0e52\2\u0e5b\2\u0ed2\2\u0edb\2\u0f22\2\u0f2b\2\u1042\2\u104b"+ + "\2\u1092\2\u109b\2\u17e2\2\u17eb\2\u1812\2\u181b\2\u1948\2\u1951\2\u19d2"+ + "\2\u19db\2\u1a82\2\u1a8b\2\u1a92\2\u1a9b\2\u1b52\2\u1b5b\2\u1bb2\2\u1bbb"+ + "\2\u1c42\2\u1c4b\2\u1c52\2\u1c5b\2\ua622\2\ua62b\2\ua8d2\2\ua8db\2\ua902"+ + "\2\ua90b\2\ua9d2\2\ua9db\2\ua9f2\2\ua9fb\2\uaa52\2\uaa5b\2\uabf2\2\uabfb"+ + "\2\uff12\2\uff1b\2\u04a2\3\u04ab\3\u1068\3\u1071\3\u10f2\3\u10fb\3\u1138"+ + "\3\u1141\3\u11d2\3\u11db\3\u12f2\3\u12fb\3\u1452\3\u145b\3\u14d2\3\u14db"+ + "\3\u1652\3\u165b\3\u16c2\3\u16cb\3\u1732\3\u173b\3\u18e2\3\u18eb\3\u1c52"+ + "\3\u1c5b\3\u6a62\3\u6a6b\3\u6b52\3\u6b5b\3\ud7d0\3\ud801\3\ue952\3\ue95b"+ + "\3\u023d\2C\2\\\2c\2|\2\u00ac\2\u00ac\2\u00b7\2\u00b7\2\u00bc\2\u00bc"+ + "\2\u00c2\2\u00d8\2\u00da\2\u00f8\2\u00fa\2\u02c3\2\u02c8\2\u02d3\2\u02e2"+ + "\2\u02e6\2\u02ee\2\u02ee\2\u02f0\2\u02f0\2\u0372\2\u0376\2\u0378\2\u0379"+ + "\2\u037c\2\u037f\2\u0381\2\u0381\2\u0388\2\u0388\2\u038a\2\u038c\2\u038e"+ + "\2\u038e\2\u0390\2\u03a3\2\u03a5\2\u03f7\2\u03f9\2\u0483\2\u048c\2\u0531"+ + "\2\u0533\2\u0558\2\u055b\2\u055b\2\u0563\2\u0589\2\u05d2\2\u05ec\2\u05f2"+ + "\2\u05f4\2\u0622\2\u064c\2\u0670\2\u0671\2\u0673\2\u06d5\2\u06d7\2\u06d7"+ + "\2\u06e7\2\u06e8\2\u06f0\2\u06f1\2\u06fc\2\u06fe\2\u0701\2\u0701\2\u0712"+ + "\2\u0712\2\u0714\2\u0731\2\u074f\2\u07a7\2\u07b3\2\u07b3\2\u07cc\2\u07ec"+ + "\2\u07f6\2\u07f7\2\u07fc\2\u07fc\2\u0802\2\u0817\2\u081c\2\u081c\2\u0826"+ + "\2\u0826\2\u082a\2\u082a\2\u0842\2\u085a\2\u08a2\2\u08b6\2\u08b8\2\u08bf"+ + "\2\u0906\2\u093b\2\u093f\2\u093f\2\u0952\2\u0952\2\u095a\2\u0963\2\u0973"+ + "\2\u0982\2\u0987\2\u098e\2\u0991\2\u0992\2\u0995\2\u09aa\2\u09ac\2\u09b2"+ + "\2\u09b4\2\u09b4\2\u09b8\2\u09bb\2\u09bf\2\u09bf\2\u09d0\2\u09d0\2\u09de"+ + "\2\u09df\2\u09e1\2\u09e3\2\u09f2\2\u09f3\2\u0a07\2\u0a0c\2\u0a11\2\u0a12"+ + "\2\u0a15\2\u0a2a\2\u0a2c\2\u0a32\2\u0a34\2\u0a35\2\u0a37\2\u0a38\2\u0a3a"+ + "\2\u0a3b\2\u0a5b\2\u0a5e\2\u0a60\2\u0a60\2\u0a74\2\u0a76\2\u0a87\2\u0a8f"+ + "\2\u0a91\2\u0a93\2\u0a95\2\u0aaa\2\u0aac\2\u0ab2\2\u0ab4\2\u0ab5\2\u0ab7"+ + "\2\u0abb\2\u0abf\2\u0abf\2\u0ad2\2\u0ad2\2\u0ae2\2\u0ae3\2\u0afb\2\u0afb"+ + "\2\u0b07\2\u0b0e\2\u0b11\2\u0b12\2\u0b15\2\u0b2a\2\u0b2c\2\u0b32\2\u0b34"+ + "\2\u0b35\2\u0b37\2\u0b3b\2\u0b3f\2\u0b3f\2\u0b5e\2\u0b5f\2\u0b61\2\u0b63"+ + "\2\u0b73\2\u0b73\2\u0b85\2\u0b85\2\u0b87\2\u0b8c\2\u0b90\2\u0b92\2\u0b94"+ + "\2\u0b97\2\u0b9b\2\u0b9c\2\u0b9e\2\u0b9e\2\u0ba0\2\u0ba1\2\u0ba5\2\u0ba6"+ + "\2\u0baa\2\u0bac\2\u0bb0\2\u0bbb\2\u0bd2\2\u0bd2\2\u0c07\2\u0c0e\2\u0c10"+ + "\2\u0c12\2\u0c14\2\u0c2a\2\u0c2c\2\u0c3b\2\u0c3f\2\u0c3f\2\u0c5a\2\u0c5c"+ + "\2\u0c62\2\u0c63\2\u0c82\2\u0c82\2\u0c87\2\u0c8e\2\u0c90\2\u0c92\2\u0c94"+ + "\2\u0caa\2\u0cac\2\u0cb5\2\u0cb7\2\u0cbb\2\u0cbf\2\u0cbf\2\u0ce0\2\u0ce0"+ + "\2\u0ce2\2\u0ce3\2\u0cf3\2\u0cf4\2\u0d07\2\u0d0e\2\u0d10\2\u0d12\2\u0d14"+ + "\2\u0d3c\2\u0d3f\2\u0d3f\2\u0d50\2\u0d50\2\u0d56\2\u0d58\2\u0d61\2\u0d63"+ + "\2\u0d7c\2\u0d81\2\u0d87\2\u0d98\2\u0d9c\2\u0db3\2\u0db5\2\u0dbd\2\u0dbf"+ + "\2\u0dbf\2\u0dc2\2\u0dc8\2\u0e03\2\u0e32\2\u0e34\2\u0e35\2\u0e42\2\u0e48"+ + "\2\u0e83\2\u0e84\2\u0e86\2\u0e86\2\u0e89\2\u0e8a\2\u0e8c\2\u0e8c\2\u0e8f"+ + "\2\u0e8f\2\u0e96\2\u0e99\2\u0e9b\2\u0ea1\2\u0ea3\2\u0ea5\2\u0ea7\2\u0ea7"+ + "\2\u0ea9\2\u0ea9\2\u0eac\2\u0ead\2\u0eaf\2\u0eb2\2\u0eb4\2\u0eb5\2\u0ebf"+ + "\2\u0ebf\2\u0ec2\2\u0ec6\2\u0ec8\2\u0ec8\2\u0ede\2\u0ee1\2\u0f02\2\u0f02"+ + "\2\u0f42\2\u0f49\2\u0f4b\2\u0f6e\2\u0f8a\2\u0f8e\2\u1002\2\u102c\2\u1041"+ + "\2\u1041\2\u1052\2\u1057\2\u105c\2\u105f\2\u1063\2\u1063\2\u1067\2\u1068"+ + "\2\u1070\2\u1072\2\u1077\2\u1083\2\u1090\2\u1090\2\u10a2\2\u10c7\2\u10c9"+ + "\2\u10c9\2\u10cf\2\u10cf\2\u10d2\2\u10fc\2\u10fe\2\u124a\2\u124c\2\u124f"+ + "\2\u1252\2\u1258\2\u125a\2\u125a\2\u125c\2\u125f\2\u1262\2\u128a\2\u128c"+ + "\2\u128f\2\u1292\2\u12b2\2\u12b4\2\u12b7\2\u12ba\2\u12c0\2\u12c2\2\u12c2"+ + "\2\u12c4\2\u12c7\2\u12ca\2\u12d8\2\u12da\2\u1312\2\u1314\2\u1317\2\u131a"+ + "\2\u135c\2\u1382\2\u1391\2\u13a2\2\u13f7\2\u13fa\2\u13ff\2\u1403\2\u166e"+ + "\2\u1671\2\u1681\2\u1683\2\u169c\2\u16a2\2\u16ec\2\u16f3\2\u16fa\2\u1702"+ + "\2\u170e\2\u1710\2\u1713\2\u1722\2\u1733\2\u1742\2\u1753\2\u1762\2\u176e"+ + "\2\u1770\2\u1772\2\u1782\2\u17b5\2\u17d9\2\u17d9\2\u17de\2\u17de\2\u1822"+ + "\2\u1879\2\u1882\2\u1886\2\u1889\2\u18aa\2\u18ac\2\u18ac\2\u18b2\2\u18f7"+ + "\2\u1902\2\u1920\2\u1952\2\u196f\2\u1972\2\u1976\2\u1982\2\u19ad\2\u19b2"+ + "\2\u19cb\2\u1a02\2\u1a18\2\u1a22\2\u1a56\2\u1aa9\2\u1aa9\2\u1b07\2\u1b35"+ + "\2\u1b47\2\u1b4d\2\u1b85\2\u1ba2\2\u1bb0\2\u1bb1\2\u1bbc\2\u1be7\2\u1c02"+ + "\2\u1c25\2\u1c4f\2\u1c51\2\u1c5c\2\u1c7f\2\u1c82\2\u1c8a\2\u1ceb\2\u1cee"+ + "\2\u1cf0\2\u1cf3\2\u1cf7\2\u1cf8\2\u1d02\2\u1dc1\2\u1e02\2\u1f17\2\u1f1a"+ + "\2\u1f1f\2\u1f22\2\u1f47\2\u1f4a\2\u1f4f\2\u1f52\2\u1f59\2\u1f5b\2\u1f5b"+ + "\2\u1f5d\2\u1f5d\2\u1f5f\2\u1f5f\2\u1f61\2\u1f7f\2\u1f82\2\u1fb6\2\u1fb8"+ + "\2\u1fbe\2\u1fc0\2\u1fc0\2\u1fc4\2\u1fc6\2\u1fc8\2\u1fce\2\u1fd2\2\u1fd5"+ + "\2\u1fd8\2\u1fdd\2\u1fe2\2\u1fee\2\u1ff4\2\u1ff6\2\u1ff8\2\u1ffe\2\u2073"+ + "\2\u2073\2\u2081\2\u2081\2\u2092\2\u209e\2\u2104\2\u2104\2\u2109\2\u2109"+ + "\2\u210c\2\u2115\2\u2117\2\u2117\2\u211b\2\u211f\2\u2126\2\u2126\2\u2128"+ + "\2\u2128\2\u212a\2\u212a\2\u212c\2\u212f\2\u2131\2\u213b\2\u213e\2\u2141"+ + "\2\u2147\2\u214b\2\u2150\2\u2150\2\u2185\2\u2186\2\u2c02\2\u2c30\2\u2c32"+ + "\2\u2c60\2\u2c62\2\u2ce6\2\u2ced\2\u2cf0\2\u2cf4\2\u2cf5\2\u2d02\2\u2d27"+ + "\2\u2d29\2\u2d29\2\u2d2f\2\u2d2f\2\u2d32\2\u2d69\2\u2d71\2\u2d71\2\u2d82"+ + "\2\u2d98\2\u2da2\2\u2da8\2\u2daa\2\u2db0\2\u2db2\2\u2db8\2\u2dba\2\u2dc0"+ + "\2\u2dc2\2\u2dc8\2\u2dca\2\u2dd0\2\u2dd2\2\u2dd8\2\u2dda\2\u2de0\2\u2e31"+ + "\2\u2e31\2\u3007\2\u3008\2\u3033\2\u3037\2\u303d\2\u303e\2\u3043\2\u3098"+ + "\2\u309f\2\u30a1\2\u30a3\2\u30fc\2\u30fe\2\u3101\2\u3107\2\u312f\2\u3133"+ + "\2\u3190\2\u31a2\2\u31bc\2\u31f2\2\u3201\2\u3402\2\u4db7\2\u4e02\2\u9fd7"+ + "\2\ua002\2\ua48e\2\ua4d2\2\ua4ff\2\ua502\2\ua60e\2\ua612\2\ua621\2\ua62c"+ + "\2\ua62d\2\ua642\2\ua670\2\ua681\2\ua69f\2\ua6a2\2\ua6e7\2\ua719\2\ua721"+ + "\2\ua724\2\ua78a\2\ua78d\2\ua7b0\2\ua7b2\2\ua7b9\2\ua7f9\2\ua803\2\ua805"+ + "\2\ua807\2\ua809\2\ua80c\2\ua80e\2\ua824\2\ua842\2\ua875\2\ua884\2\ua8b5"+ + "\2\ua8f4\2\ua8f9\2\ua8fd\2\ua8fd\2\ua8ff\2\ua8ff\2\ua90c\2\ua927\2\ua932"+ + "\2\ua948\2\ua962\2\ua97e\2\ua986\2\ua9b4\2\ua9d1\2\ua9d1\2\ua9e2\2\ua9e6"+ + "\2\ua9e8\2\ua9f1\2\ua9fc\2\uaa00\2\uaa02\2\uaa2a\2\uaa42\2\uaa44\2\uaa46"+ + "\2\uaa4d\2\uaa62\2\uaa78\2\uaa7c\2\uaa7c\2\uaa80\2\uaab1\2\uaab3\2\uaab3"+ + "\2\uaab7\2\uaab8\2\uaabb\2\uaabf\2\uaac2\2\uaac2\2\uaac4\2\uaac4\2\uaadd"+ + "\2\uaadf\2\uaae2\2\uaaec\2\uaaf4\2\uaaf6\2\uab03\2\uab08\2\uab0b\2\uab10"+ + "\2\uab13\2\uab18\2\uab22\2\uab28\2\uab2a\2\uab30\2\uab32\2\uab5c\2\uab5e"+ + "\2\uab67\2\uab72\2\uabe4\2\uac02\2\ud7a5\2\ud7b2\2\ud7c8\2\ud7cd\2\ud7fd"+ + "\2\uf902\2\ufa6f\2\ufa72\2\ufadb\2\ufb02\2\ufb08\2\ufb15\2\ufb19\2\ufb1f"+ + "\2\ufb1f\2\ufb21\2\ufb2a\2\ufb2c\2\ufb38\2\ufb3a\2\ufb3e\2\ufb40\2\ufb40"+ + "\2\ufb42\2\ufb43\2\ufb45\2\ufb46\2\ufb48\2\ufbb3\2\ufbd5\2\ufd3f\2\ufd52"+ + "\2\ufd91\2\ufd94\2\ufdc9\2\ufdf2\2\ufdfd\2\ufe72\2\ufe76\2\ufe78\2\ufefe"+ + "\2\uff23\2\uff3c\2\uff43\2\uff5c\2\uff68\2\uffc0\2\uffc4\2\uffc9\2\uffcc"+ + "\2\uffd1\2\uffd4\2\uffd9\2\uffdc\2\uffde\2\2\3\r\3\17\3(\3*\3<\3>\3?\3"+ + "A\3O\3R\3_\3\u0082\3\u00fc\3\u0282\3\u029e\3\u02a2\3\u02d2\3\u0302\3\u0321"+ + "\3\u0332\3\u0342\3\u0344\3\u034b\3\u0352\3\u0377\3\u0382\3\u039f\3\u03a2"+ + "\3\u03c5\3\u03ca\3\u03d1\3\u0402\3\u049f\3\u04b2\3\u04d5\3\u04da\3\u04fd"+ + "\3\u0502\3\u0529\3\u0532\3\u0565\3\u0602\3\u0738\3\u0742\3\u0757\3\u0762"+ + "\3\u0769\3\u0802\3\u0807\3\u080a\3\u080a\3\u080c\3\u0837\3\u0839\3\u083a"+ + "\3\u083e\3\u083e\3\u0841\3\u0857\3\u0862\3\u0878\3\u0882\3\u08a0\3\u08e2"+ + "\3\u08f4\3\u08f6\3\u08f7\3\u0902\3\u0917\3\u0922\3\u093b\3\u0982\3\u09b9"+ + "\3\u09c0\3\u09c1\3\u0a02\3\u0a02\3\u0a12\3\u0a15\3\u0a17\3\u0a19\3\u0a1b"+ + "\3\u0a35\3\u0a62\3\u0a7e\3\u0a82\3\u0a9e\3\u0ac2\3\u0ac9\3\u0acb\3\u0ae6"+ + "\3\u0b02\3\u0b37\3\u0b42\3\u0b57\3\u0b62\3\u0b74\3\u0b82\3\u0b93\3\u0c02"+ + "\3\u0c4a\3\u0c82\3\u0cb4\3\u0cc2\3\u0cf4\3\u1005\3\u1039\3\u1085\3\u10b1"+ + "\3\u10d2\3\u10ea\3\u1105\3\u1128\3\u1152\3\u1174\3\u1178\3\u1178\3\u1185"+ + "\3\u11b4\3\u11c3\3\u11c6\3\u11dc\3\u11dc\3\u11de\3\u11de\3\u1202\3\u1213"+ + "\3\u1215\3\u122d\3\u1282\3\u1288\3\u128a\3\u128a\3\u128c\3\u128f\3\u1291"+ + "\3\u129f\3\u12a1\3\u12aa\3\u12b2\3\u12e0\3\u1307\3\u130e\3\u1311\3\u1312"+ + "\3\u1315\3\u132a\3\u132c\3\u1332\3\u1334\3\u1335\3\u1337\3\u133b\3\u133f"+ + "\3\u133f\3\u1352\3\u1352\3\u135f\3\u1363\3\u1402\3\u1436\3\u1449\3\u144c"+ + "\3\u1482\3\u14b1\3\u14c6\3\u14c7\3\u14c9\3\u14c9\3\u1582\3\u15b0\3\u15da"+ + "\3\u15dd\3\u1602\3\u1631\3\u1646\3\u1646\3\u1682\3\u16ac\3\u1702\3\u171b"+ + "\3\u18a2\3\u18e1\3\u1901\3\u1901\3\u1ac2\3\u1afa\3\u1c02\3\u1c0a\3\u1c0c"+ + "\3\u1c30\3\u1c42\3\u1c42\3\u1c74\3\u1c91\3\u2002\3\u239b\3\u2482\3\u2545"+ + "\3\u3002\3\u3430\3\u4402\3\u4648\3\u6802\3\u6a3a\3\u6a42\3\u6a60\3\u6ad2"+ + "\3\u6aef\3\u6b02\3\u6b31\3\u6b42\3\u6b45\3\u6b65\3\u6b79\3\u6b7f\3\u6b91"+ + "\3\u6f02\3\u6f46\3\u6f52\3\u6f52\3\u6f95\3\u6fa1\3\u6fe2\3\u6fe2\3\u7002"+ + "\3\u87ee\3\u8802\3\u8af4\3\ub002\3\ub003\3\ubc02\3\ubc6c\3\ubc72\3\ubc7e"+ + "\3\ubc82\3\ubc8a\3\ubc92\3\ubc9b\3\ud402\3\ud456\3\ud458\3\ud49e\3\ud4a0"+ + "\3\ud4a1\3\ud4a4\3\ud4a4\3\ud4a7\3\ud4a8\3\ud4ab\3\ud4ae\3\ud4b0\3\ud4bb"+ + "\3\ud4bd\3\ud4bd\3\ud4bf\3\ud4c5\3\ud4c7\3\ud507\3\ud509\3\ud50c\3\ud50f"+ + "\3\ud516\3\ud518\3\ud51e\3\ud520\3\ud53b\3\ud53d\3\ud540\3\ud542\3\ud546"+ + "\3\ud548\3\ud548\3\ud54c\3\ud552\3\ud554\3\ud6a7\3\ud6aa\3\ud6c2\3\ud6c4"+ + "\3\ud6dc\3\ud6de\3\ud6fc\3\ud6fe\3\ud716\3\ud718\3\ud736\3\ud738\3\ud750"+ + "\3\ud752\3\ud770\3\ud772\3\ud78a\3\ud78c\3\ud7aa\3\ud7ac\3\ud7c4\3\ud7c6"+ + "\3\ud7cd\3\ue802\3\ue8c6\3\ue902\3\ue945\3\uee02\3\uee05\3\uee07\3\uee21"+ + "\3\uee23\3\uee24\3\uee26\3\uee26\3\uee29\3\uee29\3\uee2b\3\uee34\3\uee36"+ + "\3\uee39\3\uee3b\3\uee3b\3\uee3d\3\uee3d\3\uee44\3\uee44\3\uee49\3\uee49"+ + "\3\uee4b\3\uee4b\3\uee4d\3\uee4d\3\uee4f\3\uee51\3\uee53\3\uee54\3\uee56"+ + "\3\uee56\3\uee59\3\uee59\3\uee5b\3\uee5b\3\uee5d\3\uee5d\3\uee5f\3\uee5f"+ + "\3\uee61\3\uee61\3\uee63\3\uee64\3\uee66\3\uee66\3\uee69\3\uee6c\3\uee6e"+ + "\3\uee74\3\uee76\3\uee79\3\uee7b\3\uee7e\3\uee80\3\uee80\3\uee82\3\uee8b"+ + "\3\uee8d\3\uee9d\3\ueea3\3\ueea5\3\ueea7\3\ueeab\3\ueead\3\ueebd\3\2\4"+ + "\ua6d8\4\ua702\4\ub736\4\ub742\4\ub81f\4\ub822\4\ucea3\4\uf802\4\ufa1f"+ + "\4\u0390\2\4\3\2\2\2\2\6\3\2\2\2\2\b\3\2\2\2\2\n\3\2\2\2\2\f\3\2\2\2\2"+ + "\16\3\2\2\2\2\20\3\2\2\2\2\22\3\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2\2\30\3"+ + "\2\2\2\2\32\3\2\2\2\2\34\3\2\2\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3\2\2\2\2"+ + "$\3\2\2\2\2&\3\2\2\2\2(\3\2\2\2\2*\3\2\2\2\2,\3\2\2\2\2.\3\2\2\2\2\60"+ + "\3\2\2\2\2\62\3\2\2\2\2\64\3\2\2\2\2\66\3\2\2\2\28\3\2\2\2\2:\3\2\2\2"+ + "\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2\2\2B\3\2\2\2\2D\3\2\2\2\2F\3\2\2\2\2H"+ + "\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2N\3\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2T\3\2"+ + "\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3\2\2\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3\2\2"+ + "\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2\2\2\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2\2\2"+ + "n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2\2t\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2z\3"+ + "\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080\3\2\2\2\2\u0082\3\2\2\2\2\u0084\3"+ + "\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2\2\2\u008a\3\2\2\2\2\u008c\3\2\2\2"+ + "\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0096\3\2\2\2\2\u009a\3\2\2\2\2\u009c"+ + "\3\2\2\2\2\u009e\3\2\2\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\2\u00a4\3\2\2"+ + "\2\2\u00a6\3\2\2\2\2\u00a8\3\2\2\2\2\u00aa\3\2\2\2\2\u00ac\3\2\2\2\2\u00ae"+ + "\3\2\2\2\2\u00b0\3\2\2\2\2\u00b2\3\2\2\2\3\u00c8\3\2\2\2\3\u00ca\3\2\2"+ + "\2\3\u00cc\3\2\2\2\3\u00ce\3\2\2\2\3\u00d0\3\2\2\2\4\u00d2\3\2\2\2\6\u00da"+ + "\3\2\2\2\b\u00e2\3\2\2\2\n\u00e7\3\2\2\2\f\u00f1\3\2\2\2\16\u00f8\3\2"+ + "\2\2\20\u00fd\3\2\2\2\22\u0103\3\2\2\2\24\u0106\3\2\2\2\26\u010a\3\2\2"+ + "\2\30\u0111\3\2\2\2\32\u0116\3\2\2\2\34\u011b\3\2\2\2\36\u0120\3\2\2\2"+ + " \u0128\3\2\2\2\"\u012f\3\2\2\2$\u0135\3\2\2\2&\u0143\3\2\2\2(\u0146\3"+ + "\2\2\2*\u014c\3\2\2\2,\u0151\3\2\2\2.\u015c\3\2\2\2\60\u0160\3\2\2\2\62"+ + "\u0167\3\2\2\2\64\u0170\3\2\2\2\66\u0174\3\2\2\28\u017a\3\2\2\2:\u0184"+ + "\3\2\2\2<\u0186\3\2\2\2>\u018a\3\2\2\2@\u018c\3\2\2\2B\u0190\3\2\2\2D"+ + "\u0192\3\2\2\2F\u0196\3\2\2\2H\u0198\3\2\2\2J\u019a\3\2\2\2L\u019c\3\2"+ + "\2\2N\u019e\3\2\2\2P\u01a0\3\2\2\2R\u01a5\3\2\2\2T\u01aa\3\2\2\2V\u01ad"+ + "\3\2\2\2X\u01b1\3\2\2\2Z\u01b4\3\2\2\2\\\u01b7\3\2\2\2^\u01ba\3\2\2\2"+ + "`\u01bd\3\2\2\2b\u01bf\3\2\2\2d\u01c2\3\2\2\2f\u01c4\3\2\2\2h\u01c7\3"+ + "\2\2\2j\u01c9\3\2\2\2l\u01cb\3\2\2\2n\u01cd\3\2\2\2p\u01d0\3\2\2\2r\u01d3"+ + "\3\2\2\2t\u01d6\3\2\2\2v\u01d8\3\2\2\2x\u01da\3\2\2\2z\u01dc\3\2\2\2|"+ + "\u01de\3\2\2\2~\u01e0\3\2\2\2\u0080\u01e2\3\2\2\2\u0082\u01e4\3\2\2\2"+ + "\u0084\u01f2\3\2\2\2\u0086\u01f6\3\2\2\2\u0088\u0202\3\2\2\2\u008a\u0210"+ + "\3\2\2\2\u008c\u021e\3\2\2\2\u008e\u0232\3\2\2\2\u0090\u0234\3\2\2\2\u0092"+ + "\u0258\3\2\2\2\u0094\u025a\3\2\2\2\u0096\u0265\3\2\2\2\u0098\u026b\3\2"+ + "\2\2\u009a\u0272\3\2\2\2\u009c\u0278\3\2\2\2\u009e\u027a\3\2\2\2\u00a0"+ + "\u027f\3\2\2\2\u00a2\u0284\3\2\2\2\u00a4\u028b\3\2\2\2\u00a6\u0296\3\2"+ + "\2\2\u00a8\u02a1\3\2\2\2\u00aa\u02ae\3\2\2\2\u00ac\u02b4\3\2\2\2\u00ae"+ + "\u02c3\3\2\2\2\u00b0\u02c9\3\2\2\2\u00b2\u02e2\3\2\2\2\u00b4\u02e8\3\2"+ + "\2\2\u00b6\u02ea\3\2\2\2\u00b8\u0306\3\2\2\2\u00ba\u0310\3\2\2\2\u00bc"+ + "\u0312\3\2\2\2\u00be\u0314\3\2\2\2\u00c0\u0316\3\2\2\2\u00c2\u031e\3\2"+ + "\2\2\u00c4\u0320\3\2\2\2\u00c6\u0322\3\2\2\2\u00c8\u0325\3\2\2\2\u00ca"+ + "\u032b\3\2\2\2\u00cc\u0339\3\2\2\2\u00ce\u0356\3\2\2\2\u00d0\u035a\3\2"+ + "\2\2\u00d2\u00d3\7d\2\2\u00d3\u00d4\7t\2\2\u00d4\u00d5\7g\2\2\u00d5\u00d6"+ + "\7c\2\2\u00d6\u00d7\7m\2\2\u00d7\u00d8\3\2\2\2\u00d8\u00d9\b\2\2\2\u00d9"+ + "\5\3\2\2\2\u00da\u00db\7f\2\2\u00db\u00dc\7g\2\2\u00dc\u00dd\7h\2\2\u00dd"+ + "\u00de\7c\2\2\u00de\u00df\7w\2\2\u00df\u00e0\7n\2\2\u00e0\u00e1\7v\2\2"+ + "\u00e1\7\3\2\2\2\u00e2\u00e3\7h\2\2\u00e3\u00e4\7w\2\2\u00e4\u00e5\7p"+ + "\2\2\u00e5\u00e6\7e\2\2\u00e6\t\3\2\2\2\u00e7\u00e8\7k\2\2\u00e8\u00e9"+ + "\7p\2\2\u00e9\u00ea\7v\2\2\u00ea\u00eb\7g\2\2\u00eb\u00ec\7t\2\2\u00ec"+ + "\u00ed\7h\2\2\u00ed\u00ee\7c\2\2\u00ee\u00ef\7e\2\2\u00ef\u00f0\7g\2\2"+ + "\u00f0\13\3\2\2\2\u00f1\u00f2\7u\2\2\u00f2\u00f3\7g\2\2\u00f3\u00f4\7"+ + "n\2\2\u00f4\u00f5\7g\2\2\u00f5\u00f6\7e\2\2\u00f6\u00f7\7v\2\2\u00f7\r"+ + "\3\2\2\2\u00f8\u00f9\7e\2\2\u00f9\u00fa\7c\2\2\u00fa\u00fb\7u\2\2\u00fb"+ + "\u00fc\7g\2\2\u00fc\17\3\2\2\2\u00fd\u00fe\7f\2\2\u00fe\u00ff\7g\2\2\u00ff"+ + "\u0100\7h\2\2\u0100\u0101\7g\2\2\u0101\u0102\7t\2\2\u0102\21\3\2\2\2\u0103"+ + "\u0104\7i\2\2\u0104\u0105\7q\2\2\u0105\23\3\2\2\2\u0106\u0107\7o\2\2\u0107"+ + "\u0108\7c\2\2\u0108\u0109\7r\2\2\u0109\25\3\2\2\2\u010a\u010b\7u\2\2\u010b"+ + "\u010c\7v\2\2\u010c\u010d\7t\2\2\u010d\u010e\7w\2\2\u010e\u010f\7e\2\2"+ + "\u010f\u0110\7v\2\2\u0110\27\3\2\2\2\u0111\u0112\7e\2\2\u0112\u0113\7"+ + "j\2\2\u0113\u0114\7c\2\2\u0114\u0115\7p\2\2\u0115\31\3\2\2\2\u0116\u0117"+ + "\7g\2\2\u0117\u0118\7n\2\2\u0118\u0119\7u\2\2\u0119\u011a\7g\2\2\u011a"+ + "\33\3\2\2\2\u011b\u011c\7i\2\2\u011c\u011d\7q\2\2\u011d\u011e\7v\2\2\u011e"+ + "\u011f\7q\2\2\u011f\35\3\2\2\2\u0120\u0121\7r\2\2\u0121\u0122\7c\2\2\u0122"+ + "\u0123\7e\2\2\u0123\u0124\7m\2\2\u0124\u0125\7c\2\2\u0125\u0126\7i\2\2"+ + "\u0126\u0127\7g\2\2\u0127\37\3\2\2\2\u0128\u0129\7u\2\2\u0129\u012a\7"+ + "y\2\2\u012a\u012b\7k\2\2\u012b\u012c\7v\2\2\u012c\u012d\7e\2\2\u012d\u012e"+ + "\7j\2\2\u012e!\3\2\2\2\u012f\u0130\7e\2\2\u0130\u0131\7q\2\2\u0131\u0132"+ + "\7p\2\2\u0132\u0133\7u\2\2\u0133\u0134\7v\2\2\u0134#\3\2\2\2\u0135\u0136"+ + "\7h\2\2\u0136\u0137\7c\2\2\u0137\u0138\7n\2\2\u0138\u0139\7n\2\2\u0139"+ + "\u013a\7v\2\2\u013a\u013b\7j\2\2\u013b\u013c\7t\2\2\u013c\u013d\7q\2\2"+ + "\u013d\u013e\7w\2\2\u013e\u013f\7i\2\2\u013f\u0140\7j\2\2\u0140\u0141"+ + "\3\2\2\2\u0141\u0142\b\22\2\2\u0142%\3\2\2\2\u0143\u0144\7k\2\2\u0144"+ + "\u0145\7h\2\2\u0145\'\3\2\2\2\u0146\u0147\7t\2\2\u0147\u0148\7c\2\2\u0148"+ + "\u0149\7p\2\2\u0149\u014a\7i\2\2\u014a\u014b\7g\2\2\u014b)\3\2\2\2\u014c"+ + "\u014d\7v\2\2\u014d\u014e\7{\2\2\u014e\u014f\7r\2\2\u014f\u0150\7g\2\2"+ + "\u0150+\3\2\2\2\u0151\u0152\7e\2\2\u0152\u0153\7q\2\2\u0153\u0154\7p\2"+ + "\2\u0154\u0155\7v\2\2\u0155\u0156\7k\2\2\u0156\u0157\7p\2\2\u0157\u0158"+ + "\7w\2\2\u0158\u0159\7g\2\2\u0159\u015a\3\2\2\2\u015a\u015b\b\26\2\2\u015b"+ + "-\3\2\2\2\u015c\u015d\7h\2\2\u015d\u015e\7q\2\2\u015e\u015f\7t\2\2\u015f"+ + "/\3\2\2\2\u0160\u0161\7k\2\2\u0161\u0162\7o\2\2\u0162\u0163\7r\2\2\u0163"+ + "\u0164\7q\2\2\u0164\u0165\7t\2\2\u0165\u0166\7v\2\2\u0166\61\3\2\2\2\u0167"+ + "\u0168\7t\2\2\u0168\u0169\7g\2\2\u0169\u016a\7v\2\2\u016a\u016b\7w\2\2"+ + "\u016b\u016c\7t\2\2\u016c\u016d\7p\2\2\u016d\u016e\3\2\2\2\u016e\u016f"+ + "\b\31\2\2\u016f\63\3\2\2\2\u0170\u0171\7x\2\2\u0171\u0172\7c\2\2\u0172"+ + "\u0173\7t\2\2\u0173\65\3\2\2\2\u0174\u0175\7p\2\2\u0175\u0176\7k\2\2\u0176"+ + "\u0177\7n\2\2\u0177\u0178\3\2\2\2\u0178\u0179\b\33\2\2\u0179\67\3\2\2"+ + "\2\u017a\u017f\5\u00c2a\2\u017b\u017e\5\u00c2a\2\u017c\u017e\5\u00c4b"+ + "\2\u017d\u017b\3\2\2\2\u017d\u017c\3\2\2\2\u017e\u0181\3\2\2\2\u017f\u017d"+ + "\3\2\2\2\u017f\u0180\3\2\2\2\u0180\u0182\3\2\2\2\u0181\u017f\3\2\2\2\u0182"+ + "\u0183\b\34\2\2\u01839\3\2\2\2\u0184\u0185\7*\2\2\u0185;\3\2\2\2\u0186"+ + "\u0187\7+\2\2\u0187\u0188\3\2\2\2\u0188\u0189\b\36\2\2\u0189=\3\2\2\2"+ + "\u018a\u018b\7}\2\2\u018b?\3\2\2\2\u018c\u018d\7\177\2\2\u018d\u018e\3"+ + "\2\2\2\u018e\u018f\b \2\2\u018fA\3\2\2\2\u0190\u0191\7]\2\2\u0191C\3\2"+ + "\2\2\u0192\u0193\7_\2\2\u0193\u0194\3\2\2\2\u0194\u0195\b\"\2\2\u0195"+ + "E\3\2\2\2\u0196\u0197\7?\2\2\u0197G\3\2\2\2\u0198\u0199\7.\2\2\u0199I"+ + "\3\2\2\2\u019a\u019b\7=\2\2\u019bK\3\2\2\2\u019c\u019d\7<\2\2\u019dM\3"+ + "\2\2\2\u019e\u019f\7\60\2\2\u019fO\3\2\2\2\u01a0\u01a1\7-\2\2\u01a1\u01a2"+ + "\7-\2\2\u01a2\u01a3\3\2\2\2\u01a3\u01a4\b(\2\2\u01a4Q\3\2\2\2\u01a5\u01a6"+ + "\7/\2\2\u01a6\u01a7\7/\2\2\u01a7\u01a8\3\2\2\2\u01a8\u01a9\b)\2\2\u01a9"+ + "S\3\2\2\2\u01aa\u01ab\7<\2\2\u01ab\u01ac\7?\2\2\u01acU\3\2\2\2\u01ad\u01ae"+ + "\7\60\2\2\u01ae\u01af\7\60\2\2\u01af\u01b0\7\60\2\2\u01b0W\3\2\2\2\u01b1"+ + "\u01b2\7~\2\2\u01b2\u01b3\7~\2\2\u01b3Y\3\2\2\2\u01b4\u01b5\7(\2\2\u01b5"+ + "\u01b6\7(\2\2\u01b6[\3\2\2\2\u01b7\u01b8\7?\2\2\u01b8\u01b9\7?\2\2\u01b9"+ + "]\3\2\2\2\u01ba\u01bb\7#\2\2\u01bb\u01bc\7?\2\2\u01bc_\3\2\2\2\u01bd\u01be"+ + "\7>\2\2\u01bea\3\2\2\2\u01bf\u01c0\7>\2\2\u01c0\u01c1\7?\2\2\u01c1c\3"+ + "\2\2\2\u01c2\u01c3\7@\2\2\u01c3e\3\2\2\2\u01c4\u01c5\7@\2\2\u01c5\u01c6"+ + "\7?\2\2\u01c6g\3\2\2\2\u01c7\u01c8\7~\2\2\u01c8i\3\2\2\2\u01c9\u01ca\7"+ + "\61\2\2\u01cak\3\2\2\2\u01cb\u01cc\7\'\2\2\u01ccm\3\2\2\2\u01cd\u01ce"+ + "\7>\2\2\u01ce\u01cf\7>\2\2\u01cfo\3\2\2\2\u01d0\u01d1\7@\2\2\u01d1\u01d2"+ + "\7@\2\2\u01d2q\3\2\2\2\u01d3\u01d4\7(\2\2\u01d4\u01d5\7`\2\2\u01d5s\3"+ + "\2\2\2\u01d6\u01d7\7\u0080\2\2\u01d7u\3\2\2\2\u01d8\u01d9\7#\2\2\u01d9"+ + "w\3\2\2\2\u01da\u01db\7-\2\2\u01dby\3\2\2\2\u01dc\u01dd\7/\2\2\u01dd{"+ + "\3\2\2\2\u01de\u01df\7`\2\2\u01df}\3\2\2\2\u01e0\u01e1\7,\2\2\u01e1\177"+ + "\3\2\2\2\u01e2\u01e3\7(\2\2\u01e3\u0081\3\2\2\2\u01e4\u01e5\7>\2\2\u01e5"+ + "\u01e6\7/\2\2\u01e6\u0083\3\2\2\2\u01e7\u01f3\7\62\2\2\u01e8\u01ef\t\2"+ + "\2\2\u01e9\u01eb\7a\2\2\u01ea\u01e9\3\2\2\2\u01ea\u01eb\3\2\2\2\u01eb"+ + "\u01ec\3\2\2\2\u01ec\u01ee\t\3\2\2\u01ed\u01ea\3\2\2\2\u01ee\u01f1\3\2"+ + "\2\2\u01ef\u01ed\3\2\2\2\u01ef\u01f0\3\2\2\2\u01f0\u01f3\3\2\2\2\u01f1"+ + "\u01ef\3\2\2\2\u01f2\u01e7\3\2\2\2\u01f2\u01e8\3\2\2\2\u01f3\u01f4\3\2"+ + "\2\2\u01f4\u01f5\bB\2\2\u01f5\u0085\3\2\2\2\u01f6\u01f7\7\62\2\2\u01f7"+ + "\u01fc\t\4\2\2\u01f8\u01fa\7a\2\2\u01f9\u01f8\3\2\2\2\u01f9\u01fa\3\2"+ + "\2\2\u01fa\u01fb\3\2\2\2\u01fb\u01fd\5\u00be_\2\u01fc\u01f9\3\2\2\2\u01fd"+ + "\u01fe\3\2\2\2\u01fe\u01fc\3\2\2\2\u01fe\u01ff\3\2\2\2\u01ff\u0200\3\2"+ + "\2\2\u0200\u0201\bC\2\2\u0201\u0087\3\2\2\2\u0202\u0204\7\62\2\2\u0203"+ + "\u0205\t\5\2\2\u0204\u0203\3\2\2\2\u0204\u0205\3\2\2\2\u0205\u020a\3\2"+ + "\2\2\u0206\u0208\7a\2\2\u0207\u0206\3\2\2\2\u0207\u0208\3\2\2\2\u0208"+ + "\u0209\3\2\2\2\u0209\u020b\5\u00ba]\2\u020a\u0207\3\2\2\2\u020b\u020c"+ + "\3\2\2\2\u020c\u020a\3\2\2\2\u020c\u020d\3\2\2\2\u020d\u020e\3\2\2\2\u020e"+ + "\u020f\bD\2\2\u020f\u0089\3\2\2\2\u0210\u0211\7\62\2\2\u0211\u0216\t\6"+ + "\2\2\u0212\u0214\7a\2\2\u0213\u0212\3\2\2\2\u0213\u0214\3\2\2\2\u0214"+ + "\u0215\3\2\2\2\u0215\u0217\5\u00bc^\2\u0216\u0213\3\2\2\2\u0217\u0218"+ + "\3\2\2\2\u0218\u0216\3\2\2\2\u0218\u0219\3\2\2\2\u0219\u021a\3\2\2\2\u021a"+ + "\u021b\bE\2\2\u021b\u008b\3\2\2\2\u021c\u021f\5\u008eG\2\u021d\u021f\5"+ + "\u0090H\2\u021e\u021c\3\2\2\2\u021e\u021d\3\2\2\2\u021f\u0220\3\2\2\2"+ + "\u0220\u0221\bF\2\2\u0221\u008d\3\2\2\2\u0222\u022b\5\u00b8\\\2\u0223"+ + "\u0225\7\60\2\2\u0224\u0226\5\u00b8\\\2\u0225\u0224\3\2\2\2\u0225\u0226"+ + "\3\2\2\2\u0226\u0228\3\2\2\2\u0227\u0229\5\u00c0`\2\u0228\u0227\3\2\2"+ + "\2\u0228\u0229\3\2\2\2\u0229\u022c\3\2\2\2\u022a\u022c\5\u00c0`\2\u022b"+ + "\u0223\3\2\2\2\u022b\u022a\3\2\2\2\u022c\u0233\3\2\2\2\u022d\u022e\7\60"+ + "\2\2\u022e\u0230\5\u00b8\\\2\u022f\u0231\5\u00c0`\2\u0230\u022f\3\2\2"+ + "\2\u0230\u0231\3\2\2\2\u0231\u0233\3\2\2\2\u0232\u0222\3\2\2\2\u0232\u022d"+ + "\3\2\2\2\u0233\u008f\3\2\2\2\u0234\u0235\7\62\2\2\u0235\u0236\t\6\2\2"+ + "\u0236\u0237\5\u0092I\2\u0237\u0238\5\u0094J\2\u0238\u0091\3\2\2\2\u0239"+ + "\u023b\7a\2\2\u023a\u0239\3\2\2\2\u023a\u023b\3\2\2\2\u023b\u023c\3\2"+ + "\2\2\u023c\u023e\5\u00bc^\2\u023d\u023a\3\2\2\2\u023e\u023f\3\2\2\2\u023f"+ + "\u023d\3\2\2\2\u023f\u0240\3\2\2\2\u0240\u024b\3\2\2\2\u0241\u0248\7\60"+ + "\2\2\u0242\u0244\7a\2\2\u0243\u0242\3\2\2\2\u0243\u0244\3\2\2\2\u0244"+ + "\u0245\3\2\2\2\u0245\u0247\5\u00bc^\2\u0246\u0243\3\2\2\2\u0247\u024a"+ + "\3\2\2\2\u0248\u0246\3\2\2\2\u0248\u0249\3\2\2\2\u0249\u024c\3\2\2\2\u024a"+ + "\u0248\3\2\2\2\u024b\u0241\3\2\2\2\u024b\u024c\3\2\2\2\u024c\u0259\3\2"+ + "\2\2\u024d\u024e\7\60\2\2\u024e\u0255\5\u00bc^\2\u024f\u0251\7a\2\2\u0250"+ + "\u024f\3\2\2\2\u0250\u0251\3\2\2\2\u0251\u0252\3\2\2\2\u0252\u0254\5\u00bc"+ + "^\2\u0253\u0250\3\2\2\2\u0254\u0257\3\2\2\2\u0255\u0253\3\2\2\2\u0255"+ + "\u0256\3\2\2\2\u0256\u0259\3\2\2\2\u0257\u0255\3\2\2\2\u0258\u023d\3\2"+ + "\2\2\u0258\u024d\3\2\2\2\u0259\u0093\3\2\2\2\u025a\u025c\t\7\2\2\u025b"+ + "\u025d\t\b\2\2\u025c\u025b\3\2\2\2\u025c\u025d\3\2\2\2\u025d\u025e\3\2"+ + "\2\2\u025e\u025f\5\u00b8\\\2\u025f\u0095\3\2\2\2\u0260\u0266\5\u0084B"+ + "\2\u0261\u0266\5\u0086C\2\u0262\u0266\5\u0088D\2\u0263\u0266\5\u008aE"+ + "\2\u0264\u0266\5\u008cF\2\u0265\u0260\3\2\2\2\u0265\u0261\3\2\2\2\u0265"+ + "\u0262\3\2\2\2\u0265\u0263\3\2\2\2\u0265\u0264\3\2\2\2\u0266\u0267\3\2"+ + "\2\2\u0267\u0268\7k\2\2\u0268\u0269\3\2\2\2\u0269\u026a\bK\2\2\u026a\u0097"+ + "\3\2\2\2\u026b\u026e\7)\2\2\u026c\u026f\5\u00b4Z\2\u026d\u026f\5\u009c"+ + "N\2\u026e\u026c\3\2\2\2\u026e\u026d\3\2\2\2\u026f\u0270\3\2\2\2\u0270"+ + "\u0271\7)\2\2\u0271\u0099\3\2\2\2\u0272\u0273\5\u0098L\2\u0273\u0274\3"+ + "\2\2\2\u0274\u0275\bM\2\2\u0275\u009b\3\2\2\2\u0276\u0279\5\u009eO\2\u0277"+ + "\u0279\5\u00a0P\2\u0278\u0276\3\2\2\2\u0278\u0277\3\2\2\2\u0279\u009d"+ + "\3\2\2\2\u027a\u027b\7^\2\2\u027b\u027c\5\u00ba]\2\u027c\u027d\5\u00ba"+ + "]\2\u027d\u027e\5\u00ba]\2\u027e\u009f\3\2\2\2\u027f\u0280\7^\2\2\u0280"+ + "\u0281\7z\2\2\u0281\u0282\5\u00bc^\2\u0282\u0283\5\u00bc^\2\u0283\u00a1"+ + "\3\2\2\2\u0284\u0285\7^\2\2\u0285\u0286\7w\2\2\u0286\u0287\5\u00bc^\2"+ + "\u0287\u0288\5\u00bc^\2\u0288\u0289\5\u00bc^\2\u0289\u028a\5\u00bc^\2"+ + "\u028a\u00a3\3\2\2\2\u028b\u028c\7^\2\2\u028c\u028d\7W\2\2\u028d\u028e"+ + "\5\u00bc^\2\u028e\u028f\5\u00bc^\2\u028f\u0290\5\u00bc^\2\u0290\u0291"+ + "\5\u00bc^\2\u0291\u0292\5\u00bc^\2\u0292\u0293\5\u00bc^\2\u0293\u0294"+ + "\5\u00bc^\2\u0294\u0295\5\u00bc^\2\u0295\u00a5\3\2\2\2\u0296\u029a\7b"+ + "\2\2\u0297\u0299\n\t\2\2\u0298\u0297\3\2\2\2\u0299\u029c\3\2\2\2\u029a"+ + "\u0298\3\2\2\2\u029a\u029b\3\2\2\2\u029b\u029d\3\2\2\2\u029c\u029a\3\2"+ + "\2\2\u029d\u029e\7b\2\2\u029e\u029f\3\2\2\2\u029f\u02a0\bS\2\2\u02a0\u00a7"+ + "\3\2\2\2\u02a1\u02a6\7$\2\2\u02a2\u02a5\n\n\2\2\u02a3\u02a5\5\u00b6[\2"+ + "\u02a4\u02a2\3\2\2\2\u02a4\u02a3\3\2\2\2\u02a5\u02a8\3\2\2\2\u02a6\u02a4"+ + "\3\2\2\2\u02a6\u02a7\3\2\2\2\u02a7\u02a9\3\2\2\2\u02a8\u02a6\3\2\2\2\u02a9"+ + "\u02aa\7$\2\2\u02aa\u02ab\3\2\2\2\u02ab\u02ac\bT\2\2\u02ac\u00a9\3\2\2"+ + "\2\u02ad\u02af\t\13\2\2\u02ae\u02ad\3\2\2\2\u02af\u02b0\3\2\2\2\u02b0"+ + "\u02ae\3\2\2\2\u02b0\u02b1\3\2\2\2\u02b1\u02b2\3\2\2\2\u02b2\u02b3\bU"+ + "\3\2\u02b3\u00ab\3\2\2\2\u02b4\u02b5\7\61\2\2\u02b5\u02b6\7,\2\2\u02b6"+ + "\u02ba\3\2\2\2\u02b7\u02b9\13\2\2\2\u02b8\u02b7\3\2\2\2\u02b9\u02bc\3"+ + "\2\2\2\u02ba\u02bb\3\2\2\2\u02ba\u02b8\3\2\2\2\u02bb\u02bd\3\2\2\2\u02bc"+ + "\u02ba\3\2\2\2\u02bd\u02be\7,\2\2\u02be\u02bf\7\61\2\2\u02bf\u02c0\3\2"+ + "\2\2\u02c0\u02c1\bV\3\2\u02c1\u00ad\3\2\2\2\u02c2\u02c4\t\f\2\2\u02c3"+ + "\u02c2\3\2\2\2\u02c4\u02c5\3\2\2\2\u02c5\u02c3\3\2\2\2\u02c5\u02c6\3\2"+ + "\2\2\u02c6\u02c7\3\2\2\2\u02c7\u02c8\bW\3\2\u02c8\u00af\3\2\2\2\u02c9"+ + "\u02ca\7\61\2\2\u02ca\u02cb\7\61\2\2\u02cb\u02cf\3\2\2\2\u02cc\u02ce\n"+ + "\f\2\2\u02cd\u02cc\3\2\2\2\u02ce\u02d1\3\2\2\2\u02cf\u02cd\3\2\2\2\u02cf"+ + "\u02d0\3\2\2\2\u02d0\u02d2\3\2\2\2\u02d1\u02cf\3\2\2\2\u02d2\u02d3\bX"+ + "\3\2\u02d3\u00b1\3\2\2\2\u02d4\u02d6\7\17\2\2\u02d5\u02d4\3\2\2\2\u02d5"+ + "\u02d6\3\2\2\2\u02d6\u02d7\3\2\2\2\u02d7\u02e3\7\f\2\2\u02d8\u02da\7\17"+ + "\2\2\u02d9\u02d8\3\2\2\2\u02da\u02db\3\2\2\2\u02db\u02d9\3\2\2\2\u02db"+ + "\u02dc\3\2\2\2\u02dc\u02e3\3\2\2\2\u02dd\u02df\7\f\2\2\u02de\u02dd\3\2"+ + "\2\2\u02df\u02e0\3\2\2\2\u02e0\u02de\3\2\2\2\u02e0\u02e1\3\2\2\2\u02e1"+ + "\u02e3\3\2\2\2\u02e2\u02d5\3\2\2\2\u02e2\u02d9\3\2\2\2\u02e2\u02de\3\2"+ + "\2\2\u02e3\u00b3\3\2\2\2\u02e4\u02e9\n\r\2\2\u02e5\u02e9\5\u00a2Q\2\u02e6"+ + "\u02e9\5\u00a4R\2\u02e7\u02e9\5\u00b6[\2\u02e8\u02e4\3\2\2\2\u02e8\u02e5"+ + "\3\2\2\2\u02e8\u02e6\3\2\2\2\u02e8\u02e7\3\2\2\2\u02e9\u00b5\3\2\2\2\u02ea"+ + "\u0304\7^\2\2\u02eb\u02ec\7w\2\2\u02ec\u02ed\5\u00bc^\2\u02ed\u02ee\5"+ + "\u00bc^\2\u02ee\u02ef\5\u00bc^\2\u02ef\u02f0\5\u00bc^\2\u02f0\u0305\3"+ + "\2\2\2\u02f1\u02f2\7W\2\2\u02f2\u02f3\5\u00bc^\2\u02f3\u02f4\5\u00bc^"+ + "\2\u02f4\u02f5\5\u00bc^\2\u02f5\u02f6\5\u00bc^\2\u02f6\u02f7\5\u00bc^"+ + "\2\u02f7\u02f8\5\u00bc^\2\u02f8\u02f9\5\u00bc^\2\u02f9\u02fa\5\u00bc^"+ + "\2\u02fa\u0305\3\2\2\2\u02fb\u0305\t\16\2\2\u02fc\u02fd\5\u00ba]\2\u02fd"+ + "\u02fe\5\u00ba]\2\u02fe\u02ff\5\u00ba]\2\u02ff\u0305\3\2\2\2\u0300\u0301"+ + "\7z\2\2\u0301\u0302\5\u00bc^\2\u0302\u0303\5\u00bc^\2\u0303\u0305\3\2"+ + "\2\2\u0304\u02eb\3\2\2\2\u0304\u02f1\3\2\2\2\u0304\u02fb\3\2\2\2\u0304"+ + "\u02fc\3\2\2\2\u0304\u0300\3\2\2\2\u0305\u00b7\3\2\2\2\u0306\u030d\t\3"+ + "\2\2\u0307\u0309\7a\2\2\u0308\u0307\3\2\2\2\u0308\u0309\3\2\2\2\u0309"+ + "\u030a\3\2\2\2\u030a\u030c\t\3\2\2\u030b\u0308\3\2\2\2\u030c\u030f\3\2"+ + "\2\2\u030d\u030b\3\2\2\2\u030d\u030e\3\2\2\2\u030e\u00b9\3\2\2\2\u030f"+ + "\u030d\3\2\2\2\u0310\u0311\t\17\2\2\u0311\u00bb\3\2\2\2\u0312\u0313\t"+ + "\20\2\2\u0313\u00bd\3\2\2\2\u0314\u0315\t\21\2\2\u0315\u00bf\3\2\2\2\u0316"+ + "\u0318\t\22\2\2\u0317\u0319\t\b\2\2\u0318\u0317\3\2\2\2\u0318\u0319\3"+ + "\2\2\2\u0319\u031a\3\2\2\2\u031a\u031b\5\u00b8\\\2\u031b\u00c1\3\2\2\2"+ + "\u031c\u031f\5\u00c6c\2\u031d\u031f\7a\2\2\u031e\u031c\3\2\2\2\u031e\u031d"+ + "\3\2\2\2\u031f\u00c3\3\2\2\2\u0320\u0321\t\23\2\2\u0321\u00c5\3\2\2\2"+ + "\u0322\u0323\t\24\2\2\u0323\u00c7\3\2\2\2\u0324\u0326\t\13\2\2\u0325\u0324"+ + "\3\2\2\2\u0326\u0327\3\2\2\2\u0327\u0325\3\2\2\2\u0327\u0328\3\2\2\2\u0328"+ + "\u0329\3\2\2\2\u0329\u032a\bd\3\2\u032a\u00c9\3\2\2\2\u032b\u032c\7\61"+ + "\2\2\u032c\u032d\7,\2\2\u032d\u0331\3\2\2\2\u032e\u0330\n\f\2\2\u032f"+ + "\u032e\3\2\2\2\u0330\u0333\3\2\2\2\u0331\u0332\3\2\2\2\u0331\u032f\3\2"+ + "\2\2\u0332\u0334\3\2\2\2\u0333\u0331\3\2\2\2\u0334\u0335\7,\2\2\u0335"+ + "\u0336\7\61\2\2\u0336\u0337\3\2\2\2\u0337\u0338\be\3\2\u0338\u00cb\3\2"+ + "\2\2\u0339\u033a\7\61\2\2\u033a\u033b\7\61\2\2\u033b\u033f\3\2\2\2\u033c"+ + "\u033e\n\f\2\2\u033d\u033c\3\2\2\2\u033e\u0341\3\2\2\2\u033f\u033d\3\2"+ + "\2\2\u033f\u0340\3\2\2\2\u0340\u0342\3\2\2\2\u0341\u033f\3\2\2\2\u0342"+ + "\u0343\bf\3\2\u0343\u00cd\3\2\2\2\u0344\u0346\t\f\2\2\u0345\u0344\3\2"+ + "\2\2\u0346\u0347\3\2\2\2\u0347\u0345\3\2\2\2\u0347\u0348\3\2\2\2\u0348"+ + "\u0357\3\2\2\2\u0349\u0357\7=\2\2\u034a\u034b\7\61\2\2\u034b\u034c\7,"+ + "\2\2\u034c\u0350\3\2\2\2\u034d\u034f\13\2\2\2\u034e\u034d\3\2\2\2\u034f"+ + "\u0352\3\2\2\2\u0350\u0351\3\2\2\2\u0350\u034e\3\2\2\2\u0351\u0353\3\2"+ + "\2\2\u0352\u0350\3\2\2\2\u0353\u0354\7,\2\2\u0354\u0357\7\61\2\2\u0355"+ + "\u0357\7\2\2\3\u0356\u0345\3\2\2\2\u0356\u0349\3\2\2\2\u0356\u034a\3\2"+ + "\2\2\u0356\u0355\3\2\2\2\u0357\u0358\3\2\2\2\u0358\u0359\bg\4\2\u0359"+ + "\u00cf\3\2\2\2\u035a\u035b\3\2\2\2\u035b\u035c\3\2\2\2\u035c\u035d\bh"+ + "\4\2\u035d\u035e\bh\3\2\u035e\u00d1\3\2\2\29\2\3\u017d\u017f\u01ea\u01ef"+ + "\u01f2\u01f9\u01fe\u0204\u0207\u020c\u0213\u0218\u021e\u0225\u0228\u022b"+ + "\u0230\u0232\u023a\u023f\u0243\u0248\u024b\u0250\u0255\u0258\u025c\u0265"+ + "\u026e\u0278\u029a\u02a4\u02a6\u02b0\u02ba\u02c5\u02cf\u02d5\u02db\u02e0"+ + "\u02e2\u02e8\u0304\u0308\u030d\u0318\u031e\u0327\u0331\u033f\u0347\u0350"+ + "\u0356\5\4\3\2\2\3\2\4\2\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.tokens b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.tokens new file mode 100644 index 000000000..3d04e655a --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoLexer.tokens @@ -0,0 +1,153 @@ +BREAK=1 +DEFAULT=2 +FUNC=3 +INTERFACE=4 +SELECT=5 +CASE=6 +DEFER=7 +GO=8 +MAP=9 +STRUCT=10 +CHAN=11 +ELSE=12 +GOTO=13 +PACKAGE=14 +SWITCH=15 +CONST=16 +FALLTHROUGH=17 +IF=18 +RANGE=19 +TYPE=20 +CONTINUE=21 +FOR=22 +IMPORT=23 +RETURN=24 +VAR=25 +NIL_LIT=26 +IDENTIFIER=27 +L_PAREN=28 +R_PAREN=29 +L_CURLY=30 +R_CURLY=31 +L_BRACKET=32 +R_BRACKET=33 +ASSIGN=34 +COMMA=35 +SEMI=36 +COLON=37 +DOT=38 +PLUS_PLUS=39 +MINUS_MINUS=40 +DECLARE_ASSIGN=41 +ELLIPSIS=42 +LOGICAL_OR=43 +LOGICAL_AND=44 +EQUALS=45 +NOT_EQUALS=46 +LESS=47 +LESS_OR_EQUALS=48 +GREATER=49 +GREATER_OR_EQUALS=50 +OR=51 +DIV=52 +MOD=53 +LSHIFT=54 +RSHIFT=55 +BIT_CLEAR=56 +UNDERLYING=57 +EXCLAMATION=58 +PLUS=59 +MINUS=60 +CARET=61 +STAR=62 +AMPERSAND=63 +RECEIVE=64 +DECIMAL_LIT=65 +BINARY_LIT=66 +OCTAL_LIT=67 +HEX_LIT=68 +FLOAT_LIT=69 +DECIMAL_FLOAT_LIT=70 +HEX_FLOAT_LIT=71 +IMAGINARY_LIT=72 +RUNE_LIT=73 +BYTE_VALUE=74 +OCTAL_BYTE_VALUE=75 +HEX_BYTE_VALUE=76 +LITTLE_U_VALUE=77 +BIG_U_VALUE=78 +RAW_STRING_LIT=79 +INTERPRETED_STRING_LIT=80 +WS=81 +COMMENT=82 +TERMINATOR=83 +LINE_COMMENT=84 +NEWLINE=85 +WS_NLSEMI=86 +COMMENT_NLSEMI=87 +LINE_COMMENT_NLSEMI=88 +EOS=89 +OTHER=90 +'break'=1 +'default'=2 +'func'=3 +'interface'=4 +'select'=5 +'case'=6 +'defer'=7 +'go'=8 +'map'=9 +'struct'=10 +'chan'=11 +'else'=12 +'goto'=13 +'package'=14 +'switch'=15 +'const'=16 +'fallthrough'=17 +'if'=18 +'range'=19 +'type'=20 +'continue'=21 +'for'=22 +'import'=23 +'return'=24 +'var'=25 +'nil'=26 +'('=28 +')'=29 +'{'=30 +'}'=31 +'['=32 +']'=33 +'='=34 +','=35 +';'=36 +':'=37 +'.'=38 +'++'=39 +'--'=40 +':='=41 +'...'=42 +'||'=43 +'&&'=44 +'=='=45 +'!='=46 +'<'=47 +'<='=48 +'>'=49 +'>='=50 +'|'=51 +'/'=52 +'%'=53 +'<<'=54 +'>>'=55 +'&^'=56 +'~'=57 +'!'=58 +'+'=59 +'-'=60 +'^'=61 +'*'=62 +'&'=63 +'<-'=64 diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoMethod.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoMethod.java new file mode 100644 index 000000000..c5ca08e34 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoMethod.java @@ -0,0 +1,22 @@ +package run.mone.antlr.golang; + +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +/** + * @author goodjava@qq.com + * @date 2024/1/29 16:56 + */ +@Data +@Builder +public class GoMethod { + + private String name; + + private List paramList; + + private String code; + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParam.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParam.java new file mode 100644 index 000000000..10397309f --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParam.java @@ -0,0 +1,18 @@ +package run.mone.antlr.golang; + +import lombok.Builder; +import lombok.Data; + +/** + * @author goodjava@qq.com + * @date 2024/1/29 17:02 + */ +@Data +@Builder +public class GoParam { + + private String name; + + private String type; + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.interp b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.interp new file mode 100644 index 000000000..feb511177 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.interp @@ -0,0 +1,295 @@ +token literal names: +null +'break' +'default' +'func' +'interface' +'select' +'case' +'defer' +'go' +'map' +'struct' +'chan' +'else' +'goto' +'package' +'switch' +'const' +'fallthrough' +'if' +'range' +'type' +'continue' +'for' +'import' +'return' +'var' +'nil' +null +'(' +')' +'{' +'}' +'[' +']' +'=' +',' +';' +':' +'.' +'++' +'--' +':=' +'...' +'||' +'&&' +'==' +'!=' +'<' +'<=' +'>' +'>=' +'|' +'/' +'%' +'<<' +'>>' +'&^' +'~' +'!' +'+' +'-' +'^' +'*' +'&' +'<-' +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +BREAK +DEFAULT +FUNC +INTERFACE +SELECT +CASE +DEFER +GO +MAP +STRUCT +CHAN +ELSE +GOTO +PACKAGE +SWITCH +CONST +FALLTHROUGH +IF +RANGE +TYPE +CONTINUE +FOR +IMPORT +RETURN +VAR +NIL_LIT +IDENTIFIER +L_PAREN +R_PAREN +L_CURLY +R_CURLY +L_BRACKET +R_BRACKET +ASSIGN +COMMA +SEMI +COLON +DOT +PLUS_PLUS +MINUS_MINUS +DECLARE_ASSIGN +ELLIPSIS +LOGICAL_OR +LOGICAL_AND +EQUALS +NOT_EQUALS +LESS +LESS_OR_EQUALS +GREATER +GREATER_OR_EQUALS +OR +DIV +MOD +LSHIFT +RSHIFT +BIT_CLEAR +UNDERLYING +EXCLAMATION +PLUS +MINUS +CARET +STAR +AMPERSAND +RECEIVE +DECIMAL_LIT +BINARY_LIT +OCTAL_LIT +HEX_LIT +FLOAT_LIT +DECIMAL_FLOAT_LIT +HEX_FLOAT_LIT +IMAGINARY_LIT +RUNE_LIT +BYTE_VALUE +OCTAL_BYTE_VALUE +HEX_BYTE_VALUE +LITTLE_U_VALUE +BIG_U_VALUE +RAW_STRING_LIT +INTERPRETED_STRING_LIT +WS +COMMENT +TERMINATOR +LINE_COMMENT +NEWLINE +WS_NLSEMI +COMMENT_NLSEMI +LINE_COMMENT_NLSEMI +EOS +OTHER + +rule names: +sourceFile +packageClause +importDecl +importSpec +importPath +declaration +constDecl +constSpec +identifierList +expressionList +comment +typeDecl +typeSpec +aliasDecl +typeDef +typeParameters +typeParameterDecl +typeElement +typeTerm +functionDecl +methodDecl +receiver +varDecl +varSpec +block +statementList +statement +simpleStmt +expressionStmt +sendStmt +incDecStmt +assignment +assign_op +shortVarDecl +labeledStmt +returnStmt +breakStmt +continueStmt +gotoStmt +fallthroughStmt +deferStmt +ifStmt +switchStmt +exprSwitchStmt +exprCaseClause +exprSwitchCase +typeSwitchStmt +typeSwitchGuard +typeCaseClause +typeSwitchCase +typeList +selectStmt +commClause +commCase +recvStmt +forStmt +forClause +rangeClause +goStmt +type_ +typeArgs +typeName +typeLit +arrayType +arrayLength +elementType +pointerType +interfaceType +sliceType +mapType +channelType +methodSpec +functionType +signature +result +parameters +parameterDecl +expression +primaryExpr +conversion +operand +literal +basicLit +integer +operandName +qualifiedIdent +compositeLit +literalType +literalValue +elementList +keyedElement +key +element +structType +fieldDecl +string_ +embeddedField +functionLit +index +slice_ +typeAssertion +arguments +methodExpr +eos + + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 92, 1025, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 216, 10, 2, 12, 2, 14, 2, 219, 11, 2, 3, 2, 3, 2, 3, 2, 5, 2, 224, 10, 2, 3, 2, 3, 2, 7, 2, 228, 10, 2, 12, 2, 14, 2, 231, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 244, 10, 4, 12, 4, 14, 4, 247, 11, 4, 3, 4, 5, 4, 250, 10, 4, 3, 5, 5, 5, 253, 10, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 5, 7, 262, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 7, 8, 270, 10, 8, 12, 8, 14, 8, 273, 11, 8, 3, 8, 5, 8, 276, 10, 8, 3, 9, 3, 9, 5, 9, 280, 10, 9, 3, 9, 3, 9, 5, 9, 284, 10, 9, 3, 10, 3, 10, 3, 10, 7, 10, 289, 10, 10, 12, 10, 14, 10, 292, 11, 10, 3, 11, 3, 11, 3, 11, 7, 11, 297, 10, 11, 12, 11, 14, 11, 300, 11, 11, 3, 12, 3, 12, 3, 13, 7, 13, 305, 10, 13, 12, 13, 14, 13, 308, 11, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 7, 13, 316, 10, 13, 12, 13, 14, 13, 319, 11, 13, 3, 13, 5, 13, 322, 10, 13, 3, 14, 3, 14, 5, 14, 326, 10, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 334, 10, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 342, 10, 17, 12, 17, 14, 17, 345, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 7, 19, 355, 10, 19, 12, 19, 14, 19, 358, 11, 19, 3, 20, 5, 20, 361, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 5, 21, 368, 10, 21, 3, 21, 3, 21, 5, 21, 372, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 379, 10, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 389, 10, 24, 12, 24, 14, 24, 392, 11, 24, 3, 24, 5, 24, 395, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 401, 10, 25, 3, 25, 3, 25, 5, 25, 405, 10, 25, 3, 26, 3, 26, 5, 26, 409, 10, 26, 3, 26, 3, 26, 3, 27, 5, 27, 414, 10, 27, 3, 27, 5, 27, 417, 10, 27, 3, 27, 5, 27, 420, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 425, 10, 27, 13, 27, 14, 27, 426, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 444, 10, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 451, 10, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 5, 34, 467, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 5, 36, 478, 10, 36, 3, 37, 3, 37, 5, 37, 482, 10, 37, 3, 38, 3, 38, 5, 38, 486, 10, 38, 3, 39, 3, 39, 5, 39, 490, 10, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 5, 43, 509, 10, 43, 3, 43, 3, 43, 3, 43, 3, 43, 5, 43, 515, 10, 43, 5, 43, 517, 10, 43, 3, 44, 3, 44, 5, 44, 521, 10, 44, 3, 45, 3, 45, 5, 45, 525, 10, 45, 3, 45, 5, 45, 528, 10, 45, 3, 45, 3, 45, 5, 45, 532, 10, 45, 5, 45, 534, 10, 45, 3, 45, 3, 45, 7, 45, 538, 10, 45, 12, 45, 14, 45, 541, 11, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 5, 46, 548, 10, 46, 3, 47, 3, 47, 3, 47, 5, 47, 553, 10, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 5, 48, 564, 10, 48, 3, 48, 3, 48, 7, 48, 568, 10, 48, 12, 48, 14, 48, 571, 11, 48, 3, 48, 3, 48, 3, 49, 3, 49, 5, 49, 577, 10, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 5, 50, 588, 10, 50, 3, 51, 3, 51, 3, 51, 5, 51, 593, 10, 51, 3, 52, 3, 52, 5, 52, 597, 10, 52, 3, 52, 3, 52, 3, 52, 5, 52, 602, 10, 52, 7, 52, 604, 10, 52, 12, 52, 14, 52, 607, 11, 52, 3, 53, 3, 53, 3, 53, 7, 53, 612, 10, 53, 12, 53, 14, 53, 615, 11, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 5, 54, 622, 10, 54, 3, 55, 3, 55, 3, 55, 5, 55, 627, 10, 55, 3, 55, 5, 55, 630, 10, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 5, 56, 638, 10, 56, 3, 56, 3, 56, 3, 57, 3, 57, 5, 57, 644, 10, 57, 3, 57, 3, 57, 5, 57, 648, 10, 57, 5, 57, 650, 10, 57, 3, 57, 3, 57, 3, 58, 5, 58, 655, 10, 58, 3, 58, 3, 58, 5, 58, 659, 10, 58, 3, 58, 3, 58, 5, 58, 663, 10, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 5, 59, 671, 10, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 5, 61, 681, 10, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 5, 61, 688, 10, 61, 3, 62, 3, 62, 3, 62, 5, 62, 693, 10, 62, 3, 62, 3, 62, 3, 63, 3, 63, 5, 63, 699, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 5, 64, 709, 10, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 5, 69, 727, 10, 69, 3, 69, 3, 69, 7, 69, 731, 10, 69, 12, 69, 14, 69, 734, 11, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 5, 72, 753, 10, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 5, 73, 763, 10, 73, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 5, 75, 770, 10, 75, 3, 76, 3, 76, 5, 76, 774, 10, 76, 3, 77, 3, 77, 3, 77, 3, 77, 7, 77, 780, 10, 77, 12, 77, 14, 77, 783, 11, 77, 3, 77, 5, 77, 786, 10, 77, 5, 77, 788, 10, 77, 3, 77, 3, 77, 3, 78, 5, 78, 793, 10, 78, 3, 78, 5, 78, 796, 10, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 5, 79, 804, 10, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 7, 79, 821, 10, 79, 12, 79, 14, 79, 824, 11, 79, 3, 80, 3, 80, 3, 80, 3, 80, 5, 80, 830, 10, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 5, 80, 839, 10, 80, 7, 80, 841, 10, 80, 12, 80, 14, 80, 844, 11, 80, 3, 81, 3, 81, 3, 81, 3, 81, 5, 81, 850, 10, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 5, 82, 857, 10, 82, 3, 82, 3, 82, 3, 82, 3, 82, 5, 82, 863, 10, 82, 3, 83, 3, 83, 3, 83, 5, 83, 868, 10, 83, 3, 84, 3, 84, 3, 84, 3, 84, 5, 84, 874, 10, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 87, 3, 87, 3, 88, 3, 88, 3, 88, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 5, 89, 897, 10, 89, 5, 89, 899, 10, 89, 3, 90, 3, 90, 3, 90, 5, 90, 904, 10, 90, 5, 90, 906, 10, 90, 3, 90, 3, 90, 3, 91, 3, 91, 3, 91, 7, 91, 913, 10, 91, 12, 91, 14, 91, 916, 11, 91, 3, 92, 3, 92, 3, 92, 5, 92, 921, 10, 92, 3, 92, 3, 92, 3, 93, 3, 93, 5, 93, 927, 10, 93, 3, 94, 3, 94, 5, 94, 931, 10, 94, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 7, 95, 938, 10, 95, 12, 95, 14, 95, 941, 11, 95, 3, 95, 3, 95, 3, 96, 3, 96, 3, 96, 3, 96, 5, 96, 949, 10, 96, 3, 96, 5, 96, 952, 10, 96, 3, 97, 3, 97, 3, 98, 5, 98, 957, 10, 98, 3, 98, 3, 98, 5, 98, 961, 10, 98, 3, 99, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 5, 101, 973, 10, 101, 3, 101, 3, 101, 5, 101, 977, 10, 101, 3, 101, 5, 101, 980, 10, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 5, 101, 987, 10, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 5, 103, 1001, 10, 103, 5, 103, 1003, 10, 103, 3, 103, 5, 103, 1006, 10, 103, 3, 103, 5, 103, 1009, 10, 103, 5, 103, 1011, 10, 103, 3, 103, 3, 103, 3, 104, 3, 104, 3, 104, 3, 104, 3, 105, 3, 105, 3, 105, 3, 105, 5, 105, 1023, 10, 105, 3, 105, 2, 4, 156, 158, 106, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 2, 12, 4, 2, 29, 29, 40, 40, 4, 2, 84, 84, 86, 86, 3, 2, 41, 42, 4, 2, 53, 58, 61, 65, 3, 2, 60, 66, 4, 2, 54, 58, 64, 65, 4, 2, 53, 53, 61, 63, 3, 2, 47, 52, 4, 2, 67, 70, 74, 75, 3, 2, 81, 82, 2, 1090, 2, 210, 3, 2, 2, 2, 4, 234, 3, 2, 2, 2, 6, 237, 3, 2, 2, 2, 8, 252, 3, 2, 2, 2, 10, 256, 3, 2, 2, 2, 12, 261, 3, 2, 2, 2, 14, 263, 3, 2, 2, 2, 16, 277, 3, 2, 2, 2, 18, 285, 3, 2, 2, 2, 20, 293, 3, 2, 2, 2, 22, 301, 3, 2, 2, 2, 24, 306, 3, 2, 2, 2, 26, 325, 3, 2, 2, 2, 28, 327, 3, 2, 2, 2, 30, 331, 3, 2, 2, 2, 32, 337, 3, 2, 2, 2, 34, 348, 3, 2, 2, 2, 36, 351, 3, 2, 2, 2, 38, 360, 3, 2, 2, 2, 40, 364, 3, 2, 2, 2, 42, 373, 3, 2, 2, 2, 44, 380, 3, 2, 2, 2, 46, 382, 3, 2, 2, 2, 48, 396, 3, 2, 2, 2, 50, 406, 3, 2, 2, 2, 52, 424, 3, 2, 2, 2, 54, 443, 3, 2, 2, 2, 56, 450, 3, 2, 2, 2, 58, 452, 3, 2, 2, 2, 60, 454, 3, 2, 2, 2, 62, 458, 3, 2, 2, 2, 64, 461, 3, 2, 2, 2, 66, 466, 3, 2, 2, 2, 68, 470, 3, 2, 2, 2, 70, 474, 3, 2, 2, 2, 72, 479, 3, 2, 2, 2, 74, 483, 3, 2, 2, 2, 76, 487, 3, 2, 2, 2, 78, 491, 3, 2, 2, 2, 80, 494, 3, 2, 2, 2, 82, 496, 3, 2, 2, 2, 84, 499, 3, 2, 2, 2, 86, 520, 3, 2, 2, 2, 88, 522, 3, 2, 2, 2, 90, 544, 3, 2, 2, 2, 92, 552, 3, 2, 2, 2, 94, 554, 3, 2, 2, 2, 96, 576, 3, 2, 2, 2, 98, 584, 3, 2, 2, 2, 100, 592, 3, 2, 2, 2, 102, 596, 3, 2, 2, 2, 104, 608, 3, 2, 2, 2, 106, 618, 3, 2, 2, 2, 108, 629, 3, 2, 2, 2, 110, 637, 3, 2, 2, 2, 112, 641, 3, 2, 2, 2, 114, 654, 3, 2, 2, 2, 116, 670, 3, 2, 2, 2, 118, 675, 3, 2, 2, 2, 120, 687, 3, 2, 2, 2, 122, 689, 3, 2, 2, 2, 124, 698, 3, 2, 2, 2, 126, 708, 3, 2, 2, 2, 128, 710, 3, 2, 2, 2, 130, 715, 3, 2, 2, 2, 132, 717, 3, 2, 2, 2, 134, 719, 3, 2, 2, 2, 136, 722, 3, 2, 2, 2, 138, 737, 3, 2, 2, 2, 140, 741, 3, 2, 2, 2, 142, 752, 3, 2, 2, 2, 144, 762, 3, 2, 2, 2, 146, 764, 3, 2, 2, 2, 148, 767, 3, 2, 2, 2, 150, 773, 3, 2, 2, 2, 152, 775, 3, 2, 2, 2, 154, 792, 3, 2, 2, 2, 156, 803, 3, 2, 2, 2, 158, 829, 3, 2, 2, 2, 160, 845, 3, 2, 2, 2, 162, 862, 3, 2, 2, 2, 164, 867, 3, 2, 2, 2, 166, 873, 3, 2, 2, 2, 168, 875, 3, 2, 2, 2, 170, 877, 3, 2, 2, 2, 172, 879, 3, 2, 2, 2, 174, 883, 3, 2, 2, 2, 176, 898, 3, 2, 2, 2, 178, 900, 3, 2, 2, 2, 180, 909, 3, 2, 2, 2, 182, 920, 3, 2, 2, 2, 184, 926, 3, 2, 2, 2, 186, 930, 3, 2, 2, 2, 188, 932, 3, 2, 2, 2, 190, 948, 3, 2, 2, 2, 192, 953, 3, 2, 2, 2, 194, 956, 3, 2, 2, 2, 196, 962, 3, 2, 2, 2, 198, 966, 3, 2, 2, 2, 200, 970, 3, 2, 2, 2, 202, 990, 3, 2, 2, 2, 204, 995, 3, 2, 2, 2, 206, 1014, 3, 2, 2, 2, 208, 1022, 3, 2, 2, 2, 210, 211, 5, 4, 3, 2, 211, 217, 5, 208, 105, 2, 212, 213, 5, 6, 4, 2, 213, 214, 5, 208, 105, 2, 214, 216, 3, 2, 2, 2, 215, 212, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 229, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 224, 5, 40, 21, 2, 221, 224, 5, 42, 22, 2, 222, 224, 5, 12, 7, 2, 223, 220, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 222, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 226, 5, 208, 105, 2, 226, 228, 3, 2, 2, 2, 227, 223, 3, 2, 2, 2, 228, 231, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 229, 230, 3, 2, 2, 2, 230, 232, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 232, 233, 7, 2, 2, 3, 233, 3, 3, 2, 2, 2, 234, 235, 7, 16, 2, 2, 235, 236, 7, 29, 2, 2, 236, 5, 3, 2, 2, 2, 237, 249, 7, 25, 2, 2, 238, 250, 5, 8, 5, 2, 239, 245, 7, 30, 2, 2, 240, 241, 5, 8, 5, 2, 241, 242, 5, 208, 105, 2, 242, 244, 3, 2, 2, 2, 243, 240, 3, 2, 2, 2, 244, 247, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 245, 246, 3, 2, 2, 2, 246, 248, 3, 2, 2, 2, 247, 245, 3, 2, 2, 2, 248, 250, 7, 31, 2, 2, 249, 238, 3, 2, 2, 2, 249, 239, 3, 2, 2, 2, 250, 7, 3, 2, 2, 2, 251, 253, 9, 2, 2, 2, 252, 251, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 255, 5, 10, 6, 2, 255, 9, 3, 2, 2, 2, 256, 257, 5, 192, 97, 2, 257, 11, 3, 2, 2, 2, 258, 262, 5, 14, 8, 2, 259, 262, 5, 24, 13, 2, 260, 262, 5, 46, 24, 2, 261, 258, 3, 2, 2, 2, 261, 259, 3, 2, 2, 2, 261, 260, 3, 2, 2, 2, 262, 13, 3, 2, 2, 2, 263, 275, 7, 18, 2, 2, 264, 276, 5, 16, 9, 2, 265, 271, 7, 30, 2, 2, 266, 267, 5, 16, 9, 2, 267, 268, 5, 208, 105, 2, 268, 270, 3, 2, 2, 2, 269, 266, 3, 2, 2, 2, 270, 273, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 274, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 274, 276, 7, 31, 2, 2, 275, 264, 3, 2, 2, 2, 275, 265, 3, 2, 2, 2, 276, 15, 3, 2, 2, 2, 277, 283, 5, 18, 10, 2, 278, 280, 5, 120, 61, 2, 279, 278, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 282, 7, 36, 2, 2, 282, 284, 5, 20, 11, 2, 283, 279, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 17, 3, 2, 2, 2, 285, 290, 7, 29, 2, 2, 286, 287, 7, 37, 2, 2, 287, 289, 7, 29, 2, 2, 288, 286, 3, 2, 2, 2, 289, 292, 3, 2, 2, 2, 290, 288, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 19, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 293, 298, 5, 156, 79, 2, 294, 295, 7, 37, 2, 2, 295, 297, 5, 156, 79, 2, 296, 294, 3, 2, 2, 2, 297, 300, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 21, 3, 2, 2, 2, 300, 298, 3, 2, 2, 2, 301, 302, 9, 3, 2, 2, 302, 23, 3, 2, 2, 2, 303, 305, 5, 22, 12, 2, 304, 303, 3, 2, 2, 2, 305, 308, 3, 2, 2, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 309, 3, 2, 2, 2, 308, 306, 3, 2, 2, 2, 309, 321, 7, 22, 2, 2, 310, 322, 5, 26, 14, 2, 311, 317, 7, 30, 2, 2, 312, 313, 5, 26, 14, 2, 313, 314, 5, 208, 105, 2, 314, 316, 3, 2, 2, 2, 315, 312, 3, 2, 2, 2, 316, 319, 3, 2, 2, 2, 317, 315, 3, 2, 2, 2, 317, 318, 3, 2, 2, 2, 318, 320, 3, 2, 2, 2, 319, 317, 3, 2, 2, 2, 320, 322, 7, 31, 2, 2, 321, 310, 3, 2, 2, 2, 321, 311, 3, 2, 2, 2, 322, 25, 3, 2, 2, 2, 323, 326, 5, 28, 15, 2, 324, 326, 5, 30, 16, 2, 325, 323, 3, 2, 2, 2, 325, 324, 3, 2, 2, 2, 326, 27, 3, 2, 2, 2, 327, 328, 7, 29, 2, 2, 328, 329, 7, 36, 2, 2, 329, 330, 5, 120, 61, 2, 330, 29, 3, 2, 2, 2, 331, 333, 7, 29, 2, 2, 332, 334, 5, 32, 17, 2, 333, 332, 3, 2, 2, 2, 333, 334, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 336, 5, 120, 61, 2, 336, 31, 3, 2, 2, 2, 337, 338, 7, 34, 2, 2, 338, 343, 5, 34, 18, 2, 339, 340, 7, 37, 2, 2, 340, 342, 5, 34, 18, 2, 341, 339, 3, 2, 2, 2, 342, 345, 3, 2, 2, 2, 343, 341, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 346, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 346, 347, 7, 35, 2, 2, 347, 33, 3, 2, 2, 2, 348, 349, 5, 18, 10, 2, 349, 350, 5, 36, 19, 2, 350, 35, 3, 2, 2, 2, 351, 356, 5, 38, 20, 2, 352, 353, 7, 53, 2, 2, 353, 355, 5, 38, 20, 2, 354, 352, 3, 2, 2, 2, 355, 358, 3, 2, 2, 2, 356, 354, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 37, 3, 2, 2, 2, 358, 356, 3, 2, 2, 2, 359, 361, 7, 59, 2, 2, 360, 359, 3, 2, 2, 2, 360, 361, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 363, 5, 120, 61, 2, 363, 39, 3, 2, 2, 2, 364, 365, 7, 5, 2, 2, 365, 367, 7, 29, 2, 2, 366, 368, 5, 32, 17, 2, 367, 366, 3, 2, 2, 2, 367, 368, 3, 2, 2, 2, 368, 369, 3, 2, 2, 2, 369, 371, 5, 148, 75, 2, 370, 372, 5, 50, 26, 2, 371, 370, 3, 2, 2, 2, 371, 372, 3, 2, 2, 2, 372, 41, 3, 2, 2, 2, 373, 374, 7, 5, 2, 2, 374, 375, 5, 44, 23, 2, 375, 376, 7, 29, 2, 2, 376, 378, 5, 148, 75, 2, 377, 379, 5, 50, 26, 2, 378, 377, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 43, 3, 2, 2, 2, 380, 381, 5, 152, 77, 2, 381, 45, 3, 2, 2, 2, 382, 394, 7, 27, 2, 2, 383, 395, 5, 48, 25, 2, 384, 390, 7, 30, 2, 2, 385, 386, 5, 48, 25, 2, 386, 387, 5, 208, 105, 2, 387, 389, 3, 2, 2, 2, 388, 385, 3, 2, 2, 2, 389, 392, 3, 2, 2, 2, 390, 388, 3, 2, 2, 2, 390, 391, 3, 2, 2, 2, 391, 393, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 393, 395, 7, 31, 2, 2, 394, 383, 3, 2, 2, 2, 394, 384, 3, 2, 2, 2, 395, 47, 3, 2, 2, 2, 396, 404, 5, 18, 10, 2, 397, 400, 5, 120, 61, 2, 398, 399, 7, 36, 2, 2, 399, 401, 5, 20, 11, 2, 400, 398, 3, 2, 2, 2, 400, 401, 3, 2, 2, 2, 401, 405, 3, 2, 2, 2, 402, 403, 7, 36, 2, 2, 403, 405, 5, 20, 11, 2, 404, 397, 3, 2, 2, 2, 404, 402, 3, 2, 2, 2, 405, 49, 3, 2, 2, 2, 406, 408, 7, 32, 2, 2, 407, 409, 5, 52, 27, 2, 408, 407, 3, 2, 2, 2, 408, 409, 3, 2, 2, 2, 409, 410, 3, 2, 2, 2, 410, 411, 7, 33, 2, 2, 411, 51, 3, 2, 2, 2, 412, 414, 7, 38, 2, 2, 413, 412, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 420, 3, 2, 2, 2, 415, 417, 7, 91, 2, 2, 416, 415, 3, 2, 2, 2, 416, 417, 3, 2, 2, 2, 417, 420, 3, 2, 2, 2, 418, 420, 6, 27, 2, 2, 419, 413, 3, 2, 2, 2, 419, 416, 3, 2, 2, 2, 419, 418, 3, 2, 2, 2, 420, 421, 3, 2, 2, 2, 421, 422, 5, 54, 28, 2, 422, 423, 5, 208, 105, 2, 423, 425, 3, 2, 2, 2, 424, 419, 3, 2, 2, 2, 425, 426, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 53, 3, 2, 2, 2, 428, 444, 5, 12, 7, 2, 429, 444, 5, 70, 36, 2, 430, 444, 5, 56, 29, 2, 431, 444, 5, 118, 60, 2, 432, 444, 5, 72, 37, 2, 433, 444, 5, 74, 38, 2, 434, 444, 5, 76, 39, 2, 435, 444, 5, 78, 40, 2, 436, 444, 5, 80, 41, 2, 437, 444, 5, 50, 26, 2, 438, 444, 5, 84, 43, 2, 439, 444, 5, 86, 44, 2, 440, 444, 5, 104, 53, 2, 441, 444, 5, 112, 57, 2, 442, 444, 5, 82, 42, 2, 443, 428, 3, 2, 2, 2, 443, 429, 3, 2, 2, 2, 443, 430, 3, 2, 2, 2, 443, 431, 3, 2, 2, 2, 443, 432, 3, 2, 2, 2, 443, 433, 3, 2, 2, 2, 443, 434, 3, 2, 2, 2, 443, 435, 3, 2, 2, 2, 443, 436, 3, 2, 2, 2, 443, 437, 3, 2, 2, 2, 443, 438, 3, 2, 2, 2, 443, 439, 3, 2, 2, 2, 443, 440, 3, 2, 2, 2, 443, 441, 3, 2, 2, 2, 443, 442, 3, 2, 2, 2, 444, 55, 3, 2, 2, 2, 445, 451, 5, 60, 31, 2, 446, 451, 5, 62, 32, 2, 447, 451, 5, 64, 33, 2, 448, 451, 5, 58, 30, 2, 449, 451, 5, 68, 35, 2, 450, 445, 3, 2, 2, 2, 450, 446, 3, 2, 2, 2, 450, 447, 3, 2, 2, 2, 450, 448, 3, 2, 2, 2, 450, 449, 3, 2, 2, 2, 451, 57, 3, 2, 2, 2, 452, 453, 5, 156, 79, 2, 453, 59, 3, 2, 2, 2, 454, 455, 5, 156, 79, 2, 455, 456, 7, 66, 2, 2, 456, 457, 5, 156, 79, 2, 457, 61, 3, 2, 2, 2, 458, 459, 5, 156, 79, 2, 459, 460, 9, 4, 2, 2, 460, 63, 3, 2, 2, 2, 461, 462, 5, 20, 11, 2, 462, 463, 5, 66, 34, 2, 463, 464, 5, 20, 11, 2, 464, 65, 3, 2, 2, 2, 465, 467, 9, 5, 2, 2, 466, 465, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 469, 7, 36, 2, 2, 469, 67, 3, 2, 2, 2, 470, 471, 5, 18, 10, 2, 471, 472, 7, 43, 2, 2, 472, 473, 5, 20, 11, 2, 473, 69, 3, 2, 2, 2, 474, 475, 7, 29, 2, 2, 475, 477, 7, 39, 2, 2, 476, 478, 5, 54, 28, 2, 477, 476, 3, 2, 2, 2, 477, 478, 3, 2, 2, 2, 478, 71, 3, 2, 2, 2, 479, 481, 7, 26, 2, 2, 480, 482, 5, 20, 11, 2, 481, 480, 3, 2, 2, 2, 481, 482, 3, 2, 2, 2, 482, 73, 3, 2, 2, 2, 483, 485, 7, 3, 2, 2, 484, 486, 7, 29, 2, 2, 485, 484, 3, 2, 2, 2, 485, 486, 3, 2, 2, 2, 486, 75, 3, 2, 2, 2, 487, 489, 7, 23, 2, 2, 488, 490, 7, 29, 2, 2, 489, 488, 3, 2, 2, 2, 489, 490, 3, 2, 2, 2, 490, 77, 3, 2, 2, 2, 491, 492, 7, 15, 2, 2, 492, 493, 7, 29, 2, 2, 493, 79, 3, 2, 2, 2, 494, 495, 7, 19, 2, 2, 495, 81, 3, 2, 2, 2, 496, 497, 7, 9, 2, 2, 497, 498, 5, 156, 79, 2, 498, 83, 3, 2, 2, 2, 499, 508, 7, 20, 2, 2, 500, 509, 5, 156, 79, 2, 501, 502, 5, 208, 105, 2, 502, 503, 5, 156, 79, 2, 503, 509, 3, 2, 2, 2, 504, 505, 5, 56, 29, 2, 505, 506, 5, 208, 105, 2, 506, 507, 5, 156, 79, 2, 507, 509, 3, 2, 2, 2, 508, 500, 3, 2, 2, 2, 508, 501, 3, 2, 2, 2, 508, 504, 3, 2, 2, 2, 509, 510, 3, 2, 2, 2, 510, 516, 5, 50, 26, 2, 511, 514, 7, 14, 2, 2, 512, 515, 5, 84, 43, 2, 513, 515, 5, 50, 26, 2, 514, 512, 3, 2, 2, 2, 514, 513, 3, 2, 2, 2, 515, 517, 3, 2, 2, 2, 516, 511, 3, 2, 2, 2, 516, 517, 3, 2, 2, 2, 517, 85, 3, 2, 2, 2, 518, 521, 5, 88, 45, 2, 519, 521, 5, 94, 48, 2, 520, 518, 3, 2, 2, 2, 520, 519, 3, 2, 2, 2, 521, 87, 3, 2, 2, 2, 522, 533, 7, 17, 2, 2, 523, 525, 5, 156, 79, 2, 524, 523, 3, 2, 2, 2, 524, 525, 3, 2, 2, 2, 525, 534, 3, 2, 2, 2, 526, 528, 5, 56, 29, 2, 527, 526, 3, 2, 2, 2, 527, 528, 3, 2, 2, 2, 528, 529, 3, 2, 2, 2, 529, 531, 5, 208, 105, 2, 530, 532, 5, 156, 79, 2, 531, 530, 3, 2, 2, 2, 531, 532, 3, 2, 2, 2, 532, 534, 3, 2, 2, 2, 533, 524, 3, 2, 2, 2, 533, 527, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 539, 7, 32, 2, 2, 536, 538, 5, 90, 46, 2, 537, 536, 3, 2, 2, 2, 538, 541, 3, 2, 2, 2, 539, 537, 3, 2, 2, 2, 539, 540, 3, 2, 2, 2, 540, 542, 3, 2, 2, 2, 541, 539, 3, 2, 2, 2, 542, 543, 7, 33, 2, 2, 543, 89, 3, 2, 2, 2, 544, 545, 5, 92, 47, 2, 545, 547, 7, 39, 2, 2, 546, 548, 5, 52, 27, 2, 547, 546, 3, 2, 2, 2, 547, 548, 3, 2, 2, 2, 548, 91, 3, 2, 2, 2, 549, 550, 7, 8, 2, 2, 550, 553, 5, 20, 11, 2, 551, 553, 7, 4, 2, 2, 552, 549, 3, 2, 2, 2, 552, 551, 3, 2, 2, 2, 553, 93, 3, 2, 2, 2, 554, 563, 7, 17, 2, 2, 555, 564, 5, 96, 49, 2, 556, 557, 5, 208, 105, 2, 557, 558, 5, 96, 49, 2, 558, 564, 3, 2, 2, 2, 559, 560, 5, 56, 29, 2, 560, 561, 5, 208, 105, 2, 561, 562, 5, 96, 49, 2, 562, 564, 3, 2, 2, 2, 563, 555, 3, 2, 2, 2, 563, 556, 3, 2, 2, 2, 563, 559, 3, 2, 2, 2, 564, 565, 3, 2, 2, 2, 565, 569, 7, 32, 2, 2, 566, 568, 5, 98, 50, 2, 567, 566, 3, 2, 2, 2, 568, 571, 3, 2, 2, 2, 569, 567, 3, 2, 2, 2, 569, 570, 3, 2, 2, 2, 570, 572, 3, 2, 2, 2, 571, 569, 3, 2, 2, 2, 572, 573, 7, 33, 2, 2, 573, 95, 3, 2, 2, 2, 574, 575, 7, 29, 2, 2, 575, 577, 7, 43, 2, 2, 576, 574, 3, 2, 2, 2, 576, 577, 3, 2, 2, 2, 577, 578, 3, 2, 2, 2, 578, 579, 5, 158, 80, 2, 579, 580, 7, 40, 2, 2, 580, 581, 7, 30, 2, 2, 581, 582, 7, 22, 2, 2, 582, 583, 7, 31, 2, 2, 583, 97, 3, 2, 2, 2, 584, 585, 5, 100, 51, 2, 585, 587, 7, 39, 2, 2, 586, 588, 5, 52, 27, 2, 587, 586, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 99, 3, 2, 2, 2, 589, 590, 7, 8, 2, 2, 590, 593, 5, 102, 52, 2, 591, 593, 7, 4, 2, 2, 592, 589, 3, 2, 2, 2, 592, 591, 3, 2, 2, 2, 593, 101, 3, 2, 2, 2, 594, 597, 5, 120, 61, 2, 595, 597, 7, 28, 2, 2, 596, 594, 3, 2, 2, 2, 596, 595, 3, 2, 2, 2, 597, 605, 3, 2, 2, 2, 598, 601, 7, 37, 2, 2, 599, 602, 5, 120, 61, 2, 600, 602, 7, 28, 2, 2, 601, 599, 3, 2, 2, 2, 601, 600, 3, 2, 2, 2, 602, 604, 3, 2, 2, 2, 603, 598, 3, 2, 2, 2, 604, 607, 3, 2, 2, 2, 605, 603, 3, 2, 2, 2, 605, 606, 3, 2, 2, 2, 606, 103, 3, 2, 2, 2, 607, 605, 3, 2, 2, 2, 608, 609, 7, 7, 2, 2, 609, 613, 7, 32, 2, 2, 610, 612, 5, 106, 54, 2, 611, 610, 3, 2, 2, 2, 612, 615, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 613, 614, 3, 2, 2, 2, 614, 616, 3, 2, 2, 2, 615, 613, 3, 2, 2, 2, 616, 617, 7, 33, 2, 2, 617, 105, 3, 2, 2, 2, 618, 619, 5, 108, 55, 2, 619, 621, 7, 39, 2, 2, 620, 622, 5, 52, 27, 2, 621, 620, 3, 2, 2, 2, 621, 622, 3, 2, 2, 2, 622, 107, 3, 2, 2, 2, 623, 626, 7, 8, 2, 2, 624, 627, 5, 60, 31, 2, 625, 627, 5, 110, 56, 2, 626, 624, 3, 2, 2, 2, 626, 625, 3, 2, 2, 2, 627, 630, 3, 2, 2, 2, 628, 630, 7, 4, 2, 2, 629, 623, 3, 2, 2, 2, 629, 628, 3, 2, 2, 2, 630, 109, 3, 2, 2, 2, 631, 632, 5, 20, 11, 2, 632, 633, 7, 36, 2, 2, 633, 638, 3, 2, 2, 2, 634, 635, 5, 18, 10, 2, 635, 636, 7, 43, 2, 2, 636, 638, 3, 2, 2, 2, 637, 631, 3, 2, 2, 2, 637, 634, 3, 2, 2, 2, 637, 638, 3, 2, 2, 2, 638, 639, 3, 2, 2, 2, 639, 640, 5, 156, 79, 2, 640, 111, 3, 2, 2, 2, 641, 649, 7, 24, 2, 2, 642, 644, 5, 156, 79, 2, 643, 642, 3, 2, 2, 2, 643, 644, 3, 2, 2, 2, 644, 650, 3, 2, 2, 2, 645, 650, 5, 114, 58, 2, 646, 648, 5, 116, 59, 2, 647, 646, 3, 2, 2, 2, 647, 648, 3, 2, 2, 2, 648, 650, 3, 2, 2, 2, 649, 643, 3, 2, 2, 2, 649, 645, 3, 2, 2, 2, 649, 647, 3, 2, 2, 2, 650, 651, 3, 2, 2, 2, 651, 652, 5, 50, 26, 2, 652, 113, 3, 2, 2, 2, 653, 655, 5, 56, 29, 2, 654, 653, 3, 2, 2, 2, 654, 655, 3, 2, 2, 2, 655, 656, 3, 2, 2, 2, 656, 658, 5, 208, 105, 2, 657, 659, 5, 156, 79, 2, 658, 657, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 662, 5, 208, 105, 2, 661, 663, 5, 56, 29, 2, 662, 661, 3, 2, 2, 2, 662, 663, 3, 2, 2, 2, 663, 115, 3, 2, 2, 2, 664, 665, 5, 20, 11, 2, 665, 666, 7, 36, 2, 2, 666, 671, 3, 2, 2, 2, 667, 668, 5, 18, 10, 2, 668, 669, 7, 43, 2, 2, 669, 671, 3, 2, 2, 2, 670, 664, 3, 2, 2, 2, 670, 667, 3, 2, 2, 2, 670, 671, 3, 2, 2, 2, 671, 672, 3, 2, 2, 2, 672, 673, 7, 21, 2, 2, 673, 674, 5, 156, 79, 2, 674, 117, 3, 2, 2, 2, 675, 676, 7, 10, 2, 2, 676, 677, 5, 156, 79, 2, 677, 119, 3, 2, 2, 2, 678, 680, 5, 124, 63, 2, 679, 681, 5, 122, 62, 2, 680, 679, 3, 2, 2, 2, 680, 681, 3, 2, 2, 2, 681, 688, 3, 2, 2, 2, 682, 688, 5, 126, 64, 2, 683, 684, 7, 30, 2, 2, 684, 685, 5, 120, 61, 2, 685, 686, 7, 31, 2, 2, 686, 688, 3, 2, 2, 2, 687, 678, 3, 2, 2, 2, 687, 682, 3, 2, 2, 2, 687, 683, 3, 2, 2, 2, 688, 121, 3, 2, 2, 2, 689, 690, 7, 34, 2, 2, 690, 692, 5, 102, 52, 2, 691, 693, 7, 37, 2, 2, 692, 691, 3, 2, 2, 2, 692, 693, 3, 2, 2, 2, 693, 694, 3, 2, 2, 2, 694, 695, 7, 35, 2, 2, 695, 123, 3, 2, 2, 2, 696, 699, 5, 172, 87, 2, 697, 699, 7, 29, 2, 2, 698, 696, 3, 2, 2, 2, 698, 697, 3, 2, 2, 2, 699, 125, 3, 2, 2, 2, 700, 709, 5, 128, 65, 2, 701, 709, 5, 188, 95, 2, 702, 709, 5, 134, 68, 2, 703, 709, 5, 146, 74, 2, 704, 709, 5, 136, 69, 2, 705, 709, 5, 138, 70, 2, 706, 709, 5, 140, 71, 2, 707, 709, 5, 142, 72, 2, 708, 700, 3, 2, 2, 2, 708, 701, 3, 2, 2, 2, 708, 702, 3, 2, 2, 2, 708, 703, 3, 2, 2, 2, 708, 704, 3, 2, 2, 2, 708, 705, 3, 2, 2, 2, 708, 706, 3, 2, 2, 2, 708, 707, 3, 2, 2, 2, 709, 127, 3, 2, 2, 2, 710, 711, 7, 34, 2, 2, 711, 712, 5, 130, 66, 2, 712, 713, 7, 35, 2, 2, 713, 714, 5, 132, 67, 2, 714, 129, 3, 2, 2, 2, 715, 716, 5, 156, 79, 2, 716, 131, 3, 2, 2, 2, 717, 718, 5, 120, 61, 2, 718, 133, 3, 2, 2, 2, 719, 720, 7, 64, 2, 2, 720, 721, 5, 120, 61, 2, 721, 135, 3, 2, 2, 2, 722, 723, 7, 6, 2, 2, 723, 732, 7, 32, 2, 2, 724, 727, 5, 144, 73, 2, 725, 727, 5, 36, 19, 2, 726, 724, 3, 2, 2, 2, 726, 725, 3, 2, 2, 2, 727, 728, 3, 2, 2, 2, 728, 729, 5, 208, 105, 2, 729, 731, 3, 2, 2, 2, 730, 726, 3, 2, 2, 2, 731, 734, 3, 2, 2, 2, 732, 730, 3, 2, 2, 2, 732, 733, 3, 2, 2, 2, 733, 735, 3, 2, 2, 2, 734, 732, 3, 2, 2, 2, 735, 736, 7, 33, 2, 2, 736, 137, 3, 2, 2, 2, 737, 738, 7, 34, 2, 2, 738, 739, 7, 35, 2, 2, 739, 740, 5, 132, 67, 2, 740, 139, 3, 2, 2, 2, 741, 742, 7, 11, 2, 2, 742, 743, 7, 34, 2, 2, 743, 744, 5, 120, 61, 2, 744, 745, 7, 35, 2, 2, 745, 746, 5, 132, 67, 2, 746, 141, 3, 2, 2, 2, 747, 753, 7, 13, 2, 2, 748, 749, 7, 13, 2, 2, 749, 753, 7, 66, 2, 2, 750, 751, 7, 66, 2, 2, 751, 753, 7, 13, 2, 2, 752, 747, 3, 2, 2, 2, 752, 748, 3, 2, 2, 2, 752, 750, 3, 2, 2, 2, 753, 754, 3, 2, 2, 2, 754, 755, 5, 132, 67, 2, 755, 143, 3, 2, 2, 2, 756, 757, 7, 29, 2, 2, 757, 758, 5, 152, 77, 2, 758, 759, 5, 150, 76, 2, 759, 763, 3, 2, 2, 2, 760, 761, 7, 29, 2, 2, 761, 763, 5, 152, 77, 2, 762, 756, 3, 2, 2, 2, 762, 760, 3, 2, 2, 2, 763, 145, 3, 2, 2, 2, 764, 765, 7, 5, 2, 2, 765, 766, 5, 148, 75, 2, 766, 147, 3, 2, 2, 2, 767, 769, 5, 152, 77, 2, 768, 770, 5, 150, 76, 2, 769, 768, 3, 2, 2, 2, 769, 770, 3, 2, 2, 2, 770, 149, 3, 2, 2, 2, 771, 774, 5, 152, 77, 2, 772, 774, 5, 120, 61, 2, 773, 771, 3, 2, 2, 2, 773, 772, 3, 2, 2, 2, 774, 151, 3, 2, 2, 2, 775, 787, 7, 30, 2, 2, 776, 781, 5, 154, 78, 2, 777, 778, 7, 37, 2, 2, 778, 780, 5, 154, 78, 2, 779, 777, 3, 2, 2, 2, 780, 783, 3, 2, 2, 2, 781, 779, 3, 2, 2, 2, 781, 782, 3, 2, 2, 2, 782, 785, 3, 2, 2, 2, 783, 781, 3, 2, 2, 2, 784, 786, 7, 37, 2, 2, 785, 784, 3, 2, 2, 2, 785, 786, 3, 2, 2, 2, 786, 788, 3, 2, 2, 2, 787, 776, 3, 2, 2, 2, 787, 788, 3, 2, 2, 2, 788, 789, 3, 2, 2, 2, 789, 790, 7, 31, 2, 2, 790, 153, 3, 2, 2, 2, 791, 793, 5, 18, 10, 2, 792, 791, 3, 2, 2, 2, 792, 793, 3, 2, 2, 2, 793, 795, 3, 2, 2, 2, 794, 796, 7, 44, 2, 2, 795, 794, 3, 2, 2, 2, 795, 796, 3, 2, 2, 2, 796, 797, 3, 2, 2, 2, 797, 798, 5, 120, 61, 2, 798, 155, 3, 2, 2, 2, 799, 800, 8, 79, 1, 2, 800, 804, 5, 158, 80, 2, 801, 802, 9, 6, 2, 2, 802, 804, 5, 156, 79, 8, 803, 799, 3, 2, 2, 2, 803, 801, 3, 2, 2, 2, 804, 822, 3, 2, 2, 2, 805, 806, 12, 7, 2, 2, 806, 807, 9, 7, 2, 2, 807, 821, 5, 156, 79, 8, 808, 809, 12, 6, 2, 2, 809, 810, 9, 8, 2, 2, 810, 821, 5, 156, 79, 7, 811, 812, 12, 5, 2, 2, 812, 813, 9, 9, 2, 2, 813, 821, 5, 156, 79, 6, 814, 815, 12, 4, 2, 2, 815, 816, 7, 46, 2, 2, 816, 821, 5, 156, 79, 5, 817, 818, 12, 3, 2, 2, 818, 819, 7, 45, 2, 2, 819, 821, 5, 156, 79, 4, 820, 805, 3, 2, 2, 2, 820, 808, 3, 2, 2, 2, 820, 811, 3, 2, 2, 2, 820, 814, 3, 2, 2, 2, 820, 817, 3, 2, 2, 2, 821, 824, 3, 2, 2, 2, 822, 820, 3, 2, 2, 2, 822, 823, 3, 2, 2, 2, 823, 157, 3, 2, 2, 2, 824, 822, 3, 2, 2, 2, 825, 826, 8, 80, 1, 2, 826, 830, 5, 162, 82, 2, 827, 830, 5, 160, 81, 2, 828, 830, 5, 206, 104, 2, 829, 825, 3, 2, 2, 2, 829, 827, 3, 2, 2, 2, 829, 828, 3, 2, 2, 2, 830, 842, 3, 2, 2, 2, 831, 838, 12, 3, 2, 2, 832, 833, 7, 40, 2, 2, 833, 839, 7, 29, 2, 2, 834, 839, 5, 198, 100, 2, 835, 839, 5, 200, 101, 2, 836, 839, 5, 202, 102, 2, 837, 839, 5, 204, 103, 2, 838, 832, 3, 2, 2, 2, 838, 834, 3, 2, 2, 2, 838, 835, 3, 2, 2, 2, 838, 836, 3, 2, 2, 2, 838, 837, 3, 2, 2, 2, 839, 841, 3, 2, 2, 2, 840, 831, 3, 2, 2, 2, 841, 844, 3, 2, 2, 2, 842, 840, 3, 2, 2, 2, 842, 843, 3, 2, 2, 2, 843, 159, 3, 2, 2, 2, 844, 842, 3, 2, 2, 2, 845, 846, 5, 120, 61, 2, 846, 847, 7, 30, 2, 2, 847, 849, 5, 156, 79, 2, 848, 850, 7, 37, 2, 2, 849, 848, 3, 2, 2, 2, 849, 850, 3, 2, 2, 2, 850, 851, 3, 2, 2, 2, 851, 852, 7, 31, 2, 2, 852, 161, 3, 2, 2, 2, 853, 863, 5, 164, 83, 2, 854, 856, 5, 170, 86, 2, 855, 857, 5, 122, 62, 2, 856, 855, 3, 2, 2, 2, 856, 857, 3, 2, 2, 2, 857, 863, 3, 2, 2, 2, 858, 859, 7, 30, 2, 2, 859, 860, 5, 156, 79, 2, 860, 861, 7, 31, 2, 2, 861, 863, 3, 2, 2, 2, 862, 853, 3, 2, 2, 2, 862, 854, 3, 2, 2, 2, 862, 858, 3, 2, 2, 2, 863, 163, 3, 2, 2, 2, 864, 868, 5, 166, 84, 2, 865, 868, 5, 174, 88, 2, 866, 868, 5, 196, 99, 2, 867, 864, 3, 2, 2, 2, 867, 865, 3, 2, 2, 2, 867, 866, 3, 2, 2, 2, 868, 165, 3, 2, 2, 2, 869, 874, 7, 28, 2, 2, 870, 874, 5, 168, 85, 2, 871, 874, 5, 192, 97, 2, 872, 874, 7, 71, 2, 2, 873, 869, 3, 2, 2, 2, 873, 870, 3, 2, 2, 2, 873, 871, 3, 2, 2, 2, 873, 872, 3, 2, 2, 2, 874, 167, 3, 2, 2, 2, 875, 876, 9, 10, 2, 2, 876, 169, 3, 2, 2, 2, 877, 878, 7, 29, 2, 2, 878, 171, 3, 2, 2, 2, 879, 880, 7, 29, 2, 2, 880, 881, 7, 40, 2, 2, 881, 882, 7, 29, 2, 2, 882, 173, 3, 2, 2, 2, 883, 884, 5, 176, 89, 2, 884, 885, 5, 178, 90, 2, 885, 175, 3, 2, 2, 2, 886, 899, 5, 188, 95, 2, 887, 899, 5, 128, 65, 2, 888, 889, 7, 34, 2, 2, 889, 890, 7, 44, 2, 2, 890, 891, 7, 35, 2, 2, 891, 899, 5, 132, 67, 2, 892, 899, 5, 138, 70, 2, 893, 899, 5, 140, 71, 2, 894, 896, 5, 124, 63, 2, 895, 897, 5, 122, 62, 2, 896, 895, 3, 2, 2, 2, 896, 897, 3, 2, 2, 2, 897, 899, 3, 2, 2, 2, 898, 886, 3, 2, 2, 2, 898, 887, 3, 2, 2, 2, 898, 888, 3, 2, 2, 2, 898, 892, 3, 2, 2, 2, 898, 893, 3, 2, 2, 2, 898, 894, 3, 2, 2, 2, 899, 177, 3, 2, 2, 2, 900, 905, 7, 32, 2, 2, 901, 903, 5, 180, 91, 2, 902, 904, 7, 37, 2, 2, 903, 902, 3, 2, 2, 2, 903, 904, 3, 2, 2, 2, 904, 906, 3, 2, 2, 2, 905, 901, 3, 2, 2, 2, 905, 906, 3, 2, 2, 2, 906, 907, 3, 2, 2, 2, 907, 908, 7, 33, 2, 2, 908, 179, 3, 2, 2, 2, 909, 914, 5, 182, 92, 2, 910, 911, 7, 37, 2, 2, 911, 913, 5, 182, 92, 2, 912, 910, 3, 2, 2, 2, 913, 916, 3, 2, 2, 2, 914, 912, 3, 2, 2, 2, 914, 915, 3, 2, 2, 2, 915, 181, 3, 2, 2, 2, 916, 914, 3, 2, 2, 2, 917, 918, 5, 184, 93, 2, 918, 919, 7, 39, 2, 2, 919, 921, 3, 2, 2, 2, 920, 917, 3, 2, 2, 2, 920, 921, 3, 2, 2, 2, 921, 922, 3, 2, 2, 2, 922, 923, 5, 186, 94, 2, 923, 183, 3, 2, 2, 2, 924, 927, 5, 156, 79, 2, 925, 927, 5, 178, 90, 2, 926, 924, 3, 2, 2, 2, 926, 925, 3, 2, 2, 2, 927, 185, 3, 2, 2, 2, 928, 931, 5, 156, 79, 2, 929, 931, 5, 178, 90, 2, 930, 928, 3, 2, 2, 2, 930, 929, 3, 2, 2, 2, 931, 187, 3, 2, 2, 2, 932, 933, 7, 12, 2, 2, 933, 939, 7, 32, 2, 2, 934, 935, 5, 190, 96, 2, 935, 936, 5, 208, 105, 2, 936, 938, 3, 2, 2, 2, 937, 934, 3, 2, 2, 2, 938, 941, 3, 2, 2, 2, 939, 937, 3, 2, 2, 2, 939, 940, 3, 2, 2, 2, 940, 942, 3, 2, 2, 2, 941, 939, 3, 2, 2, 2, 942, 943, 7, 33, 2, 2, 943, 189, 3, 2, 2, 2, 944, 945, 5, 18, 10, 2, 945, 946, 5, 120, 61, 2, 946, 949, 3, 2, 2, 2, 947, 949, 5, 194, 98, 2, 948, 944, 3, 2, 2, 2, 948, 947, 3, 2, 2, 2, 949, 951, 3, 2, 2, 2, 950, 952, 5, 192, 97, 2, 951, 950, 3, 2, 2, 2, 951, 952, 3, 2, 2, 2, 952, 191, 3, 2, 2, 2, 953, 954, 9, 11, 2, 2, 954, 193, 3, 2, 2, 2, 955, 957, 7, 64, 2, 2, 956, 955, 3, 2, 2, 2, 956, 957, 3, 2, 2, 2, 957, 958, 3, 2, 2, 2, 958, 960, 5, 124, 63, 2, 959, 961, 5, 122, 62, 2, 960, 959, 3, 2, 2, 2, 960, 961, 3, 2, 2, 2, 961, 195, 3, 2, 2, 2, 962, 963, 7, 5, 2, 2, 963, 964, 5, 148, 75, 2, 964, 965, 5, 50, 26, 2, 965, 197, 3, 2, 2, 2, 966, 967, 7, 34, 2, 2, 967, 968, 5, 156, 79, 2, 968, 969, 7, 35, 2, 2, 969, 199, 3, 2, 2, 2, 970, 986, 7, 34, 2, 2, 971, 973, 5, 156, 79, 2, 972, 971, 3, 2, 2, 2, 972, 973, 3, 2, 2, 2, 973, 974, 3, 2, 2, 2, 974, 976, 7, 39, 2, 2, 975, 977, 5, 156, 79, 2, 976, 975, 3, 2, 2, 2, 976, 977, 3, 2, 2, 2, 977, 987, 3, 2, 2, 2, 978, 980, 5, 156, 79, 2, 979, 978, 3, 2, 2, 2, 979, 980, 3, 2, 2, 2, 980, 981, 3, 2, 2, 2, 981, 982, 7, 39, 2, 2, 982, 983, 5, 156, 79, 2, 983, 984, 7, 39, 2, 2, 984, 985, 5, 156, 79, 2, 985, 987, 3, 2, 2, 2, 986, 972, 3, 2, 2, 2, 986, 979, 3, 2, 2, 2, 987, 988, 3, 2, 2, 2, 988, 989, 7, 35, 2, 2, 989, 201, 3, 2, 2, 2, 990, 991, 7, 40, 2, 2, 991, 992, 7, 30, 2, 2, 992, 993, 5, 120, 61, 2, 993, 994, 7, 31, 2, 2, 994, 203, 3, 2, 2, 2, 995, 1010, 7, 30, 2, 2, 996, 1003, 5, 20, 11, 2, 997, 1000, 5, 120, 61, 2, 998, 999, 7, 37, 2, 2, 999, 1001, 5, 20, 11, 2, 1000, 998, 3, 2, 2, 2, 1000, 1001, 3, 2, 2, 2, 1001, 1003, 3, 2, 2, 2, 1002, 996, 3, 2, 2, 2, 1002, 997, 3, 2, 2, 2, 1003, 1005, 3, 2, 2, 2, 1004, 1006, 7, 44, 2, 2, 1005, 1004, 3, 2, 2, 2, 1005, 1006, 3, 2, 2, 2, 1006, 1008, 3, 2, 2, 2, 1007, 1009, 7, 37, 2, 2, 1008, 1007, 3, 2, 2, 2, 1008, 1009, 3, 2, 2, 2, 1009, 1011, 3, 2, 2, 2, 1010, 1002, 3, 2, 2, 2, 1010, 1011, 3, 2, 2, 2, 1011, 1012, 3, 2, 2, 2, 1012, 1013, 7, 31, 2, 2, 1013, 205, 3, 2, 2, 2, 1014, 1015, 5, 120, 61, 2, 1015, 1016, 7, 40, 2, 2, 1016, 1017, 7, 29, 2, 2, 1017, 207, 3, 2, 2, 2, 1018, 1023, 7, 38, 2, 2, 1019, 1023, 7, 2, 2, 3, 1020, 1023, 7, 91, 2, 2, 1021, 1023, 6, 105, 9, 2, 1022, 1018, 3, 2, 2, 2, 1022, 1019, 3, 2, 2, 2, 1022, 1020, 3, 2, 2, 2, 1022, 1021, 3, 2, 2, 2, 1023, 209, 3, 2, 2, 2, 123, 217, 223, 229, 245, 249, 252, 261, 271, 275, 279, 283, 290, 298, 306, 317, 321, 325, 333, 343, 356, 360, 367, 371, 378, 390, 394, 400, 404, 408, 413, 416, 419, 426, 443, 450, 466, 477, 481, 485, 489, 508, 514, 516, 520, 524, 527, 531, 533, 539, 547, 552, 563, 569, 576, 587, 592, 596, 601, 605, 613, 621, 626, 629, 637, 643, 647, 649, 654, 658, 662, 670, 680, 687, 692, 698, 708, 726, 732, 752, 762, 769, 773, 781, 785, 787, 792, 795, 803, 820, 822, 829, 838, 842, 849, 856, 862, 867, 873, 896, 898, 903, 905, 914, 920, 926, 930, 939, 948, 951, 956, 960, 972, 976, 979, 986, 1000, 1002, 1005, 1008, 1010, 1022] \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.java new file mode 100644 index 000000000..8c200f3d8 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.java @@ -0,0 +1,7752 @@ +package run.mone.antlr.golang;// Generated from GoParser.g4 by ANTLR 4.7.1 + +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; +import org.antlr.v4.runtime.tree.*; + +import java.util.List; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class GoParser extends GoParserBase { + static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + BREAK=1, DEFAULT=2, FUNC=3, INTERFACE=4, SELECT=5, CASE=6, DEFER=7, GO=8, + MAP=9, STRUCT=10, CHAN=11, ELSE=12, GOTO=13, PACKAGE=14, SWITCH=15, CONST=16, + FALLTHROUGH=17, IF=18, RANGE=19, TYPE=20, CONTINUE=21, FOR=22, IMPORT=23, + RETURN=24, VAR=25, NIL_LIT=26, IDENTIFIER=27, L_PAREN=28, R_PAREN=29, + L_CURLY=30, R_CURLY=31, L_BRACKET=32, R_BRACKET=33, ASSIGN=34, COMMA=35, + SEMI=36, COLON=37, DOT=38, PLUS_PLUS=39, MINUS_MINUS=40, DECLARE_ASSIGN=41, + ELLIPSIS=42, LOGICAL_OR=43, LOGICAL_AND=44, EQUALS=45, NOT_EQUALS=46, + LESS=47, LESS_OR_EQUALS=48, GREATER=49, GREATER_OR_EQUALS=50, OR=51, DIV=52, + MOD=53, LSHIFT=54, RSHIFT=55, BIT_CLEAR=56, UNDERLYING=57, EXCLAMATION=58, + PLUS=59, MINUS=60, CARET=61, STAR=62, AMPERSAND=63, RECEIVE=64, DECIMAL_LIT=65, + BINARY_LIT=66, OCTAL_LIT=67, HEX_LIT=68, FLOAT_LIT=69, DECIMAL_FLOAT_LIT=70, + HEX_FLOAT_LIT=71, IMAGINARY_LIT=72, RUNE_LIT=73, BYTE_VALUE=74, OCTAL_BYTE_VALUE=75, + HEX_BYTE_VALUE=76, LITTLE_U_VALUE=77, BIG_U_VALUE=78, RAW_STRING_LIT=79, + INTERPRETED_STRING_LIT=80, WS=81, COMMENT=82, TERMINATOR=83, LINE_COMMENT=84, + NEWLINE=85, WS_NLSEMI=86, COMMENT_NLSEMI=87, LINE_COMMENT_NLSEMI=88, EOS=89, + OTHER=90; + public static final int + RULE_sourceFile = 0, RULE_packageClause = 1, RULE_importDecl = 2, RULE_importSpec = 3, + RULE_importPath = 4, RULE_declaration = 5, RULE_constDecl = 6, RULE_constSpec = 7, + RULE_identifierList = 8, RULE_expressionList = 9, RULE_comment = 10, RULE_typeDecl = 11, + RULE_typeSpec = 12, RULE_aliasDecl = 13, RULE_typeDef = 14, RULE_typeParameters = 15, + RULE_typeParameterDecl = 16, RULE_typeElement = 17, RULE_typeTerm = 18, + RULE_functionDecl = 19, RULE_methodDecl = 20, RULE_receiver = 21, RULE_varDecl = 22, + RULE_varSpec = 23, RULE_block = 24, RULE_statementList = 25, RULE_statement = 26, + RULE_simpleStmt = 27, RULE_expressionStmt = 28, RULE_sendStmt = 29, RULE_incDecStmt = 30, + RULE_assignment = 31, RULE_assign_op = 32, RULE_shortVarDecl = 33, RULE_labeledStmt = 34, + RULE_returnStmt = 35, RULE_breakStmt = 36, RULE_continueStmt = 37, RULE_gotoStmt = 38, + RULE_fallthroughStmt = 39, RULE_deferStmt = 40, RULE_ifStmt = 41, RULE_switchStmt = 42, + RULE_exprSwitchStmt = 43, RULE_exprCaseClause = 44, RULE_exprSwitchCase = 45, + RULE_typeSwitchStmt = 46, RULE_typeSwitchGuard = 47, RULE_typeCaseClause = 48, + RULE_typeSwitchCase = 49, RULE_typeList = 50, RULE_selectStmt = 51, RULE_commClause = 52, + RULE_commCase = 53, RULE_recvStmt = 54, RULE_forStmt = 55, RULE_forClause = 56, + RULE_rangeClause = 57, RULE_goStmt = 58, RULE_type_ = 59, RULE_typeArgs = 60, + RULE_typeName = 61, RULE_typeLit = 62, RULE_arrayType = 63, RULE_arrayLength = 64, + RULE_elementType = 65, RULE_pointerType = 66, RULE_interfaceType = 67, + RULE_sliceType = 68, RULE_mapType = 69, RULE_channelType = 70, RULE_methodSpec = 71, + RULE_functionType = 72, RULE_signature = 73, RULE_result = 74, RULE_parameters = 75, + RULE_parameterDecl = 76, RULE_expression = 77, RULE_primaryExpr = 78, + RULE_conversion = 79, RULE_operand = 80, RULE_literal = 81, RULE_basicLit = 82, + RULE_integer = 83, RULE_operandName = 84, RULE_qualifiedIdent = 85, RULE_compositeLit = 86, + RULE_literalType = 87, RULE_literalValue = 88, RULE_elementList = 89, + RULE_keyedElement = 90, RULE_key = 91, RULE_element = 92, RULE_structType = 93, + RULE_fieldDecl = 94, RULE_string_ = 95, RULE_embeddedField = 96, RULE_functionLit = 97, + RULE_index = 98, RULE_slice_ = 99, RULE_typeAssertion = 100, RULE_arguments = 101, + RULE_methodExpr = 102, RULE_eos = 103; + public static final String[] ruleNames = { + "sourceFile", "packageClause", "importDecl", "importSpec", "importPath", + "declaration", "constDecl", "constSpec", "identifierList", "expressionList", + "comment", "typeDecl", "typeSpec", "aliasDecl", "typeDef", "typeParameters", + "typeParameterDecl", "typeElement", "typeTerm", "functionDecl", "methodDecl", + "receiver", "varDecl", "varSpec", "block", "statementList", "statement", + "simpleStmt", "expressionStmt", "sendStmt", "incDecStmt", "assignment", + "assign_op", "shortVarDecl", "labeledStmt", "returnStmt", "breakStmt", + "continueStmt", "gotoStmt", "fallthroughStmt", "deferStmt", "ifStmt", + "switchStmt", "exprSwitchStmt", "exprCaseClause", "exprSwitchCase", "typeSwitchStmt", + "typeSwitchGuard", "typeCaseClause", "typeSwitchCase", "typeList", "selectStmt", + "commClause", "commCase", "recvStmt", "forStmt", "forClause", "rangeClause", + "goStmt", "type_", "typeArgs", "typeName", "typeLit", "arrayType", "arrayLength", + "elementType", "pointerType", "interfaceType", "sliceType", "mapType", + "channelType", "methodSpec", "functionType", "signature", "result", "parameters", + "parameterDecl", "expression", "primaryExpr", "conversion", "operand", + "literal", "basicLit", "integer", "operandName", "qualifiedIdent", "compositeLit", + "literalType", "literalValue", "elementList", "keyedElement", "key", "element", + "structType", "fieldDecl", "string_", "embeddedField", "functionLit", + "index", "slice_", "typeAssertion", "arguments", "methodExpr", "eos" + }; + + private static final String[] _LITERAL_NAMES = { + null, "'break'", "'default'", "'func'", "'interface'", "'select'", "'case'", + "'defer'", "'go'", "'map'", "'struct'", "'chan'", "'else'", "'goto'", + "'package'", "'switch'", "'const'", "'fallthrough'", "'if'", "'range'", + "'type'", "'continue'", "'for'", "'import'", "'return'", "'var'", "'nil'", + null, "'('", "')'", "'{'", "'}'", "'['", "']'", "'='", "','", "';'", "':'", + "'.'", "'++'", "'--'", "':='", "'...'", "'||'", "'&&'", "'=='", "'!='", + "'<'", "'<='", "'>'", "'>='", "'|'", "'/'", "'%'", "'<<'", "'>>'", "'&^'", + "'~'", "'!'", "'+'", "'-'", "'^'", "'*'", "'&'", "'<-'" + }; + private static final String[] _SYMBOLIC_NAMES = { + null, "BREAK", "DEFAULT", "FUNC", "INTERFACE", "SELECT", "CASE", "DEFER", + "GO", "MAP", "STRUCT", "CHAN", "ELSE", "GOTO", "PACKAGE", "SWITCH", "CONST", + "FALLTHROUGH", "IF", "RANGE", "TYPE", "CONTINUE", "FOR", "IMPORT", "RETURN", + "VAR", "NIL_LIT", "IDENTIFIER", "L_PAREN", "R_PAREN", "L_CURLY", "R_CURLY", + "L_BRACKET", "R_BRACKET", "ASSIGN", "COMMA", "SEMI", "COLON", "DOT", "PLUS_PLUS", + "MINUS_MINUS", "DECLARE_ASSIGN", "ELLIPSIS", "LOGICAL_OR", "LOGICAL_AND", + "EQUALS", "NOT_EQUALS", "LESS", "LESS_OR_EQUALS", "GREATER", "GREATER_OR_EQUALS", + "OR", "DIV", "MOD", "LSHIFT", "RSHIFT", "BIT_CLEAR", "UNDERLYING", "EXCLAMATION", + "PLUS", "MINUS", "CARET", "STAR", "AMPERSAND", "RECEIVE", "DECIMAL_LIT", + "BINARY_LIT", "OCTAL_LIT", "HEX_LIT", "FLOAT_LIT", "DECIMAL_FLOAT_LIT", + "HEX_FLOAT_LIT", "IMAGINARY_LIT", "RUNE_LIT", "BYTE_VALUE", "OCTAL_BYTE_VALUE", + "HEX_BYTE_VALUE", "LITTLE_U_VALUE", "BIG_U_VALUE", "RAW_STRING_LIT", "INTERPRETED_STRING_LIT", + "WS", "COMMENT", "TERMINATOR", "LINE_COMMENT", "NEWLINE", "WS_NLSEMI", + "COMMENT_NLSEMI", "LINE_COMMENT_NLSEMI", "EOS", "OTHER" + }; + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "GoParser.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public GoParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + public static class SourceFileContext extends ParserRuleContext { + public PackageClauseContext packageClause() { + return getRuleContext(PackageClauseContext.class,0); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public TerminalNode EOF() { return getToken(GoParser.EOF, 0); } + public List importDecl() { + return getRuleContexts(ImportDeclContext.class); + } + public ImportDeclContext importDecl(int i) { + return getRuleContext(ImportDeclContext.class,i); + } + public List functionDecl() { + return getRuleContexts(FunctionDeclContext.class); + } + public FunctionDeclContext functionDecl(int i) { + return getRuleContext(FunctionDeclContext.class,i); + } + public List methodDecl() { + return getRuleContexts(MethodDeclContext.class); + } + public MethodDeclContext methodDecl(int i) { + return getRuleContext(MethodDeclContext.class,i); + } + public List declaration() { + return getRuleContexts(DeclarationContext.class); + } + public DeclarationContext declaration(int i) { + return getRuleContext(DeclarationContext.class,i); + } + public SourceFileContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sourceFile; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSourceFile(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSourceFile(this); + } + } + + public final SourceFileContext sourceFile() throws RecognitionException { + SourceFileContext _localctx = new SourceFileContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_sourceFile); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(208); + packageClause(); + setState(209); + eos(); + setState(215); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IMPORT) { + { + { + setState(210); + importDecl(); + setState(211); + eos(); + } + } + setState(217); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(227); + _errHandler.sync(this); + _la = _input.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << CONST) | (1L << TYPE) | (1L << VAR))) != 0) || _la==COMMENT || _la==LINE_COMMENT) { + { + { + setState(221); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { + case 1: + { + setState(218); + functionDecl(); + } + break; + case 2: + { + setState(219); + methodDecl(); + } + break; + case 3: + { + setState(220); + declaration(); + } + break; + } + setState(223); + eos(); + } + } + setState(229); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(230); + match(EOF); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PackageClauseContext extends ParserRuleContext { + public Token packageName; + public TerminalNode PACKAGE() { return getToken(GoParser.PACKAGE, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public PackageClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_packageClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterPackageClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitPackageClause(this); + } + } + + public final PackageClauseContext packageClause() throws RecognitionException { + PackageClauseContext _localctx = new PackageClauseContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_packageClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(232); + match(PACKAGE); + setState(233); + ((PackageClauseContext)_localctx).packageName = match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportDeclContext extends ParserRuleContext { + public TerminalNode IMPORT() { return getToken(GoParser.IMPORT, 0); } + public List importSpec() { + return getRuleContexts(ImportSpecContext.class); + } + public ImportSpecContext importSpec(int i) { + return getRuleContext(ImportSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public ImportDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterImportDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitImportDecl(this); + } + } + + public final ImportDeclContext importDecl() throws RecognitionException { + ImportDeclContext _localctx = new ImportDeclContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_importDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(235); + match(IMPORT); + setState(247); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + case DOT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + { + setState(236); + importSpec(); + } + break; + case L_PAREN: + { + setState(237); + match(L_PAREN); + setState(243); + _errHandler.sync(this); + _la = _input.LA(1); + while (((((_la - 27)) & ~0x3f) == 0 && ((1L << (_la - 27)) & ((1L << (IDENTIFIER - 27)) | (1L << (DOT - 27)) | (1L << (RAW_STRING_LIT - 27)) | (1L << (INTERPRETED_STRING_LIT - 27)))) != 0)) { + { + { + setState(238); + importSpec(); + setState(239); + eos(); + } + } + setState(245); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(246); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportSpecContext extends ParserRuleContext { + public Token alias; + public ImportPathContext importPath() { + return getRuleContext(ImportPathContext.class,0); + } + public TerminalNode DOT() { return getToken(GoParser.DOT, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public ImportSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importSpec; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterImportSpec(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitImportSpec(this); + } + } + + public final ImportSpecContext importSpec() throws RecognitionException { + ImportSpecContext _localctx = new ImportSpecContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_importSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(250); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==IDENTIFIER || _la==DOT) { + { + setState(249); + ((ImportSpecContext)_localctx).alias = _input.LT(1); + _la = _input.LA(1); + if ( !(_la==IDENTIFIER || _la==DOT) ) { + ((ImportSpecContext)_localctx).alias = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + + setState(252); + importPath(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ImportPathContext extends ParserRuleContext { + public String_Context string_() { + return getRuleContext(String_Context.class,0); + } + public ImportPathContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_importPath; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterImportPath(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitImportPath(this); + } + } + + public final ImportPathContext importPath() throws RecognitionException { + ImportPathContext _localctx = new ImportPathContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_importPath); + try { + enterOuterAlt(_localctx, 1); + { + setState(254); + string_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DeclarationContext extends ParserRuleContext { + public ConstDeclContext constDecl() { + return getRuleContext(ConstDeclContext.class,0); + } + public TypeDeclContext typeDecl() { + return getRuleContext(TypeDeclContext.class,0); + } + public VarDeclContext varDecl() { + return getRuleContext(VarDeclContext.class,0); + } + public DeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_declaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitDeclaration(this); + } + } + + public final DeclarationContext declaration() throws RecognitionException { + DeclarationContext _localctx = new DeclarationContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_declaration); + try { + setState(259); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CONST: + enterOuterAlt(_localctx, 1); + { + setState(256); + constDecl(); + } + break; + case TYPE: + case COMMENT: + case LINE_COMMENT: + enterOuterAlt(_localctx, 2); + { + setState(257); + typeDecl(); + } + break; + case VAR: + enterOuterAlt(_localctx, 3); + { + setState(258); + varDecl(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ConstDeclContext extends ParserRuleContext { + public TerminalNode CONST() { return getToken(GoParser.CONST, 0); } + public List constSpec() { + return getRuleContexts(ConstSpecContext.class); + } + public ConstSpecContext constSpec(int i) { + return getRuleContext(ConstSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public ConstDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_constDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterConstDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitConstDecl(this); + } + } + + public final ConstDeclContext constDecl() throws RecognitionException { + ConstDeclContext _localctx = new ConstDeclContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_constDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(261); + match(CONST); + setState(273); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + { + setState(262); + constSpec(); + } + break; + case L_PAREN: + { + setState(263); + match(L_PAREN); + setState(269); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER) { + { + { + setState(264); + constSpec(); + setState(265); + eos(); + } + } + setState(271); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(272); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ConstSpecContext extends ParserRuleContext { + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(GoParser.ASSIGN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public ConstSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_constSpec; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterConstSpec(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitConstSpec(this); + } + } + + public final ConstSpecContext constSpec() throws RecognitionException { + ConstSpecContext _localctx = new ConstSpecContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_constSpec); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(275); + identifierList(); + setState(281); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { + case 1: + { + setState(277); + _errHandler.sync(this); + _la = _input.LA(1); + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (FUNC - 3)) | (1L << (INTERFACE - 3)) | (1L << (MAP - 3)) | (1L << (STRUCT - 3)) | (1L << (CHAN - 3)) | (1L << (IDENTIFIER - 3)) | (1L << (L_PAREN - 3)) | (1L << (L_BRACKET - 3)) | (1L << (STAR - 3)) | (1L << (RECEIVE - 3)))) != 0)) { + { + setState(276); + type_(); + } + } + + setState(279); + match(ASSIGN); + setState(280); + expressionList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IdentifierListContext extends ParserRuleContext { + public List IDENTIFIER() { return getTokens(GoParser.IDENTIFIER); } + public TerminalNode IDENTIFIER(int i) { + return getToken(GoParser.IDENTIFIER, i); + } + public List COMMA() { return getTokens(GoParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GoParser.COMMA, i); + } + public IdentifierListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_identifierList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterIdentifierList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitIdentifierList(this); + } + } + + public final IdentifierListContext identifierList() throws RecognitionException { + IdentifierListContext _localctx = new IdentifierListContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_identifierList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(283); + match(IDENTIFIER); + setState(288); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,11,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(284); + match(COMMA); + setState(285); + match(IDENTIFIER); + } + } + } + setState(290); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,11,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionListContext extends ParserRuleContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public List COMMA() { return getTokens(GoParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GoParser.COMMA, i); + } + public ExpressionListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expressionList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterExpressionList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitExpressionList(this); + } + } + + public final ExpressionListContext expressionList() throws RecognitionException { + ExpressionListContext _localctx = new ExpressionListContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_expressionList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(291); + expression(0); + setState(296); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,12,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(292); + match(COMMA); + setState(293); + expression(0); + } + } + } + setState(298); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,12,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CommentContext extends ParserRuleContext { + public TerminalNode COMMENT() { return getToken(GoParser.COMMENT, 0); } + public TerminalNode LINE_COMMENT() { return getToken(GoParser.LINE_COMMENT, 0); } + public CommentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_comment; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterComment(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitComment(this); + } + } + + public final CommentContext comment() throws RecognitionException { + CommentContext _localctx = new CommentContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_comment); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(299); + _la = _input.LA(1); + if ( !(_la==COMMENT || _la==LINE_COMMENT) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeDeclContext extends ParserRuleContext { + public TerminalNode TYPE() { return getToken(GoParser.TYPE, 0); } + public List typeSpec() { + return getRuleContexts(TypeSpecContext.class); + } + public TypeSpecContext typeSpec(int i) { + return getRuleContext(TypeSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public List comment() { + return getRuleContexts(CommentContext.class); + } + public CommentContext comment(int i) { + return getRuleContext(CommentContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public TypeDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeDecl(this); + } + } + + public final TypeDeclContext typeDecl() throws RecognitionException { + TypeDeclContext _localctx = new TypeDeclContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_typeDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(304); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMENT || _la==LINE_COMMENT) { + { + { + setState(301); + comment(); + } + } + setState(306); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(307); + match(TYPE); + setState(319); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + { + setState(308); + typeSpec(); + } + break; + case L_PAREN: + { + setState(309); + match(L_PAREN); + setState(315); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER) { + { + { + setState(310); + typeSpec(); + setState(311); + eos(); + } + } + setState(317); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(318); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSpecContext extends ParserRuleContext { + public AliasDeclContext aliasDecl() { + return getRuleContext(AliasDeclContext.class,0); + } + public TypeDefContext typeDef() { + return getRuleContext(TypeDefContext.class,0); + } + public TypeSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSpec; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeSpec(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeSpec(this); + } + } + + public final TypeSpecContext typeSpec() throws RecognitionException { + TypeSpecContext _localctx = new TypeSpecContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_typeSpec); + try { + setState(323); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(321); + aliasDecl(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(322); + typeDef(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AliasDeclContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public TerminalNode ASSIGN() { return getToken(GoParser.ASSIGN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public AliasDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_aliasDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterAliasDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitAliasDecl(this); + } + } + + public final AliasDeclContext aliasDecl() throws RecognitionException { + AliasDeclContext _localctx = new AliasDeclContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_aliasDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(325); + match(IDENTIFIER); + setState(326); + match(ASSIGN); + setState(327); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeDefContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TypeParametersContext typeParameters() { + return getRuleContext(TypeParametersContext.class,0); + } + public TypeDefContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeDef; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeDef(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeDef(this); + } + } + + public final TypeDefContext typeDef() throws RecognitionException { + TypeDefContext _localctx = new TypeDefContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_typeDef); + try { + enterOuterAlt(_localctx, 1); + { + setState(329); + match(IDENTIFIER); + setState(331); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) { + case 1: + { + setState(330); + typeParameters(); + } + break; + } + setState(333); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeParametersContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public List typeParameterDecl() { + return getRuleContexts(TypeParameterDeclContext.class); + } + public TypeParameterDeclContext typeParameterDecl(int i) { + return getRuleContext(TypeParameterDeclContext.class,i); + } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public List COMMA() { return getTokens(GoParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GoParser.COMMA, i); + } + public TypeParametersContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeParameters; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeParameters(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeParameters(this); + } + } + + public final TypeParametersContext typeParameters() throws RecognitionException { + TypeParametersContext _localctx = new TypeParametersContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_typeParameters); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(335); + match(L_BRACKET); + setState(336); + typeParameterDecl(); + setState(341); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(337); + match(COMMA); + setState(338); + typeParameterDecl(); + } + } + setState(343); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(344); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeParameterDeclContext extends ParserRuleContext { + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TypeElementContext typeElement() { + return getRuleContext(TypeElementContext.class,0); + } + public TypeParameterDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeParameterDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeParameterDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeParameterDecl(this); + } + } + + public final TypeParameterDeclContext typeParameterDecl() throws RecognitionException { + TypeParameterDeclContext _localctx = new TypeParameterDeclContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_typeParameterDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(346); + identifierList(); + setState(347); + typeElement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeElementContext extends ParserRuleContext { + public List typeTerm() { + return getRuleContexts(TypeTermContext.class); + } + public TypeTermContext typeTerm(int i) { + return getRuleContext(TypeTermContext.class,i); + } + public List OR() { return getTokens(GoParser.OR); } + public TerminalNode OR(int i) { + return getToken(GoParser.OR, i); + } + public TypeElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeElement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeElement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeElement(this); + } + } + + public final TypeElementContext typeElement() throws RecognitionException { + TypeElementContext _localctx = new TypeElementContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_typeElement); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(349); + typeTerm(); + setState(354); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(350); + match(OR); + setState(351); + typeTerm(); + } + } + } + setState(356); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeTermContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode UNDERLYING() { return getToken(GoParser.UNDERLYING, 0); } + public TypeTermContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeTerm; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeTerm(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeTerm(this); + } + } + + public final TypeTermContext typeTerm() throws RecognitionException { + TypeTermContext _localctx = new TypeTermContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_typeTerm); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(358); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==UNDERLYING) { + { + setState(357); + match(UNDERLYING); + } + } + + setState(360); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionDeclContext extends ParserRuleContext { + public TerminalNode FUNC() { return getToken(GoParser.FUNC, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public TypeParametersContext typeParameters() { + return getRuleContext(TypeParametersContext.class,0); + } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public FunctionDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterFunctionDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitFunctionDecl(this); + } + } + + public final FunctionDeclContext functionDecl() throws RecognitionException { + FunctionDeclContext _localctx = new FunctionDeclContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_functionDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(362); + match(FUNC); + setState(363); + match(IDENTIFIER); + setState(365); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==L_BRACKET) { + { + setState(364); + typeParameters(); + } + } + + setState(367); + signature(); + setState(369); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) { + case 1: + { + setState(368); + block(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodDeclContext extends ParserRuleContext { + public TerminalNode FUNC() { return getToken(GoParser.FUNC, 0); } + public ReceiverContext receiver() { + return getRuleContext(ReceiverContext.class,0); + } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public MethodDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterMethodDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitMethodDecl(this); + } + } + + public final MethodDeclContext methodDecl() throws RecognitionException { + MethodDeclContext _localctx = new MethodDeclContext(_ctx, getState()); + enterRule(_localctx, 40, RULE_methodDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(371); + match(FUNC); + setState(372); + receiver(); + setState(373); + match(IDENTIFIER); + setState(374); + signature(); + setState(376); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { + case 1: + { + setState(375); + block(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReceiverContext extends ParserRuleContext { + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public ReceiverContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_receiver; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterReceiver(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitReceiver(this); + } + } + + public final ReceiverContext receiver() throws RecognitionException { + ReceiverContext _localctx = new ReceiverContext(_ctx, getState()); + enterRule(_localctx, 42, RULE_receiver); + try { + enterOuterAlt(_localctx, 1); + { + setState(378); + parameters(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VarDeclContext extends ParserRuleContext { + public TerminalNode VAR() { return getToken(GoParser.VAR, 0); } + public List varSpec() { + return getRuleContexts(VarSpecContext.class); + } + public VarSpecContext varSpec(int i) { + return getRuleContext(VarSpecContext.class,i); + } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public VarDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_varDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterVarDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitVarDecl(this); + } + } + + public final VarDeclContext varDecl() throws RecognitionException { + VarDeclContext _localctx = new VarDeclContext(_ctx, getState()); + enterRule(_localctx, 44, RULE_varDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(380); + match(VAR); + setState(392); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + { + setState(381); + varSpec(); + } + break; + case L_PAREN: + { + setState(382); + match(L_PAREN); + setState(388); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER) { + { + { + setState(383); + varSpec(); + setState(384); + eos(); + } + } + setState(390); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(391); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VarSpecContext extends ParserRuleContext { + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode ASSIGN() { return getToken(GoParser.ASSIGN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public VarSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_varSpec; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterVarSpec(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitVarSpec(this); + } + } + + public final VarSpecContext varSpec() throws RecognitionException { + VarSpecContext _localctx = new VarSpecContext(_ctx, getState()); + enterRule(_localctx, 46, RULE_varSpec); + try { + enterOuterAlt(_localctx, 1); + { + setState(394); + identifierList(); + setState(402); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case STAR: + case RECEIVE: + { + setState(395); + type_(); + setState(398); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) { + case 1: + { + setState(396); + match(ASSIGN); + setState(397); + expressionList(); + } + break; + } + } + break; + case ASSIGN: + { + setState(400); + match(ASSIGN); + setState(401); + expressionList(); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BlockContext extends ParserRuleContext { + public TerminalNode L_CURLY() { return getToken(GoParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GoParser.R_CURLY, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public BlockContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_block; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterBlock(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitBlock(this); + } + } + + public final BlockContext block() throws RecognitionException { + BlockContext _localctx = new BlockContext(_ctx, getState()); + enterRule(_localctx, 48, RULE_block); + try { + enterOuterAlt(_localctx, 1); + { + setState(404); + match(L_CURLY); + setState(406); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { + case 1: + { + setState(405); + statementList(); + } + break; + } + setState(408); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StatementListContext extends ParserRuleContext { + public List statement() { + return getRuleContexts(StatementContext.class); + } + public StatementContext statement(int i) { + return getRuleContext(StatementContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public List SEMI() { return getTokens(GoParser.SEMI); } + public TerminalNode SEMI(int i) { + return getToken(GoParser.SEMI, i); + } + public List EOS() { return getTokens(GoParser.EOS); } + public TerminalNode EOS(int i) { + return getToken(GoParser.EOS, i); + } + public StatementListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statementList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterStatementList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitStatementList(this); + } + } + + public final StatementListContext statementList() throws RecognitionException { + StatementListContext _localctx = new StatementListContext(_ctx, getState()); + enterRule(_localctx, 50, RULE_statementList); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(422); + _errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + setState(417); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) { + case 1: + { + setState(411); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==SEMI) { + { + setState(410); + match(SEMI); + } + } + + } + break; + case 2: + { + setState(414); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==EOS) { + { + setState(413); + match(EOS); + } + } + + } + break; + case 3: + { + setState(416); + if (!(this.closingBracket())) throw new FailedPredicateException(this, "this.closingBracket()"); + } + break; + } + setState(419); + statement(); + setState(420); + eos(); + } + } + break; + default: + throw new NoViableAltException(this); + } + setState(424); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,32,_ctx); + } while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StatementContext extends ParserRuleContext { + public DeclarationContext declaration() { + return getRuleContext(DeclarationContext.class,0); + } + public LabeledStmtContext labeledStmt() { + return getRuleContext(LabeledStmtContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public GoStmtContext goStmt() { + return getRuleContext(GoStmtContext.class,0); + } + public ReturnStmtContext returnStmt() { + return getRuleContext(ReturnStmtContext.class,0); + } + public BreakStmtContext breakStmt() { + return getRuleContext(BreakStmtContext.class,0); + } + public ContinueStmtContext continueStmt() { + return getRuleContext(ContinueStmtContext.class,0); + } + public GotoStmtContext gotoStmt() { + return getRuleContext(GotoStmtContext.class,0); + } + public FallthroughStmtContext fallthroughStmt() { + return getRuleContext(FallthroughStmtContext.class,0); + } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public IfStmtContext ifStmt() { + return getRuleContext(IfStmtContext.class,0); + } + public SwitchStmtContext switchStmt() { + return getRuleContext(SwitchStmtContext.class,0); + } + public SelectStmtContext selectStmt() { + return getRuleContext(SelectStmtContext.class,0); + } + public ForStmtContext forStmt() { + return getRuleContext(ForStmtContext.class,0); + } + public DeferStmtContext deferStmt() { + return getRuleContext(DeferStmtContext.class,0); + } + public StatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitStatement(this); + } + } + + public final StatementContext statement() throws RecognitionException { + StatementContext _localctx = new StatementContext(_ctx, getState()); + enterRule(_localctx, 52, RULE_statement); + try { + setState(441); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(426); + declaration(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(427); + labeledStmt(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(428); + simpleStmt(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(429); + goStmt(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(430); + returnStmt(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(431); + breakStmt(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(432); + continueStmt(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(433); + gotoStmt(); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(434); + fallthroughStmt(); + } + break; + case 10: + enterOuterAlt(_localctx, 10); + { + setState(435); + block(); + } + break; + case 11: + enterOuterAlt(_localctx, 11); + { + setState(436); + ifStmt(); + } + break; + case 12: + enterOuterAlt(_localctx, 12); + { + setState(437); + switchStmt(); + } + break; + case 13: + enterOuterAlt(_localctx, 13); + { + setState(438); + selectStmt(); + } + break; + case 14: + enterOuterAlt(_localctx, 14); + { + setState(439); + forStmt(); + } + break; + case 15: + enterOuterAlt(_localctx, 15); + { + setState(440); + deferStmt(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SimpleStmtContext extends ParserRuleContext { + public SendStmtContext sendStmt() { + return getRuleContext(SendStmtContext.class,0); + } + public IncDecStmtContext incDecStmt() { + return getRuleContext(IncDecStmtContext.class,0); + } + public AssignmentContext assignment() { + return getRuleContext(AssignmentContext.class,0); + } + public ExpressionStmtContext expressionStmt() { + return getRuleContext(ExpressionStmtContext.class,0); + } + public ShortVarDeclContext shortVarDecl() { + return getRuleContext(ShortVarDeclContext.class,0); + } + public SimpleStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_simpleStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSimpleStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSimpleStmt(this); + } + } + + public final SimpleStmtContext simpleStmt() throws RecognitionException { + SimpleStmtContext _localctx = new SimpleStmtContext(_ctx, getState()); + enterRule(_localctx, 54, RULE_simpleStmt); + try { + setState(448); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(443); + sendStmt(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(444); + incDecStmt(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(445); + assignment(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(446); + expressionStmt(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(447); + shortVarDecl(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionStmtContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ExpressionStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expressionStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterExpressionStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitExpressionStmt(this); + } + } + + public final ExpressionStmtContext expressionStmt() throws RecognitionException { + ExpressionStmtContext _localctx = new ExpressionStmtContext(_ctx, getState()); + enterRule(_localctx, 56, RULE_expressionStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(450); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SendStmtContext extends ParserRuleContext { + public ExpressionContext channel; + public TerminalNode RECEIVE() { return getToken(GoParser.RECEIVE, 0); } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public SendStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sendStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSendStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSendStmt(this); + } + } + + public final SendStmtContext sendStmt() throws RecognitionException { + SendStmtContext _localctx = new SendStmtContext(_ctx, getState()); + enterRule(_localctx, 58, RULE_sendStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(452); + ((SendStmtContext)_localctx).channel = expression(0); + setState(453); + match(RECEIVE); + setState(454); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IncDecStmtContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode PLUS_PLUS() { return getToken(GoParser.PLUS_PLUS, 0); } + public TerminalNode MINUS_MINUS() { return getToken(GoParser.MINUS_MINUS, 0); } + public IncDecStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_incDecStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterIncDecStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitIncDecStmt(this); + } + } + + public final IncDecStmtContext incDecStmt() throws RecognitionException { + IncDecStmtContext _localctx = new IncDecStmtContext(_ctx, getState()); + enterRule(_localctx, 60, RULE_incDecStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(456); + expression(0); + setState(457); + _la = _input.LA(1); + if ( !(_la==PLUS_PLUS || _la==MINUS_MINUS) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AssignmentContext extends ParserRuleContext { + public List expressionList() { + return getRuleContexts(ExpressionListContext.class); + } + public ExpressionListContext expressionList(int i) { + return getRuleContext(ExpressionListContext.class,i); + } + public Assign_opContext assign_op() { + return getRuleContext(Assign_opContext.class,0); + } + public AssignmentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assignment; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterAssignment(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitAssignment(this); + } + } + + public final AssignmentContext assignment() throws RecognitionException { + AssignmentContext _localctx = new AssignmentContext(_ctx, getState()); + enterRule(_localctx, 62, RULE_assignment); + try { + enterOuterAlt(_localctx, 1); + { + setState(459); + expressionList(); + setState(460); + assign_op(); + setState(461); + expressionList(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Assign_opContext extends ParserRuleContext { + public TerminalNode ASSIGN() { return getToken(GoParser.ASSIGN, 0); } + public TerminalNode PLUS() { return getToken(GoParser.PLUS, 0); } + public TerminalNode MINUS() { return getToken(GoParser.MINUS, 0); } + public TerminalNode OR() { return getToken(GoParser.OR, 0); } + public TerminalNode CARET() { return getToken(GoParser.CARET, 0); } + public TerminalNode STAR() { return getToken(GoParser.STAR, 0); } + public TerminalNode DIV() { return getToken(GoParser.DIV, 0); } + public TerminalNode MOD() { return getToken(GoParser.MOD, 0); } + public TerminalNode LSHIFT() { return getToken(GoParser.LSHIFT, 0); } + public TerminalNode RSHIFT() { return getToken(GoParser.RSHIFT, 0); } + public TerminalNode AMPERSAND() { return getToken(GoParser.AMPERSAND, 0); } + public TerminalNode BIT_CLEAR() { return getToken(GoParser.BIT_CLEAR, 0); } + public Assign_opContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assign_op; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterAssign_op(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitAssign_op(this); + } + } + + public final Assign_opContext assign_op() throws RecognitionException { + Assign_opContext _localctx = new Assign_opContext(_ctx, getState()); + enterRule(_localctx, 64, RULE_assign_op); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(464); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OR) | (1L << DIV) | (1L << MOD) | (1L << LSHIFT) | (1L << RSHIFT) | (1L << BIT_CLEAR) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0)) { + { + setState(463); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OR) | (1L << DIV) | (1L << MOD) | (1L << LSHIFT) | (1L << RSHIFT) | (1L << BIT_CLEAR) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + + setState(466); + match(ASSIGN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ShortVarDeclContext extends ParserRuleContext { + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode DECLARE_ASSIGN() { return getToken(GoParser.DECLARE_ASSIGN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public ShortVarDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_shortVarDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterShortVarDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitShortVarDecl(this); + } + } + + public final ShortVarDeclContext shortVarDecl() throws RecognitionException { + ShortVarDeclContext _localctx = new ShortVarDeclContext(_ctx, getState()); + enterRule(_localctx, 66, RULE_shortVarDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(468); + identifierList(); + setState(469); + match(DECLARE_ASSIGN); + setState(470); + expressionList(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LabeledStmtContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public TerminalNode COLON() { return getToken(GoParser.COLON, 0); } + public StatementContext statement() { + return getRuleContext(StatementContext.class,0); + } + public LabeledStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_labeledStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterLabeledStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitLabeledStmt(this); + } + } + + public final LabeledStmtContext labeledStmt() throws RecognitionException { + LabeledStmtContext _localctx = new LabeledStmtContext(_ctx, getState()); + enterRule(_localctx, 68, RULE_labeledStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(472); + match(IDENTIFIER); + setState(473); + match(COLON); + setState(475); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { + case 1: + { + setState(474); + statement(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReturnStmtContext extends ParserRuleContext { + public TerminalNode RETURN() { return getToken(GoParser.RETURN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public ReturnStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_returnStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterReturnStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitReturnStmt(this); + } + } + + public final ReturnStmtContext returnStmt() throws RecognitionException { + ReturnStmtContext _localctx = new ReturnStmtContext(_ctx, getState()); + enterRule(_localctx, 70, RULE_returnStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(477); + match(RETURN); + setState(479); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) { + case 1: + { + setState(478); + expressionList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BreakStmtContext extends ParserRuleContext { + public TerminalNode BREAK() { return getToken(GoParser.BREAK, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public BreakStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_breakStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterBreakStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitBreakStmt(this); + } + } + + public final BreakStmtContext breakStmt() throws RecognitionException { + BreakStmtContext _localctx = new BreakStmtContext(_ctx, getState()); + enterRule(_localctx, 72, RULE_breakStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(481); + match(BREAK); + setState(483); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) { + case 1: + { + setState(482); + match(IDENTIFIER); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ContinueStmtContext extends ParserRuleContext { + public TerminalNode CONTINUE() { return getToken(GoParser.CONTINUE, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public ContinueStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_continueStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterContinueStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitContinueStmt(this); + } + } + + public final ContinueStmtContext continueStmt() throws RecognitionException { + ContinueStmtContext _localctx = new ContinueStmtContext(_ctx, getState()); + enterRule(_localctx, 74, RULE_continueStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(485); + match(CONTINUE); + setState(487); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,39,_ctx) ) { + case 1: + { + setState(486); + match(IDENTIFIER); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GotoStmtContext extends ParserRuleContext { + public TerminalNode GOTO() { return getToken(GoParser.GOTO, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public GotoStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_gotoStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterGotoStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitGotoStmt(this); + } + } + + public final GotoStmtContext gotoStmt() throws RecognitionException { + GotoStmtContext _localctx = new GotoStmtContext(_ctx, getState()); + enterRule(_localctx, 76, RULE_gotoStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(489); + match(GOTO); + setState(490); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FallthroughStmtContext extends ParserRuleContext { + public TerminalNode FALLTHROUGH() { return getToken(GoParser.FALLTHROUGH, 0); } + public FallthroughStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fallthroughStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterFallthroughStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitFallthroughStmt(this); + } + } + + public final FallthroughStmtContext fallthroughStmt() throws RecognitionException { + FallthroughStmtContext _localctx = new FallthroughStmtContext(_ctx, getState()); + enterRule(_localctx, 78, RULE_fallthroughStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(492); + match(FALLTHROUGH); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DeferStmtContext extends ParserRuleContext { + public TerminalNode DEFER() { return getToken(GoParser.DEFER, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public DeferStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_deferStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterDeferStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitDeferStmt(this); + } + } + + public final DeferStmtContext deferStmt() throws RecognitionException { + DeferStmtContext _localctx = new DeferStmtContext(_ctx, getState()); + enterRule(_localctx, 80, RULE_deferStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(494); + match(DEFER); + setState(495); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IfStmtContext extends ParserRuleContext { + public TerminalNode IF() { return getToken(GoParser.IF, 0); } + public List block() { + return getRuleContexts(BlockContext.class); + } + public BlockContext block(int i) { + return getRuleContext(BlockContext.class,i); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public TerminalNode ELSE() { return getToken(GoParser.ELSE, 0); } + public IfStmtContext ifStmt() { + return getRuleContext(IfStmtContext.class,0); + } + public IfStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ifStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterIfStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitIfStmt(this); + } + } + + public final IfStmtContext ifStmt() throws RecognitionException { + IfStmtContext _localctx = new IfStmtContext(_ctx, getState()); + enterRule(_localctx, 82, RULE_ifStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(497); + match(IF); + setState(506); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,40,_ctx) ) { + case 1: + { + setState(498); + expression(0); + } + break; + case 2: + { + setState(499); + eos(); + setState(500); + expression(0); + } + break; + case 3: + { + setState(502); + simpleStmt(); + setState(503); + eos(); + setState(504); + expression(0); + } + break; + } + setState(508); + block(); + setState(514); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) { + case 1: + { + setState(509); + match(ELSE); + setState(512); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IF: + { + setState(510); + ifStmt(); + } + break; + case L_CURLY: + { + setState(511); + block(); + } + break; + default: + throw new NoViableAltException(this); + } + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SwitchStmtContext extends ParserRuleContext { + public ExprSwitchStmtContext exprSwitchStmt() { + return getRuleContext(ExprSwitchStmtContext.class,0); + } + public TypeSwitchStmtContext typeSwitchStmt() { + return getRuleContext(TypeSwitchStmtContext.class,0); + } + public SwitchStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_switchStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSwitchStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSwitchStmt(this); + } + } + + public final SwitchStmtContext switchStmt() throws RecognitionException { + SwitchStmtContext _localctx = new SwitchStmtContext(_ctx, getState()); + enterRule(_localctx, 84, RULE_switchStmt); + try { + setState(518); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,43,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(516); + exprSwitchStmt(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(517); + typeSwitchStmt(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExprSwitchStmtContext extends ParserRuleContext { + public TerminalNode SWITCH() { return getToken(GoParser.SWITCH, 0); } + public TerminalNode L_CURLY() { return getToken(GoParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GoParser.R_CURLY, 0); } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public List exprCaseClause() { + return getRuleContexts(ExprCaseClauseContext.class); + } + public ExprCaseClauseContext exprCaseClause(int i) { + return getRuleContext(ExprCaseClauseContext.class,i); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public ExprSwitchStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exprSwitchStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterExprSwitchStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitExprSwitchStmt(this); + } + } + + public final ExprSwitchStmtContext exprSwitchStmt() throws RecognitionException { + ExprSwitchStmtContext _localctx = new ExprSwitchStmtContext(_ctx, getState()); + enterRule(_localctx, 86, RULE_exprSwitchStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(520); + match(SWITCH); + setState(531); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,47,_ctx) ) { + case 1: + { + setState(522); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(521); + expression(0); + } + } + + } + break; + case 2: + { + setState(525); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,45,_ctx) ) { + case 1: + { + setState(524); + simpleStmt(); + } + break; + } + setState(527); + eos(); + setState(529); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(528); + expression(0); + } + } + + } + break; + } + setState(533); + match(L_CURLY); + setState(537); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==DEFAULT || _la==CASE) { + { + { + setState(534); + exprCaseClause(); + } + } + setState(539); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(540); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExprCaseClauseContext extends ParserRuleContext { + public ExprSwitchCaseContext exprSwitchCase() { + return getRuleContext(ExprSwitchCaseContext.class,0); + } + public TerminalNode COLON() { return getToken(GoParser.COLON, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public ExprCaseClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exprCaseClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterExprCaseClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitExprCaseClause(this); + } + } + + public final ExprCaseClauseContext exprCaseClause() throws RecognitionException { + ExprCaseClauseContext _localctx = new ExprCaseClauseContext(_ctx, getState()); + enterRule(_localctx, 88, RULE_exprCaseClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(542); + exprSwitchCase(); + setState(543); + match(COLON); + setState(545); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,49,_ctx) ) { + case 1: + { + setState(544); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExprSwitchCaseContext extends ParserRuleContext { + public TerminalNode CASE() { return getToken(GoParser.CASE, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode DEFAULT() { return getToken(GoParser.DEFAULT, 0); } + public ExprSwitchCaseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exprSwitchCase; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterExprSwitchCase(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitExprSwitchCase(this); + } + } + + public final ExprSwitchCaseContext exprSwitchCase() throws RecognitionException { + ExprSwitchCaseContext _localctx = new ExprSwitchCaseContext(_ctx, getState()); + enterRule(_localctx, 90, RULE_exprSwitchCase); + try { + setState(550); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CASE: + enterOuterAlt(_localctx, 1); + { + setState(547); + match(CASE); + setState(548); + expressionList(); + } + break; + case DEFAULT: + enterOuterAlt(_localctx, 2); + { + setState(549); + match(DEFAULT); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSwitchStmtContext extends ParserRuleContext { + public TerminalNode SWITCH() { return getToken(GoParser.SWITCH, 0); } + public TerminalNode L_CURLY() { return getToken(GoParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GoParser.R_CURLY, 0); } + public TypeSwitchGuardContext typeSwitchGuard() { + return getRuleContext(TypeSwitchGuardContext.class,0); + } + public EosContext eos() { + return getRuleContext(EosContext.class,0); + } + public SimpleStmtContext simpleStmt() { + return getRuleContext(SimpleStmtContext.class,0); + } + public List typeCaseClause() { + return getRuleContexts(TypeCaseClauseContext.class); + } + public TypeCaseClauseContext typeCaseClause(int i) { + return getRuleContext(TypeCaseClauseContext.class,i); + } + public TypeSwitchStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSwitchStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeSwitchStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeSwitchStmt(this); + } + } + + public final TypeSwitchStmtContext typeSwitchStmt() throws RecognitionException { + TypeSwitchStmtContext _localctx = new TypeSwitchStmtContext(_ctx, getState()); + enterRule(_localctx, 92, RULE_typeSwitchStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(552); + match(SWITCH); + setState(561); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,51,_ctx) ) { + case 1: + { + setState(553); + typeSwitchGuard(); + } + break; + case 2: + { + setState(554); + eos(); + setState(555); + typeSwitchGuard(); + } + break; + case 3: + { + setState(557); + simpleStmt(); + setState(558); + eos(); + setState(559); + typeSwitchGuard(); + } + break; + } + setState(563); + match(L_CURLY); + setState(567); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==DEFAULT || _la==CASE) { + { + { + setState(564); + typeCaseClause(); + } + } + setState(569); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(570); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSwitchGuardContext extends ParserRuleContext { + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public TerminalNode DOT() { return getToken(GoParser.DOT, 0); } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public TerminalNode TYPE() { return getToken(GoParser.TYPE, 0); } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public TerminalNode DECLARE_ASSIGN() { return getToken(GoParser.DECLARE_ASSIGN, 0); } + public TypeSwitchGuardContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSwitchGuard; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeSwitchGuard(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeSwitchGuard(this); + } + } + + public final TypeSwitchGuardContext typeSwitchGuard() throws RecognitionException { + TypeSwitchGuardContext _localctx = new TypeSwitchGuardContext(_ctx, getState()); + enterRule(_localctx, 94, RULE_typeSwitchGuard); + try { + enterOuterAlt(_localctx, 1); + { + setState(574); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,53,_ctx) ) { + case 1: + { + setState(572); + match(IDENTIFIER); + setState(573); + match(DECLARE_ASSIGN); + } + break; + } + setState(576); + primaryExpr(0); + setState(577); + match(DOT); + setState(578); + match(L_PAREN); + setState(579); + match(TYPE); + setState(580); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeCaseClauseContext extends ParserRuleContext { + public TypeSwitchCaseContext typeSwitchCase() { + return getRuleContext(TypeSwitchCaseContext.class,0); + } + public TerminalNode COLON() { return getToken(GoParser.COLON, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public TypeCaseClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeCaseClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeCaseClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeCaseClause(this); + } + } + + public final TypeCaseClauseContext typeCaseClause() throws RecognitionException { + TypeCaseClauseContext _localctx = new TypeCaseClauseContext(_ctx, getState()); + enterRule(_localctx, 96, RULE_typeCaseClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(582); + typeSwitchCase(); + setState(583); + match(COLON); + setState(585); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,54,_ctx) ) { + case 1: + { + setState(584); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeSwitchCaseContext extends ParserRuleContext { + public TerminalNode CASE() { return getToken(GoParser.CASE, 0); } + public TypeListContext typeList() { + return getRuleContext(TypeListContext.class,0); + } + public TerminalNode DEFAULT() { return getToken(GoParser.DEFAULT, 0); } + public TypeSwitchCaseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeSwitchCase; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeSwitchCase(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeSwitchCase(this); + } + } + + public final TypeSwitchCaseContext typeSwitchCase() throws RecognitionException { + TypeSwitchCaseContext _localctx = new TypeSwitchCaseContext(_ctx, getState()); + enterRule(_localctx, 98, RULE_typeSwitchCase); + try { + setState(590); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CASE: + enterOuterAlt(_localctx, 1); + { + setState(587); + match(CASE); + setState(588); + typeList(); + } + break; + case DEFAULT: + enterOuterAlt(_localctx, 2); + { + setState(589); + match(DEFAULT); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeListContext extends ParserRuleContext { + public List type_() { + return getRuleContexts(Type_Context.class); + } + public Type_Context type_(int i) { + return getRuleContext(Type_Context.class,i); + } + public List NIL_LIT() { return getTokens(GoParser.NIL_LIT); } + public TerminalNode NIL_LIT(int i) { + return getToken(GoParser.NIL_LIT, i); + } + public List COMMA() { return getTokens(GoParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GoParser.COMMA, i); + } + public TypeListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeList(this); + } + } + + public final TypeListContext typeList() throws RecognitionException { + TypeListContext _localctx = new TypeListContext(_ctx, getState()); + enterRule(_localctx, 100, RULE_typeList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(594); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case STAR: + case RECEIVE: + { + setState(592); + type_(); + } + break; + case NIL_LIT: + { + setState(593); + match(NIL_LIT); + } + break; + default: + throw new NoViableAltException(this); + } + setState(603); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,58,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(596); + match(COMMA); + setState(599); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case STAR: + case RECEIVE: + { + setState(597); + type_(); + } + break; + case NIL_LIT: + { + setState(598); + match(NIL_LIT); + } + break; + default: + throw new NoViableAltException(this); + } + } + } + } + setState(605); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,58,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SelectStmtContext extends ParserRuleContext { + public TerminalNode SELECT() { return getToken(GoParser.SELECT, 0); } + public TerminalNode L_CURLY() { return getToken(GoParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GoParser.R_CURLY, 0); } + public List commClause() { + return getRuleContexts(CommClauseContext.class); + } + public CommClauseContext commClause(int i) { + return getRuleContext(CommClauseContext.class,i); + } + public SelectStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_selectStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSelectStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSelectStmt(this); + } + } + + public final SelectStmtContext selectStmt() throws RecognitionException { + SelectStmtContext _localctx = new SelectStmtContext(_ctx, getState()); + enterRule(_localctx, 102, RULE_selectStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(606); + match(SELECT); + setState(607); + match(L_CURLY); + setState(611); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==DEFAULT || _la==CASE) { + { + { + setState(608); + commClause(); + } + } + setState(613); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(614); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CommClauseContext extends ParserRuleContext { + public CommCaseContext commCase() { + return getRuleContext(CommCaseContext.class,0); + } + public TerminalNode COLON() { return getToken(GoParser.COLON, 0); } + public StatementListContext statementList() { + return getRuleContext(StatementListContext.class,0); + } + public CommClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_commClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterCommClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitCommClause(this); + } + } + + public final CommClauseContext commClause() throws RecognitionException { + CommClauseContext _localctx = new CommClauseContext(_ctx, getState()); + enterRule(_localctx, 104, RULE_commClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(616); + commCase(); + setState(617); + match(COLON); + setState(619); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,60,_ctx) ) { + case 1: + { + setState(618); + statementList(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CommCaseContext extends ParserRuleContext { + public TerminalNode CASE() { return getToken(GoParser.CASE, 0); } + public SendStmtContext sendStmt() { + return getRuleContext(SendStmtContext.class,0); + } + public RecvStmtContext recvStmt() { + return getRuleContext(RecvStmtContext.class,0); + } + public TerminalNode DEFAULT() { return getToken(GoParser.DEFAULT, 0); } + public CommCaseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_commCase; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterCommCase(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitCommCase(this); + } + } + + public final CommCaseContext commCase() throws RecognitionException { + CommCaseContext _localctx = new CommCaseContext(_ctx, getState()); + enterRule(_localctx, 106, RULE_commCase); + try { + setState(627); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CASE: + enterOuterAlt(_localctx, 1); + { + setState(621); + match(CASE); + setState(624); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,61,_ctx) ) { + case 1: + { + setState(622); + sendStmt(); + } + break; + case 2: + { + setState(623); + recvStmt(); + } + break; + } + } + break; + case DEFAULT: + enterOuterAlt(_localctx, 2); + { + setState(626); + match(DEFAULT); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class RecvStmtContext extends ParserRuleContext { + public ExpressionContext recvExpr; + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(GoParser.ASSIGN, 0); } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode DECLARE_ASSIGN() { return getToken(GoParser.DECLARE_ASSIGN, 0); } + public RecvStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_recvStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterRecvStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitRecvStmt(this); + } + } + + public final RecvStmtContext recvStmt() throws RecognitionException { + RecvStmtContext _localctx = new RecvStmtContext(_ctx, getState()); + enterRule(_localctx, 108, RULE_recvStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(635); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,63,_ctx) ) { + case 1: + { + setState(629); + expressionList(); + setState(630); + match(ASSIGN); + } + break; + case 2: + { + setState(632); + identifierList(); + setState(633); + match(DECLARE_ASSIGN); + } + break; + } + setState(637); + ((RecvStmtContext)_localctx).recvExpr = expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ForStmtContext extends ParserRuleContext { + public TerminalNode FOR() { return getToken(GoParser.FOR, 0); } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public ForClauseContext forClause() { + return getRuleContext(ForClauseContext.class,0); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public RangeClauseContext rangeClause() { + return getRuleContext(RangeClauseContext.class,0); + } + public ForStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_forStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterForStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitForStmt(this); + } + } + + public final ForStmtContext forStmt() throws RecognitionException { + ForStmtContext _localctx = new ForStmtContext(_ctx, getState()); + enterRule(_localctx, 110, RULE_forStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(639); + match(FOR); + setState(647); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,66,_ctx) ) { + case 1: + { + setState(641); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(640); + expression(0); + } + } + + } + break; + case 2: + { + setState(643); + forClause(); + } + break; + case 3: + { + setState(645); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << RANGE) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(644); + rangeClause(); + } + } + + } + break; + } + setState(649); + block(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ForClauseContext extends ParserRuleContext { + public SimpleStmtContext initStmt; + public SimpleStmtContext postStmt; + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public List simpleStmt() { + return getRuleContexts(SimpleStmtContext.class); + } + public SimpleStmtContext simpleStmt(int i) { + return getRuleContext(SimpleStmtContext.class,i); + } + public ForClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_forClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterForClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitForClause(this); + } + } + + public final ForClauseContext forClause() throws RecognitionException { + ForClauseContext _localctx = new ForClauseContext(_ctx, getState()); + enterRule(_localctx, 112, RULE_forClause); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(652); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,67,_ctx) ) { + case 1: + { + setState(651); + ((ForClauseContext)_localctx).initStmt = simpleStmt(); + } + break; + } + setState(654); + eos(); + setState(656); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,68,_ctx) ) { + case 1: + { + setState(655); + expression(0); + } + break; + } + setState(658); + eos(); + setState(660); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(659); + ((ForClauseContext)_localctx).postStmt = simpleStmt(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class RangeClauseContext extends ParserRuleContext { + public TerminalNode RANGE() { return getToken(GoParser.RANGE, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(GoParser.ASSIGN, 0); } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode DECLARE_ASSIGN() { return getToken(GoParser.DECLARE_ASSIGN, 0); } + public RangeClauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_rangeClause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterRangeClause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitRangeClause(this); + } + } + + public final RangeClauseContext rangeClause() throws RecognitionException { + RangeClauseContext _localctx = new RangeClauseContext(_ctx, getState()); + enterRule(_localctx, 114, RULE_rangeClause); + try { + enterOuterAlt(_localctx, 1); + { + setState(668); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,70,_ctx) ) { + case 1: + { + setState(662); + expressionList(); + setState(663); + match(ASSIGN); + } + break; + case 2: + { + setState(665); + identifierList(); + setState(666); + match(DECLARE_ASSIGN); + } + break; + } + setState(670); + match(RANGE); + setState(671); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class GoStmtContext extends ParserRuleContext { + public TerminalNode GO() { return getToken(GoParser.GO, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public GoStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_goStmt; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterGoStmt(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitGoStmt(this); + } + } + + public final GoStmtContext goStmt() throws RecognitionException { + GoStmtContext _localctx = new GoStmtContext(_ctx, getState()); + enterRule(_localctx, 116, RULE_goStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(673); + match(GO); + setState(674); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Type_Context extends ParserRuleContext { + public TypeNameContext typeName() { + return getRuleContext(TypeNameContext.class,0); + } + public TypeArgsContext typeArgs() { + return getRuleContext(TypeArgsContext.class,0); + } + public TypeLitContext typeLit() { + return getRuleContext(TypeLitContext.class,0); + } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public Type_Context(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_type_; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterType_(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitType_(this); + } + } + + public final Type_Context type_() throws RecognitionException { + Type_Context _localctx = new Type_Context(_ctx, getState()); + enterRule(_localctx, 118, RULE_type_); + try { + setState(685); + _errHandler.sync(this); + switch (_input.LA(1)) { + case IDENTIFIER: + enterOuterAlt(_localctx, 1); + { + setState(676); + typeName(); + setState(678); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,71,_ctx) ) { + case 1: + { + setState(677); + typeArgs(); + } + break; + } + } + break; + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case L_BRACKET: + case STAR: + case RECEIVE: + enterOuterAlt(_localctx, 2); + { + setState(680); + typeLit(); + } + break; + case L_PAREN: + enterOuterAlt(_localctx, 3); + { + setState(681); + match(L_PAREN); + setState(682); + type_(); + setState(683); + match(R_PAREN); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeArgsContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public TypeListContext typeList() { + return getRuleContext(TypeListContext.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public TerminalNode COMMA() { return getToken(GoParser.COMMA, 0); } + public TypeArgsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeArgs; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeArgs(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeArgs(this); + } + } + + public final TypeArgsContext typeArgs() throws RecognitionException { + TypeArgsContext _localctx = new TypeArgsContext(_ctx, getState()); + enterRule(_localctx, 120, RULE_typeArgs); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(687); + match(L_BRACKET); + setState(688); + typeList(); + setState(690); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(689); + match(COMMA); + } + } + + setState(692); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeNameContext extends ParserRuleContext { + public QualifiedIdentContext qualifiedIdent() { + return getRuleContext(QualifiedIdentContext.class,0); + } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public TypeNameContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeName; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeName(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeName(this); + } + } + + public final TypeNameContext typeName() throws RecognitionException { + TypeNameContext _localctx = new TypeNameContext(_ctx, getState()); + enterRule(_localctx, 122, RULE_typeName); + try { + setState(696); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,74,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(694); + qualifiedIdent(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(695); + match(IDENTIFIER); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeLitContext extends ParserRuleContext { + public ArrayTypeContext arrayType() { + return getRuleContext(ArrayTypeContext.class,0); + } + public StructTypeContext structType() { + return getRuleContext(StructTypeContext.class,0); + } + public PointerTypeContext pointerType() { + return getRuleContext(PointerTypeContext.class,0); + } + public FunctionTypeContext functionType() { + return getRuleContext(FunctionTypeContext.class,0); + } + public InterfaceTypeContext interfaceType() { + return getRuleContext(InterfaceTypeContext.class,0); + } + public SliceTypeContext sliceType() { + return getRuleContext(SliceTypeContext.class,0); + } + public MapTypeContext mapType() { + return getRuleContext(MapTypeContext.class,0); + } + public ChannelTypeContext channelType() { + return getRuleContext(ChannelTypeContext.class,0); + } + public TypeLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeLit; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeLit(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeLit(this); + } + } + + public final TypeLitContext typeLit() throws RecognitionException { + TypeLitContext _localctx = new TypeLitContext(_ctx, getState()); + enterRule(_localctx, 124, RULE_typeLit); + try { + setState(706); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,75,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(698); + arrayType(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(699); + structType(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(700); + pointerType(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(701); + functionType(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(702); + interfaceType(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(703); + sliceType(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(704); + mapType(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(705); + channelType(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrayTypeContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public ArrayLengthContext arrayLength() { + return getRuleContext(ArrayLengthContext.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public ArrayTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrayType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterArrayType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitArrayType(this); + } + } + + public final ArrayTypeContext arrayType() throws RecognitionException { + ArrayTypeContext _localctx = new ArrayTypeContext(_ctx, getState()); + enterRule(_localctx, 126, RULE_arrayType); + try { + enterOuterAlt(_localctx, 1); + { + setState(708); + match(L_BRACKET); + setState(709); + arrayLength(); + setState(710); + match(R_BRACKET); + setState(711); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArrayLengthContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ArrayLengthContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arrayLength; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterArrayLength(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitArrayLength(this); + } + } + + public final ArrayLengthContext arrayLength() throws RecognitionException { + ArrayLengthContext _localctx = new ArrayLengthContext(_ctx, getState()); + enterRule(_localctx, 128, RULE_arrayLength); + try { + enterOuterAlt(_localctx, 1); + { + setState(713); + expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ElementTypeContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public ElementTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_elementType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterElementType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitElementType(this); + } + } + + public final ElementTypeContext elementType() throws RecognitionException { + ElementTypeContext _localctx = new ElementTypeContext(_ctx, getState()); + enterRule(_localctx, 130, RULE_elementType); + try { + enterOuterAlt(_localctx, 1); + { + setState(715); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PointerTypeContext extends ParserRuleContext { + public TerminalNode STAR() { return getToken(GoParser.STAR, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public PointerTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_pointerType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterPointerType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitPointerType(this); + } + } + + public final PointerTypeContext pointerType() throws RecognitionException { + PointerTypeContext _localctx = new PointerTypeContext(_ctx, getState()); + enterRule(_localctx, 132, RULE_pointerType); + try { + enterOuterAlt(_localctx, 1); + { + setState(717); + match(STAR); + setState(718); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class InterfaceTypeContext extends ParserRuleContext { + public TerminalNode INTERFACE() { return getToken(GoParser.INTERFACE, 0); } + public TerminalNode L_CURLY() { return getToken(GoParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GoParser.R_CURLY, 0); } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public List methodSpec() { + return getRuleContexts(MethodSpecContext.class); + } + public MethodSpecContext methodSpec(int i) { + return getRuleContext(MethodSpecContext.class,i); + } + public List typeElement() { + return getRuleContexts(TypeElementContext.class); + } + public TypeElementContext typeElement(int i) { + return getRuleContext(TypeElementContext.class,i); + } + public InterfaceTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_interfaceType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterInterfaceType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitInterfaceType(this); + } + } + + public final InterfaceTypeContext interfaceType() throws RecognitionException { + InterfaceTypeContext _localctx = new InterfaceTypeContext(_ctx, getState()); + enterRule(_localctx, 134, RULE_interfaceType); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(720); + match(INTERFACE); + setState(721); + match(L_CURLY); + setState(730); + _errHandler.sync(this); + _la = _input.LA(1); + while (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (FUNC - 3)) | (1L << (INTERFACE - 3)) | (1L << (MAP - 3)) | (1L << (STRUCT - 3)) | (1L << (CHAN - 3)) | (1L << (IDENTIFIER - 3)) | (1L << (L_PAREN - 3)) | (1L << (L_BRACKET - 3)) | (1L << (UNDERLYING - 3)) | (1L << (STAR - 3)) | (1L << (RECEIVE - 3)))) != 0)) { + { + { + setState(724); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,76,_ctx) ) { + case 1: + { + setState(722); + methodSpec(); + } + break; + case 2: + { + setState(723); + typeElement(); + } + break; + } + setState(726); + eos(); + } + } + setState(732); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(733); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SliceTypeContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public SliceTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_sliceType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSliceType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSliceType(this); + } + } + + public final SliceTypeContext sliceType() throws RecognitionException { + SliceTypeContext _localctx = new SliceTypeContext(_ctx, getState()); + enterRule(_localctx, 136, RULE_sliceType); + try { + enterOuterAlt(_localctx, 1); + { + setState(735); + match(L_BRACKET); + setState(736); + match(R_BRACKET); + setState(737); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MapTypeContext extends ParserRuleContext { + public TerminalNode MAP() { return getToken(GoParser.MAP, 0); } + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public MapTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_mapType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterMapType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitMapType(this); + } + } + + public final MapTypeContext mapType() throws RecognitionException { + MapTypeContext _localctx = new MapTypeContext(_ctx, getState()); + enterRule(_localctx, 138, RULE_mapType); + try { + enterOuterAlt(_localctx, 1); + { + setState(739); + match(MAP); + setState(740); + match(L_BRACKET); + setState(741); + type_(); + setState(742); + match(R_BRACKET); + setState(743); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ChannelTypeContext extends ParserRuleContext { + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public TerminalNode CHAN() { return getToken(GoParser.CHAN, 0); } + public TerminalNode RECEIVE() { return getToken(GoParser.RECEIVE, 0); } + public ChannelTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_channelType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterChannelType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitChannelType(this); + } + } + + public final ChannelTypeContext channelType() throws RecognitionException { + ChannelTypeContext _localctx = new ChannelTypeContext(_ctx, getState()); + enterRule(_localctx, 140, RULE_channelType); + try { + enterOuterAlt(_localctx, 1); + { + setState(750); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,78,_ctx) ) { + case 1: + { + setState(745); + match(CHAN); + } + break; + case 2: + { + setState(746); + match(CHAN); + setState(747); + match(RECEIVE); + } + break; + case 3: + { + setState(748); + match(RECEIVE); + setState(749); + match(CHAN); + } + break; + } + setState(752); + elementType(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodSpecContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public ResultContext result() { + return getRuleContext(ResultContext.class,0); + } + public MethodSpecContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodSpec; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterMethodSpec(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitMethodSpec(this); + } + } + + public final MethodSpecContext methodSpec() throws RecognitionException { + MethodSpecContext _localctx = new MethodSpecContext(_ctx, getState()); + enterRule(_localctx, 142, RULE_methodSpec); + try { + setState(760); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,79,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(754); + match(IDENTIFIER); + setState(755); + parameters(); + setState(756); + result(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(758); + match(IDENTIFIER); + setState(759); + parameters(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionTypeContext extends ParserRuleContext { + public TerminalNode FUNC() { return getToken(GoParser.FUNC, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public FunctionTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterFunctionType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitFunctionType(this); + } + } + + public final FunctionTypeContext functionType() throws RecognitionException { + FunctionTypeContext _localctx = new FunctionTypeContext(_ctx, getState()); + enterRule(_localctx, 144, RULE_functionType); + try { + enterOuterAlt(_localctx, 1); + { + setState(762); + match(FUNC); + setState(763); + signature(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class SignatureContext extends ParserRuleContext { + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public ResultContext result() { + return getRuleContext(ResultContext.class,0); + } + public SignatureContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_signature; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSignature(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSignature(this); + } + } + + public final SignatureContext signature() throws RecognitionException { + SignatureContext _localctx = new SignatureContext(_ctx, getState()); + enterRule(_localctx, 146, RULE_signature); + try { + enterOuterAlt(_localctx, 1); + { + setState(765); + parameters(); + setState(767); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,80,_ctx) ) { + case 1: + { + setState(766); + result(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ResultContext extends ParserRuleContext { + public ParametersContext parameters() { + return getRuleContext(ParametersContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public ResultContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_result; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterResult(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitResult(this); + } + } + + public final ResultContext result() throws RecognitionException { + ResultContext _localctx = new ResultContext(_ctx, getState()); + enterRule(_localctx, 148, RULE_result); + try { + setState(771); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,81,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(769); + parameters(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(770); + type_(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ParametersContext extends ParserRuleContext { + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public List parameterDecl() { + return getRuleContexts(ParameterDeclContext.class); + } + public ParameterDeclContext parameterDecl(int i) { + return getRuleContext(ParameterDeclContext.class,i); + } + public List COMMA() { return getTokens(GoParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GoParser.COMMA, i); + } + public ParametersContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_parameters; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterParameters(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitParameters(this); + } + } + + public final ParametersContext parameters() throws RecognitionException { + ParametersContext _localctx = new ParametersContext(_ctx, getState()); + enterRule(_localctx, 150, RULE_parameters); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(773); + match(L_PAREN); + setState(785); + _errHandler.sync(this); + _la = _input.LA(1); + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (FUNC - 3)) | (1L << (INTERFACE - 3)) | (1L << (MAP - 3)) | (1L << (STRUCT - 3)) | (1L << (CHAN - 3)) | (1L << (IDENTIFIER - 3)) | (1L << (L_PAREN - 3)) | (1L << (L_BRACKET - 3)) | (1L << (ELLIPSIS - 3)) | (1L << (STAR - 3)) | (1L << (RECEIVE - 3)))) != 0)) { + { + setState(774); + parameterDecl(); + setState(779); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,82,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(775); + match(COMMA); + setState(776); + parameterDecl(); + } + } + } + setState(781); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,82,_ctx); + } + setState(783); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(782); + match(COMMA); + } + } + + } + } + + setState(787); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ParameterDeclContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public TerminalNode ELLIPSIS() { return getToken(GoParser.ELLIPSIS, 0); } + public ParameterDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_parameterDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterParameterDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitParameterDecl(this); + } + } + + public final ParameterDeclContext parameterDecl() throws RecognitionException { + ParameterDeclContext _localctx = new ParameterDeclContext(_ctx, getState()); + enterRule(_localctx, 152, RULE_parameterDecl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(790); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,85,_ctx) ) { + case 1: + { + setState(789); + identifierList(); + } + break; + } + setState(793); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==ELLIPSIS) { + { + setState(792); + match(ELLIPSIS); + } + } + + setState(795); + type_(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpressionContext extends ParserRuleContext { + public Token unary_op; + public Token mul_op; + public Token add_op; + public Token rel_op; + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public TerminalNode PLUS() { return getToken(GoParser.PLUS, 0); } + public TerminalNode MINUS() { return getToken(GoParser.MINUS, 0); } + public TerminalNode EXCLAMATION() { return getToken(GoParser.EXCLAMATION, 0); } + public TerminalNode CARET() { return getToken(GoParser.CARET, 0); } + public TerminalNode STAR() { return getToken(GoParser.STAR, 0); } + public TerminalNode AMPERSAND() { return getToken(GoParser.AMPERSAND, 0); } + public TerminalNode RECEIVE() { return getToken(GoParser.RECEIVE, 0); } + public TerminalNode DIV() { return getToken(GoParser.DIV, 0); } + public TerminalNode MOD() { return getToken(GoParser.MOD, 0); } + public TerminalNode LSHIFT() { return getToken(GoParser.LSHIFT, 0); } + public TerminalNode RSHIFT() { return getToken(GoParser.RSHIFT, 0); } + public TerminalNode BIT_CLEAR() { return getToken(GoParser.BIT_CLEAR, 0); } + public TerminalNode OR() { return getToken(GoParser.OR, 0); } + public TerminalNode EQUALS() { return getToken(GoParser.EQUALS, 0); } + public TerminalNode NOT_EQUALS() { return getToken(GoParser.NOT_EQUALS, 0); } + public TerminalNode LESS() { return getToken(GoParser.LESS, 0); } + public TerminalNode LESS_OR_EQUALS() { return getToken(GoParser.LESS_OR_EQUALS, 0); } + public TerminalNode GREATER() { return getToken(GoParser.GREATER, 0); } + public TerminalNode GREATER_OR_EQUALS() { return getToken(GoParser.GREATER_OR_EQUALS, 0); } + public TerminalNode LOGICAL_AND() { return getToken(GoParser.LOGICAL_AND, 0); } + public TerminalNode LOGICAL_OR() { return getToken(GoParser.LOGICAL_OR, 0); } + public ExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitExpression(this); + } + } + + public final ExpressionContext expression() throws RecognitionException { + return expression(0); + } + + private ExpressionContext expression(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState); + ExpressionContext _prevctx = _localctx; + int _startState = 154; + enterRecursionRule(_localctx, 154, RULE_expression, _p); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(801); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,87,_ctx) ) { + case 1: + { + setState(798); + primaryExpr(0); + } + break; + case 2: + { + setState(799); + ((ExpressionContext)_localctx).unary_op = _input.LT(1); + _la = _input.LA(1); + if ( !(((((_la - 58)) & ~0x3f) == 0 && ((1L << (_la - 58)) & ((1L << (EXCLAMATION - 58)) | (1L << (PLUS - 58)) | (1L << (MINUS - 58)) | (1L << (CARET - 58)) | (1L << (STAR - 58)) | (1L << (AMPERSAND - 58)) | (1L << (RECEIVE - 58)))) != 0)) ) { + ((ExpressionContext)_localctx).unary_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(800); + expression(6); + } + break; + } + _ctx.stop = _input.LT(-1); + setState(820); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,89,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + setState(818); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,88,_ctx) ) { + case 1: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(803); + if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); + setState(804); + ((ExpressionContext)_localctx).mul_op = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << DIV) | (1L << MOD) | (1L << LSHIFT) | (1L << RSHIFT) | (1L << BIT_CLEAR) | (1L << STAR) | (1L << AMPERSAND))) != 0)) ) { + ((ExpressionContext)_localctx).mul_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(805); + expression(6); + } + break; + case 2: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(806); + if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); + setState(807); + ((ExpressionContext)_localctx).add_op = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << OR) | (1L << PLUS) | (1L << MINUS) | (1L << CARET))) != 0)) ) { + ((ExpressionContext)_localctx).add_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(808); + expression(5); + } + break; + case 3: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(809); + if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); + setState(810); + ((ExpressionContext)_localctx).rel_op = _input.LT(1); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQUALS) | (1L << NOT_EQUALS) | (1L << LESS) | (1L << LESS_OR_EQUALS) | (1L << GREATER) | (1L << GREATER_OR_EQUALS))) != 0)) ) { + ((ExpressionContext)_localctx).rel_op = (Token)_errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(811); + expression(4); + } + break; + case 4: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(812); + if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); + setState(813); + match(LOGICAL_AND); + setState(814); + expression(3); + } + break; + case 5: + { + _localctx = new ExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_expression); + setState(815); + if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); + setState(816); + match(LOGICAL_OR); + setState(817); + expression(2); + } + break; + } + } + } + setState(822); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,89,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public static class PrimaryExprContext extends ParserRuleContext { + public OperandContext operand() { + return getRuleContext(OperandContext.class,0); + } + public ConversionContext conversion() { + return getRuleContext(ConversionContext.class,0); + } + public MethodExprContext methodExpr() { + return getRuleContext(MethodExprContext.class,0); + } + public PrimaryExprContext primaryExpr() { + return getRuleContext(PrimaryExprContext.class,0); + } + public TerminalNode DOT() { return getToken(GoParser.DOT, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public IndexContext index() { + return getRuleContext(IndexContext.class,0); + } + public Slice_Context slice_() { + return getRuleContext(Slice_Context.class,0); + } + public TypeAssertionContext typeAssertion() { + return getRuleContext(TypeAssertionContext.class,0); + } + public ArgumentsContext arguments() { + return getRuleContext(ArgumentsContext.class,0); + } + public PrimaryExprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_primaryExpr; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterPrimaryExpr(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitPrimaryExpr(this); + } + } + + public final PrimaryExprContext primaryExpr() throws RecognitionException { + return primaryExpr(0); + } + + private PrimaryExprContext primaryExpr(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + PrimaryExprContext _localctx = new PrimaryExprContext(_ctx, _parentState); + PrimaryExprContext _prevctx = _localctx; + int _startState = 156; + enterRecursionRule(_localctx, 156, RULE_primaryExpr, _p); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(827); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,90,_ctx) ) { + case 1: + { + setState(824); + operand(); + } + break; + case 2: + { + setState(825); + conversion(); + } + break; + case 3: + { + setState(826); + methodExpr(); + } + break; + } + _ctx.stop = _input.LT(-1); + setState(840); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,92,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + { + _localctx = new PrimaryExprContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_primaryExpr); + setState(829); + if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); + setState(836); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,91,_ctx) ) { + case 1: + { + setState(830); + match(DOT); + setState(831); + match(IDENTIFIER); + } + break; + case 2: + { + setState(832); + index(); + } + break; + case 3: + { + setState(833); + slice_(); + } + break; + case 4: + { + setState(834); + typeAssertion(); + } + break; + case 5: + { + setState(835); + arguments(); + } + break; + } + } + } + } + setState(842); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,92,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public static class ConversionContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public TerminalNode COMMA() { return getToken(GoParser.COMMA, 0); } + public ConversionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_conversion; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterConversion(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitConversion(this); + } + } + + public final ConversionContext conversion() throws RecognitionException { + ConversionContext _localctx = new ConversionContext(_ctx, getState()); + enterRule(_localctx, 158, RULE_conversion); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(843); + type_(); + setState(844); + match(L_PAREN); + setState(845); + expression(0); + setState(847); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(846); + match(COMMA); + } + } + + setState(849); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OperandContext extends ParserRuleContext { + public LiteralContext literal() { + return getRuleContext(LiteralContext.class,0); + } + public OperandNameContext operandName() { + return getRuleContext(OperandNameContext.class,0); + } + public TypeArgsContext typeArgs() { + return getRuleContext(TypeArgsContext.class,0); + } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public OperandContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_operand; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterOperand(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitOperand(this); + } + } + + public final OperandContext operand() throws RecognitionException { + OperandContext _localctx = new OperandContext(_ctx, getState()); + enterRule(_localctx, 160, RULE_operand); + try { + setState(860); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,95,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(851); + literal(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(852); + operandName(); + setState(854); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,94,_ctx) ) { + case 1: + { + setState(853); + typeArgs(); + } + break; + } + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(856); + match(L_PAREN); + setState(857); + expression(0); + setState(858); + match(R_PAREN); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralContext extends ParserRuleContext { + public BasicLitContext basicLit() { + return getRuleContext(BasicLitContext.class,0); + } + public CompositeLitContext compositeLit() { + return getRuleContext(CompositeLitContext.class,0); + } + public FunctionLitContext functionLit() { + return getRuleContext(FunctionLitContext.class,0); + } + public LiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literal; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitLiteral(this); + } + } + + public final LiteralContext literal() throws RecognitionException { + LiteralContext _localctx = new LiteralContext(_ctx, getState()); + enterRule(_localctx, 162, RULE_literal); + try { + setState(865); + _errHandler.sync(this); + switch (_input.LA(1)) { + case NIL_LIT: + case DECIMAL_LIT: + case BINARY_LIT: + case OCTAL_LIT: + case HEX_LIT: + case FLOAT_LIT: + case IMAGINARY_LIT: + case RUNE_LIT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + enterOuterAlt(_localctx, 1); + { + setState(862); + basicLit(); + } + break; + case MAP: + case STRUCT: + case IDENTIFIER: + case L_BRACKET: + enterOuterAlt(_localctx, 2); + { + setState(863); + compositeLit(); + } + break; + case FUNC: + enterOuterAlt(_localctx, 3); + { + setState(864); + functionLit(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BasicLitContext extends ParserRuleContext { + public TerminalNode NIL_LIT() { return getToken(GoParser.NIL_LIT, 0); } + public IntegerContext integer() { + return getRuleContext(IntegerContext.class,0); + } + public String_Context string_() { + return getRuleContext(String_Context.class,0); + } + public TerminalNode FLOAT_LIT() { return getToken(GoParser.FLOAT_LIT, 0); } + public BasicLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_basicLit; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterBasicLit(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitBasicLit(this); + } + } + + public final BasicLitContext basicLit() throws RecognitionException { + BasicLitContext _localctx = new BasicLitContext(_ctx, getState()); + enterRule(_localctx, 164, RULE_basicLit); + try { + setState(871); + _errHandler.sync(this); + switch (_input.LA(1)) { + case NIL_LIT: + enterOuterAlt(_localctx, 1); + { + setState(867); + match(NIL_LIT); + } + break; + case DECIMAL_LIT: + case BINARY_LIT: + case OCTAL_LIT: + case HEX_LIT: + case IMAGINARY_LIT: + case RUNE_LIT: + enterOuterAlt(_localctx, 2); + { + setState(868); + integer(); + } + break; + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + enterOuterAlt(_localctx, 3); + { + setState(869); + string_(); + } + break; + case FLOAT_LIT: + enterOuterAlt(_localctx, 4); + { + setState(870); + match(FLOAT_LIT); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IntegerContext extends ParserRuleContext { + public TerminalNode DECIMAL_LIT() { return getToken(GoParser.DECIMAL_LIT, 0); } + public TerminalNode BINARY_LIT() { return getToken(GoParser.BINARY_LIT, 0); } + public TerminalNode OCTAL_LIT() { return getToken(GoParser.OCTAL_LIT, 0); } + public TerminalNode HEX_LIT() { return getToken(GoParser.HEX_LIT, 0); } + public TerminalNode IMAGINARY_LIT() { return getToken(GoParser.IMAGINARY_LIT, 0); } + public TerminalNode RUNE_LIT() { return getToken(GoParser.RUNE_LIT, 0); } + public IntegerContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_integer; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterInteger(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitInteger(this); + } + } + + public final IntegerContext integer() throws RecognitionException { + IntegerContext _localctx = new IntegerContext(_ctx, getState()); + enterRule(_localctx, 166, RULE_integer); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(873); + _la = _input.LA(1); + if ( !(((((_la - 65)) & ~0x3f) == 0 && ((1L << (_la - 65)) & ((1L << (DECIMAL_LIT - 65)) | (1L << (BINARY_LIT - 65)) | (1L << (OCTAL_LIT - 65)) | (1L << (HEX_LIT - 65)) | (1L << (IMAGINARY_LIT - 65)) | (1L << (RUNE_LIT - 65)))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class OperandNameContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public OperandNameContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_operandName; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterOperandName(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitOperandName(this); + } + } + + public final OperandNameContext operandName() throws RecognitionException { + OperandNameContext _localctx = new OperandNameContext(_ctx, getState()); + enterRule(_localctx, 168, RULE_operandName); + try { + enterOuterAlt(_localctx, 1); + { + setState(875); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class QualifiedIdentContext extends ParserRuleContext { + public List IDENTIFIER() { return getTokens(GoParser.IDENTIFIER); } + public TerminalNode IDENTIFIER(int i) { + return getToken(GoParser.IDENTIFIER, i); + } + public TerminalNode DOT() { return getToken(GoParser.DOT, 0); } + public QualifiedIdentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_qualifiedIdent; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterQualifiedIdent(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitQualifiedIdent(this); + } + } + + public final QualifiedIdentContext qualifiedIdent() throws RecognitionException { + QualifiedIdentContext _localctx = new QualifiedIdentContext(_ctx, getState()); + enterRule(_localctx, 170, RULE_qualifiedIdent); + try { + enterOuterAlt(_localctx, 1); + { + setState(877); + match(IDENTIFIER); + setState(878); + match(DOT); + setState(879); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class CompositeLitContext extends ParserRuleContext { + public LiteralTypeContext literalType() { + return getRuleContext(LiteralTypeContext.class,0); + } + public LiteralValueContext literalValue() { + return getRuleContext(LiteralValueContext.class,0); + } + public CompositeLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_compositeLit; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterCompositeLit(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitCompositeLit(this); + } + } + + public final CompositeLitContext compositeLit() throws RecognitionException { + CompositeLitContext _localctx = new CompositeLitContext(_ctx, getState()); + enterRule(_localctx, 172, RULE_compositeLit); + try { + enterOuterAlt(_localctx, 1); + { + setState(881); + literalType(); + setState(882); + literalValue(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralTypeContext extends ParserRuleContext { + public StructTypeContext structType() { + return getRuleContext(StructTypeContext.class,0); + } + public ArrayTypeContext arrayType() { + return getRuleContext(ArrayTypeContext.class,0); + } + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public TerminalNode ELLIPSIS() { return getToken(GoParser.ELLIPSIS, 0); } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public ElementTypeContext elementType() { + return getRuleContext(ElementTypeContext.class,0); + } + public SliceTypeContext sliceType() { + return getRuleContext(SliceTypeContext.class,0); + } + public MapTypeContext mapType() { + return getRuleContext(MapTypeContext.class,0); + } + public TypeNameContext typeName() { + return getRuleContext(TypeNameContext.class,0); + } + public TypeArgsContext typeArgs() { + return getRuleContext(TypeArgsContext.class,0); + } + public LiteralTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literalType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterLiteralType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitLiteralType(this); + } + } + + public final LiteralTypeContext literalType() throws RecognitionException { + LiteralTypeContext _localctx = new LiteralTypeContext(_ctx, getState()); + enterRule(_localctx, 174, RULE_literalType); + int _la; + try { + setState(896); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,99,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(884); + structType(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(885); + arrayType(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(886); + match(L_BRACKET); + setState(887); + match(ELLIPSIS); + setState(888); + match(R_BRACKET); + setState(889); + elementType(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(890); + sliceType(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(891); + mapType(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(892); + typeName(); + setState(894); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==L_BRACKET) { + { + setState(893); + typeArgs(); + } + } + + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralValueContext extends ParserRuleContext { + public TerminalNode L_CURLY() { return getToken(GoParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GoParser.R_CURLY, 0); } + public ElementListContext elementList() { + return getRuleContext(ElementListContext.class,0); + } + public TerminalNode COMMA() { return getToken(GoParser.COMMA, 0); } + public LiteralValueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literalValue; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterLiteralValue(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitLiteralValue(this); + } + } + + public final LiteralValueContext literalValue() throws RecognitionException { + LiteralValueContext _localctx = new LiteralValueContext(_ctx, getState()); + enterRule(_localctx, 176, RULE_literalValue); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(898); + match(L_CURLY); + setState(903); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_CURLY) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(899); + elementList(); + setState(901); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(900); + match(COMMA); + } + } + + } + } + + setState(905); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ElementListContext extends ParserRuleContext { + public List keyedElement() { + return getRuleContexts(KeyedElementContext.class); + } + public KeyedElementContext keyedElement(int i) { + return getRuleContext(KeyedElementContext.class,i); + } + public List COMMA() { return getTokens(GoParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GoParser.COMMA, i); + } + public ElementListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_elementList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterElementList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitElementList(this); + } + } + + public final ElementListContext elementList() throws RecognitionException { + ElementListContext _localctx = new ElementListContext(_ctx, getState()); + enterRule(_localctx, 178, RULE_elementList); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(907); + keyedElement(); + setState(912); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,102,_ctx); + while ( _alt!=2 && _alt!= ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(908); + match(COMMA); + setState(909); + keyedElement(); + } + } + } + setState(914); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,102,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class KeyedElementContext extends ParserRuleContext { + public ElementContext element() { + return getRuleContext(ElementContext.class,0); + } + public KeyContext key() { + return getRuleContext(KeyContext.class,0); + } + public TerminalNode COLON() { return getToken(GoParser.COLON, 0); } + public KeyedElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_keyedElement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterKeyedElement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitKeyedElement(this); + } + } + + public final KeyedElementContext keyedElement() throws RecognitionException { + KeyedElementContext _localctx = new KeyedElementContext(_ctx, getState()); + enterRule(_localctx, 180, RULE_keyedElement); + try { + enterOuterAlt(_localctx, 1); + { + setState(918); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,103,_ctx) ) { + case 1: + { + setState(915); + key(); + setState(916); + match(COLON); + } + break; + } + setState(920); + element(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class KeyContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public LiteralValueContext literalValue() { + return getRuleContext(LiteralValueContext.class,0); + } + public KeyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_key; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterKey(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitKey(this); + } + } + + public final KeyContext key() throws RecognitionException { + KeyContext _localctx = new KeyContext(_ctx, getState()); + enterRule(_localctx, 182, RULE_key); + try { + setState(924); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case NIL_LIT: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case EXCLAMATION: + case PLUS: + case MINUS: + case CARET: + case STAR: + case AMPERSAND: + case RECEIVE: + case DECIMAL_LIT: + case BINARY_LIT: + case OCTAL_LIT: + case HEX_LIT: + case FLOAT_LIT: + case IMAGINARY_LIT: + case RUNE_LIT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + enterOuterAlt(_localctx, 1); + { + setState(922); + expression(0); + } + break; + case L_CURLY: + enterOuterAlt(_localctx, 2); + { + setState(923); + literalValue(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ElementContext extends ParserRuleContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public LiteralValueContext literalValue() { + return getRuleContext(LiteralValueContext.class,0); + } + public ElementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_element; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterElement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitElement(this); + } + } + + public final ElementContext element() throws RecognitionException { + ElementContext _localctx = new ElementContext(_ctx, getState()); + enterRule(_localctx, 184, RULE_element); + try { + setState(928); + _errHandler.sync(this); + switch (_input.LA(1)) { + case FUNC: + case INTERFACE: + case MAP: + case STRUCT: + case CHAN: + case NIL_LIT: + case IDENTIFIER: + case L_PAREN: + case L_BRACKET: + case EXCLAMATION: + case PLUS: + case MINUS: + case CARET: + case STAR: + case AMPERSAND: + case RECEIVE: + case DECIMAL_LIT: + case BINARY_LIT: + case OCTAL_LIT: + case HEX_LIT: + case FLOAT_LIT: + case IMAGINARY_LIT: + case RUNE_LIT: + case RAW_STRING_LIT: + case INTERPRETED_STRING_LIT: + enterOuterAlt(_localctx, 1); + { + setState(926); + expression(0); + } + break; + case L_CURLY: + enterOuterAlt(_localctx, 2); + { + setState(927); + literalValue(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StructTypeContext extends ParserRuleContext { + public TerminalNode STRUCT() { return getToken(GoParser.STRUCT, 0); } + public TerminalNode L_CURLY() { return getToken(GoParser.L_CURLY, 0); } + public TerminalNode R_CURLY() { return getToken(GoParser.R_CURLY, 0); } + public List fieldDecl() { + return getRuleContexts(FieldDeclContext.class); + } + public FieldDeclContext fieldDecl(int i) { + return getRuleContext(FieldDeclContext.class,i); + } + public List eos() { + return getRuleContexts(EosContext.class); + } + public EosContext eos(int i) { + return getRuleContext(EosContext.class,i); + } + public StructTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_structType; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterStructType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitStructType(this); + } + } + + public final StructTypeContext structType() throws RecognitionException { + StructTypeContext _localctx = new StructTypeContext(_ctx, getState()); + enterRule(_localctx, 186, RULE_structType); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(930); + match(STRUCT); + setState(931); + match(L_CURLY); + setState(937); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER || _la==STAR) { + { + { + setState(932); + fieldDecl(); + setState(933); + eos(); + } + } + setState(939); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(940); + match(R_CURLY); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FieldDeclContext extends ParserRuleContext { + public String_Context tag; + public IdentifierListContext identifierList() { + return getRuleContext(IdentifierListContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public EmbeddedFieldContext embeddedField() { + return getRuleContext(EmbeddedFieldContext.class,0); + } + public String_Context string_() { + return getRuleContext(String_Context.class,0); + } + public FieldDeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fieldDecl; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterFieldDecl(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitFieldDecl(this); + } + } + + public final FieldDeclContext fieldDecl() throws RecognitionException { + FieldDeclContext _localctx = new FieldDeclContext(_ctx, getState()); + enterRule(_localctx, 188, RULE_fieldDecl); + try { + enterOuterAlt(_localctx, 1); + { + setState(946); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,107,_ctx) ) { + case 1: + { + setState(942); + identifierList(); + setState(943); + type_(); + } + break; + case 2: + { + setState(945); + embeddedField(); + } + break; + } + setState(949); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,108,_ctx) ) { + case 1: + { + setState(948); + ((FieldDeclContext)_localctx).tag = string_(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class String_Context extends ParserRuleContext { + public TerminalNode RAW_STRING_LIT() { return getToken(GoParser.RAW_STRING_LIT, 0); } + public TerminalNode INTERPRETED_STRING_LIT() { return getToken(GoParser.INTERPRETED_STRING_LIT, 0); } + public String_Context(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_string_; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterString_(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitString_(this); + } + } + + public final String_Context string_() throws RecognitionException { + String_Context _localctx = new String_Context(_ctx, getState()); + enterRule(_localctx, 190, RULE_string_); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(951); + _la = _input.LA(1); + if ( !(_la==RAW_STRING_LIT || _la==INTERPRETED_STRING_LIT) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EmbeddedFieldContext extends ParserRuleContext { + public TypeNameContext typeName() { + return getRuleContext(TypeNameContext.class,0); + } + public TerminalNode STAR() { return getToken(GoParser.STAR, 0); } + public TypeArgsContext typeArgs() { + return getRuleContext(TypeArgsContext.class,0); + } + public EmbeddedFieldContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_embeddedField; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterEmbeddedField(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitEmbeddedField(this); + } + } + + public final EmbeddedFieldContext embeddedField() throws RecognitionException { + EmbeddedFieldContext _localctx = new EmbeddedFieldContext(_ctx, getState()); + enterRule(_localctx, 192, RULE_embeddedField); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(954); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==STAR) { + { + setState(953); + match(STAR); + } + } + + setState(956); + typeName(); + setState(958); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,110,_ctx) ) { + case 1: + { + setState(957); + typeArgs(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FunctionLitContext extends ParserRuleContext { + public TerminalNode FUNC() { return getToken(GoParser.FUNC, 0); } + public SignatureContext signature() { + return getRuleContext(SignatureContext.class,0); + } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public FunctionLitContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_functionLit; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterFunctionLit(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitFunctionLit(this); + } + } + + public final FunctionLitContext functionLit() throws RecognitionException { + FunctionLitContext _localctx = new FunctionLitContext(_ctx, getState()); + enterRule(_localctx, 194, RULE_functionLit); + try { + enterOuterAlt(_localctx, 1); + { + setState(960); + match(FUNC); + setState(961); + signature(); + setState(962); + block(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IndexContext extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public IndexContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_index; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterIndex(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitIndex(this); + } + } + + public final IndexContext index() throws RecognitionException { + IndexContext _localctx = new IndexContext(_ctx, getState()); + enterRule(_localctx, 196, RULE_index); + try { + enterOuterAlt(_localctx, 1); + { + setState(964); + match(L_BRACKET); + setState(965); + expression(0); + setState(966); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Slice_Context extends ParserRuleContext { + public TerminalNode L_BRACKET() { return getToken(GoParser.L_BRACKET, 0); } + public TerminalNode R_BRACKET() { return getToken(GoParser.R_BRACKET, 0); } + public List COLON() { return getTokens(GoParser.COLON); } + public TerminalNode COLON(int i) { + return getToken(GoParser.COLON, i); + } + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public Slice_Context(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_slice_; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterSlice_(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitSlice_(this); + } + } + + public final Slice_Context slice_() throws RecognitionException { + Slice_Context _localctx = new Slice_Context(_ctx, getState()); + enterRule(_localctx, 198, RULE_slice_); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(968); + match(L_BRACKET); + setState(984); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,114,_ctx) ) { + case 1: + { + setState(970); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(969); + expression(0); + } + } + + setState(972); + match(COLON); + setState(974); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(973); + expression(0); + } + } + + } + break; + case 2: + { + setState(977); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(976); + expression(0); + } + } + + setState(979); + match(COLON); + setState(980); + expression(0); + setState(981); + match(COLON); + setState(982); + expression(0); + } + break; + } + setState(986); + match(R_BRACKET); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class TypeAssertionContext extends ParserRuleContext { + public TerminalNode DOT() { return getToken(GoParser.DOT, 0); } + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public TypeAssertionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_typeAssertion; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterTypeAssertion(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitTypeAssertion(this); + } + } + + public final TypeAssertionContext typeAssertion() throws RecognitionException { + TypeAssertionContext _localctx = new TypeAssertionContext(_ctx, getState()); + enterRule(_localctx, 200, RULE_typeAssertion); + try { + enterOuterAlt(_localctx, 1); + { + setState(988); + match(DOT); + setState(989); + match(L_PAREN); + setState(990); + type_(); + setState(991); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ArgumentsContext extends ParserRuleContext { + public TerminalNode L_PAREN() { return getToken(GoParser.L_PAREN, 0); } + public TerminalNode R_PAREN() { return getToken(GoParser.R_PAREN, 0); } + public ExpressionListContext expressionList() { + return getRuleContext(ExpressionListContext.class,0); + } + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode ELLIPSIS() { return getToken(GoParser.ELLIPSIS, 0); } + public List COMMA() { return getTokens(GoParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(GoParser.COMMA, i); + } + public ArgumentsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_arguments; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterArguments(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitArguments(this); + } + } + + public final ArgumentsContext arguments() throws RecognitionException { + ArgumentsContext _localctx = new ArgumentsContext(_ctx, getState()); + enterRule(_localctx, 202, RULE_arguments); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(993); + match(L_PAREN); + setState(1008); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FUNC) | (1L << INTERFACE) | (1L << MAP) | (1L << STRUCT) | (1L << CHAN) | (1L << NIL_LIT) | (1L << IDENTIFIER) | (1L << L_PAREN) | (1L << L_BRACKET) | (1L << EXCLAMATION) | (1L << PLUS) | (1L << MINUS) | (1L << CARET) | (1L << STAR) | (1L << AMPERSAND))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (RECEIVE - 64)) | (1L << (DECIMAL_LIT - 64)) | (1L << (BINARY_LIT - 64)) | (1L << (OCTAL_LIT - 64)) | (1L << (HEX_LIT - 64)) | (1L << (FLOAT_LIT - 64)) | (1L << (IMAGINARY_LIT - 64)) | (1L << (RUNE_LIT - 64)) | (1L << (RAW_STRING_LIT - 64)) | (1L << (INTERPRETED_STRING_LIT - 64)))) != 0)) { + { + setState(1000); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,116,_ctx) ) { + case 1: + { + setState(994); + expressionList(); + } + break; + case 2: + { + setState(995); + type_(); + setState(998); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,115,_ctx) ) { + case 1: + { + setState(996); + match(COMMA); + setState(997); + expressionList(); + } + break; + } + } + break; + } + setState(1003); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==ELLIPSIS) { + { + setState(1002); + match(ELLIPSIS); + } + } + + setState(1006); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==COMMA) { + { + setState(1005); + match(COMMA); + } + } + + } + } + + setState(1010); + match(R_PAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class MethodExprContext extends ParserRuleContext { + public Type_Context type_() { + return getRuleContext(Type_Context.class,0); + } + public TerminalNode DOT() { return getToken(GoParser.DOT, 0); } + public TerminalNode IDENTIFIER() { return getToken(GoParser.IDENTIFIER, 0); } + public MethodExprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodExpr; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterMethodExpr(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitMethodExpr(this); + } + } + + public final MethodExprContext methodExpr() throws RecognitionException { + MethodExprContext _localctx = new MethodExprContext(_ctx, getState()); + enterRule(_localctx, 204, RULE_methodExpr); + try { + enterOuterAlt(_localctx, 1); + { + setState(1012); + type_(); + setState(1013); + match(DOT); + setState(1014); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EosContext extends ParserRuleContext { + public TerminalNode SEMI() { return getToken(GoParser.SEMI, 0); } + public TerminalNode EOF() { return getToken(GoParser.EOF, 0); } + public TerminalNode EOS() { return getToken(GoParser.EOS, 0); } + public EosContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_eos; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).enterEos(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof GoParserListener) ((GoParserListener)listener).exitEos(this); + } + } + + public final EosContext eos() throws RecognitionException { + EosContext _localctx = new EosContext(_ctx, getState()); + enterRule(_localctx, 206, RULE_eos); + try { + setState(1020); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,120,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(1016); + match(SEMI); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(1017); + match(EOF); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(1018); + match(EOS); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(1019); + if (!(this.closingBracket())) throw new FailedPredicateException(this, "this.closingBracket()"); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 25: + return statementList_sempred((StatementListContext)_localctx, predIndex); + case 77: + return expression_sempred((ExpressionContext)_localctx, predIndex); + case 78: + return primaryExpr_sempred((PrimaryExprContext)_localctx, predIndex); + case 103: + return eos_sempred((EosContext)_localctx, predIndex); + } + return true; + } + private boolean statementList_sempred(StatementListContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return this.closingBracket(); + } + return true; + } + private boolean expression_sempred(ExpressionContext _localctx, int predIndex) { + switch (predIndex) { + case 1: + return precpred(_ctx, 5); + case 2: + return precpred(_ctx, 4); + case 3: + return precpred(_ctx, 3); + case 4: + return precpred(_ctx, 2); + case 5: + return precpred(_ctx, 1); + } + return true; + } + private boolean primaryExpr_sempred(PrimaryExprContext _localctx, int predIndex) { + switch (predIndex) { + case 6: + return precpred(_ctx, 1); + } + return true; + } + private boolean eos_sempred(EosContext _localctx, int predIndex) { + switch (predIndex) { + case 7: + return this.closingBracket(); + } + return true; + } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\\\u0401\4\2\t\2\4"+ + "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ + "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ + ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ + "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ + "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+ + "\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+ + "\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_\4"+ + "`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\3\2\3\2\3\2"+ + "\3\2\3\2\7\2\u00d8\n\2\f\2\16\2\u00db\13\2\3\2\3\2\3\2\5\2\u00e0\n\2\3"+ + "\2\3\2\7\2\u00e4\n\2\f\2\16\2\u00e7\13\2\3\2\3\2\3\3\3\3\3\3\3\4\3\4\3"+ + "\4\3\4\3\4\3\4\7\4\u00f4\n\4\f\4\16\4\u00f7\13\4\3\4\5\4\u00fa\n\4\3\5"+ + "\5\5\u00fd\n\5\3\5\3\5\3\6\3\6\3\7\3\7\3\7\5\7\u0106\n\7\3\b\3\b\3\b\3"+ + "\b\3\b\3\b\7\b\u010e\n\b\f\b\16\b\u0111\13\b\3\b\5\b\u0114\n\b\3\t\3\t"+ + "\5\t\u0118\n\t\3\t\3\t\5\t\u011c\n\t\3\n\3\n\3\n\7\n\u0121\n\n\f\n\16"+ + "\n\u0124\13\n\3\13\3\13\3\13\7\13\u0129\n\13\f\13\16\13\u012c\13\13\3"+ + "\f\3\f\3\r\7\r\u0131\n\r\f\r\16\r\u0134\13\r\3\r\3\r\3\r\3\r\3\r\3\r\7"+ + "\r\u013c\n\r\f\r\16\r\u013f\13\r\3\r\5\r\u0142\n\r\3\16\3\16\5\16\u0146"+ + "\n\16\3\17\3\17\3\17\3\17\3\20\3\20\5\20\u014e\n\20\3\20\3\20\3\21\3\21"+ + "\3\21\3\21\7\21\u0156\n\21\f\21\16\21\u0159\13\21\3\21\3\21\3\22\3\22"+ + "\3\22\3\23\3\23\3\23\7\23\u0163\n\23\f\23\16\23\u0166\13\23\3\24\5\24"+ + "\u0169\n\24\3\24\3\24\3\25\3\25\3\25\5\25\u0170\n\25\3\25\3\25\5\25\u0174"+ + "\n\25\3\26\3\26\3\26\3\26\3\26\5\26\u017b\n\26\3\27\3\27\3\30\3\30\3\30"+ + "\3\30\3\30\3\30\7\30\u0185\n\30\f\30\16\30\u0188\13\30\3\30\5\30\u018b"+ + "\n\30\3\31\3\31\3\31\3\31\5\31\u0191\n\31\3\31\3\31\5\31\u0195\n\31\3"+ + "\32\3\32\5\32\u0199\n\32\3\32\3\32\3\33\5\33\u019e\n\33\3\33\5\33\u01a1"+ + "\n\33\3\33\5\33\u01a4\n\33\3\33\3\33\3\33\6\33\u01a9\n\33\r\33\16\33\u01aa"+ + "\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34"+ + "\3\34\5\34\u01bc\n\34\3\35\3\35\3\35\3\35\3\35\5\35\u01c3\n\35\3\36\3"+ + "\36\3\37\3\37\3\37\3\37\3 \3 \3 \3!\3!\3!\3!\3\"\5\"\u01d3\n\"\3\"\3\""+ + "\3#\3#\3#\3#\3$\3$\3$\5$\u01de\n$\3%\3%\5%\u01e2\n%\3&\3&\5&\u01e6\n&"+ + "\3\'\3\'\5\'\u01ea\n\'\3(\3(\3(\3)\3)\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3"+ + "+\3+\5+\u01fd\n+\3+\3+\3+\3+\5+\u0203\n+\5+\u0205\n+\3,\3,\5,\u0209\n"+ + ",\3-\3-\5-\u020d\n-\3-\5-\u0210\n-\3-\3-\5-\u0214\n-\5-\u0216\n-\3-\3"+ + "-\7-\u021a\n-\f-\16-\u021d\13-\3-\3-\3.\3.\3.\5.\u0224\n.\3/\3/\3/\5/"+ + "\u0229\n/\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\5\60\u0234\n\60"+ + "\3\60\3\60\7\60\u0238\n\60\f\60\16\60\u023b\13\60\3\60\3\60\3\61\3\61"+ + "\5\61\u0241\n\61\3\61\3\61\3\61\3\61\3\61\3\61\3\62\3\62\3\62\5\62\u024c"+ + "\n\62\3\63\3\63\3\63\5\63\u0251\n\63\3\64\3\64\5\64\u0255\n\64\3\64\3"+ + "\64\3\64\5\64\u025a\n\64\7\64\u025c\n\64\f\64\16\64\u025f\13\64\3\65\3"+ + "\65\3\65\7\65\u0264\n\65\f\65\16\65\u0267\13\65\3\65\3\65\3\66\3\66\3"+ + "\66\5\66\u026e\n\66\3\67\3\67\3\67\5\67\u0273\n\67\3\67\5\67\u0276\n\67"+ + "\38\38\38\38\38\38\58\u027e\n8\38\38\39\39\59\u0284\n9\39\39\59\u0288"+ + "\n9\59\u028a\n9\39\39\3:\5:\u028f\n:\3:\3:\5:\u0293\n:\3:\3:\5:\u0297"+ + "\n:\3;\3;\3;\3;\3;\3;\5;\u029f\n;\3;\3;\3;\3<\3<\3<\3=\3=\5=\u02a9\n="+ + "\3=\3=\3=\3=\3=\5=\u02b0\n=\3>\3>\3>\5>\u02b5\n>\3>\3>\3?\3?\5?\u02bb"+ + "\n?\3@\3@\3@\3@\3@\3@\3@\3@\5@\u02c5\n@\3A\3A\3A\3A\3A\3B\3B\3C\3C\3D"+ + "\3D\3D\3E\3E\3E\3E\5E\u02d7\nE\3E\3E\7E\u02db\nE\fE\16E\u02de\13E\3E\3"+ + "E\3F\3F\3F\3F\3G\3G\3G\3G\3G\3G\3H\3H\3H\3H\3H\5H\u02f1\nH\3H\3H\3I\3"+ + "I\3I\3I\3I\3I\5I\u02fb\nI\3J\3J\3J\3K\3K\5K\u0302\nK\3L\3L\5L\u0306\n"+ + "L\3M\3M\3M\3M\7M\u030c\nM\fM\16M\u030f\13M\3M\5M\u0312\nM\5M\u0314\nM"+ + "\3M\3M\3N\5N\u0319\nN\3N\5N\u031c\nN\3N\3N\3O\3O\3O\3O\5O\u0324\nO\3O"+ + "\3O\3O\3O\3O\3O\3O\3O\3O\3O\3O\3O\3O\3O\3O\7O\u0335\nO\fO\16O\u0338\13"+ + "O\3P\3P\3P\3P\5P\u033e\nP\3P\3P\3P\3P\3P\3P\3P\5P\u0347\nP\7P\u0349\n"+ + "P\fP\16P\u034c\13P\3Q\3Q\3Q\3Q\5Q\u0352\nQ\3Q\3Q\3R\3R\3R\5R\u0359\nR"+ + "\3R\3R\3R\3R\5R\u035f\nR\3S\3S\3S\5S\u0364\nS\3T\3T\3T\3T\5T\u036a\nT"+ + "\3U\3U\3V\3V\3W\3W\3W\3W\3X\3X\3X\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\5Y\u0381"+ + "\nY\5Y\u0383\nY\3Z\3Z\3Z\5Z\u0388\nZ\5Z\u038a\nZ\3Z\3Z\3[\3[\3[\7[\u0391"+ + "\n[\f[\16[\u0394\13[\3\\\3\\\3\\\5\\\u0399\n\\\3\\\3\\\3]\3]\5]\u039f"+ + "\n]\3^\3^\5^\u03a3\n^\3_\3_\3_\3_\3_\7_\u03aa\n_\f_\16_\u03ad\13_\3_\3"+ + "_\3`\3`\3`\3`\5`\u03b5\n`\3`\5`\u03b8\n`\3a\3a\3b\5b\u03bd\nb\3b\3b\5"+ + "b\u03c1\nb\3c\3c\3c\3c\3d\3d\3d\3d\3e\3e\5e\u03cd\ne\3e\3e\5e\u03d1\n"+ + "e\3e\5e\u03d4\ne\3e\3e\3e\3e\3e\5e\u03db\ne\3e\3e\3f\3f\3f\3f\3f\3g\3"+ + "g\3g\3g\3g\5g\u03e9\ng\5g\u03eb\ng\3g\5g\u03ee\ng\3g\5g\u03f1\ng\5g\u03f3"+ + "\ng\3g\3g\3h\3h\3h\3h\3i\3i\3i\3i\5i\u03ff\ni\3i\2\4\u009c\u009ej\2\4"+ + "\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNP"+ + "RTVXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084\u0086\u0088\u008a\u008c\u008e"+ + "\u0090\u0092\u0094\u0096\u0098\u009a\u009c\u009e\u00a0\u00a2\u00a4\u00a6"+ + "\u00a8\u00aa\u00ac\u00ae\u00b0\u00b2\u00b4\u00b6\u00b8\u00ba\u00bc\u00be"+ + "\u00c0\u00c2\u00c4\u00c6\u00c8\u00ca\u00cc\u00ce\u00d0\2\f\4\2\35\35("+ + "(\4\2TTVV\3\2)*\4\2\65:=A\3\2\u01ca\3\2\2\2@\u01cd\3\2\2\2B\u01d2\3\2\2\2D\u01d6\3\2\2\2F\u01da"+ + "\3\2\2\2H\u01df\3\2\2\2J\u01e3\3\2\2\2L\u01e7\3\2\2\2N\u01eb\3\2\2\2P"+ + "\u01ee\3\2\2\2R\u01f0\3\2\2\2T\u01f3\3\2\2\2V\u0208\3\2\2\2X\u020a\3\2"+ + "\2\2Z\u0220\3\2\2\2\\\u0228\3\2\2\2^\u022a\3\2\2\2`\u0240\3\2\2\2b\u0248"+ + "\3\2\2\2d\u0250\3\2\2\2f\u0254\3\2\2\2h\u0260\3\2\2\2j\u026a\3\2\2\2l"+ + "\u0275\3\2\2\2n\u027d\3\2\2\2p\u0281\3\2\2\2r\u028e\3\2\2\2t\u029e\3\2"+ + "\2\2v\u02a3\3\2\2\2x\u02af\3\2\2\2z\u02b1\3\2\2\2|\u02ba\3\2\2\2~\u02c4"+ + "\3\2\2\2\u0080\u02c6\3\2\2\2\u0082\u02cb\3\2\2\2\u0084\u02cd\3\2\2\2\u0086"+ + "\u02cf\3\2\2\2\u0088\u02d2\3\2\2\2\u008a\u02e1\3\2\2\2\u008c\u02e5\3\2"+ + "\2\2\u008e\u02f0\3\2\2\2\u0090\u02fa\3\2\2\2\u0092\u02fc\3\2\2\2\u0094"+ + "\u02ff\3\2\2\2\u0096\u0305\3\2\2\2\u0098\u0307\3\2\2\2\u009a\u0318\3\2"+ + "\2\2\u009c\u0323\3\2\2\2\u009e\u033d\3\2\2\2\u00a0\u034d\3\2\2\2\u00a2"+ + "\u035e\3\2\2\2\u00a4\u0363\3\2\2\2\u00a6\u0369\3\2\2\2\u00a8\u036b\3\2"+ + "\2\2\u00aa\u036d\3\2\2\2\u00ac\u036f\3\2\2\2\u00ae\u0373\3\2\2\2\u00b0"+ + "\u0382\3\2\2\2\u00b2\u0384\3\2\2\2\u00b4\u038d\3\2\2\2\u00b6\u0398\3\2"+ + "\2\2\u00b8\u039e\3\2\2\2\u00ba\u03a2\3\2\2\2\u00bc\u03a4\3\2\2\2\u00be"+ + "\u03b4\3\2\2\2\u00c0\u03b9\3\2\2\2\u00c2\u03bc\3\2\2\2\u00c4\u03c2\3\2"+ + "\2\2\u00c6\u03c6\3\2\2\2\u00c8\u03ca\3\2\2\2\u00ca\u03de\3\2\2\2\u00cc"+ + "\u03e3\3\2\2\2\u00ce\u03f6\3\2\2\2\u00d0\u03fe\3\2\2\2\u00d2\u00d3\5\4"+ + "\3\2\u00d3\u00d9\5\u00d0i\2\u00d4\u00d5\5\6\4\2\u00d5\u00d6\5\u00d0i\2"+ + "\u00d6\u00d8\3\2\2\2\u00d7\u00d4\3\2\2\2\u00d8\u00db\3\2\2\2\u00d9\u00d7"+ + "\3\2\2\2\u00d9\u00da\3\2\2\2\u00da\u00e5\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc"+ + "\u00e0\5(\25\2\u00dd\u00e0\5*\26\2\u00de\u00e0\5\f\7\2\u00df\u00dc\3\2"+ + "\2\2\u00df\u00dd\3\2\2\2\u00df\u00de\3\2\2\2\u00e0\u00e1\3\2\2\2\u00e1"+ + "\u00e2\5\u00d0i\2\u00e2\u00e4\3\2\2\2\u00e3\u00df\3\2\2\2\u00e4\u00e7"+ + "\3\2\2\2\u00e5\u00e3\3\2\2\2\u00e5\u00e6\3\2\2\2\u00e6\u00e8\3\2\2\2\u00e7"+ + "\u00e5\3\2\2\2\u00e8\u00e9\7\2\2\3\u00e9\3\3\2\2\2\u00ea\u00eb\7\20\2"+ + "\2\u00eb\u00ec\7\35\2\2\u00ec\5\3\2\2\2\u00ed\u00f9\7\31\2\2\u00ee\u00fa"+ + "\5\b\5\2\u00ef\u00f5\7\36\2\2\u00f0\u00f1\5\b\5\2\u00f1\u00f2\5\u00d0"+ + "i\2\u00f2\u00f4\3\2\2\2\u00f3\u00f0\3\2\2\2\u00f4\u00f7\3\2\2\2\u00f5"+ + "\u00f3\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6\u00f8\3\2\2\2\u00f7\u00f5\3\2"+ + "\2\2\u00f8\u00fa\7\37\2\2\u00f9\u00ee\3\2\2\2\u00f9\u00ef\3\2\2\2\u00fa"+ + "\7\3\2\2\2\u00fb\u00fd\t\2\2\2\u00fc\u00fb\3\2\2\2\u00fc\u00fd\3\2\2\2"+ + "\u00fd\u00fe\3\2\2\2\u00fe\u00ff\5\n\6\2\u00ff\t\3\2\2\2\u0100\u0101\5"+ + "\u00c0a\2\u0101\13\3\2\2\2\u0102\u0106\5\16\b\2\u0103\u0106\5\30\r\2\u0104"+ + "\u0106\5.\30\2\u0105\u0102\3\2\2\2\u0105\u0103\3\2\2\2\u0105\u0104\3\2"+ + "\2\2\u0106\r\3\2\2\2\u0107\u0113\7\22\2\2\u0108\u0114\5\20\t\2\u0109\u010f"+ + "\7\36\2\2\u010a\u010b\5\20\t\2\u010b\u010c\5\u00d0i\2\u010c\u010e\3\2"+ + "\2\2\u010d\u010a\3\2\2\2\u010e\u0111\3\2\2\2\u010f\u010d\3\2\2\2\u010f"+ + "\u0110\3\2\2\2\u0110\u0112\3\2\2\2\u0111\u010f\3\2\2\2\u0112\u0114\7\37"+ + "\2\2\u0113\u0108\3\2\2\2\u0113\u0109\3\2\2\2\u0114\17\3\2\2\2\u0115\u011b"+ + "\5\22\n\2\u0116\u0118\5x=\2\u0117\u0116\3\2\2\2\u0117\u0118\3\2\2\2\u0118"+ + "\u0119\3\2\2\2\u0119\u011a\7$\2\2\u011a\u011c\5\24\13\2\u011b\u0117\3"+ + "\2\2\2\u011b\u011c\3\2\2\2\u011c\21\3\2\2\2\u011d\u0122\7\35\2\2\u011e"+ + "\u011f\7%\2\2\u011f\u0121\7\35\2\2\u0120\u011e\3\2\2\2\u0121\u0124\3\2"+ + "\2\2\u0122\u0120\3\2\2\2\u0122\u0123\3\2\2\2\u0123\23\3\2\2\2\u0124\u0122"+ + "\3\2\2\2\u0125\u012a\5\u009cO\2\u0126\u0127\7%\2\2\u0127\u0129\5\u009c"+ + "O\2\u0128\u0126\3\2\2\2\u0129\u012c\3\2\2\2\u012a\u0128\3\2\2\2\u012a"+ + "\u012b\3\2\2\2\u012b\25\3\2\2\2\u012c\u012a\3\2\2\2\u012d\u012e\t\3\2"+ + "\2\u012e\27\3\2\2\2\u012f\u0131\5\26\f\2\u0130\u012f\3\2\2\2\u0131\u0134"+ + "\3\2\2\2\u0132\u0130\3\2\2\2\u0132\u0133\3\2\2\2\u0133\u0135\3\2\2\2\u0134"+ + "\u0132\3\2\2\2\u0135\u0141\7\26\2\2\u0136\u0142\5\32\16\2\u0137\u013d"+ + "\7\36\2\2\u0138\u0139\5\32\16\2\u0139\u013a\5\u00d0i\2\u013a\u013c\3\2"+ + "\2\2\u013b\u0138\3\2\2\2\u013c\u013f\3\2\2\2\u013d\u013b\3\2\2\2\u013d"+ + "\u013e\3\2\2\2\u013e\u0140\3\2\2\2\u013f\u013d\3\2\2\2\u0140\u0142\7\37"+ + "\2\2\u0141\u0136\3\2\2\2\u0141\u0137\3\2\2\2\u0142\31\3\2\2\2\u0143\u0146"+ + "\5\34\17\2\u0144\u0146\5\36\20\2\u0145\u0143\3\2\2\2\u0145\u0144\3\2\2"+ + "\2\u0146\33\3\2\2\2\u0147\u0148\7\35\2\2\u0148\u0149\7$\2\2\u0149\u014a"+ + "\5x=\2\u014a\35\3\2\2\2\u014b\u014d\7\35\2\2\u014c\u014e\5 \21\2\u014d"+ + "\u014c\3\2\2\2\u014d\u014e\3\2\2\2\u014e\u014f\3\2\2\2\u014f\u0150\5x"+ + "=\2\u0150\37\3\2\2\2\u0151\u0152\7\"\2\2\u0152\u0157\5\"\22\2\u0153\u0154"+ + "\7%\2\2\u0154\u0156\5\"\22\2\u0155\u0153\3\2\2\2\u0156\u0159\3\2\2\2\u0157"+ + "\u0155\3\2\2\2\u0157\u0158\3\2\2\2\u0158\u015a\3\2\2\2\u0159\u0157\3\2"+ + "\2\2\u015a\u015b\7#\2\2\u015b!\3\2\2\2\u015c\u015d\5\22\n\2\u015d\u015e"+ + "\5$\23\2\u015e#\3\2\2\2\u015f\u0164\5&\24\2\u0160\u0161\7\65\2\2\u0161"+ + "\u0163\5&\24\2\u0162\u0160\3\2\2\2\u0163\u0166\3\2\2\2\u0164\u0162\3\2"+ + "\2\2\u0164\u0165\3\2\2\2\u0165%\3\2\2\2\u0166\u0164\3\2\2\2\u0167\u0169"+ + "\7;\2\2\u0168\u0167\3\2\2\2\u0168\u0169\3\2\2\2\u0169\u016a\3\2\2\2\u016a"+ + "\u016b\5x=\2\u016b\'\3\2\2\2\u016c\u016d\7\5\2\2\u016d\u016f\7\35\2\2"+ + "\u016e\u0170\5 \21\2\u016f\u016e\3\2\2\2\u016f\u0170\3\2\2\2\u0170\u0171"+ + "\3\2\2\2\u0171\u0173\5\u0094K\2\u0172\u0174\5\62\32\2\u0173\u0172\3\2"+ + "\2\2\u0173\u0174\3\2\2\2\u0174)\3\2\2\2\u0175\u0176\7\5\2\2\u0176\u0177"+ + "\5,\27\2\u0177\u0178\7\35\2\2\u0178\u017a\5\u0094K\2\u0179\u017b\5\62"+ + "\32\2\u017a\u0179\3\2\2\2\u017a\u017b\3\2\2\2\u017b+\3\2\2\2\u017c\u017d"+ + "\5\u0098M\2\u017d-\3\2\2\2\u017e\u018a\7\33\2\2\u017f\u018b\5\60\31\2"+ + "\u0180\u0186\7\36\2\2\u0181\u0182\5\60\31\2\u0182\u0183\5\u00d0i\2\u0183"+ + "\u0185\3\2\2\2\u0184\u0181\3\2\2\2\u0185\u0188\3\2\2\2\u0186\u0184\3\2"+ + "\2\2\u0186\u0187\3\2\2\2\u0187\u0189\3\2\2\2\u0188\u0186\3\2\2\2\u0189"+ + "\u018b\7\37\2\2\u018a\u017f\3\2\2\2\u018a\u0180\3\2\2\2\u018b/\3\2\2\2"+ + "\u018c\u0194\5\22\n\2\u018d\u0190\5x=\2\u018e\u018f\7$\2\2\u018f\u0191"+ + "\5\24\13\2\u0190\u018e\3\2\2\2\u0190\u0191\3\2\2\2\u0191\u0195\3\2\2\2"+ + "\u0192\u0193\7$\2\2\u0193\u0195\5\24\13\2\u0194\u018d\3\2\2\2\u0194\u0192"+ + "\3\2\2\2\u0195\61\3\2\2\2\u0196\u0198\7 \2\2\u0197\u0199\5\64\33\2\u0198"+ + "\u0197\3\2\2\2\u0198\u0199\3\2\2\2\u0199\u019a\3\2\2\2\u019a\u019b\7!"+ + "\2\2\u019b\63\3\2\2\2\u019c\u019e\7&\2\2\u019d\u019c\3\2\2\2\u019d\u019e"+ + "\3\2\2\2\u019e\u01a4\3\2\2\2\u019f\u01a1\7[\2\2\u01a0\u019f\3\2\2\2\u01a0"+ + "\u01a1\3\2\2\2\u01a1\u01a4\3\2\2\2\u01a2\u01a4\6\33\2\2\u01a3\u019d\3"+ + "\2\2\2\u01a3\u01a0\3\2\2\2\u01a3\u01a2\3\2\2\2\u01a4\u01a5\3\2\2\2\u01a5"+ + "\u01a6\5\66\34\2\u01a6\u01a7\5\u00d0i\2\u01a7\u01a9\3\2\2\2\u01a8\u01a3"+ + "\3\2\2\2\u01a9\u01aa\3\2\2\2\u01aa\u01a8\3\2\2\2\u01aa\u01ab\3\2\2\2\u01ab"+ + "\65\3\2\2\2\u01ac\u01bc\5\f\7\2\u01ad\u01bc\5F$\2\u01ae\u01bc\58\35\2"+ + "\u01af\u01bc\5v<\2\u01b0\u01bc\5H%\2\u01b1\u01bc\5J&\2\u01b2\u01bc\5L"+ + "\'\2\u01b3\u01bc\5N(\2\u01b4\u01bc\5P)\2\u01b5\u01bc\5\62\32\2\u01b6\u01bc"+ + "\5T+\2\u01b7\u01bc\5V,\2\u01b8\u01bc\5h\65\2\u01b9\u01bc\5p9\2\u01ba\u01bc"+ + "\5R*\2\u01bb\u01ac\3\2\2\2\u01bb\u01ad\3\2\2\2\u01bb\u01ae\3\2\2\2\u01bb"+ + "\u01af\3\2\2\2\u01bb\u01b0\3\2\2\2\u01bb\u01b1\3\2\2\2\u01bb\u01b2\3\2"+ + "\2\2\u01bb\u01b3\3\2\2\2\u01bb\u01b4\3\2\2\2\u01bb\u01b5\3\2\2\2\u01bb"+ + "\u01b6\3\2\2\2\u01bb\u01b7\3\2\2\2\u01bb\u01b8\3\2\2\2\u01bb\u01b9\3\2"+ + "\2\2\u01bb\u01ba\3\2\2\2\u01bc\67\3\2\2\2\u01bd\u01c3\5<\37\2\u01be\u01c3"+ + "\5> \2\u01bf\u01c3\5@!\2\u01c0\u01c3\5:\36\2\u01c1\u01c3\5D#\2\u01c2\u01bd"+ + "\3\2\2\2\u01c2\u01be\3\2\2\2\u01c2\u01bf\3\2\2\2\u01c2\u01c0\3\2\2\2\u01c2"+ + "\u01c1\3\2\2\2\u01c39\3\2\2\2\u01c4\u01c5\5\u009cO\2\u01c5;\3\2\2\2\u01c6"+ + "\u01c7\5\u009cO\2\u01c7\u01c8\7B\2\2\u01c8\u01c9\5\u009cO\2\u01c9=\3\2"+ + "\2\2\u01ca\u01cb\5\u009cO\2\u01cb\u01cc\t\4\2\2\u01cc?\3\2\2\2\u01cd\u01ce"+ + "\5\24\13\2\u01ce\u01cf\5B\"\2\u01cf\u01d0\5\24\13\2\u01d0A\3\2\2\2\u01d1"+ + "\u01d3\t\5\2\2\u01d2\u01d1\3\2\2\2\u01d2\u01d3\3\2\2\2\u01d3\u01d4\3\2"+ + "\2\2\u01d4\u01d5\7$\2\2\u01d5C\3\2\2\2\u01d6\u01d7\5\22\n\2\u01d7\u01d8"+ + "\7+\2\2\u01d8\u01d9\5\24\13\2\u01d9E\3\2\2\2\u01da\u01db\7\35\2\2\u01db"+ + "\u01dd\7\'\2\2\u01dc\u01de\5\66\34\2\u01dd\u01dc\3\2\2\2\u01dd\u01de\3"+ + "\2\2\2\u01deG\3\2\2\2\u01df\u01e1\7\32\2\2\u01e0\u01e2\5\24\13\2\u01e1"+ + "\u01e0\3\2\2\2\u01e1\u01e2\3\2\2\2\u01e2I\3\2\2\2\u01e3\u01e5\7\3\2\2"+ + "\u01e4\u01e6\7\35\2\2\u01e5\u01e4\3\2\2\2\u01e5\u01e6\3\2\2\2\u01e6K\3"+ + "\2\2\2\u01e7\u01e9\7\27\2\2\u01e8\u01ea\7\35\2\2\u01e9\u01e8\3\2\2\2\u01e9"+ + "\u01ea\3\2\2\2\u01eaM\3\2\2\2\u01eb\u01ec\7\17\2\2\u01ec\u01ed\7\35\2"+ + "\2\u01edO\3\2\2\2\u01ee\u01ef\7\23\2\2\u01efQ\3\2\2\2\u01f0\u01f1\7\t"+ + "\2\2\u01f1\u01f2\5\u009cO\2\u01f2S\3\2\2\2\u01f3\u01fc\7\24\2\2\u01f4"+ + "\u01fd\5\u009cO\2\u01f5\u01f6\5\u00d0i\2\u01f6\u01f7\5\u009cO\2\u01f7"+ + "\u01fd\3\2\2\2\u01f8\u01f9\58\35\2\u01f9\u01fa\5\u00d0i\2\u01fa\u01fb"+ + "\5\u009cO\2\u01fb\u01fd\3\2\2\2\u01fc\u01f4\3\2\2\2\u01fc\u01f5\3\2\2"+ + "\2\u01fc\u01f8\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u0204\5\62\32\2\u01ff"+ + "\u0202\7\16\2\2\u0200\u0203\5T+\2\u0201\u0203\5\62\32\2\u0202\u0200\3"+ + "\2\2\2\u0202\u0201\3\2\2\2\u0203\u0205\3\2\2\2\u0204\u01ff\3\2\2\2\u0204"+ + "\u0205\3\2\2\2\u0205U\3\2\2\2\u0206\u0209\5X-\2\u0207\u0209\5^\60\2\u0208"+ + "\u0206\3\2\2\2\u0208\u0207\3\2\2\2\u0209W\3\2\2\2\u020a\u0215\7\21\2\2"+ + "\u020b\u020d\5\u009cO\2\u020c\u020b\3\2\2\2\u020c\u020d\3\2\2\2\u020d"+ + "\u0216\3\2\2\2\u020e\u0210\58\35\2\u020f\u020e\3\2\2\2\u020f\u0210\3\2"+ + "\2\2\u0210\u0211\3\2\2\2\u0211\u0213\5\u00d0i\2\u0212\u0214\5\u009cO\2"+ + "\u0213\u0212\3\2\2\2\u0213\u0214\3\2\2\2\u0214\u0216\3\2\2\2\u0215\u020c"+ + "\3\2\2\2\u0215\u020f\3\2\2\2\u0216\u0217\3\2\2\2\u0217\u021b\7 \2\2\u0218"+ + "\u021a\5Z.\2\u0219\u0218\3\2\2\2\u021a\u021d\3\2\2\2\u021b\u0219\3\2\2"+ + "\2\u021b\u021c\3\2\2\2\u021c\u021e\3\2\2\2\u021d\u021b\3\2\2\2\u021e\u021f"+ + "\7!\2\2\u021fY\3\2\2\2\u0220\u0221\5\\/\2\u0221\u0223\7\'\2\2\u0222\u0224"+ + "\5\64\33\2\u0223\u0222\3\2\2\2\u0223\u0224\3\2\2\2\u0224[\3\2\2\2\u0225"+ + "\u0226\7\b\2\2\u0226\u0229\5\24\13\2\u0227\u0229\7\4\2\2\u0228\u0225\3"+ + "\2\2\2\u0228\u0227\3\2\2\2\u0229]\3\2\2\2\u022a\u0233\7\21\2\2\u022b\u0234"+ + "\5`\61\2\u022c\u022d\5\u00d0i\2\u022d\u022e\5`\61\2\u022e\u0234\3\2\2"+ + "\2\u022f\u0230\58\35\2\u0230\u0231\5\u00d0i\2\u0231\u0232\5`\61\2\u0232"+ + "\u0234\3\2\2\2\u0233\u022b\3\2\2\2\u0233\u022c\3\2\2\2\u0233\u022f\3\2"+ + "\2\2\u0234\u0235\3\2\2\2\u0235\u0239\7 \2\2\u0236\u0238\5b\62\2\u0237"+ + "\u0236\3\2\2\2\u0238\u023b\3\2\2\2\u0239\u0237\3\2\2\2\u0239\u023a\3\2"+ + "\2\2\u023a\u023c\3\2\2\2\u023b\u0239\3\2\2\2\u023c\u023d\7!\2\2\u023d"+ + "_\3\2\2\2\u023e\u023f\7\35\2\2\u023f\u0241\7+\2\2\u0240\u023e\3\2\2\2"+ + "\u0240\u0241\3\2\2\2\u0241\u0242\3\2\2\2\u0242\u0243\5\u009eP\2\u0243"+ + "\u0244\7(\2\2\u0244\u0245\7\36\2\2\u0245\u0246\7\26\2\2\u0246\u0247\7"+ + "\37\2\2\u0247a\3\2\2\2\u0248\u0249\5d\63\2\u0249\u024b\7\'\2\2\u024a\u024c"+ + "\5\64\33\2\u024b\u024a\3\2\2\2\u024b\u024c\3\2\2\2\u024cc\3\2\2\2\u024d"+ + "\u024e\7\b\2\2\u024e\u0251\5f\64\2\u024f\u0251\7\4\2\2\u0250\u024d\3\2"+ + "\2\2\u0250\u024f\3\2\2\2\u0251e\3\2\2\2\u0252\u0255\5x=\2\u0253\u0255"+ + "\7\34\2\2\u0254\u0252\3\2\2\2\u0254\u0253\3\2\2\2\u0255\u025d\3\2\2\2"+ + "\u0256\u0259\7%\2\2\u0257\u025a\5x=\2\u0258\u025a\7\34\2\2\u0259\u0257"+ + "\3\2\2\2\u0259\u0258\3\2\2\2\u025a\u025c\3\2\2\2\u025b\u0256\3\2\2\2\u025c"+ + "\u025f\3\2\2\2\u025d\u025b\3\2\2\2\u025d\u025e\3\2\2\2\u025eg\3\2\2\2"+ + "\u025f\u025d\3\2\2\2\u0260\u0261\7\7\2\2\u0261\u0265\7 \2\2\u0262\u0264"+ + "\5j\66\2\u0263\u0262\3\2\2\2\u0264\u0267\3\2\2\2\u0265\u0263\3\2\2\2\u0265"+ + "\u0266\3\2\2\2\u0266\u0268\3\2\2\2\u0267\u0265\3\2\2\2\u0268\u0269\7!"+ + "\2\2\u0269i\3\2\2\2\u026a\u026b\5l\67\2\u026b\u026d\7\'\2\2\u026c\u026e"+ + "\5\64\33\2\u026d\u026c\3\2\2\2\u026d\u026e\3\2\2\2\u026ek\3\2\2\2\u026f"+ + "\u0272\7\b\2\2\u0270\u0273\5<\37\2\u0271\u0273\5n8\2\u0272\u0270\3\2\2"+ + "\2\u0272\u0271\3\2\2\2\u0273\u0276\3\2\2\2\u0274\u0276\7\4\2\2\u0275\u026f"+ + "\3\2\2\2\u0275\u0274\3\2\2\2\u0276m\3\2\2\2\u0277\u0278\5\24\13\2\u0278"+ + "\u0279\7$\2\2\u0279\u027e\3\2\2\2\u027a\u027b\5\22\n\2\u027b\u027c\7+"+ + "\2\2\u027c\u027e\3\2\2\2\u027d\u0277\3\2\2\2\u027d\u027a\3\2\2\2\u027d"+ + "\u027e\3\2\2\2\u027e\u027f\3\2\2\2\u027f\u0280\5\u009cO\2\u0280o\3\2\2"+ + "\2\u0281\u0289\7\30\2\2\u0282\u0284\5\u009cO\2\u0283\u0282\3\2\2\2\u0283"+ + "\u0284\3\2\2\2\u0284\u028a\3\2\2\2\u0285\u028a\5r:\2\u0286\u0288\5t;\2"+ + "\u0287\u0286\3\2\2\2\u0287\u0288\3\2\2\2\u0288\u028a\3\2\2\2\u0289\u0283"+ + "\3\2\2\2\u0289\u0285\3\2\2\2\u0289\u0287\3\2\2\2\u028a\u028b\3\2\2\2\u028b"+ + "\u028c\5\62\32\2\u028cq\3\2\2\2\u028d\u028f\58\35\2\u028e\u028d\3\2\2"+ + "\2\u028e\u028f\3\2\2\2\u028f\u0290\3\2\2\2\u0290\u0292\5\u00d0i\2\u0291"+ + "\u0293\5\u009cO\2\u0292\u0291\3\2\2\2\u0292\u0293\3\2\2\2\u0293\u0294"+ + "\3\2\2\2\u0294\u0296\5\u00d0i\2\u0295\u0297\58\35\2\u0296\u0295\3\2\2"+ + "\2\u0296\u0297\3\2\2\2\u0297s\3\2\2\2\u0298\u0299\5\24\13\2\u0299\u029a"+ + "\7$\2\2\u029a\u029f\3\2\2\2\u029b\u029c\5\22\n\2\u029c\u029d\7+\2\2\u029d"+ + "\u029f\3\2\2\2\u029e\u0298\3\2\2\2\u029e\u029b\3\2\2\2\u029e\u029f\3\2"+ + "\2\2\u029f\u02a0\3\2\2\2\u02a0\u02a1\7\25\2\2\u02a1\u02a2\5\u009cO\2\u02a2"+ + "u\3\2\2\2\u02a3\u02a4\7\n\2\2\u02a4\u02a5\5\u009cO\2\u02a5w\3\2\2\2\u02a6"+ + "\u02a8\5|?\2\u02a7\u02a9\5z>\2\u02a8\u02a7\3\2\2\2\u02a8\u02a9\3\2\2\2"+ + "\u02a9\u02b0\3\2\2\2\u02aa\u02b0\5~@\2\u02ab\u02ac\7\36\2\2\u02ac\u02ad"+ + "\5x=\2\u02ad\u02ae\7\37\2\2\u02ae\u02b0\3\2\2\2\u02af\u02a6\3\2\2\2\u02af"+ + "\u02aa\3\2\2\2\u02af\u02ab\3\2\2\2\u02b0y\3\2\2\2\u02b1\u02b2\7\"\2\2"+ + "\u02b2\u02b4\5f\64\2\u02b3\u02b5\7%\2\2\u02b4\u02b3\3\2\2\2\u02b4\u02b5"+ + "\3\2\2\2\u02b5\u02b6\3\2\2\2\u02b6\u02b7\7#\2\2\u02b7{\3\2\2\2\u02b8\u02bb"+ + "\5\u00acW\2\u02b9\u02bb\7\35\2\2\u02ba\u02b8\3\2\2\2\u02ba\u02b9\3\2\2"+ + "\2\u02bb}\3\2\2\2\u02bc\u02c5\5\u0080A\2\u02bd\u02c5\5\u00bc_\2\u02be"+ + "\u02c5\5\u0086D\2\u02bf\u02c5\5\u0092J\2\u02c0\u02c5\5\u0088E\2\u02c1"+ + "\u02c5\5\u008aF\2\u02c2\u02c5\5\u008cG\2\u02c3\u02c5\5\u008eH\2\u02c4"+ + "\u02bc\3\2\2\2\u02c4\u02bd\3\2\2\2\u02c4\u02be\3\2\2\2\u02c4\u02bf\3\2"+ + "\2\2\u02c4\u02c0\3\2\2\2\u02c4\u02c1\3\2\2\2\u02c4\u02c2\3\2\2\2\u02c4"+ + "\u02c3\3\2\2\2\u02c5\177\3\2\2\2\u02c6\u02c7\7\"\2\2\u02c7\u02c8\5\u0082"+ + "B\2\u02c8\u02c9\7#\2\2\u02c9\u02ca\5\u0084C\2\u02ca\u0081\3\2\2\2\u02cb"+ + "\u02cc\5\u009cO\2\u02cc\u0083\3\2\2\2\u02cd\u02ce\5x=\2\u02ce\u0085\3"+ + "\2\2\2\u02cf\u02d0\7@\2\2\u02d0\u02d1\5x=\2\u02d1\u0087\3\2\2\2\u02d2"+ + "\u02d3\7\6\2\2\u02d3\u02dc\7 \2\2\u02d4\u02d7\5\u0090I\2\u02d5\u02d7\5"+ + "$\23\2\u02d6\u02d4\3\2\2\2\u02d6\u02d5\3\2\2\2\u02d7\u02d8\3\2\2\2\u02d8"+ + "\u02d9\5\u00d0i\2\u02d9\u02db\3\2\2\2\u02da\u02d6\3\2\2\2\u02db\u02de"+ + "\3\2\2\2\u02dc\u02da\3\2\2\2\u02dc\u02dd\3\2\2\2\u02dd\u02df\3\2\2\2\u02de"+ + "\u02dc\3\2\2\2\u02df\u02e0\7!\2\2\u02e0\u0089\3\2\2\2\u02e1\u02e2\7\""+ + "\2\2\u02e2\u02e3\7#\2\2\u02e3\u02e4\5\u0084C\2\u02e4\u008b\3\2\2\2\u02e5"+ + "\u02e6\7\13\2\2\u02e6\u02e7\7\"\2\2\u02e7\u02e8\5x=\2\u02e8\u02e9\7#\2"+ + "\2\u02e9\u02ea\5\u0084C\2\u02ea\u008d\3\2\2\2\u02eb\u02f1\7\r\2\2\u02ec"+ + "\u02ed\7\r\2\2\u02ed\u02f1\7B\2\2\u02ee\u02ef\7B\2\2\u02ef\u02f1\7\r\2"+ + "\2\u02f0\u02eb\3\2\2\2\u02f0\u02ec\3\2\2\2\u02f0\u02ee\3\2\2\2\u02f1\u02f2"+ + "\3\2\2\2\u02f2\u02f3\5\u0084C\2\u02f3\u008f\3\2\2\2\u02f4\u02f5\7\35\2"+ + "\2\u02f5\u02f6\5\u0098M\2\u02f6\u02f7\5\u0096L\2\u02f7\u02fb\3\2\2\2\u02f8"+ + "\u02f9\7\35\2\2\u02f9\u02fb\5\u0098M\2\u02fa\u02f4\3\2\2\2\u02fa\u02f8"+ + "\3\2\2\2\u02fb\u0091\3\2\2\2\u02fc\u02fd\7\5\2\2\u02fd\u02fe\5\u0094K"+ + "\2\u02fe\u0093\3\2\2\2\u02ff\u0301\5\u0098M\2\u0300\u0302\5\u0096L\2\u0301"+ + "\u0300\3\2\2\2\u0301\u0302\3\2\2\2\u0302\u0095\3\2\2\2\u0303\u0306\5\u0098"+ + "M\2\u0304\u0306\5x=\2\u0305\u0303\3\2\2\2\u0305\u0304\3\2\2\2\u0306\u0097"+ + "\3\2\2\2\u0307\u0313\7\36\2\2\u0308\u030d\5\u009aN\2\u0309\u030a\7%\2"+ + "\2\u030a\u030c\5\u009aN\2\u030b\u0309\3\2\2\2\u030c\u030f\3\2\2\2\u030d"+ + "\u030b\3\2\2\2\u030d\u030e\3\2\2\2\u030e\u0311\3\2\2\2\u030f\u030d\3\2"+ + "\2\2\u0310\u0312\7%\2\2\u0311\u0310\3\2\2\2\u0311\u0312\3\2\2\2\u0312"+ + "\u0314\3\2\2\2\u0313\u0308\3\2\2\2\u0313\u0314\3\2\2\2\u0314\u0315\3\2"+ + "\2\2\u0315\u0316\7\37\2\2\u0316\u0099\3\2\2\2\u0317\u0319\5\22\n\2\u0318"+ + "\u0317\3\2\2\2\u0318\u0319\3\2\2\2\u0319\u031b\3\2\2\2\u031a\u031c\7,"+ + "\2\2\u031b\u031a\3\2\2\2\u031b\u031c\3\2\2\2\u031c\u031d\3\2\2\2\u031d"+ + "\u031e\5x=\2\u031e\u009b\3\2\2\2\u031f\u0320\bO\1\2\u0320\u0324\5\u009e"+ + "P\2\u0321\u0322\t\6\2\2\u0322\u0324\5\u009cO\b\u0323\u031f\3\2\2\2\u0323"+ + "\u0321\3\2\2\2\u0324\u0336\3\2\2\2\u0325\u0326\f\7\2\2\u0326\u0327\t\7"+ + "\2\2\u0327\u0335\5\u009cO\b\u0328\u0329\f\6\2\2\u0329\u032a\t\b\2\2\u032a"+ + "\u0335\5\u009cO\7\u032b\u032c\f\5\2\2\u032c\u032d\t\t\2\2\u032d\u0335"+ + "\5\u009cO\6\u032e\u032f\f\4\2\2\u032f\u0330\7.\2\2\u0330\u0335\5\u009c"+ + "O\5\u0331\u0332\f\3\2\2\u0332\u0333\7-\2\2\u0333\u0335\5\u009cO\4\u0334"+ + "\u0325\3\2\2\2\u0334\u0328\3\2\2\2\u0334\u032b\3\2\2\2\u0334\u032e\3\2"+ + "\2\2\u0334\u0331\3\2\2\2\u0335\u0338\3\2\2\2\u0336\u0334\3\2\2\2\u0336"+ + "\u0337\3\2\2\2\u0337\u009d\3\2\2\2\u0338\u0336\3\2\2\2\u0339\u033a\bP"+ + "\1\2\u033a\u033e\5\u00a2R\2\u033b\u033e\5\u00a0Q\2\u033c\u033e\5\u00ce"+ + "h\2\u033d\u0339\3\2\2\2\u033d\u033b\3\2\2\2\u033d\u033c\3\2\2\2\u033e"+ + "\u034a\3\2\2\2\u033f\u0346\f\3\2\2\u0340\u0341\7(\2\2\u0341\u0347\7\35"+ + "\2\2\u0342\u0347\5\u00c6d\2\u0343\u0347\5\u00c8e\2\u0344\u0347\5\u00ca"+ + "f\2\u0345\u0347\5\u00ccg\2\u0346\u0340\3\2\2\2\u0346\u0342\3\2\2\2\u0346"+ + "\u0343\3\2\2\2\u0346\u0344\3\2\2\2\u0346\u0345\3\2\2\2\u0347\u0349\3\2"+ + "\2\2\u0348\u033f\3\2\2\2\u0349\u034c\3\2\2\2\u034a\u0348\3\2\2\2\u034a"+ + "\u034b\3\2\2\2\u034b\u009f\3\2\2\2\u034c\u034a\3\2\2\2\u034d\u034e\5x"+ + "=\2\u034e\u034f\7\36\2\2\u034f\u0351\5\u009cO\2\u0350\u0352\7%\2\2\u0351"+ + "\u0350\3\2\2\2\u0351\u0352\3\2\2\2\u0352\u0353\3\2\2\2\u0353\u0354\7\37"+ + "\2\2\u0354\u00a1\3\2\2\2\u0355\u035f\5\u00a4S\2\u0356\u0358\5\u00aaV\2"+ + "\u0357\u0359\5z>\2\u0358\u0357\3\2\2\2\u0358\u0359\3\2\2\2\u0359\u035f"+ + "\3\2\2\2\u035a\u035b\7\36\2\2\u035b\u035c\5\u009cO\2\u035c\u035d\7\37"+ + "\2\2\u035d\u035f\3\2\2\2\u035e\u0355\3\2\2\2\u035e\u0356\3\2\2\2\u035e"+ + "\u035a\3\2\2\2\u035f\u00a3\3\2\2\2\u0360\u0364\5\u00a6T\2\u0361\u0364"+ + "\5\u00aeX\2\u0362\u0364\5\u00c4c\2\u0363\u0360\3\2\2\2\u0363\u0361\3\2"+ + "\2\2\u0363\u0362\3\2\2\2\u0364\u00a5\3\2\2\2\u0365\u036a\7\34\2\2\u0366"+ + "\u036a\5\u00a8U\2\u0367\u036a\5\u00c0a\2\u0368\u036a\7G\2\2\u0369\u0365"+ + "\3\2\2\2\u0369\u0366\3\2\2\2\u0369\u0367\3\2\2\2\u0369\u0368\3\2\2\2\u036a"+ + "\u00a7\3\2\2\2\u036b\u036c\t\n\2\2\u036c\u00a9\3\2\2\2\u036d\u036e\7\35"+ + "\2\2\u036e\u00ab\3\2\2\2\u036f\u0370\7\35\2\2\u0370\u0371\7(\2\2\u0371"+ + "\u0372\7\35\2\2\u0372\u00ad\3\2\2\2\u0373\u0374\5\u00b0Y\2\u0374\u0375"+ + "\5\u00b2Z\2\u0375\u00af\3\2\2\2\u0376\u0383\5\u00bc_\2\u0377\u0383\5\u0080"+ + "A\2\u0378\u0379\7\"\2\2\u0379\u037a\7,\2\2\u037a\u037b\7#\2\2\u037b\u0383"+ + "\5\u0084C\2\u037c\u0383\5\u008aF\2\u037d\u0383\5\u008cG\2\u037e\u0380"+ + "\5|?\2\u037f\u0381\5z>\2\u0380\u037f\3\2\2\2\u0380\u0381\3\2\2\2\u0381"+ + "\u0383\3\2\2\2\u0382\u0376\3\2\2\2\u0382\u0377\3\2\2\2\u0382\u0378\3\2"+ + "\2\2\u0382\u037c\3\2\2\2\u0382\u037d\3\2\2\2\u0382\u037e\3\2\2\2\u0383"+ + "\u00b1\3\2\2\2\u0384\u0389\7 \2\2\u0385\u0387\5\u00b4[\2\u0386\u0388\7"+ + "%\2\2\u0387\u0386\3\2\2\2\u0387\u0388\3\2\2\2\u0388\u038a\3\2\2\2\u0389"+ + "\u0385\3\2\2\2\u0389\u038a\3\2\2\2\u038a\u038b\3\2\2\2\u038b\u038c\7!"+ + "\2\2\u038c\u00b3\3\2\2\2\u038d\u0392\5\u00b6\\\2\u038e\u038f\7%\2\2\u038f"+ + "\u0391\5\u00b6\\\2\u0390\u038e\3\2\2\2\u0391\u0394\3\2\2\2\u0392\u0390"+ + "\3\2\2\2\u0392\u0393\3\2\2\2\u0393\u00b5\3\2\2\2\u0394\u0392\3\2\2\2\u0395"+ + "\u0396\5\u00b8]\2\u0396\u0397\7\'\2\2\u0397\u0399\3\2\2\2\u0398\u0395"+ + "\3\2\2\2\u0398\u0399\3\2\2\2\u0399\u039a\3\2\2\2\u039a\u039b\5\u00ba^"+ + "\2\u039b\u00b7\3\2\2\2\u039c\u039f\5\u009cO\2\u039d\u039f\5\u00b2Z\2\u039e"+ + "\u039c\3\2\2\2\u039e\u039d\3\2\2\2\u039f\u00b9\3\2\2\2\u03a0\u03a3\5\u009c"+ + "O\2\u03a1\u03a3\5\u00b2Z\2\u03a2\u03a0\3\2\2\2\u03a2\u03a1\3\2\2\2\u03a3"+ + "\u00bb\3\2\2\2\u03a4\u03a5\7\f\2\2\u03a5\u03ab\7 \2\2\u03a6\u03a7\5\u00be"+ + "`\2\u03a7\u03a8\5\u00d0i\2\u03a8\u03aa\3\2\2\2\u03a9\u03a6\3\2\2\2\u03aa"+ + "\u03ad\3\2\2\2\u03ab\u03a9\3\2\2\2\u03ab\u03ac\3\2\2\2\u03ac\u03ae\3\2"+ + "\2\2\u03ad\u03ab\3\2\2\2\u03ae\u03af\7!\2\2\u03af\u00bd\3\2\2\2\u03b0"+ + "\u03b1\5\22\n\2\u03b1\u03b2\5x=\2\u03b2\u03b5\3\2\2\2\u03b3\u03b5\5\u00c2"+ + "b\2\u03b4\u03b0\3\2\2\2\u03b4\u03b3\3\2\2\2\u03b5\u03b7\3\2\2\2\u03b6"+ + "\u03b8\5\u00c0a\2\u03b7\u03b6\3\2\2\2\u03b7\u03b8\3\2\2\2\u03b8\u00bf"+ + "\3\2\2\2\u03b9\u03ba\t\13\2\2\u03ba\u00c1\3\2\2\2\u03bb\u03bd\7@\2\2\u03bc"+ + "\u03bb\3\2\2\2\u03bc\u03bd\3\2\2\2\u03bd\u03be\3\2\2\2\u03be\u03c0\5|"+ + "?\2\u03bf\u03c1\5z>\2\u03c0\u03bf\3\2\2\2\u03c0\u03c1\3\2\2\2\u03c1\u00c3"+ + "\3\2\2\2\u03c2\u03c3\7\5\2\2\u03c3\u03c4\5\u0094K\2\u03c4\u03c5\5\62\32"+ + "\2\u03c5\u00c5\3\2\2\2\u03c6\u03c7\7\"\2\2\u03c7\u03c8\5\u009cO\2\u03c8"+ + "\u03c9\7#\2\2\u03c9\u00c7\3\2\2\2\u03ca\u03da\7\"\2\2\u03cb\u03cd\5\u009c"+ + "O\2\u03cc\u03cb\3\2\2\2\u03cc\u03cd\3\2\2\2\u03cd\u03ce\3\2\2\2\u03ce"+ + "\u03d0\7\'\2\2\u03cf\u03d1\5\u009cO\2\u03d0\u03cf\3\2\2\2\u03d0\u03d1"+ + "\3\2\2\2\u03d1\u03db\3\2\2\2\u03d2\u03d4\5\u009cO\2\u03d3\u03d2\3\2\2"+ + "\2\u03d3\u03d4\3\2\2\2\u03d4\u03d5\3\2\2\2\u03d5\u03d6\7\'\2\2\u03d6\u03d7"+ + "\5\u009cO\2\u03d7\u03d8\7\'\2\2\u03d8\u03d9\5\u009cO\2\u03d9\u03db\3\2"+ + "\2\2\u03da\u03cc\3\2\2\2\u03da\u03d3\3\2\2\2\u03db\u03dc\3\2\2\2\u03dc"+ + "\u03dd\7#\2\2\u03dd\u00c9\3\2\2\2\u03de\u03df\7(\2\2\u03df\u03e0\7\36"+ + "\2\2\u03e0\u03e1\5x=\2\u03e1\u03e2\7\37\2\2\u03e2\u00cb\3\2\2\2\u03e3"+ + "\u03f2\7\36\2\2\u03e4\u03eb\5\24\13\2\u03e5\u03e8\5x=\2\u03e6\u03e7\7"+ + "%\2\2\u03e7\u03e9\5\24\13\2\u03e8\u03e6\3\2\2\2\u03e8\u03e9\3\2\2\2\u03e9"+ + "\u03eb\3\2\2\2\u03ea\u03e4\3\2\2\2\u03ea\u03e5\3\2\2\2\u03eb\u03ed\3\2"+ + "\2\2\u03ec\u03ee\7,\2\2\u03ed\u03ec\3\2\2\2\u03ed\u03ee\3\2\2\2\u03ee"+ + "\u03f0\3\2\2\2\u03ef\u03f1\7%\2\2\u03f0\u03ef\3\2\2\2\u03f0\u03f1\3\2"+ + "\2\2\u03f1\u03f3\3\2\2\2\u03f2\u03ea\3\2\2\2\u03f2\u03f3\3\2\2\2\u03f3"+ + "\u03f4\3\2\2\2\u03f4\u03f5\7\37\2\2\u03f5\u00cd\3\2\2\2\u03f6\u03f7\5"+ + "x=\2\u03f7\u03f8\7(\2\2\u03f8\u03f9\7\35\2\2\u03f9\u00cf\3\2\2\2\u03fa"+ + "\u03ff\7&\2\2\u03fb\u03ff\7\2\2\3\u03fc\u03ff\7[\2\2\u03fd\u03ff\6i\t"+ + "\2\u03fe\u03fa\3\2\2\2\u03fe\u03fb\3\2\2\2\u03fe\u03fc\3\2\2\2\u03fe\u03fd"+ + "\3\2\2\2\u03ff\u00d1\3\2\2\2{\u00d9\u00df\u00e5\u00f5\u00f9\u00fc\u0105"+ + "\u010f\u0113\u0117\u011b\u0122\u012a\u0132\u013d\u0141\u0145\u014d\u0157"+ + "\u0164\u0168\u016f\u0173\u017a\u0186\u018a\u0190\u0194\u0198\u019d\u01a0"+ + "\u01a3\u01aa\u01bb\u01c2\u01d2\u01dd\u01e1\u01e5\u01e9\u01fc\u0202\u0204"+ + "\u0208\u020c\u020f\u0213\u0215\u021b\u0223\u0228\u0233\u0239\u0240\u024b"+ + "\u0250\u0254\u0259\u025d\u0265\u026d\u0272\u0275\u027d\u0283\u0287\u0289"+ + "\u028e\u0292\u0296\u029e\u02a8\u02af\u02b4\u02ba\u02c4\u02d6\u02dc\u02f0"+ + "\u02fa\u0301\u0305\u030d\u0311\u0313\u0318\u031b\u0323\u0334\u0336\u033d"+ + "\u0346\u034a\u0351\u0358\u035e\u0363\u0369\u0380\u0382\u0387\u0389\u0392"+ + "\u0398\u039e\u03a2\u03ab\u03b4\u03b7\u03bc\u03c0\u03cc\u03d0\u03d3\u03da"+ + "\u03e8\u03ea\u03ed\u03f0\u03f2\u03fe"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.tokens b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.tokens new file mode 100644 index 000000000..3d04e655a --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParser.tokens @@ -0,0 +1,153 @@ +BREAK=1 +DEFAULT=2 +FUNC=3 +INTERFACE=4 +SELECT=5 +CASE=6 +DEFER=7 +GO=8 +MAP=9 +STRUCT=10 +CHAN=11 +ELSE=12 +GOTO=13 +PACKAGE=14 +SWITCH=15 +CONST=16 +FALLTHROUGH=17 +IF=18 +RANGE=19 +TYPE=20 +CONTINUE=21 +FOR=22 +IMPORT=23 +RETURN=24 +VAR=25 +NIL_LIT=26 +IDENTIFIER=27 +L_PAREN=28 +R_PAREN=29 +L_CURLY=30 +R_CURLY=31 +L_BRACKET=32 +R_BRACKET=33 +ASSIGN=34 +COMMA=35 +SEMI=36 +COLON=37 +DOT=38 +PLUS_PLUS=39 +MINUS_MINUS=40 +DECLARE_ASSIGN=41 +ELLIPSIS=42 +LOGICAL_OR=43 +LOGICAL_AND=44 +EQUALS=45 +NOT_EQUALS=46 +LESS=47 +LESS_OR_EQUALS=48 +GREATER=49 +GREATER_OR_EQUALS=50 +OR=51 +DIV=52 +MOD=53 +LSHIFT=54 +RSHIFT=55 +BIT_CLEAR=56 +UNDERLYING=57 +EXCLAMATION=58 +PLUS=59 +MINUS=60 +CARET=61 +STAR=62 +AMPERSAND=63 +RECEIVE=64 +DECIMAL_LIT=65 +BINARY_LIT=66 +OCTAL_LIT=67 +HEX_LIT=68 +FLOAT_LIT=69 +DECIMAL_FLOAT_LIT=70 +HEX_FLOAT_LIT=71 +IMAGINARY_LIT=72 +RUNE_LIT=73 +BYTE_VALUE=74 +OCTAL_BYTE_VALUE=75 +HEX_BYTE_VALUE=76 +LITTLE_U_VALUE=77 +BIG_U_VALUE=78 +RAW_STRING_LIT=79 +INTERPRETED_STRING_LIT=80 +WS=81 +COMMENT=82 +TERMINATOR=83 +LINE_COMMENT=84 +NEWLINE=85 +WS_NLSEMI=86 +COMMENT_NLSEMI=87 +LINE_COMMENT_NLSEMI=88 +EOS=89 +OTHER=90 +'break'=1 +'default'=2 +'func'=3 +'interface'=4 +'select'=5 +'case'=6 +'defer'=7 +'go'=8 +'map'=9 +'struct'=10 +'chan'=11 +'else'=12 +'goto'=13 +'package'=14 +'switch'=15 +'const'=16 +'fallthrough'=17 +'if'=18 +'range'=19 +'type'=20 +'continue'=21 +'for'=22 +'import'=23 +'return'=24 +'var'=25 +'nil'=26 +'('=28 +')'=29 +'{'=30 +'}'=31 +'['=32 +']'=33 +'='=34 +','=35 +';'=36 +':'=37 +'.'=38 +'++'=39 +'--'=40 +':='=41 +'...'=42 +'||'=43 +'&&'=44 +'=='=45 +'!='=46 +'<'=47 +'<='=48 +'>'=49 +'>='=50 +'|'=51 +'/'=52 +'%'=53 +'<<'=54 +'>>'=55 +'&^'=56 +'~'=57 +'!'=58 +'+'=59 +'-'=60 +'^'=61 +'*'=62 +'&'=63 +'<-'=64 diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserBase.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserBase.java new file mode 100644 index 000000000..6aa5c5da0 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserBase.java @@ -0,0 +1,28 @@ +package run.mone.antlr.golang; + +import org.antlr.v4.runtime.BufferedTokenStream; +import org.antlr.v4.runtime.Parser; +import org.antlr.v4.runtime.TokenStream; + +/** + * @author goodjava@qq.com + * @date 2024/1/29 16:33 + */ +public abstract class GoParserBase extends Parser +{ + protected GoParserBase(TokenStream input) { + super(input); + } + + + /** + * Returns true if the current Token is a closing bracket (")" or "}") + */ + protected boolean closingBracket() + { + BufferedTokenStream stream = (BufferedTokenStream)_input; + int prevTokenType = stream.LA(1); + + return prevTokenType == GoParser.R_CURLY || prevTokenType == GoParser.R_PAREN; + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserBaseListener.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserBaseListener.java new file mode 100644 index 000000000..ac039b2dd --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserBaseListener.java @@ -0,0 +1,1286 @@ +package run.mone.antlr.golang;// Generated from GoParser.g4 by ANTLR 4.7.1 + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ErrorNode; +import org.antlr.v4.runtime.tree.TerminalNode; + +/** + * This class provides an empty implementation of {@link GoParserListener}, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ +public class GoParserBaseListener implements GoParserListener { + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSourceFile(GoParser.SourceFileContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSourceFile(GoParser.SourceFileContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPackageClause(GoParser.PackageClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPackageClause(GoParser.PackageClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportDecl(GoParser.ImportDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportDecl(GoParser.ImportDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportSpec(GoParser.ImportSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportSpec(GoParser.ImportSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterImportPath(GoParser.ImportPathContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitImportPath(GoParser.ImportPathContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDeclaration(GoParser.DeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDeclaration(GoParser.DeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConstDecl(GoParser.ConstDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConstDecl(GoParser.ConstDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConstSpec(GoParser.ConstSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConstSpec(GoParser.ConstSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIdentifierList(GoParser.IdentifierListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIdentifierList(GoParser.IdentifierListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpressionList(GoParser.ExpressionListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpressionList(GoParser.ExpressionListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterComment(GoParser.CommentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitComment(GoParser.CommentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeDecl(GoParser.TypeDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeDecl(GoParser.TypeDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeSpec(GoParser.TypeSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeSpec(GoParser.TypeSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAliasDecl(GoParser.AliasDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAliasDecl(GoParser.AliasDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeDef(GoParser.TypeDefContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeDef(GoParser.TypeDefContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeParameters(GoParser.TypeParametersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeParameters(GoParser.TypeParametersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeParameterDecl(GoParser.TypeParameterDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeParameterDecl(GoParser.TypeParameterDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeElement(GoParser.TypeElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeElement(GoParser.TypeElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeTerm(GoParser.TypeTermContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeTerm(GoParser.TypeTermContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionDecl(GoParser.FunctionDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionDecl(GoParser.FunctionDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodDecl(GoParser.MethodDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodDecl(GoParser.MethodDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterReceiver(GoParser.ReceiverContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitReceiver(GoParser.ReceiverContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterVarDecl(GoParser.VarDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitVarDecl(GoParser.VarDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterVarSpec(GoParser.VarSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitVarSpec(GoParser.VarSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBlock(GoParser.BlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBlock(GoParser.BlockContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStatementList(GoParser.StatementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStatementList(GoParser.StatementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStatement(GoParser.StatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStatement(GoParser.StatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSimpleStmt(GoParser.SimpleStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSimpleStmt(GoParser.SimpleStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpressionStmt(GoParser.ExpressionStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpressionStmt(GoParser.ExpressionStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSendStmt(GoParser.SendStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSendStmt(GoParser.SendStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIncDecStmt(GoParser.IncDecStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIncDecStmt(GoParser.IncDecStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignment(GoParser.AssignmentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignment(GoParser.AssignmentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssign_op(GoParser.Assign_opContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssign_op(GoParser.Assign_opContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterShortVarDecl(GoParser.ShortVarDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitShortVarDecl(GoParser.ShortVarDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLabeledStmt(GoParser.LabeledStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLabeledStmt(GoParser.LabeledStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterReturnStmt(GoParser.ReturnStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitReturnStmt(GoParser.ReturnStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBreakStmt(GoParser.BreakStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBreakStmt(GoParser.BreakStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterContinueStmt(GoParser.ContinueStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitContinueStmt(GoParser.ContinueStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterGotoStmt(GoParser.GotoStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitGotoStmt(GoParser.GotoStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFallthroughStmt(GoParser.FallthroughStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFallthroughStmt(GoParser.FallthroughStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDeferStmt(GoParser.DeferStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDeferStmt(GoParser.DeferStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIfStmt(GoParser.IfStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIfStmt(GoParser.IfStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSwitchStmt(GoParser.SwitchStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSwitchStmt(GoParser.SwitchStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExprSwitchStmt(GoParser.ExprSwitchStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExprSwitchStmt(GoParser.ExprSwitchStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExprCaseClause(GoParser.ExprCaseClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExprCaseClause(GoParser.ExprCaseClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExprSwitchCase(GoParser.ExprSwitchCaseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExprSwitchCase(GoParser.ExprSwitchCaseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeSwitchStmt(GoParser.TypeSwitchStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeSwitchStmt(GoParser.TypeSwitchStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeSwitchGuard(GoParser.TypeSwitchGuardContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeSwitchGuard(GoParser.TypeSwitchGuardContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeCaseClause(GoParser.TypeCaseClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeCaseClause(GoParser.TypeCaseClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeSwitchCase(GoParser.TypeSwitchCaseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeSwitchCase(GoParser.TypeSwitchCaseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeList(GoParser.TypeListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeList(GoParser.TypeListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSelectStmt(GoParser.SelectStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSelectStmt(GoParser.SelectStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCommClause(GoParser.CommClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCommClause(GoParser.CommClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCommCase(GoParser.CommCaseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCommCase(GoParser.CommCaseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterRecvStmt(GoParser.RecvStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitRecvStmt(GoParser.RecvStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForStmt(GoParser.ForStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForStmt(GoParser.ForStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForClause(GoParser.ForClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForClause(GoParser.ForClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterRangeClause(GoParser.RangeClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitRangeClause(GoParser.RangeClauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterGoStmt(GoParser.GoStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitGoStmt(GoParser.GoStmtContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterType_(GoParser.Type_Context ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitType_(GoParser.Type_Context ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeArgs(GoParser.TypeArgsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeArgs(GoParser.TypeArgsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeName(GoParser.TypeNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeName(GoParser.TypeNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeLit(GoParser.TypeLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeLit(GoParser.TypeLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrayType(GoParser.ArrayTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrayType(GoParser.ArrayTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArrayLength(GoParser.ArrayLengthContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArrayLength(GoParser.ArrayLengthContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterElementType(GoParser.ElementTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitElementType(GoParser.ElementTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPointerType(GoParser.PointerTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPointerType(GoParser.PointerTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterInterfaceType(GoParser.InterfaceTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitInterfaceType(GoParser.InterfaceTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSliceType(GoParser.SliceTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSliceType(GoParser.SliceTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMapType(GoParser.MapTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMapType(GoParser.MapTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterChannelType(GoParser.ChannelTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitChannelType(GoParser.ChannelTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodSpec(GoParser.MethodSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodSpec(GoParser.MethodSpecContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionType(GoParser.FunctionTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionType(GoParser.FunctionTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSignature(GoParser.SignatureContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSignature(GoParser.SignatureContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterResult(GoParser.ResultContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitResult(GoParser.ResultContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterParameters(GoParser.ParametersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitParameters(GoParser.ParametersContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterParameterDecl(GoParser.ParameterDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitParameterDecl(GoParser.ParameterDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpression(GoParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpression(GoParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPrimaryExpr(GoParser.PrimaryExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPrimaryExpr(GoParser.PrimaryExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConversion(GoParser.ConversionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConversion(GoParser.ConversionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterOperand(GoParser.OperandContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitOperand(GoParser.OperandContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteral(GoParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteral(GoParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBasicLit(GoParser.BasicLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBasicLit(GoParser.BasicLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterInteger(GoParser.IntegerContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitInteger(GoParser.IntegerContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterOperandName(GoParser.OperandNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitOperandName(GoParser.OperandNameContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterQualifiedIdent(GoParser.QualifiedIdentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitQualifiedIdent(GoParser.QualifiedIdentContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCompositeLit(GoParser.CompositeLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCompositeLit(GoParser.CompositeLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteralType(GoParser.LiteralTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteralType(GoParser.LiteralTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteralValue(GoParser.LiteralValueContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteralValue(GoParser.LiteralValueContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterElementList(GoParser.ElementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitElementList(GoParser.ElementListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterKeyedElement(GoParser.KeyedElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitKeyedElement(GoParser.KeyedElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterKey(GoParser.KeyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitKey(GoParser.KeyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterElement(GoParser.ElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitElement(GoParser.ElementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStructType(GoParser.StructTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStructType(GoParser.StructTypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFieldDecl(GoParser.FieldDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFieldDecl(GoParser.FieldDeclContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterString_(GoParser.String_Context ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitString_(GoParser.String_Context ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEmbeddedField(GoParser.EmbeddedFieldContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEmbeddedField(GoParser.EmbeddedFieldContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFunctionLit(GoParser.FunctionLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFunctionLit(GoParser.FunctionLitContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIndex(GoParser.IndexContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIndex(GoParser.IndexContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSlice_(GoParser.Slice_Context ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSlice_(GoParser.Slice_Context ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTypeAssertion(GoParser.TypeAssertionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTypeAssertion(GoParser.TypeAssertionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArguments(GoParser.ArgumentsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArguments(GoParser.ArgumentsContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodExpr(GoParser.MethodExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodExpr(GoParser.MethodExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEos(GoParser.EosContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEos(GoParser.EosContext ctx) { } + + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitTerminal(TerminalNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitErrorNode(ErrorNode node) { } +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserListener.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserListener.java new file mode 100644 index 000000000..63a6b2b43 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/GoParserListener.java @@ -0,0 +1,1049 @@ +package run.mone.antlr.golang;// Generated from GoParser.g4 by ANTLR 4.7.1 +import org.antlr.v4.runtime.tree.ParseTreeListener; + +/** + * This interface defines a complete listener for a parse tree produced by + * {@link GoParser}. + */ +public interface GoParserListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link GoParser#sourceFile}. + * @param ctx the parse tree + */ + void enterSourceFile(GoParser.SourceFileContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#sourceFile}. + * @param ctx the parse tree + */ + void exitSourceFile(GoParser.SourceFileContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#packageClause}. + * @param ctx the parse tree + */ + void enterPackageClause(GoParser.PackageClauseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#packageClause}. + * @param ctx the parse tree + */ + void exitPackageClause(GoParser.PackageClauseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#importDecl}. + * @param ctx the parse tree + */ + void enterImportDecl(GoParser.ImportDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#importDecl}. + * @param ctx the parse tree + */ + void exitImportDecl(GoParser.ImportDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#importSpec}. + * @param ctx the parse tree + */ + void enterImportSpec(GoParser.ImportSpecContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#importSpec}. + * @param ctx the parse tree + */ + void exitImportSpec(GoParser.ImportSpecContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#importPath}. + * @param ctx the parse tree + */ + void enterImportPath(GoParser.ImportPathContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#importPath}. + * @param ctx the parse tree + */ + void exitImportPath(GoParser.ImportPathContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#declaration}. + * @param ctx the parse tree + */ + void enterDeclaration(GoParser.DeclarationContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#declaration}. + * @param ctx the parse tree + */ + void exitDeclaration(GoParser.DeclarationContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#constDecl}. + * @param ctx the parse tree + */ + void enterConstDecl(GoParser.ConstDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#constDecl}. + * @param ctx the parse tree + */ + void exitConstDecl(GoParser.ConstDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#constSpec}. + * @param ctx the parse tree + */ + void enterConstSpec(GoParser.ConstSpecContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#constSpec}. + * @param ctx the parse tree + */ + void exitConstSpec(GoParser.ConstSpecContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#identifierList}. + * @param ctx the parse tree + */ + void enterIdentifierList(GoParser.IdentifierListContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#identifierList}. + * @param ctx the parse tree + */ + void exitIdentifierList(GoParser.IdentifierListContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#expressionList}. + * @param ctx the parse tree + */ + void enterExpressionList(GoParser.ExpressionListContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#expressionList}. + * @param ctx the parse tree + */ + void exitExpressionList(GoParser.ExpressionListContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#comment}. + * @param ctx the parse tree + */ + void enterComment(GoParser.CommentContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#comment}. + * @param ctx the parse tree + */ + void exitComment(GoParser.CommentContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeDecl}. + * @param ctx the parse tree + */ + void enterTypeDecl(GoParser.TypeDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeDecl}. + * @param ctx the parse tree + */ + void exitTypeDecl(GoParser.TypeDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeSpec}. + * @param ctx the parse tree + */ + void enterTypeSpec(GoParser.TypeSpecContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeSpec}. + * @param ctx the parse tree + */ + void exitTypeSpec(GoParser.TypeSpecContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#aliasDecl}. + * @param ctx the parse tree + */ + void enterAliasDecl(GoParser.AliasDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#aliasDecl}. + * @param ctx the parse tree + */ + void exitAliasDecl(GoParser.AliasDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeDef}. + * @param ctx the parse tree + */ + void enterTypeDef(GoParser.TypeDefContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeDef}. + * @param ctx the parse tree + */ + void exitTypeDef(GoParser.TypeDefContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeParameters}. + * @param ctx the parse tree + */ + void enterTypeParameters(GoParser.TypeParametersContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeParameters}. + * @param ctx the parse tree + */ + void exitTypeParameters(GoParser.TypeParametersContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeParameterDecl}. + * @param ctx the parse tree + */ + void enterTypeParameterDecl(GoParser.TypeParameterDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeParameterDecl}. + * @param ctx the parse tree + */ + void exitTypeParameterDecl(GoParser.TypeParameterDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeElement}. + * @param ctx the parse tree + */ + void enterTypeElement(GoParser.TypeElementContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeElement}. + * @param ctx the parse tree + */ + void exitTypeElement(GoParser.TypeElementContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeTerm}. + * @param ctx the parse tree + */ + void enterTypeTerm(GoParser.TypeTermContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeTerm}. + * @param ctx the parse tree + */ + void exitTypeTerm(GoParser.TypeTermContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#functionDecl}. + * @param ctx the parse tree + */ + void enterFunctionDecl(GoParser.FunctionDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#functionDecl}. + * @param ctx the parse tree + */ + void exitFunctionDecl(GoParser.FunctionDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#methodDecl}. + * @param ctx the parse tree + */ + void enterMethodDecl(GoParser.MethodDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#methodDecl}. + * @param ctx the parse tree + */ + void exitMethodDecl(GoParser.MethodDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#receiver}. + * @param ctx the parse tree + */ + void enterReceiver(GoParser.ReceiverContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#receiver}. + * @param ctx the parse tree + */ + void exitReceiver(GoParser.ReceiverContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#varDecl}. + * @param ctx the parse tree + */ + void enterVarDecl(GoParser.VarDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#varDecl}. + * @param ctx the parse tree + */ + void exitVarDecl(GoParser.VarDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#varSpec}. + * @param ctx the parse tree + */ + void enterVarSpec(GoParser.VarSpecContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#varSpec}. + * @param ctx the parse tree + */ + void exitVarSpec(GoParser.VarSpecContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#block}. + * @param ctx the parse tree + */ + void enterBlock(GoParser.BlockContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#block}. + * @param ctx the parse tree + */ + void exitBlock(GoParser.BlockContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#statementList}. + * @param ctx the parse tree + */ + void enterStatementList(GoParser.StatementListContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#statementList}. + * @param ctx the parse tree + */ + void exitStatementList(GoParser.StatementListContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#statement}. + * @param ctx the parse tree + */ + void enterStatement(GoParser.StatementContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#statement}. + * @param ctx the parse tree + */ + void exitStatement(GoParser.StatementContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#simpleStmt}. + * @param ctx the parse tree + */ + void enterSimpleStmt(GoParser.SimpleStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#simpleStmt}. + * @param ctx the parse tree + */ + void exitSimpleStmt(GoParser.SimpleStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#expressionStmt}. + * @param ctx the parse tree + */ + void enterExpressionStmt(GoParser.ExpressionStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#expressionStmt}. + * @param ctx the parse tree + */ + void exitExpressionStmt(GoParser.ExpressionStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#sendStmt}. + * @param ctx the parse tree + */ + void enterSendStmt(GoParser.SendStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#sendStmt}. + * @param ctx the parse tree + */ + void exitSendStmt(GoParser.SendStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#incDecStmt}. + * @param ctx the parse tree + */ + void enterIncDecStmt(GoParser.IncDecStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#incDecStmt}. + * @param ctx the parse tree + */ + void exitIncDecStmt(GoParser.IncDecStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#assignment}. + * @param ctx the parse tree + */ + void enterAssignment(GoParser.AssignmentContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#assignment}. + * @param ctx the parse tree + */ + void exitAssignment(GoParser.AssignmentContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#assign_op}. + * @param ctx the parse tree + */ + void enterAssign_op(GoParser.Assign_opContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#assign_op}. + * @param ctx the parse tree + */ + void exitAssign_op(GoParser.Assign_opContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#shortVarDecl}. + * @param ctx the parse tree + */ + void enterShortVarDecl(GoParser.ShortVarDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#shortVarDecl}. + * @param ctx the parse tree + */ + void exitShortVarDecl(GoParser.ShortVarDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#labeledStmt}. + * @param ctx the parse tree + */ + void enterLabeledStmt(GoParser.LabeledStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#labeledStmt}. + * @param ctx the parse tree + */ + void exitLabeledStmt(GoParser.LabeledStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#returnStmt}. + * @param ctx the parse tree + */ + void enterReturnStmt(GoParser.ReturnStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#returnStmt}. + * @param ctx the parse tree + */ + void exitReturnStmt(GoParser.ReturnStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#breakStmt}. + * @param ctx the parse tree + */ + void enterBreakStmt(GoParser.BreakStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#breakStmt}. + * @param ctx the parse tree + */ + void exitBreakStmt(GoParser.BreakStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#continueStmt}. + * @param ctx the parse tree + */ + void enterContinueStmt(GoParser.ContinueStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#continueStmt}. + * @param ctx the parse tree + */ + void exitContinueStmt(GoParser.ContinueStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#gotoStmt}. + * @param ctx the parse tree + */ + void enterGotoStmt(GoParser.GotoStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#gotoStmt}. + * @param ctx the parse tree + */ + void exitGotoStmt(GoParser.GotoStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#fallthroughStmt}. + * @param ctx the parse tree + */ + void enterFallthroughStmt(GoParser.FallthroughStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#fallthroughStmt}. + * @param ctx the parse tree + */ + void exitFallthroughStmt(GoParser.FallthroughStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#deferStmt}. + * @param ctx the parse tree + */ + void enterDeferStmt(GoParser.DeferStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#deferStmt}. + * @param ctx the parse tree + */ + void exitDeferStmt(GoParser.DeferStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#ifStmt}. + * @param ctx the parse tree + */ + void enterIfStmt(GoParser.IfStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#ifStmt}. + * @param ctx the parse tree + */ + void exitIfStmt(GoParser.IfStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#switchStmt}. + * @param ctx the parse tree + */ + void enterSwitchStmt(GoParser.SwitchStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#switchStmt}. + * @param ctx the parse tree + */ + void exitSwitchStmt(GoParser.SwitchStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#exprSwitchStmt}. + * @param ctx the parse tree + */ + void enterExprSwitchStmt(GoParser.ExprSwitchStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#exprSwitchStmt}. + * @param ctx the parse tree + */ + void exitExprSwitchStmt(GoParser.ExprSwitchStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#exprCaseClause}. + * @param ctx the parse tree + */ + void enterExprCaseClause(GoParser.ExprCaseClauseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#exprCaseClause}. + * @param ctx the parse tree + */ + void exitExprCaseClause(GoParser.ExprCaseClauseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#exprSwitchCase}. + * @param ctx the parse tree + */ + void enterExprSwitchCase(GoParser.ExprSwitchCaseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#exprSwitchCase}. + * @param ctx the parse tree + */ + void exitExprSwitchCase(GoParser.ExprSwitchCaseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeSwitchStmt}. + * @param ctx the parse tree + */ + void enterTypeSwitchStmt(GoParser.TypeSwitchStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeSwitchStmt}. + * @param ctx the parse tree + */ + void exitTypeSwitchStmt(GoParser.TypeSwitchStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeSwitchGuard}. + * @param ctx the parse tree + */ + void enterTypeSwitchGuard(GoParser.TypeSwitchGuardContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeSwitchGuard}. + * @param ctx the parse tree + */ + void exitTypeSwitchGuard(GoParser.TypeSwitchGuardContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeCaseClause}. + * @param ctx the parse tree + */ + void enterTypeCaseClause(GoParser.TypeCaseClauseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeCaseClause}. + * @param ctx the parse tree + */ + void exitTypeCaseClause(GoParser.TypeCaseClauseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeSwitchCase}. + * @param ctx the parse tree + */ + void enterTypeSwitchCase(GoParser.TypeSwitchCaseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeSwitchCase}. + * @param ctx the parse tree + */ + void exitTypeSwitchCase(GoParser.TypeSwitchCaseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeList}. + * @param ctx the parse tree + */ + void enterTypeList(GoParser.TypeListContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeList}. + * @param ctx the parse tree + */ + void exitTypeList(GoParser.TypeListContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#selectStmt}. + * @param ctx the parse tree + */ + void enterSelectStmt(GoParser.SelectStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#selectStmt}. + * @param ctx the parse tree + */ + void exitSelectStmt(GoParser.SelectStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#commClause}. + * @param ctx the parse tree + */ + void enterCommClause(GoParser.CommClauseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#commClause}. + * @param ctx the parse tree + */ + void exitCommClause(GoParser.CommClauseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#commCase}. + * @param ctx the parse tree + */ + void enterCommCase(GoParser.CommCaseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#commCase}. + * @param ctx the parse tree + */ + void exitCommCase(GoParser.CommCaseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#recvStmt}. + * @param ctx the parse tree + */ + void enterRecvStmt(GoParser.RecvStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#recvStmt}. + * @param ctx the parse tree + */ + void exitRecvStmt(GoParser.RecvStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#forStmt}. + * @param ctx the parse tree + */ + void enterForStmt(GoParser.ForStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#forStmt}. + * @param ctx the parse tree + */ + void exitForStmt(GoParser.ForStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#forClause}. + * @param ctx the parse tree + */ + void enterForClause(GoParser.ForClauseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#forClause}. + * @param ctx the parse tree + */ + void exitForClause(GoParser.ForClauseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#rangeClause}. + * @param ctx the parse tree + */ + void enterRangeClause(GoParser.RangeClauseContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#rangeClause}. + * @param ctx the parse tree + */ + void exitRangeClause(GoParser.RangeClauseContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#goStmt}. + * @param ctx the parse tree + */ + void enterGoStmt(GoParser.GoStmtContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#goStmt}. + * @param ctx the parse tree + */ + void exitGoStmt(GoParser.GoStmtContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#type_}. + * @param ctx the parse tree + */ + void enterType_(GoParser.Type_Context ctx); + /** + * Exit a parse tree produced by {@link GoParser#type_}. + * @param ctx the parse tree + */ + void exitType_(GoParser.Type_Context ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeArgs}. + * @param ctx the parse tree + */ + void enterTypeArgs(GoParser.TypeArgsContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeArgs}. + * @param ctx the parse tree + */ + void exitTypeArgs(GoParser.TypeArgsContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeName}. + * @param ctx the parse tree + */ + void enterTypeName(GoParser.TypeNameContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeName}. + * @param ctx the parse tree + */ + void exitTypeName(GoParser.TypeNameContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeLit}. + * @param ctx the parse tree + */ + void enterTypeLit(GoParser.TypeLitContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeLit}. + * @param ctx the parse tree + */ + void exitTypeLit(GoParser.TypeLitContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#arrayType}. + * @param ctx the parse tree + */ + void enterArrayType(GoParser.ArrayTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#arrayType}. + * @param ctx the parse tree + */ + void exitArrayType(GoParser.ArrayTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#arrayLength}. + * @param ctx the parse tree + */ + void enterArrayLength(GoParser.ArrayLengthContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#arrayLength}. + * @param ctx the parse tree + */ + void exitArrayLength(GoParser.ArrayLengthContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#elementType}. + * @param ctx the parse tree + */ + void enterElementType(GoParser.ElementTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#elementType}. + * @param ctx the parse tree + */ + void exitElementType(GoParser.ElementTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#pointerType}. + * @param ctx the parse tree + */ + void enterPointerType(GoParser.PointerTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#pointerType}. + * @param ctx the parse tree + */ + void exitPointerType(GoParser.PointerTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#interfaceType}. + * @param ctx the parse tree + */ + void enterInterfaceType(GoParser.InterfaceTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#interfaceType}. + * @param ctx the parse tree + */ + void exitInterfaceType(GoParser.InterfaceTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#sliceType}. + * @param ctx the parse tree + */ + void enterSliceType(GoParser.SliceTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#sliceType}. + * @param ctx the parse tree + */ + void exitSliceType(GoParser.SliceTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#mapType}. + * @param ctx the parse tree + */ + void enterMapType(GoParser.MapTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#mapType}. + * @param ctx the parse tree + */ + void exitMapType(GoParser.MapTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#channelType}. + * @param ctx the parse tree + */ + void enterChannelType(GoParser.ChannelTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#channelType}. + * @param ctx the parse tree + */ + void exitChannelType(GoParser.ChannelTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#methodSpec}. + * @param ctx the parse tree + */ + void enterMethodSpec(GoParser.MethodSpecContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#methodSpec}. + * @param ctx the parse tree + */ + void exitMethodSpec(GoParser.MethodSpecContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#functionType}. + * @param ctx the parse tree + */ + void enterFunctionType(GoParser.FunctionTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#functionType}. + * @param ctx the parse tree + */ + void exitFunctionType(GoParser.FunctionTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#signature}. + * @param ctx the parse tree + */ + void enterSignature(GoParser.SignatureContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#signature}. + * @param ctx the parse tree + */ + void exitSignature(GoParser.SignatureContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#result}. + * @param ctx the parse tree + */ + void enterResult(GoParser.ResultContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#result}. + * @param ctx the parse tree + */ + void exitResult(GoParser.ResultContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#parameters}. + * @param ctx the parse tree + */ + void enterParameters(GoParser.ParametersContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#parameters}. + * @param ctx the parse tree + */ + void exitParameters(GoParser.ParametersContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#parameterDecl}. + * @param ctx the parse tree + */ + void enterParameterDecl(GoParser.ParameterDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#parameterDecl}. + * @param ctx the parse tree + */ + void exitParameterDecl(GoParser.ParameterDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#expression}. + * @param ctx the parse tree + */ + void enterExpression(GoParser.ExpressionContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#expression}. + * @param ctx the parse tree + */ + void exitExpression(GoParser.ExpressionContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#primaryExpr}. + * @param ctx the parse tree + */ + void enterPrimaryExpr(GoParser.PrimaryExprContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#primaryExpr}. + * @param ctx the parse tree + */ + void exitPrimaryExpr(GoParser.PrimaryExprContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#conversion}. + * @param ctx the parse tree + */ + void enterConversion(GoParser.ConversionContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#conversion}. + * @param ctx the parse tree + */ + void exitConversion(GoParser.ConversionContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#operand}. + * @param ctx the parse tree + */ + void enterOperand(GoParser.OperandContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#operand}. + * @param ctx the parse tree + */ + void exitOperand(GoParser.OperandContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#literal}. + * @param ctx the parse tree + */ + void enterLiteral(GoParser.LiteralContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#literal}. + * @param ctx the parse tree + */ + void exitLiteral(GoParser.LiteralContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#basicLit}. + * @param ctx the parse tree + */ + void enterBasicLit(GoParser.BasicLitContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#basicLit}. + * @param ctx the parse tree + */ + void exitBasicLit(GoParser.BasicLitContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#integer}. + * @param ctx the parse tree + */ + void enterInteger(GoParser.IntegerContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#integer}. + * @param ctx the parse tree + */ + void exitInteger(GoParser.IntegerContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#operandName}. + * @param ctx the parse tree + */ + void enterOperandName(GoParser.OperandNameContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#operandName}. + * @param ctx the parse tree + */ + void exitOperandName(GoParser.OperandNameContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#qualifiedIdent}. + * @param ctx the parse tree + */ + void enterQualifiedIdent(GoParser.QualifiedIdentContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#qualifiedIdent}. + * @param ctx the parse tree + */ + void exitQualifiedIdent(GoParser.QualifiedIdentContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#compositeLit}. + * @param ctx the parse tree + */ + void enterCompositeLit(GoParser.CompositeLitContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#compositeLit}. + * @param ctx the parse tree + */ + void exitCompositeLit(GoParser.CompositeLitContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#literalType}. + * @param ctx the parse tree + */ + void enterLiteralType(GoParser.LiteralTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#literalType}. + * @param ctx the parse tree + */ + void exitLiteralType(GoParser.LiteralTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#literalValue}. + * @param ctx the parse tree + */ + void enterLiteralValue(GoParser.LiteralValueContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#literalValue}. + * @param ctx the parse tree + */ + void exitLiteralValue(GoParser.LiteralValueContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#elementList}. + * @param ctx the parse tree + */ + void enterElementList(GoParser.ElementListContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#elementList}. + * @param ctx the parse tree + */ + void exitElementList(GoParser.ElementListContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#keyedElement}. + * @param ctx the parse tree + */ + void enterKeyedElement(GoParser.KeyedElementContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#keyedElement}. + * @param ctx the parse tree + */ + void exitKeyedElement(GoParser.KeyedElementContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#key}. + * @param ctx the parse tree + */ + void enterKey(GoParser.KeyContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#key}. + * @param ctx the parse tree + */ + void exitKey(GoParser.KeyContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#element}. + * @param ctx the parse tree + */ + void enterElement(GoParser.ElementContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#element}. + * @param ctx the parse tree + */ + void exitElement(GoParser.ElementContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#structType}. + * @param ctx the parse tree + */ + void enterStructType(GoParser.StructTypeContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#structType}. + * @param ctx the parse tree + */ + void exitStructType(GoParser.StructTypeContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#fieldDecl}. + * @param ctx the parse tree + */ + void enterFieldDecl(GoParser.FieldDeclContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#fieldDecl}. + * @param ctx the parse tree + */ + void exitFieldDecl(GoParser.FieldDeclContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#string_}. + * @param ctx the parse tree + */ + void enterString_(GoParser.String_Context ctx); + /** + * Exit a parse tree produced by {@link GoParser#string_}. + * @param ctx the parse tree + */ + void exitString_(GoParser.String_Context ctx); + /** + * Enter a parse tree produced by {@link GoParser#embeddedField}. + * @param ctx the parse tree + */ + void enterEmbeddedField(GoParser.EmbeddedFieldContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#embeddedField}. + * @param ctx the parse tree + */ + void exitEmbeddedField(GoParser.EmbeddedFieldContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#functionLit}. + * @param ctx the parse tree + */ + void enterFunctionLit(GoParser.FunctionLitContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#functionLit}. + * @param ctx the parse tree + */ + void exitFunctionLit(GoParser.FunctionLitContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#index}. + * @param ctx the parse tree + */ + void enterIndex(GoParser.IndexContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#index}. + * @param ctx the parse tree + */ + void exitIndex(GoParser.IndexContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#slice_}. + * @param ctx the parse tree + */ + void enterSlice_(GoParser.Slice_Context ctx); + /** + * Exit a parse tree produced by {@link GoParser#slice_}. + * @param ctx the parse tree + */ + void exitSlice_(GoParser.Slice_Context ctx); + /** + * Enter a parse tree produced by {@link GoParser#typeAssertion}. + * @param ctx the parse tree + */ + void enterTypeAssertion(GoParser.TypeAssertionContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#typeAssertion}. + * @param ctx the parse tree + */ + void exitTypeAssertion(GoParser.TypeAssertionContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#arguments}. + * @param ctx the parse tree + */ + void enterArguments(GoParser.ArgumentsContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#arguments}. + * @param ctx the parse tree + */ + void exitArguments(GoParser.ArgumentsContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#methodExpr}. + * @param ctx the parse tree + */ + void enterMethodExpr(GoParser.MethodExprContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#methodExpr}. + * @param ctx the parse tree + */ + void exitMethodExpr(GoParser.MethodExprContext ctx); + /** + * Enter a parse tree produced by {@link GoParser#eos}. + * @param ctx the parse tree + */ + void enterEos(GoParser.EosContext ctx); + /** + * Exit a parse tree produced by {@link GoParser#eos}. + * @param ctx the parse tree + */ + void exitEos(GoParser.EosContext ctx); +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/ParseResult.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/ParseResult.java new file mode 100644 index 000000000..f9ddc0b83 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/antlr/golang/ParseResult.java @@ -0,0 +1,22 @@ +package run.mone.antlr.golang; + +import lombok.Builder; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @author goodjava@qq.com + * @date 2024/2/1 22:48 + */ +@Data +@Builder +public class ParseResult { + + + private List fieldList; + + private Map> methodMap; + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/controller/TestController.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/controller/TestController.java new file mode 100644 index 000000000..3c82b0e34 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/controller/TestController.java @@ -0,0 +1,29 @@ +package run.mone.z.desensitization.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import run.mone.z.desensitization.domain.gateway.DemoGateway; +import run.mone.z.desensitization.domain.model.DemoReqEntiry; + +/** + * @author wm + */ +@RestController +public class TestController { + + @Autowired + private DemoGateway demoGateway; + + @ResponseBody + @RequestMapping(value = "/md5", method = RequestMethod.GET) + public String getStr(){ + DemoReqEntiry req = new DemoReqEntiry(); + req.setTest("abc"); + return demoGateway.demoTest(req).getTest(); + } + + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/dto/DesensitizeRsp.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/dto/DesensitizeRsp.java new file mode 100644 index 000000000..e404ebcd7 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/dto/DesensitizeRsp.java @@ -0,0 +1,22 @@ +package run.mone.z.desensitization.dto; + +import lombok.Builder; +import lombok.Data; + +/** + * @author wmin + * @date 2024/1/31 + */ +@Data +@Builder +public class DesensitizeRsp { + private String textBefore; + + private String textAfter; + + private String username; + + private int status; + + private long durationTime; +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/mapper/ZDesensitizationRecordMapper.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/mapper/ZDesensitizationRecordMapper.java new file mode 100644 index 000000000..758ef6e45 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/mapper/ZDesensitizationRecordMapper.java @@ -0,0 +1,40 @@ +package run.mone.z.desensitization.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.z.desensitization.pojo.ZDesensitizationRecord; +import run.mone.z.desensitization.pojo.ZDesensitizationRecordExample; + +public interface ZDesensitizationRecordMapper { + long countByExample(ZDesensitizationRecordExample example); + + int deleteByExample(ZDesensitizationRecordExample example); + + int deleteByPrimaryKey(Long id); + + int insert(ZDesensitizationRecord record); + + int insertSelective(ZDesensitizationRecord record); + + List selectByExampleWithBLOBs(ZDesensitizationRecordExample example); + + List selectByExample(ZDesensitizationRecordExample example); + + ZDesensitizationRecord selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") ZDesensitizationRecord record, @Param("example") ZDesensitizationRecordExample example); + + int updateByExampleWithBLOBs(@Param("record") ZDesensitizationRecord record, @Param("example") ZDesensitizationRecordExample example); + + int updateByExample(@Param("record") ZDesensitizationRecord record, @Param("example") ZDesensitizationRecordExample example); + + int updateByPrimaryKeySelective(ZDesensitizationRecord record); + + int updateByPrimaryKeyWithBLOBs(ZDesensitizationRecord record); + + int updateByPrimaryKey(ZDesensitizationRecord record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ZDesensitizationRecord.Column ... selective); +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/pojo/ZDesensitizationRecord.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/pojo/ZDesensitizationRecord.java new file mode 100644 index 000000000..82e555caa --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/pojo/ZDesensitizationRecord.java @@ -0,0 +1,154 @@ +package run.mone.z.desensitization.pojo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; + +public class ZDesensitizationRecord { + private Long id; + + private Date gmtCreate; + + private String creator; + + private Integer status; + + private Long durationTime; + + private String textBefore; + + private String textAfter; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator == null ? null : creator.trim(); + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getDurationTime() { + return durationTime; + } + + public void setDurationTime(Long durationTime) { + this.durationTime = durationTime; + } + + public String getTextBefore() { + return textBefore; + } + + public void setTextBefore(String textBefore) { + this.textBefore = textBefore == null ? null : textBefore.trim(); + } + + public String getTextAfter() { + return textAfter; + } + + public void setTextAfter(String textAfter) { + this.textAfter = textAfter == null ? null : textAfter.trim(); + } + + public enum Column { + id("id", "id", "BIGINT", false), + gmtCreate("gmt_create", "gmtCreate", "TIMESTAMP", false), + creator("creator", "creator", "VARCHAR", false), + status("status", "status", "INTEGER", false), + durationTime("duration_time", "durationTime", "BIGINT", false), + textBefore("text_before", "textBefore", "LONGVARCHAR", false), + textAfter("text_after", "textAfter", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/pojo/ZDesensitizationRecordExample.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/pojo/ZDesensitizationRecordExample.java new file mode 100644 index 000000000..2145a11c9 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/pojo/ZDesensitizationRecordExample.java @@ -0,0 +1,511 @@ +package run.mone.z.desensitization.pojo; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ZDesensitizationRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ZDesensitizationRecordExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andGmtCreateIsNull() { + addCriterion("gmt_create is null"); + return (Criteria) this; + } + + public Criteria andGmtCreateIsNotNull() { + addCriterion("gmt_create is not null"); + return (Criteria) this; + } + + public Criteria andGmtCreateEqualTo(Date value) { + addCriterion("gmt_create =", value, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateNotEqualTo(Date value) { + addCriterion("gmt_create <>", value, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateGreaterThan(Date value) { + addCriterion("gmt_create >", value, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) { + addCriterion("gmt_create >=", value, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateLessThan(Date value) { + addCriterion("gmt_create <", value, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateLessThanOrEqualTo(Date value) { + addCriterion("gmt_create <=", value, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateIn(List values) { + addCriterion("gmt_create in", values, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateNotIn(List values) { + addCriterion("gmt_create not in", values, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateBetween(Date value1, Date value2) { + addCriterion("gmt_create between", value1, value2, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andGmtCreateNotBetween(Date value1, Date value2) { + addCriterion("gmt_create not between", value1, value2, "gmtCreate"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andDurationTimeIsNull() { + addCriterion("duration_time is null"); + return (Criteria) this; + } + + public Criteria andDurationTimeIsNotNull() { + addCriterion("duration_time is not null"); + return (Criteria) this; + } + + public Criteria andDurationTimeEqualTo(Long value) { + addCriterion("duration_time =", value, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeNotEqualTo(Long value) { + addCriterion("duration_time <>", value, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeGreaterThan(Long value) { + addCriterion("duration_time >", value, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeGreaterThanOrEqualTo(Long value) { + addCriterion("duration_time >=", value, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeLessThan(Long value) { + addCriterion("duration_time <", value, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeLessThanOrEqualTo(Long value) { + addCriterion("duration_time <=", value, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeIn(List values) { + addCriterion("duration_time in", values, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeNotIn(List values) { + addCriterion("duration_time not in", values, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeBetween(Long value1, Long value2) { + addCriterion("duration_time between", value1, value2, "durationTime"); + return (Criteria) this; + } + + public Criteria andDurationTimeNotBetween(Long value1, Long value2) { + addCriterion("duration_time not between", value1, value2, "durationTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/AiCodeDesensitizeService.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/AiCodeDesensitizeService.java new file mode 100644 index 000000000..7d76fe0ca --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/AiCodeDesensitizeService.java @@ -0,0 +1,49 @@ +package run.mone.z.desensitization.service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.xiaomi.sautumn.serverless.api.http.Http; +import com.xiaomi.sautumn.serverless.api.http.HttpResult; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * @author wmin + * @date 2023/11/20 + */ +@Service +@Slf4j +public class AiCodeDesensitizeService { + + @Resource + private Http http; + + public String aiCodeDesensitize(String code){ + String res = code; + try { + log.info("aiCodeDesensitize start"); + Map map = new HashMap<>(); + map.put("data",code); + HttpResult httpResult = http.postForm("http://localhost/desensitize_form",map,new HashMap() {{ + put("content-type", "application/x-www-form-urlencoded"); + }},"utf-8", 5000); + if (200==httpResult.getCode() && StringUtils.isNotBlank(httpResult.getContent())){ + JSONObject jsonObject = JSON.parseObject(httpResult.getContent()); + if (0==jsonObject.getInteger("code") && StringUtils.isNotBlank(jsonObject.getString("data"))){ + res = jsonObject.getString("data"); + log.info("aiCodeDesensitize done.{}", res); + } + } else { + log.error("aiCodeDesensitize failed.{}", httpResult); + } + } catch (Exception e){ + log.error("aiCodeDesensitize error.", e); + } + return res; + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/CodeDesensitizeServiceImpl.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/CodeDesensitizeServiceImpl.java new file mode 100644 index 000000000..b3368bdec --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/CodeDesensitizeServiceImpl.java @@ -0,0 +1,169 @@ +package run.mone.z.desensitization.service; + +import com.google.common.base.Preconditions; +import com.google.gson.Gson; +import com.xiaomi.youpin.infra.rpc.Result; +import com.xiaomi.youpin.infra.rpc.errors.GeneralCodes; +import io.netty.handler.codec.http.HttpResponseStatus; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import run.mone.sautumnn.springboot.starter.anno.DubboService; +import run.mone.z.desensitization.api.bo.DesensitizeReq; +import run.mone.z.desensitization.api.service.CodeDesensitizeService; +import run.mone.z.desensitization.dto.DesensitizeRsp; +import run.mone.z.desensitization.service.common.CodeDesensitizeUtils; +import run.mone.z.desensitization.service.common.CodeExtractorUtils; +import run.mone.z.desensitization.service.common.Consts; +import run.mone.z.desensitization.service.common.NewCodeDesensitizeUtils; + +import javax.annotation.Resource; + +/** + * @author wmin + * @date 2023/6/5 + */ +@DubboService(interfaceClass = CodeDesensitizeService.class, timeout = 5000, group = "${dubbo.group}", version = "1.0") +@Slf4j +public class CodeDesensitizeServiceImpl implements CodeDesensitizeService { + + @Resource + private AiCodeDesensitizeService aiCodeDesensitizeService; + + @Resource + private RecordService recordService; + + private Gson gson = new Gson(); + @Override + public Result codeDesensitize(String codeSnippet) { + try { + String codeSnippetAfterDesensitized = CodeDesensitizeUtils.codeDesensitizeForClass(codeSnippet); + if (StringUtils.isNoneBlank(codeSnippetAfterDesensitized)){ + return Result.success(codeSnippetAfterDesensitized); + } + return Result.fail(GeneralCodes.ParamError, "The code does not comply with the syntax requirements"); + } catch (Exception e) { + log.error("codeDesensitize error.", e); + return Result.fail(GeneralCodes.InternalError, HttpResponseStatus.INTERNAL_SERVER_ERROR.reasonPhrase()); + } + } + + public Result codeDesensitizeWithSpecConfig(DesensitizeReq req) { + try { + if (StringUtils.isBlank(req.getLangType())) { + log.warn("lang type is not specified! currently supported: java / go; WILL USE: java as lang type to desensitize!"); + req.setLangType(Consts.LANG_JAVA); + } + String codeSnippetAfterDesensitized = req.getText(); + switch (req.getLangType()) { + case Consts.LANG_GO: + codeSnippetAfterDesensitized = NewCodeDesensitizeUtils.codeDesensitizeForGo(req); + break; + case Consts.LANG_JAVA: + default: + codeSnippetAfterDesensitized = NewCodeDesensitizeUtils.codeDesensitizeForClass(req); + } + if (StringUtils.isNoneBlank(codeSnippetAfterDesensitized)){ + return Result.success(codeSnippetAfterDesensitized); + } + return Result.fail(GeneralCodes.ParamError, "The code does not comply with the syntax requirements"); + } catch (Exception e) { + log.error("codeDesensitize error.", e); + return Result.fail(GeneralCodes.InternalError, HttpResponseStatus.INTERNAL_SERVER_ERROR.reasonPhrase()); + } + } + + @Override + public Result textDesensitize(String text) { + try { + Pair rst = CodeExtractorUtils.codeExtractor(text); + if (rst.getKey()){ + String[] index = rst.getValue().split("-"); + String codeSnippet = text.substring(Integer.parseInt(index[0]), Integer.parseInt(index[1])+1); + Result codeRst = codeDesensitize(codeSnippet); + if (codeRst.getCode()==0){ + StringBuilder sb = new StringBuilder(text); + sb.replace(Integer.parseInt(index[0]), Integer.parseInt(index[1])+2, codeRst.getData()); + return Result.success(sb.toString()); + } + return codeRst; + } + return Result.fail(GeneralCodes.ParamError, "codeExtractor error"); + } catch (Exception e) { + log.error("textDesensitize error.", e); + return Result.fail(GeneralCodes.InternalError, HttpResponseStatus.INTERNAL_SERVER_ERROR.reasonPhrase()); + } + } + + @Override + public Result textDesensitizeWithAi(DesensitizeReq req) { + long startTime = System.currentTimeMillis(); + Result rst = null; + DesensitizeRsp rsp = DesensitizeRsp.builder() + .textBefore(req.getText()) + .username(req.getUsername()) + .build(); + try { + rst = textDesensitizeWithAiBase(req); + return rst; + } finally { + long endTime = System.currentTimeMillis(); + long duration = endTime - startTime; + rsp.setDurationTime(duration); + rsp.setStatus(rst.getCode()==0?1:0); + rsp.setTextAfter(rst.getData()); + log.info("textDesensitizeWithAi status:{},duration:{}", rsp.getStatus(), duration); + recordService.saveRecord(rsp); + } + } + + public Result textDesensitizeWithAiBase(DesensitizeReq req) { + log.info("textDesensitizeWithAi req:{}", gson.toJson(req)); + Preconditions.checkArgument(null!=req && StringUtils.isNotBlank(req.getText()), "text can not be null"); + String text = req.getText(); + Boolean aiFlag = req.getAiDesensitizeFlag(); + //保险起见,默认本地失败,只要失败就调ai + Boolean isLocalFailed = true; + String textAfterDe = text; + + try { + // 如果需要提取代码,则提取; 否则直接脱敏 + if (req.getNeedExtract() != null && Boolean.TRUE.equals(req.getNeedExtract())) { + Pair rst = CodeExtractorUtils.codeExtractorWithLabel(text); + log.info("Perform code extraction with res:{}", rst); + if (rst.getKey()) { + String[] index = rst.getValue().split("-"); + String codeSnippet = text.substring(Integer.parseInt(index[0]), Integer.parseInt(index[1])); + log.info("codeSnippet after codeExtractorWithLabel:{}", codeSnippet); + req.setText(codeSnippet); + Result codeRst = codeDesensitizeWithSpecConfig(req); + if (codeRst.getCode() == 0) { + StringBuilder sb = new StringBuilder(text); + sb.replace(Integer.parseInt(index[0]), Integer.parseInt(index[1]) + 1, codeRst.getData()); + isLocalFailed = false; + textAfterDe = sb.toString(); + } + } else { + log.error("local textDesensitizeWithAi failed."); + } + } else { + log.info("Perform desensitization directly with req!"); + Result codeRst = codeDesensitizeWithSpecConfig(req); + isLocalFailed = false; + textAfterDe = codeRst.getData(); + } + } catch (Exception e) { + log.error("textDesensitizeWithAi error.", e); + } + //if (BooleanUtils.isTrue(isLocalFailed) || BooleanUtils.isTrue(aiFlag)){ + if (BooleanUtils.isTrue(aiFlag)){ + //call ai http + textAfterDe = aiCodeDesensitizeService.aiCodeDesensitize(textAfterDe); + } + if (BooleanUtils.isTrue(isLocalFailed) && BooleanUtils.isFalse(aiFlag)){ + return Result.fail(GeneralCodes.InternalError, "local desensitization failed, and is configured not to call AI desensitization!"); + } + return Result.success(textAfterDe); + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/DubboHealthServiceImpl.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/DubboHealthServiceImpl.java new file mode 100644 index 000000000..c5bd9ee22 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/DubboHealthServiceImpl.java @@ -0,0 +1,16 @@ +package run.mone.z.desensitization.service; + +import com.xiaomi.youpin.infra.rpc.Result; +import lombok.extern.slf4j.Slf4j; +import run.mone.sautumnn.springboot.starter.anno.DubboService; +import run.mone.z.desensitization.api.service.DubboHealthService; + +@DubboService(interfaceClass = DubboHealthService.class, timeout = 1000, group = "${dubbo.group}", version = "1.0") +@Slf4j +public class DubboHealthServiceImpl implements DubboHealthService { + + @Override + public Result health() { + return Result.success("ok"); + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/RecordService.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/RecordService.java new file mode 100644 index 000000000..0bfffe4a3 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/RecordService.java @@ -0,0 +1,37 @@ +package run.mone.z.desensitization.service; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import run.mone.z.desensitization.dto.DesensitizeRsp; +import run.mone.z.desensitization.mapper.ZDesensitizationRecordMapper; +import run.mone.z.desensitization.pojo.ZDesensitizationRecord; + +import javax.annotation.Resource; +import java.util.Date; + +/** + * @author wmin + * @date 2024/1/31 + */ +@Slf4j +@Service +public class RecordService { + + @Resource + private ZDesensitizationRecordMapper recordMapper; + + public void saveRecord(DesensitizeRsp rsp) { + try { + ZDesensitizationRecord record = new ZDesensitizationRecord(); + record.setGmtCreate(new Date()); + record.setCreator(rsp.getUsername()); + record.setTextBefore(rsp.getTextBefore()); + record.setTextAfter(rsp.getTextAfter()); + record.setStatus(rsp.getStatus()); + record.setDurationTime(rsp.getDurationTime()); + log.info("saveRecord :{}", recordMapper.insert(record)); + } catch (Exception e) { + log.error("saveRecord", e); + } + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/ClassUtils.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/ClassUtils.java new file mode 100644 index 000000000..28a591232 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/ClassUtils.java @@ -0,0 +1,57 @@ +package run.mone.z.desensitization.service.common; + +import com.github.javaparser.JavaParser; +import com.github.javaparser.ast.CompilationUnit; +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.util.JavacTask; +import com.sun.source.util.Trees; +import com.sun.tools.javac.api.JavacTool; + +import javax.tools.*; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; + +/** + * @author wmin + * @date 2023/6/5 + * 解析class语法树 + */ +public class ClassUtils { + + public static CompilationUnitTree getUnitTreeWithClassName(String sourceCode, String className) throws IOException { + JavaCompiler compiler = JavacTool.create(); + StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null); + JavaFileObject sourceFile = new JavaSourceFromString(className, sourceCode); + // 设置虚拟源文件的存储位置 + fileManager.setLocation(StandardLocation.CLASS_PATH, Arrays.asList()); + // 编译源代码 + JavacTask task = (JavacTask) compiler.getTask(null, fileManager, null, null, null, Arrays.asList(sourceFile)); + // 获取编译单元树 + Trees trees = Trees.instance(task); + Iterable compilationUnits = task.parse(); + CompilationUnitTree compilationUnit = compilationUnits.iterator().next(); + // 关闭文件管理器 + fileManager.close(); + return compilationUnit; + } + + private static CompilationUnit getUnitTree(String sourceCode){ + JavaParser javaParser = new JavaParser(); + CompilationUnit compilationUnit = javaParser.parse(sourceCode).getResult().get(); + return compilationUnit; + } + + // 自定义Java源文件对象 + static class JavaSourceFromString extends SimpleJavaFileObject { + final String code; + JavaSourceFromString(String name, String code) { + super(URI.create("string:///" + name.replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE); + this.code = code; + } + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return code; + } + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeDesensitizeUtils.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeDesensitizeUtils.java new file mode 100644 index 000000000..a67de7c4e --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeDesensitizeUtils.java @@ -0,0 +1,214 @@ +package run.mone.z.desensitization.service.common; + +import com.google.common.collect.Sets; +import com.sun.source.tree.*; +import com.sun.source.util.TreeScanner; +import com.sun.tools.javac.file.JavacFileManager; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.TreeMaker; +import com.sun.tools.javac.util.Context; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; +import run.mone.z.desensitization.api.common.CodeTypeEnum; + +import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; + +import static run.mone.z.desensitization.service.common.Consts.*; + +/** + * @author wmin + * @date 2023/6/5 + * 代码脱敏 + */ +@Slf4j +public class CodeDesensitizeUtils { + + /** + * 敏感词key + */ + private static Set filedOrMethodNames = Sets.newHashSet("password", "pwd", "secret", "token", "ip", "host"); + + private static Set ipKeys = Sets.newHashSet( "ip", "host"); + /** + * IP白名单 + */ + private static Set ipWhite = Sets.newHashSet("127.0.0.1", "0.0.0.0"); + + private static TreeScanner scanner; + + public static String codeDesensitizeForClass(String sourceCode, String className) throws Exception { + CompilationUnitTree compilationUnit = ClassUtils.getUnitTreeWithClassName(sourceCode, className); + TreeScanner scanner = getTreeScanner(); + scanner.scan(compilationUnit, null); + String codeAfterDesensitized = compilationUnit.toString(); + if (tmpClassName.equals(className)){ + codeAfterDesensitized = codeAfterDesensitized.substring(tmpClassNamePrefix.length()+1, codeAfterDesensitized.length()-1).replaceAll("^\\n+|\\n+$", ""); + } + log.info("codeAfterDesensitized ======{}======", codeAfterDesensitized); + return codeAfterDesensitized; + } + + public static String codeDesensitizeForClass(String sourceCode) throws Exception { + Pair rst = CodeParseUtils.codeParse(sourceCode); + if (rst!=null){ + if (CodeTypeEnum.CLASS.getType().equals(rst.getKey())){ + return codeDesensitizeForClass(sourceCode, rst.getValue()); + } + if (CodeTypeEnum.METHOD.getType().equals(rst.getKey())){ + return codeDesensitizeForClass(tmpClassNamePrefix + sourceCode + tmpClassNameSuffix, rst.getValue()); + } + } + return ""; + } + + private static synchronized TreeScanner getTreeScanner(){ + if (scanner!=null){ + return scanner; + } + Context context = new Context(); + JavacFileManager.preRegister(context); + TreeMaker treeMaker = TreeMaker.instance(context); + scanner = new TreeScanner() { + @Override + public Void visitVariable(VariableTree variableTree, Void aVoid) { + String key = variableTree.getName().toString(); + + //已初始化 + if (variableTree.getInitializer()!=null) { + ExpressionTree initializer = variableTree.getInitializer(); + if (initializer instanceof LiteralTree) { + String value = ((LiteralTree) initializer).getValue().toString(); + String valueDesensitized = value; + if (isSensitiveKey(key.toLowerCase())){ + valueDesensitized = maskValue(value, ipKeys.contains(key.toLowerCase())?"ip":"content"); + } + Pair valuePair = isSensitiveValue(value); + if (valuePair.getKey()){ + valueDesensitized = valuePair.getValue(); + } + JCTree.JCLiteral newLiteral = treeMaker.Literal(valueDesensitized); + ((JCTree.JCVariableDecl) variableTree).init = newLiteral; + } + } + return super.visitVariable(variableTree, aVoid); + } + + @Override + public Void visitMethod(MethodTree methodTreeTree, Void aVoid) { + BlockTree body = methodTreeTree.getBody(); + if (null != body) { + List stats = body.getStatements(); + stats.forEach(it -> { + if (it instanceof JCTree.JCExpressionStatement) { + JCTree.JCExpressionStatement statement = (JCTree.JCExpressionStatement) it; + JCTree.JCExpression expression = statement.getExpression(); + if (expression instanceof JCTree.JCMethodInvocation) { + JCTree.JCMethodInvocation invocation = (JCTree.JCMethodInvocation) expression; + com.sun.tools.javac.util.List arguments = invocation.getArguments(); + if (arguments.head!=null){ + com.sun.tools.javac.util.List newArguments = null; + for (int i =0;i pair = isSensitiveValue(value); + if (pair.getKey()){ + arg = treeMaker.Literal(pair.getValue()); + } + if (newArguments==null){ + newArguments = com.sun.tools.javac.util.List.of(arg); + } else { + newArguments = newArguments.append(arg); + } + } + if (arg instanceof JCTree.JCIdent) { + if (newArguments==null){ + newArguments = com.sun.tools.javac.util.List.of(arg); + } else { + newArguments = newArguments.append(arg); + } + } + } + invocation.args = newArguments; + } + } + } + }); + } + return super.visitMethod(methodTreeTree, aVoid); + } + }; + return scanner; + } + + + private static boolean isSensitiveKey(String key){ + //todo 只要包含就算,可能误判 + for (String keyword : filedOrMethodNames) { + if (key.toLowerCase().contains(keyword.toLowerCase())) { + return true; + } + } + return false; + } + + private static Pair isSensitiveValue(String value){ + Pair ipRst = hasSensitiveIP(value); + if (ipRst.getKey()){ + return ipRst; + } + Pair pwdRst = hasSensitivePwd(value); + return pwdRst; + } + + private static Pair hasSensitivePwd(String value){ + if (value.length() < 8) { + return Pair.of(false, value); + } + String specialCharacters = "!@#$%^&*()_-"; + boolean hasLetter = false; + boolean hasDigit = false; + boolean hasSpecialChar = false; + + for (char c : value.toCharArray()) { + if (Character.isLetter(c)) { + hasLetter = true; + } else if (Character.isDigit(c)) { + hasDigit = true; + } else { + if (specialCharacters.contains(String.valueOf(c))) { + hasSpecialChar = true; + } + } + } + //同时包含字母/数字/特殊字符 + if (hasLetter && hasDigit && hasSpecialChar){ + return Pair.of(true, maskValue(value, "value")); + } + + return Pair.of(false, value); + } + + private static Pair hasSensitiveIP(String value){ + String ipPattern = "^((\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])$"; + if (!ipWhite.contains(value) && Pattern.matches(ipPattern, value)){ + return Pair.of(true, maskValue(value, "ip")); + } + return Pair.of(false, value); + } + + //对敏感信息进行脱敏 + private static String maskValue(String value, String type) { + if ("ip".equals(type)){ + if (ipWhite.contains(value)){ + return value; + } + return "*.*.*.*"; + } + return value.replaceAll(".", "*"); + } + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeExtractorUtils.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeExtractorUtils.java new file mode 100644 index 000000000..e78d782fa --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeExtractorUtils.java @@ -0,0 +1,69 @@ +package run.mone.z.desensitization.service.common; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; + +import java.util.Stack; + +/** + * @author wmin + * @date 2023/6/7 + */ +@Slf4j +public class CodeExtractorUtils { + + /** + * 只能处理单段代码 + * 代码提取,返回代码片段开始和结束的index + */ + public static Pair codeExtractor(String str) { + Stack stack = new Stack<>(); + char[] arr = str.toCharArray(); + int firstBra = -1; + int lastBra = -1; + for (int i=0;i codeExtractorWithLabel(String str) { + if (str.contains(Consts.codeExtractorStartLabel) && str.contains(Consts.codeExtractorEndLabel)){ + int startIndex = str.indexOf(Consts.codeExtractorStartLabel); + int endIndex = str.indexOf(Consts.codeExtractorEndLabel, startIndex + Consts.codeExtractorStartLabel.length()); + return Pair.of(true, startIndex + Consts.codeExtractorStartLabel.length()+"-"+endIndex); + } + return Pair.of(false,"not supported"); + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeParseUtils.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeParseUtils.java new file mode 100644 index 000000000..177aa6ef7 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/CodeParseUtils.java @@ -0,0 +1,69 @@ +package run.mone.z.desensitization.service.common; + +import com.github.javaparser.JavaParser; +import com.github.javaparser.ParseResult; +import com.github.javaparser.ast.CompilationUnit; +import com.github.javaparser.ast.PackageDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; +import run.mone.z.desensitization.api.common.CodeTypeEnum; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +/** + * @author wmin + * @date 2023/6/5 + * 代码解析 + */ +@Slf4j +public class CodeParseUtils { + + public static Pair codeParse(String sourceCode){ + Pair rst = null; + try { + if (isClass(sourceCode)){ + JavaParser javaParser = new JavaParser(); + CompilationUnit compilationUnit = javaParser.parse(sourceCode).getResult().get(); + String className = compilationUnit.getType(0).getName().getIdentifier(); + if (compilationUnit.getPackageDeclaration().isPresent()){ + PackageDeclaration packageDeclaration = compilationUnit.getPackageDeclaration().get(); + className = packageDeclaration.getName()+"."+className; + } + rst = Pair.of(CodeTypeEnum.CLASS.getType(), className); + } else if (isMethod(sourceCode)){ + rst = methodCodeParse(sourceCode); + } + } catch (Exception e){ + log.error("codeParse error", e); + } + log.info("codeParse end.rst:{}", rst); + return rst; + } + + public static boolean isClass(String sourceCode){ + Pattern pattern = Pattern.compile(".*(public|protected|private)\\s+(class|interface)\\s.*", Pattern.DOTALL); + Matcher matcher = pattern.matcher(sourceCode); + return matcher.matches(); + } + + public static boolean isMethod(String sourceCode){ + String regex = "\\s*(public|protected|private)?\\s+(static\\s+)?[\\w\\<\\>\\[\\]]+\\s+[\\w\\$]+\\(.*\\)\\s*\\{.*"; + Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); + Matcher matcher = pattern.matcher(sourceCode); + return matcher.matches(); + } + + public static Pair methodCodeParse(String sourceCode){ + Pair rst = null; + JavaParser javaParser = new JavaParser(); + ParseResult cu = javaParser.parseMethodDeclaration(sourceCode); + if (cu.isSuccessful()){ + rst = Pair.of(CodeTypeEnum.METHOD.getType(), Consts.tmpClassName); + } + return rst; + } + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/Consts.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/Consts.java new file mode 100644 index 000000000..f89ad52e6 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/Consts.java @@ -0,0 +1,20 @@ +package run.mone.z.desensitization.service.common; + +/** + * @author wmin + * @date 2023/6/6 + */ +public class Consts { + + public static String tmpClassName = "TmpClassName"; + public static String tmpClassNamePrefix = "public class TmpClassName {"; + public static String tmpClassNameSuffix = "}"; + + public static String codeExtractorStartLabel = "z_desensitization_start"; + public static String codeExtractorEndLabel = "z_desensitization_end"; + + public static final String LANG_JAVA = "java"; + + public static final String LANG_GO = "go"; + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/HttpClientUtil.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/HttpClientUtil.java new file mode 100644 index 000000000..6b53ce534 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/HttpClientUtil.java @@ -0,0 +1,138 @@ +package run.mone.z.desensitization.service.common; + +import com.alibaba.nacos.common.utils.MapUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.http.HttpEntity; +import org.apache.http.HttpStatus; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.client.LaxRedirectStrategy; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.net.URI; +import java.util.Map; + +/** + * @author HawickMason@xiaomi.com + * @date 1/31/24 8:15 PM + */ +public class HttpClientUtil { + private static Logger log = LoggerFactory.getLogger(HttpClientUtil.class); + + private static final String APPLICATION_JSON = "application/json"; + + private static final String PREFIX = "Bearer "; + + private static final String UTF_8 = "UTF-8"; + + private static CloseableHttpClient httpClient = null; + private static RequestConfig requestConfig = null; + + static { + // 设置配置请求参数 + requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 连接主机服务超时时间 + .setConnectionRequestTimeout(35000)// 请求超时时间 + .setSocketTimeout(60000)// 数据读取超时时间 + .build(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); + connectionManager.setMaxTotal(200); + connectionManager.setDefaultMaxPerRoute(20); + //connectionManager.setValidateAfterInactivity(TimeValue.ofMinutes(5)); + httpClient = HttpClients.custom() + .setConnectionManager(connectionManager) + .setDefaultRequestConfig(requestConfig) + .setRedirectStrategy(new LaxRedirectStrategy()) // Follow Redirect 跟随重定向 + .build(); + } + + public static String doGet(String url) { + return doGet(url, null, null, null); + } + + public static String doGet(String url, Map param) { + return doGet(url, param, null, null); + } + + public static String doGet(String url, Map param, Map headerParamMap, Pair headerTokenPair) { + String result = ""; + CloseableHttpResponse response = null; + try { + // 创建 uri + URIBuilder builder = new URIBuilder(url); + if (MapUtils.isNotEmpty(param)) { + for (String key : param.keySet()) { + builder.addParameter(key, String.valueOf(param.get(key))); + } + } + URI uri = builder.build(); + + // 创建 http GET请求 + HttpGet httpGet = new HttpGet(uri); + + if (headerTokenPair != null) { + httpGet.addHeader(headerTokenPair.getKey(), PREFIX + headerTokenPair.getValue()); + } + + if (null != headerParamMap && !headerParamMap.isEmpty()) { + for (String key : headerParamMap.keySet()) { + if (!httpGet.containsHeader(key)) { + httpGet.addHeader(key, (String) headerParamMap.get(key)); + } + } + } + // 执行请求 + response = httpClient.execute(httpGet); + // 判断返回状态是否为200 + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + result = EntityUtils.toString(response.getEntity(), UTF_8); + } else { + log.error("doGet error, response:{}", response); + } + } catch (Exception e) { + log.error("doGet error, url:{}", url, e); + } finally { + try { + if (response != null) { + response.close(); + } + } catch (IOException e) { + log.error("doGet close response error:", e); + } + } + return result; + } + + public static String doPostString(String url, String body, Map headerParamMap) { + try { + HttpPost post = new HttpPost(url); + if (headerParamMap != null && !headerParamMap.isEmpty()) { + for (String key : headerParamMap.keySet()) { + if (!post.containsHeader(key)) { + post.addHeader(key, (String) headerParamMap.get(key)); + } + } + } + post.setEntity(new StringEntity(body, UTF_8)); + CloseableHttpResponse response = httpClient.execute(post); + HttpEntity resEntity = response.getEntity(); + if (resEntity == null) { + return null; + } + return EntityUtils.toString(resEntity); + } catch (Exception e) { + log.error("error in post request,error message={}", e); + } + return null; + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/NewCodeDesensitizeUtils.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/NewCodeDesensitizeUtils.java new file mode 100644 index 000000000..8966a8867 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/NewCodeDesensitizeUtils.java @@ -0,0 +1,335 @@ +package run.mone.z.desensitization.service.common; + +import com.alibaba.nacos.common.utils.MapUtils; +import com.google.common.collect.Sets; +import com.sun.source.tree.*; +import com.sun.source.util.TreeScanner; +import com.sun.tools.javac.file.JavacFileManager; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.TreeMaker; +import com.sun.tools.javac.util.Context; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.springframework.util.CollectionUtils; +import run.mone.antlr.golang.Field; +import run.mone.antlr.golang.GoCode; +import run.mone.antlr.golang.ParseResult; +import run.mone.z.desensitization.api.bo.DesensitizeReq; +import run.mone.z.desensitization.api.bo.SensitiveWordConfigBo; +import run.mone.z.desensitization.api.common.CodeTypeEnum; +import run.mone.z.desensitization.api.common.SensitiveWordTypeEnum; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static run.mone.z.desensitization.service.common.Consts.*; + +/** + * @author wmin + * @date 2023/6/5 + * 可根据指定的敏感词进行代码脱敏 + */ +@Slf4j +public class NewCodeDesensitizeUtils { + + /** + * 敏感词key + */ + private static Set filedOrMethodNames = Sets.newHashSet("password", "pwd", "secret", "token", "ip", "host"); + + private static Set ipKeys = Sets.newHashSet( "ip", "host"); + /** + * IP白名单 + */ + private static Set ipWhite = Sets.newHashSet("127.0.0.1", "0.0.0.0"); + + private static TreeScanner scanner; + + public static String codeDesensitizeForClass(String sourceCode, String className, List sensitiveWordConfigs) throws Exception { + CompilationUnitTree compilationUnit = ClassUtils.getUnitTreeWithClassName(sourceCode, className); + TreeScanner scanner = getTreeScanner(sensitiveWordConfigs); + scanner.scan(compilationUnit, null); + String codeAfterDesensitized = compilationUnit.toString(); + if (tmpClassName.equals(className)){ + codeAfterDesensitized = codeAfterDesensitized.substring(tmpClassNamePrefix.length()+1, codeAfterDesensitized.length()-1).replaceAll("^\\n+|\\n+$", ""); + } + log.info("codeAfterDesensitized ======{}======", codeAfterDesensitized); + return codeAfterDesensitized; + } + + public static String codeDesensitizeForClass(DesensitizeReq req) throws Exception { + String sourceCode = req.getText(); + Pair rst = CodeParseUtils.codeParse(sourceCode); + if (rst!=null){ + if (CodeTypeEnum.CLASS.getType().equals(rst.getKey())){ + return codeDesensitizeForClass(sourceCode, rst.getValue(), req.getSensitiveWordConfigBo()); + } + if (CodeTypeEnum.METHOD.getType().equals(rst.getKey())){ + return codeDesensitizeForClass(tmpClassNamePrefix + sourceCode + tmpClassNameSuffix, rst.getValue(), req.getSensitiveWordConfigBo()); + } + } + return ""; + } + + private static synchronized TreeScanner getTreeScanner(List sensitiveWordConfigs){ + if (scanner!=null){ + return scanner; + } + final List sensitiveWordConfigList = CollectionUtils.isEmpty(sensitiveWordConfigs)?new ArrayList<>():sensitiveWordConfigs; + Context context = new Context(); + JavacFileManager.preRegister(context); + TreeMaker treeMaker = TreeMaker.instance(context); + scanner = new TreeScanner() { + List keys = getConfiguredSensitiveKeys(sensitiveWordConfigList); + List values = getConfiguredSensitiveValues(sensitiveWordConfigList); + @Override + public Void visitVariable(VariableTree variableTree, Void aVoid) { + String key = variableTree.getName().toString(); + + //已初始化 + if (variableTree.getInitializer()!=null) { + ExpressionTree initializer = variableTree.getInitializer(); + if (initializer instanceof LiteralTree) { + String value = ((LiteralTree) initializer).getValue().toString(); + String valueDesensitized = value; + if (isSensitiveKey(key, keys)){ + valueDesensitized = maskValue(value, ipKeys.contains(key.toLowerCase())?"ip":"content"); + } + Pair valuePair = isSensitiveValue(value, values); + if (valuePair.getKey()){ + valueDesensitized = valuePair.getValue(); + } + JCTree.JCLiteral newLiteral = treeMaker.Literal(valueDesensitized); + ((JCTree.JCVariableDecl) variableTree).init = newLiteral; + } + } + return super.visitVariable(variableTree, aVoid); + } + + @Override + public Void visitMethod(MethodTree methodTreeTree, Void aVoid) { + BlockTree body = methodTreeTree.getBody(); + if (null != body) { + List stats = body.getStatements(); + stats.forEach(it -> { + if (it instanceof JCTree.JCExpressionStatement) { + JCTree.JCExpressionStatement statement = (JCTree.JCExpressionStatement) it; + JCTree.JCExpression expression = statement.getExpression(); + if (expression instanceof JCTree.JCMethodInvocation) { + JCTree.JCMethodInvocation invocation = (JCTree.JCMethodInvocation) expression; + com.sun.tools.javac.util.List arguments = invocation.getArguments(); + if (arguments.head!=null){ + com.sun.tools.javac.util.List newArguments = null; + for (int i =0;i pair = isSensitiveValue(value, values); + if (pair.getKey()){ + arg = treeMaker.Literal(pair.getValue()); + } + if (newArguments==null){ + newArguments = com.sun.tools.javac.util.List.of(arg); + } else { + newArguments = newArguments.append(arg); + } + } + if (arg instanceof JCTree.JCIdent) { + if (newArguments==null){ + newArguments = com.sun.tools.javac.util.List.of(arg); + } else { + newArguments = newArguments.append(arg); + } + } + } + invocation.args = newArguments; + } + } + } + }); + } + return super.visitMethod(methodTreeTree, aVoid); + } + }; + return scanner; + } + + + private static boolean isSensitiveKey(String key, List sensitiveWordConfigs){ + //todo 只要包含就算,可能误判 + ZNormalizer.normailize(key); + if (CollectionUtils.isEmpty(sensitiveWordConfigs)){ + for (String keyword : filedOrMethodNames) { + if (key.toLowerCase().contains(keyword.toLowerCase())) { + return true; + } + } + } + for (SensitiveWordConfigBo config : sensitiveWordConfigs){ + if (config.getRegexMatch()){ + Pattern pattern = Pattern.compile(config.getContent()); + if (pattern.matcher(key).matches()){ + return true; + } + } else if (config.getCaseSensitive()){ + if (key.contains(config.getContent())) { + return true; + } + } else { + if (key.toLowerCase().contains(config.getContent().toLowerCase())) { + return true; + } + } + } + return checkSensitivityFromZ(key); + } + + private static boolean checkSensitivityFromZ(String key) { + // TODO 从z获取敏感词信息 + return false; + } + + private static Pair isSensitiveValue(String value, List sensitiveWordConfigs){ + if (CollectionUtils.isEmpty(sensitiveWordConfigs)){ + Pair ipRst = hasSensitiveIP(value); + if (ipRst.getKey()){ + return ipRst; + } + Pair pwdRst = hasSensitivePwd(value); + return pwdRst; + } + for (SensitiveWordConfigBo config : sensitiveWordConfigs){ + if (config.getRegexMatch()){ + Pattern pattern = Pattern.compile(config.getContent()); + if (pattern.matcher(value).matches()){ + return Pair.of(true, maskValue(value, "")); + } + } else if (config.getCaseSensitive()){ + if (value.contains(config.getContent())) { + return Pair.of(true, maskValue(value, "")); + } + } else { + if (value.toLowerCase().contains(config.getContent().toLowerCase())) { + return Pair.of(true, maskValue(value, "")); + } + } + } + return Pair.of(false, value); + } + + private static Pair hasSensitivePwd(String value){ + if (value.length() < 8) { + return Pair.of(false, value); + } + String specialCharacters = "!@#$%^&*()_-"; + boolean hasLetter = false; + boolean hasDigit = false; + boolean hasSpecialChar = false; + + for (char c : value.toCharArray()) { + if (Character.isLetter(c)) { + hasLetter = true; + } else if (Character.isDigit(c)) { + hasDigit = true; + } else { + if (specialCharacters.contains(String.valueOf(c))) { + hasSpecialChar = true; + } + } + } + //同时包含字母/数字/特殊字符 + if (hasLetter && hasDigit && hasSpecialChar){ + return Pair.of(true, maskValue(value, "value")); + } + + return Pair.of(false, value); + } + + private static Pair hasSensitiveIP(String value){ + String ipPattern = "^((\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(\\d{1,2}|1\\d{2}|2[0-4]\\d|25[0-5])$"; + if (!ipWhite.contains(value) && Pattern.matches(ipPattern, value)){ + return Pair.of(true, maskValue(value, "ip")); + } + return Pair.of(false, value); + } + + //对敏感信息进行脱敏 + private static String maskValue(String value, String type) { + if ("ip".equals(type)){ + if (ipWhite.contains(value)){ + return value; + } + return "*.*.*.*"; + } + return value.replaceAll(".", "*"); + } + + public static String codeDesensitizeForGo(DesensitizeReq req) { + String sourceCode = req.getText(); + try { + ParseResult parsedSource = GoCode.parse(sourceCode); + sourceCode = doDesensitize(sourceCode, parsedSource, req.getSensitiveWordConfigBo()); + } catch (Exception e) { + log.error("Error while try to parse and desensitize go code, req:{}, nested exception is:", req, e); + } + return sourceCode; + } + + public static String doDesensitize(String sourceCode, ParseResult parsedSource, List sensitiveWordConfigBo) { + List fieldList = parsedSource.getFieldList(); + for (Field f : fieldList) { + // TODO: 当前处理方式将非method调用的语法元素统一处理 + if (!"method".equals(f.getType()) && isSensitiveKey(f.getK().toLowerCase(), getConfiguredSensitiveKeys(sensitiveWordConfigBo))) { + String v = f.getV(); + int lengthOfAsterisk = v.length(); // 设定 "*" 的长度 + // 使用正则表达式替换所有的模式串为 "*" + // TODO:当前为全文替换,后续可改为精准替换 + sourceCode = sourceCode.replaceAll(v, StringUtils.repeat("*", lengthOfAsterisk)); + } else { + Map> methodMap = parsedSource.getMethodMap(); + if (MapUtils.isNotEmpty(methodMap)) { + List callParams = methodMap.get(f.getK()); + List markIndex = new ArrayList<>(); + if (!CollectionUtils.isEmpty(callParams)) { + for (int i = 0; i < callParams.size(); i++) { + if (isSensitiveKey(callParams.get(i), sensitiveWordConfigBo)) { + markIndex.add(i); + } + } + } + if (!CollectionUtils.isEmpty(markIndex)) { + String v = f.getV(); + String[] callHolders = v.split(","); + if (callHolders != null && callHolders.length > 0) { + for (int index : markIndex) { + String callHolder = callHolders[index]; + int lengthOfAsterisk = callHolder.length(); + sourceCode = sourceCode.replaceAll(callHolder, StringUtils.repeat("*", lengthOfAsterisk)); + } + } + } + } + } + } + return sourceCode; + } + + private static List getConfiguredSensitiveKeys(List sensitiveWordConfigList) { + return sensitiveWordConfigList.stream().filter(i -> + null!=i && (SensitiveWordTypeEnum.All.code==i.getType() || SensitiveWordTypeEnum.FiledKey.code==i.getType()) + ).collect(Collectors.toList()); + } + + private static List getConfiguredSensitiveValues(List sensitiveWordConfigList) { + return sensitiveWordConfigList.stream().filter(i -> + null!=i && (SensitiveWordTypeEnum.All.code==i.getType() || SensitiveWordTypeEnum.FiledValue.code==i.getType()) + ).collect(Collectors.toList()); + } + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/ZNormalizer.java b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/ZNormalizer.java new file mode 100644 index 000000000..c0ed29541 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/main/java/run/mone/z/desensitization/service/common/ZNormalizer.java @@ -0,0 +1,25 @@ +package run.mone.z.desensitization.service.common; + +/** + * @author HawickMason@xiaomi.com + * @date 1/31/24 2:32 PM + */ +public class ZNormalizer { + + public static String normailize(String word) { + // remove all nonsense char + removeNonLetters(word); + // to lower case + return word.toLowerCase(); + } + + public static String removeNonLetters(String input) { + StringBuilder result = new StringBuilder(); + for (char c : input.toCharArray()) { + if (Character.isLetter(c)) { + result.append(c); + } + } + return result.toString(); + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/GoCodeTest.java b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/GoCodeTest.java new file mode 100644 index 000000000..bbab502df --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/GoCodeTest.java @@ -0,0 +1,87 @@ +package run.mone.z.desensitization.app.test; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import org.junit.jupiter.api.Test; +import run.mone.antlr.golang.GoCode; +import run.mone.antlr.golang.ParseResult; +import run.mone.z.desensitization.api.bo.SensitiveWordConfigBo; +import run.mone.z.desensitization.service.common.NewCodeDesensitizeUtils; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +/** + * @author goodjava@qq.com + * @date 2024/2/1 22:50 + */ +public class GoCodeTest { + + + @Test + public void testParse() { + try { + String config = "[\n" + + "\t\t{\n" + + "\t\t\t\"type\": 1,\n" + + "\t\t\t\"content\": \"(?i)(sessiontoken|session|token|jwt)\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"type\": 1,\n" + + "\t\t\t\"content\": \"(?i)(username|user|admin)\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"type\": 2,\n" + + "\t\t\t\"content\": \"^\\\\d{17}(\\\\d|X)$\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"type\": 1,\n" + + "\t\t\t\"content\": \"(?i)(jdbcurl|url|dbconnection|dbconnectionstr|dbconnectionstring)\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"type\": 1,\n" + + "\t\t\t\"content\": \"(?i)(ak|sk|accesskey|secretkey)\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"type\": 2,\n" + + "\t\t\t\"content\": \"^jdbc:(\\\\w+)\\\\:\\\\/\\\\/(\\\\w+)(:\\\\d+)?\\\\/([\\\\w\\\\.-]+)$\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"type\": 2,\n" + + "\t\t\t\"content\": \"^((2(5[0-5]|[0-4]\\\\d))|[0-1]?\\\\d{1,2})(\\\\.((2(5[0-5]|[0-4]\\\\d))|[0-1]?\\\\d{1,2})){3}$\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"type\": 1,\n" + + "\t\t\t\"content\": \"(?i)(ip|host|pwd|password|secret|token|credentials|idCard|identityCard|)\",\n" + + "\t\t\t\"isRegexMatch\": true,\n" + + "\t\t\t\"isCaseSensitive\": false\n" + + "\t\t}\n" + + "\t]"; + String source = new String(Files.readAllBytes(Paths.get("/home/mason/Documents/Workspaces/xiaomi/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/test.go"))); + ParseResult parseResult = GoCode.parse(source); + String res = NewCodeDesensitizeUtils.doDesensitize(source, parseResult, new Gson().fromJson(config, new TypeToken>() {}.getType())); + System.out.println("Original:" + source); + System.out.println(" \n --------------------------------------------------------------------------------------------------- \n"); + System.out.println("Processed:" + res); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/JavaCodeTest.java b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/JavaCodeTest.java new file mode 100644 index 000000000..a0ad61e54 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/JavaCodeTest.java @@ -0,0 +1,96 @@ +package run.mone.z.desensitization.app.test; + +import com.github.javaparser.JavaParser; +import com.github.javaparser.ast.CompilationUnit; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import org.junit.jupiter.api.Test; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author goodjava@qq.com + * @date 2024/2/2 11:28 + */ +public class JavaCodeTest { + + @Test + public void test1() { + try { + String code = "abc public class A { int a=1; int b =2;} def"; + JavaParser javaParser = new JavaParser(); + CompilationUnit compilationUnit = javaParser.parse(code).getResult().get(); + + // 遍历所有的类型声明(包括类和接口) + for (ClassOrInterfaceDeclaration type : compilationUnit.findAll(ClassOrInterfaceDeclaration.class)) { + if (type.isPublic() && !type.isInterface()) { // 检查是否为公共类 + System.out.println("Found class: " + type.getName()); + } + } + } catch (Throwable ex) { + ex.printStackTrace(); + } + } + + + @Test + public void test2() { + String code = "abc public class DubboHealthServiceImpl implements DubboHealthService { @Override public Result health() { return Result.success(\"ok\"); } //计算两数之和 } def"; + + String code2 = "public class NacosService { private Map nacosNamingMap; @PostConstruct public void init() { } @Data public static class TokenResult { private String token; } @Data @Builder public static class NacosConf { private NacosNaming nacosNaming; } }"; + + String classPattern = "public\\s+class\\s+(\\w+)\\s*\\{.*?\\}"; + + Pattern pattern = Pattern.compile(classPattern, Pattern.DOTALL); + Matcher matcher = pattern.matcher(code2); + + if (matcher.find()) { + String classCode = matcher.group(0); // 获取整个类定义 + System.out.println("Extracted Java class:"); + System.out.println(classCode); + } else { + System.out.println("No Java class found in the string."); + } + } + + @Test + public void test3() { + String code = "ddd private int myMethod(String param1, int param2) { return param1.length() + param2; } kkk"; + String methodPattern = "(?:public|protected|private)?\\s+[\\w<>\\[\\]]+\\s+(\\w+)\\s*\\(([^)]*)\\)\\s*(\\{.*?\\}|;)"; + + Pattern pattern = Pattern.compile(methodPattern, Pattern.DOTALL); + Matcher matcher = pattern.matcher(code); + + while (matcher.find()) { + String methodCode = matcher.group(0); // 获取整个方法定义 + System.out.println("Extracted Java method:"); + System.out.println(methodCode); + } + } + + @Test + public void testMultiple(){ + String code = MyTest.codeSnippet; + String classPattern = "(?:public|protected|private)?\\s+class\\s+(\\w+)\\s*\\{.*?\\}"; + + Pattern pattern = Pattern.compile(classPattern, Pattern.DOTALL); + Matcher matcher = pattern.matcher(code); + + int count = 1; + + while (matcher.find()) { + String className = matcher.group(1); // 获取类名 + String classCode = matcher.group(0); // 获取整个类定义 + int startIndex = matcher.start(); // 获取匹配块的开始索引 + int endIndex = matcher.end(); // 获取匹配块的结束索引 + + System.out.println("Extracted Java class " + count + ": " + className); + System.out.println("Start Index: " + startIndex); + System.out.println("End Index: " + endIndex); + System.out.println(classCode); + System.out.println(); + + count++; + } + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/MyTest.java b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/MyTest.java new file mode 100644 index 000000000..ca70028cf --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/MyTest.java @@ -0,0 +1,108 @@ +package run.mone.z.desensitization.app.test; + +import org.apache.commons.lang3.tuple.Pair; +import org.junit.jupiter.api.Test; +import run.mone.z.desensitization.service.common.CodeDesensitizeUtils; +import run.mone.z.desensitization.service.common.CodeExtractorUtils; +import run.mone.z.desensitization.service.common.CodeParseUtils; + +import java.util.regex.Pattern; + +/** + * @author wmin + * @date 2023/6/5 + */ +public class MyTest { + + static String codeSnippet = "你是一名杰出的java程序员,我需要你帮我做一个分析和并判断。\n\n诉求如下:\n1.我会给你当前class的信息和一段需求描述,你帮我判断下实现这个需求时对当前项目上下文的依赖程度,\n依赖程度有:method、class、module、project,分别代表不依赖当前项目、依赖当前类、依赖当前模块、依赖当前项目.\n2.返回的结果必须是json格式,key固定位scope,value为依赖程度,如:{\"scope\":\"class\"}\n3.分析实现这个需求对当前项目上下文的依赖程度时有几条经验,供你参考:\n 3.1.请熟知Java项目常见的分module规则(层次划分、DDD等)及其依赖关系,并利用当前所处的位置进行依赖范围判断\n 3.2.如果不需要借助项目上下文就能实现的,则返回:{\"scope\":\"method\"}\n 3.3.如果依赖当前类(调用类的某些方法和常量等)和你的公共知识就能实现的,则返回{\"scope\":\"class\"}\n 3.4.如果判定依赖程度超过class级别,则需要你利用当前所处的类、模块及项目信息进行综合的推理,得出合适的依赖关系。\n4.如果需求描述里告诉了你scope,则你就严格按照我给定的scope\n 4.1.指定scope的格式有两种 (scope:method) 或者 (method)\n\n我给你两个例子供参考:\n例子1:\n当前class:\npublic class A {\n}\n\n当前module:\ndemo-service\n\n项目module列表:\ndemo-api、demo-service、demo-server\n\n需求:\n计算两数和\n\n返回:\n{\"scope\":\"method\"}\n\n例子1解释:\n需求为一个简单的sum需求,不需要依赖当前项目任何上下文就能实现。判定为不依赖\n\n例子2:\n当前class:\npublic class EmbeddingController {\n @ResponseBody\n @RequestMapping(value = \"/embedding\", method = RequestMethod.GET)\n public Result\u003cVoid\u003e embedding(String text);\n}\n\n当前module:\ndemo-server\n\n项目module列表:\ndemo-api、demo-service、demo-server\n\n需求:\n将一个上传的文件内容进行向量化处理,并存储\n\n返回:\n{\"scope\":\"project\"}\n\n例子2解释:\n分析当前class上下文可以判定出需求对本项目是有一定依赖关系的;\n分析当前类名和class信息可以判断出当前类是一个Controller,Controller一般轻逻辑,通过依赖调用来实现具体逻辑;\n分析所在module是demo-server,要实现这个需求,最有可能会调用一个demo-service模块的向量化处理service,同时还有落库Dao层操作;\n综上判断判定依赖为project\n\n\n下面我将给你一个真实的需求,请返回我json判定结果:\n\n当前所在class:\nz_desensitization_start\n@DubboService(interfaceClass = DubboHealthService.class, timeout = 1000, group = \"${dubbo.group}\", version = \"1.0\")\n@Slf4j\npublic class DubboHealthServiceImpl implements DubboHealthService {\n\n @Override\n public Result\u003cString\u003e health() {\n return Result.success(\"ok\");\n }\n \n //计算两数之和\n}\nz_desensitization_end\n当前所在module:\nz-desensitization-app\n\n项目module列表:\nz-desensitization-api,test,z-desensitization-app,z-desensitization-server,z-desensitization-domain,odin.debug,z-desensitization-infrastructure\n\n需求:\n计算两数之和"; + + static String codeSnippet2 = "public class DesensitizeReq implements Serializable {\n" + + " private String text;\n" + + " private List sensitiveWordConfigBo;\n" + + " private Boolean aiDesensitizeFlag;\n" + + " private String ip = \"1.1.1.1\";\n" + + "\n" + + " public String getText() {\n" + + " return text;\n" + + " }\n" + + "\n" + + " public void setText(String text) {\n" + + " this.text = text;\n" + + " }\n" + + "\n" + + " public List getSensitiveWordConfigBo() {\n" + + " return sensitiveWordConfigBo;\n" + + " }\n" + + "\n" + + " public void setSensitiveWordConfigBo(List sensitiveWordConfigBo) {\n" + + " this.sensitiveWordConfigBo = sensitiveWordConfigBo;\n" + + " }\n" + + "\n" + + " public Boolean getAiDesensitizeFlag() {\n" + + " return aiDesensitizeFlag;\n" + + " }\n" + + "\n" + + " public void setAiDesensitizeFlag(Boolean aiDesensitizeFlag) {\n" + + " this.aiDesensitizeFlag = aiDesensitizeFlag;\n" + + " }\n" + + "\n" + + " //计算两数之和(method)\n" + + "}"; + + @Test + public void testReg(){ + Pattern pattern = Pattern.compile("(?i)(ip|host|pwd|password|secret|token|credentials|idCard|identityCard)"); + System.out.println(pattern.matcher("IP").matches()); + System.out.println(pattern.matcher("password").matches()); + System.out.println(pattern.matcher("myHo").matches()); + System.out.println(pattern.matcher("idcard").matches()); + } + + @Test + public void testClassAfterCodeExtractor() throws Exception { + String codeSnippet1 = codeSnippet; + Pair rst = CodeExtractorUtils.codeExtractorWithLabel(codeSnippet1); + System.out.println(rst); + if (rst.getKey()){ + String[] index = rst.getValue().split("-"); + String code = codeSnippet1.substring(Integer.parseInt(index[0]), Integer.parseInt(index[1])); + System.out.println(code); + System.out.println("isClass:"+CodeParseUtils.isClass(code)); + CodeDesensitizeUtils.codeDesensitizeForClass(code); + } + } + + @Test + public void testClass2() throws Exception { + CodeDesensitizeUtils.codeDesensitizeForClass(codeSnippet2); + } + + @Test + public void testMethod() throws Exception { + String codeSnippet = "public void setActionConfMap(Map actionConfMap) {\n" + + " String password = \"12345\";\n" + + " this.actionConfMap = actionConfMap;\n" + + " }"; + //System.out.println(CodeParseUtils.isClass(codeSnippet)); + System.out.println(CodeParseUtils.isMethod(codeSnippet)); + System.out.println(CodeDesensitizeUtils.codeDesensitizeForClass(codeSnippet)); + } + + @Test + public void testCodeExtractor() throws Exception { + String codeSnippet = "testtttttt public void setActionConfMap(Map actionConfMap) {\n" + + " this.actionConfMap = actionConfMap;\n" + + " String ip = \"12.0.0.1\";\n" + + " } \n这是一些文本....."; + codeSnippet = "wwwwww wewewdsc\nwewfedscfds public static void main(String[] args) {\n String password = \"1\";\n one(password);//arg:JCIdent\n one(\"qwqw\");//arg:JCLiteral\n two(\"qwqw\", password);\n System.out.println(\"ddddeeee\");//arg:JCLiteral\n }asdsfwwwwww wewewdsc "; + Pair rst = CodeExtractorUtils.codeExtractor(codeSnippet); + if (rst.getKey()){ + String[] index = rst.getValue().split("-"); + String r = CodeDesensitizeUtils.codeDesensitizeForClass(codeSnippet.substring(Integer.parseInt(index[0]), Integer.parseInt(index[1])+1)); + StringBuilder sb = new StringBuilder(codeSnippet); + sb.replace(Integer.parseInt(index[0]), Integer.parseInt(index[1])+2, r); + System.out.println("-==-=="); + System.out.println(sb); + } + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/NewTest.java b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/NewTest.java new file mode 100644 index 000000000..27f41db8d --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/NewTest.java @@ -0,0 +1,81 @@ +package run.mone.z.desensitization.app.test; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import org.apache.commons.lang3.tuple.Pair; +import org.junit.jupiter.api.Test; +import run.mone.z.desensitization.api.bo.DesensitizeReq; +import run.mone.z.desensitization.api.bo.SensitiveWordConfigBo; +import run.mone.z.desensitization.service.common.CodeExtractorUtils; +import run.mone.z.desensitization.service.common.CodeParseUtils; +import run.mone.z.desensitization.service.common.NewCodeDesensitizeUtils; + +import java.util.List; + +/** + * @author wmin + * @date 2023/11/14 + */ +public class NewTest { + + String config = "[\n" + + " {\n" + + " \"id\": 10,\n" + + " \"name\": \"ip正则\",\n" + + " \"type\": 2,\n" + + " \"content\": \"^((2(5[0-5]|[0-4]\\\\d))|[0-1]?\\\\d{1,2})(\\\\.((2(5[0-5]|[0-4]\\\\d))|[0-1]?\\\\d{1,2})){3}$\",\n" + + " \"available\": true,\n" + + " \"isRegexMatch\": true,\n" + + " \"isCaseSensitive\": false,\n" + + " \"isDelete\": false,\n" + + " \"creator\": \"wangmin17\",\n" + + " \"createTime\": \"Nov 3, 2023 3:06:55 PM\",\n" + + " \"updateTime\": \"Nov 3, 2023 6:10:39 PM\"\n" + + " },\n" + + " {\n" + + " \"id\": 9,\n" + + " \"name\": \"敏感key\",\n" + + " \"type\": 1,\n" + + " \"content\": \"(?i)(ip|host|pwd|password|secret|token|credentials|idCard|identityCard|)\",\n" + + " \"available\": true,\n" + + " \"isRegexMatch\": true,\n" + + " \"isCaseSensitive\": false,\n" + + " \"isDelete\": false,\n" + + " \"creator\": \"wangmin17\",\n" + + " \"createTime\": \"Nov 3, 2023 3:05:45 PM\",\n" + + " \"updateTime\": \"Nov 14, 2023 6:38:01 PM\"\n" + + " }\n" + + "]"; + + @Test + public void testMethod() throws Exception { + String codeSnippet = "public void setActionConfMap(Map actionConfMap) {\n" + + " String password = \"12345\";\n" + + " this.actionConfMap = actionConfMap;\n" + + " }"; + //System.out.println(CodeParseUtils.isClass(codeSnippet)); + System.out.println(CodeParseUtils.isMethod(codeSnippet)); + List bos = new Gson().fromJson(config, new TypeToken>() { + }.getType()); + DesensitizeReq req = new DesensitizeReq(); + req.setText(codeSnippet); + req.setSensitiveWordConfigBo(bos); + System.out.println(NewCodeDesensitizeUtils.codeDesensitizeForClass(req)); + } + + @Test + public void testClass() throws Exception { + Pair rst = CodeExtractorUtils.codeExtractor(MyTest.codeSnippet); + if (rst.getKey()){ + String[] index = rst.getValue().split("-"); + String code = MyTest.codeSnippet.substring(Integer.parseInt(index[0]), Integer.parseInt(index[1])+1); + List bos = new Gson().fromJson(config, new TypeToken>() { + }.getType()); + DesensitizeReq req = new DesensitizeReq(); + req.setText(code); + req.setSensitiveWordConfigBo(bos); + System.out.println(CodeParseUtils.isClass(code)); + NewCodeDesensitizeUtils.codeDesensitizeForClass(req); + } + } +} diff --git a/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/test.go b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/test.go new file mode 100644 index 000000000..5eefd7d14 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/test.go @@ -0,0 +1,33 @@ +package common + +import "fmt" + +type S struct { + Password string +} + +func (s *S) SetPwd(password string) { + s.Password = password +} + +func Z(password string) { + fmt.Println(password) +} + +func SetPassord(password string) { + +} + +func A(i int, j int) { + s := S{ + Password: "abc123", + } + fmt.Println(s) + Z("z123") + Z() + fmt.Println() + SetPassord("123", "456") + +} + +var Password string = "ggogogogo" diff --git a/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/test2.go b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/test2.go new file mode 100644 index 000000000..9d7ae83ce --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-app/src/test/java/run/mone/z/desensitization/app/test/test2.go @@ -0,0 +1,3 @@ +func a() + +func b(a int, b int) \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-debug/pom.xml b/m78-all/z-desensitization/z-desensitization-debug/pom.xml new file mode 100644 index 000000000..de4c840b1 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-debug/pom.xml @@ -0,0 +1,23 @@ + + + + odin.debug + odin + 1.0.0 + 4.0.0 + + + + + com.xiaomi.mone + sautumn-server-pom + 1.0.5-0712-SNAPSHOT + + + + + + + \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-domain/pom.xml b/m78-all/z-desensitization/z-desensitization-domain/pom.xml new file mode 100644 index 000000000..bfec8fad2 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-domain/pom.xml @@ -0,0 +1,67 @@ + + + + + z-desensitization + run.mone.z + 1.0-SNAPSHOT + + 4.0.0 + + z-desensitization-domain + + + + + + org.springframework.boot + spring-boot-starter-logging + + + + + com.xiaomi.mone + sautumn-client-pom + 1.0.5-0712-SNAPSHOT + + + com.fasterxml.jackson.core + jackson-annotations + + + run.mone + infra-result + + + + + + + + z-desensitization-api + run.mone.z + 1.0-SNAPSHOT + + + + org.springframework.boot + spring-boot-starter-test + + + org.yaml + snakeyaml + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + + \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/gateway/DemoGateway.java b/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/gateway/DemoGateway.java new file mode 100644 index 000000000..52dd383fb --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/gateway/DemoGateway.java @@ -0,0 +1,10 @@ +package run.mone.z.desensitization.domain.gateway; + +import run.mone.z.desensitization.domain.model.DemoReqEntiry; +import run.mone.z.desensitization.domain.model.DemoResEntiry; + +public interface DemoGateway { + + DemoResEntiry demoTest(DemoReqEntiry reqEntiry); + +} diff --git a/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/model/DemoReqEntiry.java b/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/model/DemoReqEntiry.java new file mode 100644 index 000000000..5223d3b4d --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/model/DemoReqEntiry.java @@ -0,0 +1,10 @@ +package run.mone.z.desensitization.domain.model; + +import lombok.Data; + +@Data +public class DemoReqEntiry { + + private String test; + +} diff --git a/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/model/DemoResEntiry.java b/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/model/DemoResEntiry.java new file mode 100644 index 000000000..aed04bfcd --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-domain/src/main/java/run/mone/z/desensitization/domain/model/DemoResEntiry.java @@ -0,0 +1,16 @@ +package run.mone.z.desensitization.domain.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DemoResEntiry { + + private String test; + +} diff --git a/m78-all/z-desensitization/z-desensitization-infrastructure/pom.xml b/m78-all/z-desensitization/z-desensitization-infrastructure/pom.xml new file mode 100644 index 000000000..ae31cd1ed --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-infrastructure/pom.xml @@ -0,0 +1,26 @@ + + + + z-desensitization + run.mone.z + 1.0-SNAPSHOT + + 4.0.0 + + z-desensitization-infrastructure + + + + + + z-desensitization-domain + run.mone.z + 1.0-SNAPSHOT + + + + + + \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-infrastructure/src/main/java/run/mone/z/desensitization/gateway/DemoGatewayImpl.java b/m78-all/z-desensitization/z-desensitization-infrastructure/src/main/java/run/mone/z/desensitization/gateway/DemoGatewayImpl.java new file mode 100644 index 000000000..91615e39e --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-infrastructure/src/main/java/run/mone/z/desensitization/gateway/DemoGatewayImpl.java @@ -0,0 +1,22 @@ +package run.mone.z.desensitization.gateway; + +import com.xiaomi.sautumn.serverless.api.tool.Tool; +import org.springframework.stereotype.Service; +import run.mone.z.desensitization.domain.gateway.DemoGateway; +import run.mone.z.desensitization.domain.model.DemoReqEntiry; +import run.mone.z.desensitization.domain.model.DemoResEntiry; + +import javax.annotation.Resource; + +@Service +public class DemoGatewayImpl implements DemoGateway { + + @Resource + private Tool tool; + + @Override + public DemoResEntiry demoTest(DemoReqEntiry reqEntiry) { + return new DemoResEntiry(tool.getMd5(reqEntiry.getTest())); + } + +} diff --git a/m78-all/z-desensitization/z-desensitization-server/pom.xml b/m78-all/z-desensitization/z-desensitization-server/pom.xml new file mode 100644 index 000000000..20c0651e6 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/pom.xml @@ -0,0 +1,193 @@ + + + + z-desensitization + run.mone.z + 1.0-SNAPSHOT + + 4.0.0 + + z-desensitization-server + + + + + + + run.mone.z + z-desensitization-infrastructure + 1.0-SNAPSHOT + + + run.mone.z + z-desensitization-app + 1.0-SNAPSHOT + + + + + + + + + + src/main/resources + true + + + src/main/resources/META-INF + true + + app.properties + + META-INF/ + + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.4.1 + + + package + + shade + + + + + + + + + + run.mone.z:z-desensitization-api + run.mone.z:z-desensitization-domain + run.mone.z:z-desensitization-app + run.mone.z:z-desensitization-infrastructure + + + ${project.build.directory}/${project.artifactId}-${project.version}-mesh.jar + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.2.6.RELEASE + + run.mone.z.desensitization.bootstrap.ZDesensitizationBootstrap + + + + + repackage + + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.7 + + src/main/resources/generatorConfig.xml + true + true + + + + + mysql + mysql-connector-java + 8.0.20 + + + com.itfsw + mybatis-generator-plugin + 1.3.8 + + + + + + + + + + + dev + + dev + + + true + + + + src/main/resources/config/dev.properties + + + + + + staging + + staging + + + + src/main/resources/config/staging.properties + + + + + + c3 + + c3 + + + + src/main/resources/config/c3.properties + + + + + + c4 + + c4 + + + + src/main/resources/config/c4.properties + + + + + + preview + + preview + + + + src/main/resources/config/preview.properties + + + + + + + + + \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/java/run/mone/z/desensitization/bootstrap/ZDesensitizationBootstrap.java b/m78-all/z-desensitization/z-desensitization-server/src/main/java/run/mone/z/desensitization/bootstrap/ZDesensitizationBootstrap.java new file mode 100644 index 000000000..8a3a70c6b --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/java/run/mone/z/desensitization/bootstrap/ZDesensitizationBootstrap.java @@ -0,0 +1,35 @@ +package run.mone.z.desensitization.bootstrap; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.SpringBootVersion; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.core.SpringVersion; +import run.mone.sautumnn.springboot.starter.anno.DubboComponentScan; +import run.mone.sautumnn.springboot.starter.miapi.dubbo.annotation.EnableDubboApiDocs; +import run.mone.sautumnn.springboot.starter.miapi.http.annotation.EnableHttpApiDocs; + + +/** + * @author wm + */ +@EnableAutoConfiguration +@ComponentScan(basePackages = {"run.mone.z.desensitization", "com.xiaomi.youpin"}) +@DubboComponentScan(basePackages = {"run.mone.z.desensitization.service", "run.mone.z.desensitization"}) +@EnableHttpApiDocs +@EnableDubboApiDocs +@Slf4j +public class ZDesensitizationBootstrap { + + + public static void main(String... args) { + try { + log.info("springboot version:{} spring version:{}", SpringBootVersion.getVersion(), SpringVersion.getVersion()); + SpringApplication.run(ZDesensitizationBootstrap.class, args); + } catch (Throwable throwable) { + log.error(throwable.getMessage(), throwable); + System.exit(-1); + } + } +} \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/application.properties b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/application.properties new file mode 100644 index 000000000..ade9d1cfc --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/application.properties @@ -0,0 +1,17 @@ +#server +app.name=z-desensitization-local +server.type=${server.type} +server.port=${server.port} +server.debug=true +server.connection-timeout=1000 + +spring.main.banner-mode=off +server.tomcat.max-threads=200 +# MSF sidecar enable +side.car.open=true +#remote.side.car.server.addr=localhost +remote.side.car.server.addr= +dubbo.group=${dubbo.group} + +log.path=${log.path} +http_connectTimeout=5000 \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/c3.properties b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/c3.properties new file mode 100644 index 000000000..cec4ce4b1 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/c3.properties @@ -0,0 +1,10 @@ +#server +app.name=z-desensitization +server.type=online +server.port=8085 +server.debug=true +server.connection-timeout=1000 + +dubbo.group=online + +log.path=/home/work/log \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/c4.properties b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/c4.properties new file mode 100644 index 000000000..cec4ce4b1 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/c4.properties @@ -0,0 +1,10 @@ +#server +app.name=z-desensitization +server.type=online +server.port=8085 +server.debug=true +server.connection-timeout=1000 + +dubbo.group=online + +log.path=/home/work/log \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/dev.properties b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/dev.properties new file mode 100644 index 000000000..18188083b --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/dev.properties @@ -0,0 +1,10 @@ +#server +app.name=z-desensitization +server.type=dev +server.port=8085 +server.debug=true +server.connection-timeout=1000 + +dubbo.group=dev + +log.path=/tmp \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/preview.properties b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/preview.properties new file mode 100644 index 000000000..e12673181 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/preview.properties @@ -0,0 +1,10 @@ +#server +app.name=z-desensitization +server.type=preview +server.port=8085 +server.debug=true +server.connection-timeout=1000 + +dubbo.group=preview + +log.path=/home/work/log \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/staging.properties b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/staging.properties new file mode 100644 index 000000000..37bfc6d19 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/config/staging.properties @@ -0,0 +1,10 @@ +#server +app.name=z-desensitization +server.type=staging +server.port=8085 +server.debug=true +server.connection-timeout=1000 + +dubbo.group=staging + +log.path=/home/work/log \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/dubbo.properties b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/dubbo.properties new file mode 100644 index 000000000..4027dde81 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/dubbo.properties @@ -0,0 +1 @@ +dubbo.trace.log.path=/home/work/log/dubbo/z-desensitization_ diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/generatorConfig.xml b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/generatorConfig.xml new file mode 100644 index 000000000..35ce2e05c --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/generatorConfig.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/logback.xml b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/logback.xml new file mode 100644 index 000000000..c057717a7 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/logback.xml @@ -0,0 +1,59 @@ + + + + + + + + + ${log.path}/z-desensitization/server.log + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + ${log.path}/z-desensitization/server.log.%d{yyyy-MM-dd-HH} + ${MAX_HISTORY} + + + + + 0 + 60000 + + + + + + ${log.path}/z-desensitization/error.log + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + ${log.path}/z-desensitization/error.log.%d{yyyy-MM-dd-HH} + ${MAX_HISTORY} + + + ERROR + ACCEPT + DENY + + + + + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + + + + + + + + + + + + + diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/mapper/ZDesensitizationRecordMapper.xml b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/mapper/ZDesensitizationRecordMapper.xml new file mode 100644 index 000000000..0aae869ad --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/mapper/ZDesensitizationRecordMapper.xml @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, gmt_create, creator, status, duration_time + + + text_before, text_after + + + + + + delete from z_desensitization_record + where id = #{id,jdbcType=BIGINT} + + + delete from z_desensitization_record + + + + + + + SELECT LAST_INSERT_ID() + + insert into z_desensitization_record (gmt_create, creator, status, + duration_time, text_before, text_after + ) + values (#{gmtCreate,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, + #{durationTime,jdbcType=BIGINT}, #{textBefore,jdbcType=LONGVARCHAR}, #{textAfter,jdbcType=LONGVARCHAR} + ) + + + + SELECT LAST_INSERT_ID() + + insert into z_desensitization_record + + + gmt_create, + + + creator, + + + status, + + + duration_time, + + + text_before, + + + text_after, + + + + + #{gmtCreate,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=VARCHAR}, + + + #{status,jdbcType=INTEGER}, + + + #{durationTime,jdbcType=BIGINT}, + + + #{textBefore,jdbcType=LONGVARCHAR}, + + + #{textAfter,jdbcType=LONGVARCHAR}, + + + + + + update z_desensitization_record + + + id = #{record.id,jdbcType=BIGINT}, + + + gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=INTEGER}, + + + duration_time = #{record.durationTime,jdbcType=BIGINT}, + + + text_before = #{record.textBefore,jdbcType=LONGVARCHAR}, + + + text_after = #{record.textAfter,jdbcType=LONGVARCHAR}, + + + + + + + + update z_desensitization_record + set id = #{record.id,jdbcType=BIGINT}, + gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, + creator = #{record.creator,jdbcType=VARCHAR}, + status = #{record.status,jdbcType=INTEGER}, + duration_time = #{record.durationTime,jdbcType=BIGINT}, + text_before = #{record.textBefore,jdbcType=LONGVARCHAR}, + text_after = #{record.textAfter,jdbcType=LONGVARCHAR} + + + + + + update z_desensitization_record + set id = #{record.id,jdbcType=BIGINT}, + gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, + creator = #{record.creator,jdbcType=VARCHAR}, + status = #{record.status,jdbcType=INTEGER}, + duration_time = #{record.durationTime,jdbcType=BIGINT} + + + + + + update z_desensitization_record + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=INTEGER}, + + + duration_time = #{durationTime,jdbcType=BIGINT}, + + + text_before = #{textBefore,jdbcType=LONGVARCHAR}, + + + text_after = #{textAfter,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update z_desensitization_record + set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=VARCHAR}, + status = #{status,jdbcType=INTEGER}, + duration_time = #{durationTime,jdbcType=BIGINT}, + text_before = #{textBefore,jdbcType=LONGVARCHAR}, + text_after = #{textAfter,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update z_desensitization_record + set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=VARCHAR}, + status = #{status,jdbcType=INTEGER}, + duration_time = #{durationTime,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + + insert into z_desensitization_record + (gmt_create, creator, status, duration_time, text_before, text_after) + values + + (#{item.gmtCreate,jdbcType=TIMESTAMP}, #{item.creator,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER}, + #{item.durationTime,jdbcType=BIGINT}, #{item.textBefore,jdbcType=LONGVARCHAR}, + #{item.textAfter,jdbcType=LONGVARCHAR}) + + + + insert into z_desensitization_record ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.gmtCreate,jdbcType=TIMESTAMP} + + + #{item.creator,jdbcType=VARCHAR} + + + #{item.status,jdbcType=INTEGER} + + + #{item.durationTime,jdbcType=BIGINT} + + + #{item.textBefore,jdbcType=LONGVARCHAR} + + + #{item.textAfter,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/m78-all/z-desensitization/z-desensitization-server/src/main/resources/sql/init.sql b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/sql/init.sql new file mode 100644 index 000000000..a00b7e666 --- /dev/null +++ b/m78-all/z-desensitization/z-desensitization-server/src/main/resources/sql/init.sql @@ -0,0 +1,9 @@ +CREATE TABLE `z_desensitization_record` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `creator` varchar(64) NOT NULL DEFAULT '' COMMENT '创建者', + `text_before` text NOT NULL COMMENT '原文本', + `text_after` text COMMENT '脱敏后文本', + `status` int(1) not null comment '状态, 0: 失败, 1:成功', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='文本脱敏记录'; \ No newline at end of file