From e34de645021005f39f333944bc5e8afef5bb0e50 Mon Sep 17 00:00:00 2001 From: walker Date: Fri, 18 Mar 2022 18:31:01 +0800 Subject: [PATCH 1/4] add revision --- .gitignore | 1 + core/client.pom.xml | 2 +- core/pom.xml | 3 +- core/server.pom.xml | 2 +- distributedContext/pom.xml | 3 +- examples/pom.xml | 3 +- examples/quickstart-client/pom.xml | 4 +-- examples/quickstart-server/pom.xml | 2 +- examples/stress-server/pom.xml | 2 +- examples/tars-spring-boot-client/pom.xml | 4 +-- examples/tars-spring-boot-http-server/pom.xml | 4 +-- examples/tars-spring-boot-server/pom.xml | 4 +-- examples/tars-spring-cloud-client/pom.xml | 10 +++---- examples/tars-spring-cloud-server/pom.xml | 10 +++---- examples/tars-spring-server/pom.xml | 2 +- net/pom.xml | 3 +- pom.xml | 30 ++++++++++++++++++- protobuf/pom.xml | 2 +- spring/pom.xml | 2 +- spring/tars-spring-boot-starter/pom.xml | 2 +- spring/tars-spring-cloud-starter/pom.xml | 2 +- spring/tars-spring/pom.xml | 2 +- tars-plugins/pom.xml | 8 ++--- tools/pom.xml | 2 +- tools/tars-maven-plugin/pom.xml | 2 +- 25 files changed, 72 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index c5ec79c3..051ea4b1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ target/ *.dat examples/**/testapp/ **/.DS_Store +.flattened-pom.xml diff --git a/core/client.pom.xml b/core/client.pom.xml index 4ae82bfb..03c7baa2 100644 --- a/core/client.pom.xml +++ b/core/client.pom.xml @@ -6,7 +6,7 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} tars-client ${project.artifactId} diff --git a/core/pom.xml b/core/pom.xml index 256f39f8..f6990581 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -6,7 +6,8 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} + ../pom.xml tars-core ${project.artifactId} diff --git a/core/server.pom.xml b/core/server.pom.xml index 071e420f..d4239505 100644 --- a/core/server.pom.xml +++ b/core/server.pom.xml @@ -6,7 +6,7 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} tars-server ${project.artifactId} diff --git a/distributedContext/pom.xml b/distributedContext/pom.xml index fec0b8cc..2a827c2d 100644 --- a/distributedContext/pom.xml +++ b/distributedContext/pom.xml @@ -6,7 +6,8 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} + ../pom.xml tars-context diff --git a/examples/pom.xml b/examples/pom.xml index 936d4905..29147f37 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,8 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} + ../pom.xml tars-examples ${project.artifactId} diff --git a/examples/quickstart-client/pom.xml b/examples/quickstart-client/pom.xml index 1b06cf14..4d25ac6b 100644 --- a/examples/quickstart-client/pom.xml +++ b/examples/quickstart-client/pom.xml @@ -13,11 +13,11 @@ com.tencent.tars tars-core - 1.7.2 + ${revision} com.tencent.tars tars-net - 1.7.2 + ${revision} diff --git a/examples/quickstart-server/pom.xml b/examples/quickstart-server/pom.xml index 942694ad..b0cc617f 100644 --- a/examples/quickstart-server/pom.xml +++ b/examples/quickstart-server/pom.xml @@ -4,7 +4,7 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} tars-quickstart-server ${project.artifactId} diff --git a/examples/stress-server/pom.xml b/examples/stress-server/pom.xml index 4a1af6be..b3dbf506 100644 --- a/examples/stress-server/pom.xml +++ b/examples/stress-server/pom.xml @@ -4,7 +4,7 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} tars-stress-server ${project.artifactId} diff --git a/examples/tars-spring-boot-client/pom.xml b/examples/tars-spring-boot-client/pom.xml index f1aa8216..c745dfea 100644 --- a/examples/tars-spring-boot-client/pom.xml +++ b/examples/tars-spring-boot-client/pom.xml @@ -35,7 +35,7 @@ com.tencent.tars tars-spring-boot-starter - 1.7.2 + ${revision} @@ -84,7 +84,7 @@ com.tencent.tars tars-maven-plugin - 1.7.2 + ${revision} diff --git a/examples/tars-spring-boot-http-server/pom.xml b/examples/tars-spring-boot-http-server/pom.xml index cc516120..f2380c66 100644 --- a/examples/tars-spring-boot-http-server/pom.xml +++ b/examples/tars-spring-boot-http-server/pom.xml @@ -32,7 +32,7 @@ com.tencent.tars tars-spring-boot-starter - 1.7.2 + ${revision} @@ -81,7 +81,7 @@ com.tencent.tars tars-maven-plugin - 1.7.2 + ${revision} diff --git a/examples/tars-spring-boot-server/pom.xml b/examples/tars-spring-boot-server/pom.xml index 85b1ef14..50626180 100644 --- a/examples/tars-spring-boot-server/pom.xml +++ b/examples/tars-spring-boot-server/pom.xml @@ -5,7 +5,7 @@ tars-examples com.tencent.tars - 1.7.2 + ${revision} 4.0.0 @@ -31,7 +31,7 @@ com.tencent.tars tars-spring-boot-starter - 1.7.2 + ${revision} diff --git a/examples/tars-spring-cloud-client/pom.xml b/examples/tars-spring-cloud-client/pom.xml index 75416114..ec616aed 100644 --- a/examples/tars-spring-cloud-client/pom.xml +++ b/examples/tars-spring-cloud-client/pom.xml @@ -4,7 +4,7 @@ com.tencent.tars tars-spring-cloud-client - 1.7.2 + ${revision} war tars-spring-cloud-client @@ -23,22 +23,22 @@ com.tencent.tars tars-core - 1.7.2 + ${revision} com.tencent.tars tars-spring - 1.7.2 + ${revision} com.tencent.tars tars-protobuf - 1.7.2 + ${revision} com.tencent.tars tars-spring-cloud-starter - 1.7.2 + ${revision} diff --git a/examples/tars-spring-cloud-server/pom.xml b/examples/tars-spring-cloud-server/pom.xml index 32bd4c99..8a786396 100644 --- a/examples/tars-spring-cloud-server/pom.xml +++ b/examples/tars-spring-cloud-server/pom.xml @@ -4,7 +4,7 @@ com.tencent.tars tars-spring-cloud-server war - 1.7.2 + ${revision} tars-spring-cloud-server http://maven.apache.org @@ -43,22 +43,22 @@ com.tencent.tars tars-core - 1.7.2 + ${revision} com.tencent.tars tars-spring - 1.7.2 + ${revision} com.tencent.tars tars-protobuf - 1.7.2 + ${revision} com.tencent.tars tars-spring-cloud-starter - 1.7.2 + ${revision} diff --git a/examples/tars-spring-server/pom.xml b/examples/tars-spring-server/pom.xml index 3c79c469..588caa6c 100644 --- a/examples/tars-spring-server/pom.xml +++ b/examples/tars-spring-server/pom.xml @@ -5,7 +5,7 @@ tars-examples com.tencent.tars - 1.7.2 + ${revision} 4.0.0 war diff --git a/net/pom.xml b/net/pom.xml index 97f1d70c..ccf6609f 100644 --- a/net/pom.xml +++ b/net/pom.xml @@ -6,7 +6,8 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} + ../pom.xml tars-net jar diff --git a/pom.xml b/pom.xml index dcc60820..6aec3852 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} pom Tars Super POM For Projects @@ -50,6 +50,7 @@ + 1.7.2 1.8 1.8 UTF-8 @@ -63,6 +64,7 @@ 2.8.2 2.5.3 4.8.2 + 1.2.5 @@ -77,6 +79,32 @@ maven-javadoc-plugin ${maven_javadoc_plugin_version} + + + org.codehaus.mojo + flatten-maven-plugin + ${maven_flatten_version} + + true + resolveCiFriendliesOnly + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + diff --git a/protobuf/pom.xml b/protobuf/pom.xml index 7ba550ce..cc26f97a 100644 --- a/protobuf/pom.xml +++ b/protobuf/pom.xml @@ -5,7 +5,7 @@ tars-parent com.tencent.tars - 1.7.2 + ${revision} 4.0.0 diff --git a/spring/pom.xml b/spring/pom.xml index 29a9982a..38a78ff8 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -4,7 +4,7 @@ tars-parent com.tencent.tars - 1.7.2 + ${revision} 4.0.0 diff --git a/spring/tars-spring-boot-starter/pom.xml b/spring/tars-spring-boot-starter/pom.xml index a51b3aa5..1d1f3d2f 100644 --- a/spring/tars-spring-boot-starter/pom.xml +++ b/spring/tars-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ tars-spring-parent com.tencent.tars - 1.7.2 + ${revision} 4.0.0 diff --git a/spring/tars-spring-cloud-starter/pom.xml b/spring/tars-spring-cloud-starter/pom.xml index d3e52959..873cb5dc 100644 --- a/spring/tars-spring-cloud-starter/pom.xml +++ b/spring/tars-spring-cloud-starter/pom.xml @@ -5,7 +5,7 @@ tars-spring-parent com.tencent.tars - 1.7.2 + ${revision} tars-spring-cloud-starter diff --git a/spring/tars-spring/pom.xml b/spring/tars-spring/pom.xml index 96f02da0..4be5455e 100644 --- a/spring/tars-spring/pom.xml +++ b/spring/tars-spring/pom.xml @@ -4,7 +4,7 @@ tars-spring-parent com.tencent.tars - 1.7.2 + ${revision} 4.0.0 diff --git a/tars-plugins/pom.xml b/tars-plugins/pom.xml index d8bb046a..db710a97 100644 --- a/tars-plugins/pom.xml +++ b/tars-plugins/pom.xml @@ -5,7 +5,7 @@ tars-parent com.tencent.tars - 1.7.2 + ${revision} 4.0.0 tars-plugins @@ -16,7 +16,7 @@ ${targetJdk} ${targetJdk} UTF-8 - 1.7.25 + ${revision}5 @@ -28,12 +28,12 @@ com.tencent.tars tars-client - 1.7.2 + ${revision} com.tencent.tars tars-server - 1.7.2 + ${revision} org.hamcrest diff --git a/tools/pom.xml b/tools/pom.xml index 0fb4e09a..ad3dd5cf 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -5,7 +5,7 @@ com.tencent.tars tars-parent - 1.7.2 + ${revision} tars-tools ${project.artifactId} diff --git a/tools/tars-maven-plugin/pom.xml b/tools/tars-maven-plugin/pom.xml index e2b64d23..5eeb24f7 100644 --- a/tools/tars-maven-plugin/pom.xml +++ b/tools/tars-maven-plugin/pom.xml @@ -6,7 +6,7 @@ com.tencent.tars tars-tools - 1.7.2 + ${revision} tars-maven-plugin ${project.artifactId} From 1fc0e730c7dffc4f7c57f1d04a0e43edde4b15a9 Mon Sep 17 00:00:00 2001 From: walker Date: Sat, 7 May 2022 16:56:40 +0800 Subject: [PATCH 2/4] add tars lexer grammer file --- .../src/main/resources/antlr/TafParser.g | 109 + .../src/main/resources/antlr/TarsLexer.g | 207 ++ .../src/main/resources/antlr/TarsLexer.java | 2631 +++++++++++++++++ .../src/main/resources/antlr/useage.md | 2 + 4 files changed, 2949 insertions(+) create mode 100644 tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g create mode 100644 tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g create mode 100644 tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java create mode 100644 tools/tars-maven-plugin/src/main/resources/antlr/useage.md diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g b/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g new file mode 100644 index 00000000..43f6f3a8 --- /dev/null +++ b/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g @@ -0,0 +1,109 @@ +grammar Taf; + +tokens +{ +COLON;COMMA;COMMENT;DOT; +EQ;ESC_SEQ;GT;HEX_DIGIT;LBRACE;LBRACKET;LPAREN;LT; +OCTAL_ESC; QUOTE; RBRACE; RBRACKET; RPAREN; SEMI; TAF_BOOL; +TAF_BYTE; TAF_CONST; TAF_DOUBLE; TAF_ENUM; TAF_FALSE;TAF_FLOAT; +TAF_FLOATING_POINT_LITERAL; TAF_IDENTIFIER;TAF_INCLUDE;TAF_INT; +TAF_INTEGER_LITERAL;TAF_INTERFACE;TAF_KEY;TAF_LONG;TAF_MAP; +TAF_NAMESPACE;TAF_OPTIONAL;TAF_OUT;TAF_REQUIRE;TAF_ROUTE_KEY; +TAF_SHORT;TAF_STRING;TAF_STRING_LITERAL;TAF_STRUCT;TAF_TRUE; +TAF_UNSIGNED;TAF_VECTOR;TAF_VOID;UNICODE_ESC;WS;TAF_OPERATION; +TAF_PARAM;TAF_REF;TAF_ROOT;TAF_STRUCT_MEMBER; +} + + + + + + +start : + ( include_def )* ( namespace_def )+ ; + + + +include_def : + Taf_INCLUDE Taf_STRING_LITERAL ; + + + +namespace_def : + Taf_NAMESPACE Taf_IDENTIFIER LBRACE ( definition SEMI )+ RBRACE; + + + +definition : + ( const_def | + enum_def | + struct_def | + key_def | + interface_def +); + +const_def : + Taf_CONST type_primitive Taf_IDENTIFIER EQ v= const_initializer ; + + + +enum_def : + ( Taf_ENUM Taf_IDENTIFIER LBRACE Taf_IDENTIFIER ( COMMA Taf_IDENTIFIER )* ( COMMA )? RBRACE ); + + + + + +struct_def : + Taf_STRUCT Taf_IDENTIFIER LBRACE ( struct_member SEMI )+ RBRACE ; + + + +struct_member : + Taf_INTEGER_LITERAL (r= Taf_REQUIRE |r= Taf_OPTIONAL ) type Taf_IDENTIFIER ( EQ v= const_initializer )? ; + + + +key_def : + Taf_KEY LBRACKET n= Taf_IDENTIFIER ( COMMA k+= Taf_IDENTIFIER )+ RBRACKET ; + + + +interface_def : + Taf_INTERFACE Taf_IDENTIFIER LBRACE ( operation SEMI )+ RBRACE ; + + + +operation : + type Taf_IDENTIFIER LPAREN ( param ( COMMA param )* )? RPAREN ; + + + +param : + ( Taf_ROUTE_KEY )? ( Taf_OUT )? type Taf_IDENTIFIER ; + + + + + + + + + + + +type : + ( type_primitive | + type_vector | + type_map | + type_custom + ); + +type_primitive : + ( TAF_VOID); + +type_vector : Taf_VECTOR LT type GT ; +type_map : Taf_MAP LT type COMMA type GT ; +type_custom : ( Taf_IDENTIFIER ) ; +const_initializer : ( Taf_INTEGER_LITERAL | Taf_FLOATING_POINT_LITERAL | Taf_STRING_LITERAL | Taf_FALSE | Taf_TRUE ); + diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g new file mode 100644 index 00000000..a8a4d3c3 --- /dev/null +++ b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g @@ -0,0 +1,207 @@ +lexer grammar TarsLexer; + +@header { +package com.qq.tars.maven.parse; +} + +TARS_VOID +:( 'void' ); + +TARS_STRUCT +:( 'struct' ); + +TARS_UNSIGNED +:( 'unsigned' ); + +TARS_BOOL +:( 'bool' ); + +TARS_BYTE +:( 'byte' ); + +TARS_SHORT +:( 'short' ); + +TARS_INT +:( 'int' ); + +TARS_DOUBLE +:( 'double' ); + +TARS_FLOAT +:( 'float' ); + +TARS_LONG +:( 'long' ); + +TARS_STRING +:( 'string' ); + +TARS_VECTOR +:( 'vector' ); + +TARS_MAP +:( 'map' ); + +TARS_KEY +:( 'key' ); + +TARS_ROUTE_KEY +:( 'routekey' ); + +TARS_INCLUDE +:( '#include' ); + +TARS_NAMESPACE +:( 'module' ); + +TARS_INTERFACE +:( 'interface' ); + +TARS_OUT +:( 'out' ); + +TARS_REQUIRE +:( 'require' ); + +TARS_OPTIONAL +:( 'optional' ); + +TARS_FALSE +:( 'false' ); + +TARS_TRUE +:( 'true' ); + +TARS_ENUM +:( 'enum' ); + +TARS_CONST +:( 'const' ); + + + +TARS_IDENTIFIER +: ( ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ); + + +TARS_INTEGER_LITERAL +: ( ('0X'|'0x')('0'..'9'|'a'..'f'|'A'..'F')+| + ('O'|'o')('0'..'7')+| + ('+'|'-')?('0'..'9')+ ); + + +TARS_FLOATING_POINT_LITERAL +: ( ('+'|'-')? ('0'..'9')+ '.' ('0'..'9')+); + + +TARS_STRING_LITERAL +: ( '"' ( ESC_SEQ | ~ ( '\\' | '"' ) )* '"' ); + + +LPAREN +: ( '(' ); + + +RPAREN +: ( ')' ); + + +LBRACE +: ( '{' ); + + +RBRACE +: ( '}' ); + + +LBRACKET +: ( '[' ); + + +RBRACKET +: ( ']' ); + + +SEMI +:( ';' ); + + +COMMA +:( ',' ); + + +QUOTE +:( '"' ); + + +DOT +:( '.' ); + + +COLON +:( ':' ); + + +EQ +:( '=' ); + + +GT +:( '>' ); + + +LT +:( '<' ); + + + + + +COMMENT +: ( '//' ~('\n'|'\r')* '\r'? '\n' | + '/*' + + + + + + ( options {greedy=false; }:. )* '*/' {$channel=HIDDEN;}); + + + + + + + + + +WS +: ( ' ' | '\t' | '\r' | '\n' ) {skip();} ; + + + + + + +fragment HEX_DIGIT +: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ; + + +fragment ESC_SEQ + : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') + | UNICODE_ESC + | OCTAL_ESC + ; + + +fragment OCTAL_ESC + : '\\' ('0'..'3') ('0'..'7') ('0'..'7') + | '\\' ('0'..'7') ('0'..'7') + | '\\' ('0'..'7') + ; + + +fragment UNICODE_ESC + : '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT + ; \ No newline at end of file diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java new file mode 100644 index 00000000..3e9f6ca1 --- /dev/null +++ b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java @@ -0,0 +1,2631 @@ +// $ANTLR 3.5 TarsLexer.g 2022-05-07 16:50:45 + +package com.qq.tars.maven.parse; + + +import org.antlr.runtime.*; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; + +@SuppressWarnings("all") +public class TarsLexer extends Lexer { + public static final int EOF=-1; + public static final int COLON=4; + public static final int COMMA=5; + public static final int COMMENT=6; + public static final int DOT=7; + public static final int EQ=8; + public static final int ESC_SEQ=9; + public static final int GT=10; + public static final int HEX_DIGIT=11; + public static final int LBRACE=12; + public static final int LBRACKET=13; + public static final int LPAREN=14; + public static final int LT=15; + public static final int OCTAL_ESC=16; + public static final int QUOTE=17; + public static final int RBRACE=18; + public static final int RBRACKET=19; + public static final int RPAREN=20; + public static final int SEMI=21; + public static final int TARS_BOOL=22; + public static final int TARS_BYTE=23; + public static final int TARS_CONST=24; + public static final int TARS_DOUBLE=25; + public static final int TARS_ENUM=26; + public static final int TARS_FALSE=27; + public static final int TARS_FLOAT=28; + public static final int TARS_FLOATING_POINT_LITERAL=29; + public static final int TARS_IDENTIFIER=30; + public static final int TARS_INCLUDE=31; + public static final int TARS_INT=32; + public static final int TARS_INTEGER_LITERAL=33; + public static final int TARS_INTERFACE=34; + public static final int TARS_KEY=35; + public static final int TARS_LONG=36; + public static final int TARS_MAP=37; + public static final int TARS_NAMESPACE=38; + public static final int TARS_OPTIONAL=39; + public static final int TARS_OUT=40; + public static final int TARS_REQUIRE=41; + public static final int TARS_ROUTE_KEY=42; + public static final int TARS_SHORT=43; + public static final int TARS_STRING=44; + public static final int TARS_STRING_LITERAL=45; + public static final int TARS_STRUCT=46; + public static final int TARS_TRUE=47; + public static final int TARS_UNSIGNED=48; + public static final int TARS_VECTOR=49; + public static final int TARS_VOID=50; + public static final int UNICODE_ESC=51; + public static final int WS=52; + + // delegates + // delegators + public Lexer[] getDelegates() { + return new Lexer[] {}; + } + + public TarsLexer() {} + public TarsLexer(CharStream input) { + this(input, new RecognizerSharedState()); + } + public TarsLexer(CharStream input, RecognizerSharedState state) { + super(input,state); + } + @Override public String getGrammarFileName() { return "TarsLexer.g"; } + + // $ANTLR start "TARS_VOID" + public final void mTARS_VOID() throws RecognitionException { + try { + int _type = TARS_VOID; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:8:2: ( ( 'void' ) ) + // TarsLexer.g:8:2: ( 'void' ) + { + // TarsLexer.g:8:2: ( 'void' ) + // TarsLexer.g:8:4: 'void' + { + match("void"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_VOID" + + // $ANTLR start "TARS_STRUCT" + public final void mTARS_STRUCT() throws RecognitionException { + try { + int _type = TARS_STRUCT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:11:2: ( ( 'struct' ) ) + // TarsLexer.g:11:2: ( 'struct' ) + { + // TarsLexer.g:11:2: ( 'struct' ) + // TarsLexer.g:11:4: 'struct' + { + match("struct"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_STRUCT" + + // $ANTLR start "TARS_UNSIGNED" + public final void mTARS_UNSIGNED() throws RecognitionException { + try { + int _type = TARS_UNSIGNED; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:14:2: ( ( 'unsigned' ) ) + // TarsLexer.g:14:2: ( 'unsigned' ) + { + // TarsLexer.g:14:2: ( 'unsigned' ) + // TarsLexer.g:14:4: 'unsigned' + { + match("unsigned"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_UNSIGNED" + + // $ANTLR start "TARS_BOOL" + public final void mTARS_BOOL() throws RecognitionException { + try { + int _type = TARS_BOOL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:17:2: ( ( 'bool' ) ) + // TarsLexer.g:17:2: ( 'bool' ) + { + // TarsLexer.g:17:2: ( 'bool' ) + // TarsLexer.g:17:4: 'bool' + { + match("bool"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_BOOL" + + // $ANTLR start "TARS_BYTE" + public final void mTARS_BYTE() throws RecognitionException { + try { + int _type = TARS_BYTE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:20:2: ( ( 'byte' ) ) + // TarsLexer.g:20:2: ( 'byte' ) + { + // TarsLexer.g:20:2: ( 'byte' ) + // TarsLexer.g:20:4: 'byte' + { + match("byte"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_BYTE" + + // $ANTLR start "TARS_SHORT" + public final void mTARS_SHORT() throws RecognitionException { + try { + int _type = TARS_SHORT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:23:2: ( ( 'short' ) ) + // TarsLexer.g:23:2: ( 'short' ) + { + // TarsLexer.g:23:2: ( 'short' ) + // TarsLexer.g:23:4: 'short' + { + match("short"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_SHORT" + + // $ANTLR start "TARS_INT" + public final void mTARS_INT() throws RecognitionException { + try { + int _type = TARS_INT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:26:2: ( ( 'int' ) ) + // TarsLexer.g:26:2: ( 'int' ) + { + // TarsLexer.g:26:2: ( 'int' ) + // TarsLexer.g:26:4: 'int' + { + match("int"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_INT" + + // $ANTLR start "TARS_DOUBLE" + public final void mTARS_DOUBLE() throws RecognitionException { + try { + int _type = TARS_DOUBLE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:29:2: ( ( 'double' ) ) + // TarsLexer.g:29:2: ( 'double' ) + { + // TarsLexer.g:29:2: ( 'double' ) + // TarsLexer.g:29:4: 'double' + { + match("double"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_DOUBLE" + + // $ANTLR start "TARS_FLOAT" + public final void mTARS_FLOAT() throws RecognitionException { + try { + int _type = TARS_FLOAT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:32:2: ( ( 'float' ) ) + // TarsLexer.g:32:2: ( 'float' ) + { + // TarsLexer.g:32:2: ( 'float' ) + // TarsLexer.g:32:4: 'float' + { + match("float"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_FLOAT" + + // $ANTLR start "TARS_LONG" + public final void mTARS_LONG() throws RecognitionException { + try { + int _type = TARS_LONG; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:35:2: ( ( 'long' ) ) + // TarsLexer.g:35:2: ( 'long' ) + { + // TarsLexer.g:35:2: ( 'long' ) + // TarsLexer.g:35:4: 'long' + { + match("long"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_LONG" + + // $ANTLR start "TARS_STRING" + public final void mTARS_STRING() throws RecognitionException { + try { + int _type = TARS_STRING; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:38:2: ( ( 'string' ) ) + // TarsLexer.g:38:2: ( 'string' ) + { + // TarsLexer.g:38:2: ( 'string' ) + // TarsLexer.g:38:4: 'string' + { + match("string"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_STRING" + + // $ANTLR start "TARS_VECTOR" + public final void mTARS_VECTOR() throws RecognitionException { + try { + int _type = TARS_VECTOR; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:41:2: ( ( 'vector' ) ) + // TarsLexer.g:41:2: ( 'vector' ) + { + // TarsLexer.g:41:2: ( 'vector' ) + // TarsLexer.g:41:4: 'vector' + { + match("vector"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_VECTOR" + + // $ANTLR start "TARS_MAP" + public final void mTARS_MAP() throws RecognitionException { + try { + int _type = TARS_MAP; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:44:2: ( ( 'map' ) ) + // TarsLexer.g:44:2: ( 'map' ) + { + // TarsLexer.g:44:2: ( 'map' ) + // TarsLexer.g:44:4: 'map' + { + match("map"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_MAP" + + // $ANTLR start "TARS_KEY" + public final void mTARS_KEY() throws RecognitionException { + try { + int _type = TARS_KEY; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:47:2: ( ( 'key' ) ) + // TarsLexer.g:47:2: ( 'key' ) + { + // TarsLexer.g:47:2: ( 'key' ) + // TarsLexer.g:47:4: 'key' + { + match("key"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_KEY" + + // $ANTLR start "TARS_ROUTE_KEY" + public final void mTARS_ROUTE_KEY() throws RecognitionException { + try { + int _type = TARS_ROUTE_KEY; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:50:2: ( ( 'routekey' ) ) + // TarsLexer.g:50:2: ( 'routekey' ) + { + // TarsLexer.g:50:2: ( 'routekey' ) + // TarsLexer.g:50:4: 'routekey' + { + match("routekey"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_ROUTE_KEY" + + // $ANTLR start "TARS_INCLUDE" + public final void mTARS_INCLUDE() throws RecognitionException { + try { + int _type = TARS_INCLUDE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:53:2: ( ( '#include' ) ) + // TarsLexer.g:53:2: ( '#include' ) + { + // TarsLexer.g:53:2: ( '#include' ) + // TarsLexer.g:53:4: '#include' + { + match("#include"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_INCLUDE" + + // $ANTLR start "TARS_NAMESPACE" + public final void mTARS_NAMESPACE() throws RecognitionException { + try { + int _type = TARS_NAMESPACE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:56:2: ( ( 'module' ) ) + // TarsLexer.g:56:2: ( 'module' ) + { + // TarsLexer.g:56:2: ( 'module' ) + // TarsLexer.g:56:4: 'module' + { + match("module"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_NAMESPACE" + + // $ANTLR start "TARS_INTERFACE" + public final void mTARS_INTERFACE() throws RecognitionException { + try { + int _type = TARS_INTERFACE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:59:2: ( ( 'interface' ) ) + // TarsLexer.g:59:2: ( 'interface' ) + { + // TarsLexer.g:59:2: ( 'interface' ) + // TarsLexer.g:59:4: 'interface' + { + match("interface"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_INTERFACE" + + // $ANTLR start "TARS_OUT" + public final void mTARS_OUT() throws RecognitionException { + try { + int _type = TARS_OUT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:62:2: ( ( 'out' ) ) + // TarsLexer.g:62:2: ( 'out' ) + { + // TarsLexer.g:62:2: ( 'out' ) + // TarsLexer.g:62:4: 'out' + { + match("out"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_OUT" + + // $ANTLR start "TARS_REQUIRE" + public final void mTARS_REQUIRE() throws RecognitionException { + try { + int _type = TARS_REQUIRE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:65:2: ( ( 'require' ) ) + // TarsLexer.g:65:2: ( 'require' ) + { + // TarsLexer.g:65:2: ( 'require' ) + // TarsLexer.g:65:4: 'require' + { + match("require"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_REQUIRE" + + // $ANTLR start "TARS_OPTIONAL" + public final void mTARS_OPTIONAL() throws RecognitionException { + try { + int _type = TARS_OPTIONAL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:68:2: ( ( 'optional' ) ) + // TarsLexer.g:68:2: ( 'optional' ) + { + // TarsLexer.g:68:2: ( 'optional' ) + // TarsLexer.g:68:4: 'optional' + { + match("optional"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_OPTIONAL" + + // $ANTLR start "TARS_FALSE" + public final void mTARS_FALSE() throws RecognitionException { + try { + int _type = TARS_FALSE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:71:2: ( ( 'false' ) ) + // TarsLexer.g:71:2: ( 'false' ) + { + // TarsLexer.g:71:2: ( 'false' ) + // TarsLexer.g:71:4: 'false' + { + match("false"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_FALSE" + + // $ANTLR start "TARS_TRUE" + public final void mTARS_TRUE() throws RecognitionException { + try { + int _type = TARS_TRUE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:74:2: ( ( 'true' ) ) + // TarsLexer.g:74:2: ( 'true' ) + { + // TarsLexer.g:74:2: ( 'true' ) + // TarsLexer.g:74:4: 'true' + { + match("true"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_TRUE" + + // $ANTLR start "TARS_ENUM" + public final void mTARS_ENUM() throws RecognitionException { + try { + int _type = TARS_ENUM; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:77:2: ( ( 'enum' ) ) + // TarsLexer.g:77:2: ( 'enum' ) + { + // TarsLexer.g:77:2: ( 'enum' ) + // TarsLexer.g:77:4: 'enum' + { + match("enum"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_ENUM" + + // $ANTLR start "TARS_CONST" + public final void mTARS_CONST() throws RecognitionException { + try { + int _type = TARS_CONST; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:80:2: ( ( 'const' ) ) + // TarsLexer.g:80:2: ( 'const' ) + { + // TarsLexer.g:80:2: ( 'const' ) + // TarsLexer.g:80:4: 'const' + { + match("const"); + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_CONST" + + // $ANTLR start "TARS_IDENTIFIER" + public final void mTARS_IDENTIFIER() throws RecognitionException { + try { + int _type = TARS_IDENTIFIER; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:85:5: ( ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) ) + // TarsLexer.g:85:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) + { + // TarsLexer.g:85:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) + // TarsLexer.g:85:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* + { + if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + // TarsLexer.g:85:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* + loop1: + while (true) { + int alt1=2; + int LA1_0 = input.LA(1); + if ( ((LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||LA1_0=='_'||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) { + alt1=1; + } + + switch (alt1) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop1; + } + } + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_IDENTIFIER" + + // $ANTLR start "TARS_INTEGER_LITERAL" + public final void mTARS_INTEGER_LITERAL() throws RecognitionException { + try { + int _type = TARS_INTEGER_LITERAL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:89:5: ( ( ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ | ( 'O' | 'o' ) ( '0' .. '7' )+ | ( '+' | '-' )? ( '0' .. '9' )+ ) ) + // TarsLexer.g:89:5: ( ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ | ( 'O' | 'o' ) ( '0' .. '7' )+ | ( '+' | '-' )? ( '0' .. '9' )+ ) + { + // TarsLexer.g:89:5: ( ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ | ( 'O' | 'o' ) ( '0' .. '7' )+ | ( '+' | '-' )? ( '0' .. '9' )+ ) + int alt7=3; + switch ( input.LA(1) ) { + case '0': + { + int LA7_1 = input.LA(2); + if ( (LA7_1=='X'||LA7_1=='x') ) { + alt7=1; + } + + else { + alt7=3; + } + + } + break; + case 'O': + case 'o': + { + alt7=2; + } + break; + case '+': + case '-': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + alt7=3; + } + break; + default: + NoViableAltException nvae = + new NoViableAltException("", 7, 0, input); + throw nvae; + } + switch (alt7) { + case 1 : + // TarsLexer.g:89:7: ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ + { + // TarsLexer.g:89:7: ( '0X' | '0x' ) + int alt2=2; + int LA2_0 = input.LA(1); + if ( (LA2_0=='0') ) { + int LA2_1 = input.LA(2); + if ( (LA2_1=='X') ) { + alt2=1; + } + else if ( (LA2_1=='x') ) { + alt2=2; + } + + else { + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 2, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 2, 0, input); + throw nvae; + } + + switch (alt2) { + case 1 : + // TarsLexer.g:89:8: '0X' + { + match("0X"); + + } + break; + case 2 : + // TarsLexer.g:89:13: '0x' + { + match("0x"); + + } + break; + + } + + // TarsLexer.g:89:18: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ + int cnt3=0; + loop3: + while (true) { + int alt3=2; + int LA3_0 = input.LA(1); + if ( ((LA3_0 >= '0' && LA3_0 <= '9')||(LA3_0 >= 'A' && LA3_0 <= 'F')||(LA3_0 >= 'a' && LA3_0 <= 'f')) ) { + alt3=1; + } + + switch (alt3) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt3 >= 1 ) break loop3; + EarlyExitException eee = new EarlyExitException(3, input); + throw eee; + } + cnt3++; + } + + } + break; + case 2 : + // TarsLexer.g:90:7: ( 'O' | 'o' ) ( '0' .. '7' )+ + { + if ( input.LA(1)=='O'||input.LA(1)=='o' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + // TarsLexer.g:90:16: ( '0' .. '7' )+ + int cnt4=0; + loop4: + while (true) { + int alt4=2; + int LA4_0 = input.LA(1); + if ( ((LA4_0 >= '0' && LA4_0 <= '7')) ) { + alt4=1; + } + + switch (alt4) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt4 >= 1 ) break loop4; + EarlyExitException eee = new EarlyExitException(4, input); + throw eee; + } + cnt4++; + } + + } + break; + case 3 : + // TarsLexer.g:91:7: ( '+' | '-' )? ( '0' .. '9' )+ + { + // TarsLexer.g:91:7: ( '+' | '-' )? + int alt5=2; + int LA5_0 = input.LA(1); + if ( (LA5_0=='+'||LA5_0=='-') ) { + alt5=1; + } + switch (alt5) { + case 1 : + // TarsLexer.g: + { + if ( input.LA(1)=='+'||input.LA(1)=='-' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + } + + // TarsLexer.g:91:17: ( '0' .. '9' )+ + int cnt6=0; + loop6: + while (true) { + int alt6=2; + int LA6_0 = input.LA(1); + if ( ((LA6_0 >= '0' && LA6_0 <= '9')) ) { + alt6=1; + } + + switch (alt6) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt6 >= 1 ) break loop6; + EarlyExitException eee = new EarlyExitException(6, input); + throw eee; + } + cnt6++; + } + + } + break; + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_INTEGER_LITERAL" + + // $ANTLR start "TARS_FLOATING_POINT_LITERAL" + public final void mTARS_FLOATING_POINT_LITERAL() throws RecognitionException { + try { + int _type = TARS_FLOATING_POINT_LITERAL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:95:5: ( ( ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ) ) + // TarsLexer.g:95:5: ( ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ) + { + // TarsLexer.g:95:5: ( ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ) + // TarsLexer.g:95:9: ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ + { + // TarsLexer.g:95:9: ( '+' | '-' )? + int alt8=2; + int LA8_0 = input.LA(1); + if ( (LA8_0=='+'||LA8_0=='-') ) { + alt8=1; + } + switch (alt8) { + case 1 : + // TarsLexer.g: + { + if ( input.LA(1)=='+'||input.LA(1)=='-' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + } + + // TarsLexer.g:95:20: ( '0' .. '9' )+ + int cnt9=0; + loop9: + while (true) { + int alt9=2; + int LA9_0 = input.LA(1); + if ( ((LA9_0 >= '0' && LA9_0 <= '9')) ) { + alt9=1; + } + + switch (alt9) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt9 >= 1 ) break loop9; + EarlyExitException eee = new EarlyExitException(9, input); + throw eee; + } + cnt9++; + } + + match('.'); + // TarsLexer.g:95:36: ( '0' .. '9' )+ + int cnt10=0; + loop10: + while (true) { + int alt10=2; + int LA10_0 = input.LA(1); + if ( ((LA10_0 >= '0' && LA10_0 <= '9')) ) { + alt10=1; + } + + switch (alt10) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt10 >= 1 ) break loop10; + EarlyExitException eee = new EarlyExitException(10, input); + throw eee; + } + cnt10++; + } + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_FLOATING_POINT_LITERAL" + + // $ANTLR start "TARS_STRING_LITERAL" + public final void mTARS_STRING_LITERAL() throws RecognitionException { + try { + int _type = TARS_STRING_LITERAL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:99:5: ( ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' ) ) + // TarsLexer.g:99:5: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' ) + { + // TarsLexer.g:99:5: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' ) + // TarsLexer.g:99:7: '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' + { + match('\"'); + // TarsLexer.g:99:11: ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* + loop11: + while (true) { + int alt11=3; + int LA11_0 = input.LA(1); + if ( (LA11_0=='\\') ) { + alt11=1; + } + else if ( ((LA11_0 >= '\u0000' && LA11_0 <= '!')||(LA11_0 >= '#' && LA11_0 <= '[')||(LA11_0 >= ']' && LA11_0 <= '\uFFFF')) ) { + alt11=2; + } + + switch (alt11) { + case 1 : + // TarsLexer.g:99:13: ESC_SEQ + { + mESC_SEQ(); + + } + break; + case 2 : + // TarsLexer.g:99:23: ~ ( '\\\\' | '\"' ) + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop11; + } + } + + match('\"'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "TARS_STRING_LITERAL" + + // $ANTLR start "LPAREN" + public final void mLPAREN() throws RecognitionException { + try { + int _type = LPAREN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:103:5: ( ( '(' ) ) + // TarsLexer.g:103:5: ( '(' ) + { + // TarsLexer.g:103:5: ( '(' ) + // TarsLexer.g:103:9: '(' + { + match('('); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LPAREN" + + // $ANTLR start "RPAREN" + public final void mRPAREN() throws RecognitionException { + try { + int _type = RPAREN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:107:5: ( ( ')' ) ) + // TarsLexer.g:107:5: ( ')' ) + { + // TarsLexer.g:107:5: ( ')' ) + // TarsLexer.g:107:9: ')' + { + match(')'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RPAREN" + + // $ANTLR start "LBRACE" + public final void mLBRACE() throws RecognitionException { + try { + int _type = LBRACE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:111:5: ( ( '{' ) ) + // TarsLexer.g:111:5: ( '{' ) + { + // TarsLexer.g:111:5: ( '{' ) + // TarsLexer.g:111:9: '{' + { + match('{'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LBRACE" + + // $ANTLR start "RBRACE" + public final void mRBRACE() throws RecognitionException { + try { + int _type = RBRACE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:115:5: ( ( '}' ) ) + // TarsLexer.g:115:5: ( '}' ) + { + // TarsLexer.g:115:5: ( '}' ) + // TarsLexer.g:115:9: '}' + { + match('}'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RBRACE" + + // $ANTLR start "LBRACKET" + public final void mLBRACKET() throws RecognitionException { + try { + int _type = LBRACKET; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:119:5: ( ( '[' ) ) + // TarsLexer.g:119:5: ( '[' ) + { + // TarsLexer.g:119:5: ( '[' ) + // TarsLexer.g:119:9: '[' + { + match('['); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LBRACKET" + + // $ANTLR start "RBRACKET" + public final void mRBRACKET() throws RecognitionException { + try { + int _type = RBRACKET; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:123:5: ( ( ']' ) ) + // TarsLexer.g:123:5: ( ']' ) + { + // TarsLexer.g:123:5: ( ']' ) + // TarsLexer.g:123:9: ']' + { + match(']'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RBRACKET" + + // $ANTLR start "SEMI" + public final void mSEMI() throws RecognitionException { + try { + int _type = SEMI; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:127:2: ( ( ';' ) ) + // TarsLexer.g:127:2: ( ';' ) + { + // TarsLexer.g:127:2: ( ';' ) + // TarsLexer.g:127:4: ';' + { + match(';'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "SEMI" + + // $ANTLR start "COMMA" + public final void mCOMMA() throws RecognitionException { + try { + int _type = COMMA; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:131:2: ( ( ',' ) ) + // TarsLexer.g:131:2: ( ',' ) + { + // TarsLexer.g:131:2: ( ',' ) + // TarsLexer.g:131:4: ',' + { + match(','); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "COMMA" + + // $ANTLR start "QUOTE" + public final void mQUOTE() throws RecognitionException { + try { + int _type = QUOTE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:135:2: ( ( '\"' ) ) + // TarsLexer.g:135:2: ( '\"' ) + { + // TarsLexer.g:135:2: ( '\"' ) + // TarsLexer.g:135:4: '\"' + { + match('\"'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "QUOTE" + + // $ANTLR start "DOT" + public final void mDOT() throws RecognitionException { + try { + int _type = DOT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:139:2: ( ( '.' ) ) + // TarsLexer.g:139:2: ( '.' ) + { + // TarsLexer.g:139:2: ( '.' ) + // TarsLexer.g:139:4: '.' + { + match('.'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "DOT" + + // $ANTLR start "COLON" + public final void mCOLON() throws RecognitionException { + try { + int _type = COLON; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:143:2: ( ( ':' ) ) + // TarsLexer.g:143:2: ( ':' ) + { + // TarsLexer.g:143:2: ( ':' ) + // TarsLexer.g:143:4: ':' + { + match(':'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "COLON" + + // $ANTLR start "EQ" + public final void mEQ() throws RecognitionException { + try { + int _type = EQ; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:147:2: ( ( '=' ) ) + // TarsLexer.g:147:2: ( '=' ) + { + // TarsLexer.g:147:2: ( '=' ) + // TarsLexer.g:147:4: '=' + { + match('='); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "EQ" + + // $ANTLR start "GT" + public final void mGT() throws RecognitionException { + try { + int _type = GT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:151:2: ( ( '>' ) ) + // TarsLexer.g:151:2: ( '>' ) + { + // TarsLexer.g:151:2: ( '>' ) + // TarsLexer.g:151:4: '>' + { + match('>'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "GT" + + // $ANTLR start "LT" + public final void mLT() throws RecognitionException { + try { + int _type = LT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:155:2: ( ( '<' ) ) + // TarsLexer.g:155:2: ( '<' ) + { + // TarsLexer.g:155:2: ( '<' ) + // TarsLexer.g:155:4: '<' + { + match('<'); + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LT" + + // $ANTLR start "COMMENT" + public final void mCOMMENT() throws RecognitionException { + try { + int _type = COMMENT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:162:5: ( ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' ) ) + // TarsLexer.g:162:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' ) + { + // TarsLexer.g:162:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' ) + int alt15=2; + int LA15_0 = input.LA(1); + if ( (LA15_0=='/') ) { + int LA15_1 = input.LA(2); + if ( (LA15_1=='/') ) { + alt15=1; + } + else if ( (LA15_1=='*') ) { + alt15=2; + } + + else { + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 15, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 15, 0, input); + throw nvae; + } + + switch (alt15) { + case 1 : + // TarsLexer.g:162:9: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' + { + match("//"); + + // TarsLexer.g:162:14: (~ ( '\\n' | '\\r' ) )* + loop12: + while (true) { + int alt12=2; + int LA12_0 = input.LA(1); + if ( ((LA12_0 >= '\u0000' && LA12_0 <= '\t')||(LA12_0 >= '\u000B' && LA12_0 <= '\f')||(LA12_0 >= '\u000E' && LA12_0 <= '\uFFFF')) ) { + alt12=1; + } + + switch (alt12) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\f')||(input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop12; + } + } + + // TarsLexer.g:162:28: ( '\\r' )? + int alt13=2; + int LA13_0 = input.LA(1); + if ( (LA13_0=='\r') ) { + alt13=1; + } + switch (alt13) { + case 1 : + // TarsLexer.g:162:28: '\\r' + { + match('\r'); + } + break; + + } + + match('\n'); + } + break; + case 2 : + // TarsLexer.g:163:9: '/*' ( options {greedy=false; } : . )* '*/' + { + match("/*"); + + // TarsLexer.g:169:9: ( options {greedy=false; } : . )* + loop14: + while (true) { + int alt14=2; + int LA14_0 = input.LA(1); + if ( (LA14_0=='*') ) { + int LA14_1 = input.LA(2); + if ( (LA14_1=='/') ) { + alt14=2; + } + else if ( ((LA14_1 >= '\u0000' && LA14_1 <= '.')||(LA14_1 >= '0' && LA14_1 <= '\uFFFF')) ) { + alt14=1; + } + + } + else if ( ((LA14_0 >= '\u0000' && LA14_0 <= ')')||(LA14_0 >= '+' && LA14_0 <= '\uFFFF')) ) { + alt14=1; + } + + switch (alt14) { + case 1 : + // TarsLexer.g:169:36: . + { + matchAny(); + } + break; + + default : + break loop14; + } + } + + match("*/"); + + _channel=HIDDEN; + } + break; + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "COMMENT" + + // $ANTLR start "WS" + public final void mWS() throws RecognitionException { + try { + int _type = WS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // TarsLexer.g:180:5: ( ( ' ' | '\\t' | '\\r' | '\\n' ) ) + // TarsLexer.g:180:5: ( ' ' | '\\t' | '\\r' | '\\n' ) + { + if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + skip(); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "WS" + + // $ANTLR start "HEX_DIGIT" + public final void mHEX_DIGIT() throws RecognitionException { + try { + // TarsLexer.g:188:11: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ) + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "HEX_DIGIT" + + // $ANTLR start "ESC_SEQ" + public final void mESC_SEQ() throws RecognitionException { + try { + // TarsLexer.g:192:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC | OCTAL_ESC ) + int alt16=3; + int LA16_0 = input.LA(1); + if ( (LA16_0=='\\') ) { + switch ( input.LA(2) ) { + case '\"': + case '\'': + case '\\': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + { + alt16=1; + } + break; + case 'u': + { + alt16=2; + } + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + { + alt16=3; + } + break; + default: + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 16, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 16, 0, input); + throw nvae; + } + + switch (alt16) { + case 1 : + // TarsLexer.g:192:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) + { + match('\\'); + if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + case 2 : + // TarsLexer.g:193:9: UNICODE_ESC + { + mUNICODE_ESC(); + + } + break; + case 3 : + // TarsLexer.g:194:9: OCTAL_ESC + { + mOCTAL_ESC(); + + } + break; + + } + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "ESC_SEQ" + + // $ANTLR start "OCTAL_ESC" + public final void mOCTAL_ESC() throws RecognitionException { + try { + // TarsLexer.g:199:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ) + int alt17=3; + int LA17_0 = input.LA(1); + if ( (LA17_0=='\\') ) { + int LA17_1 = input.LA(2); + if ( ((LA17_1 >= '0' && LA17_1 <= '3')) ) { + int LA17_2 = input.LA(3); + if ( ((LA17_2 >= '0' && LA17_2 <= '7')) ) { + int LA17_4 = input.LA(4); + if ( ((LA17_4 >= '0' && LA17_4 <= '7')) ) { + alt17=1; + } + + else { + alt17=2; + } + + } + + else { + alt17=3; + } + + } + else if ( ((LA17_1 >= '4' && LA17_1 <= '7')) ) { + int LA17_3 = input.LA(3); + if ( ((LA17_3 >= '0' && LA17_3 <= '7')) ) { + alt17=2; + } + + else { + alt17=3; + } + + } + + else { + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 17, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 17, 0, input); + throw nvae; + } + + switch (alt17) { + case 1 : + // TarsLexer.g:199:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) + { + match('\\'); + if ( (input.LA(1) >= '0' && input.LA(1) <= '3') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + case 2 : + // TarsLexer.g:200:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) + { + match('\\'); + if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + case 3 : + // TarsLexer.g:201:9: '\\\\' ( '0' .. '7' ) + { + match('\\'); + if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + } + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "OCTAL_ESC" + + // $ANTLR start "UNICODE_ESC" + public final void mUNICODE_ESC() throws RecognitionException { + try { + // TarsLexer.g:206:5: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ) + // TarsLexer.g:206:9: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT + { + match('\\'); + match('u'); + mHEX_DIGIT(); + + mHEX_DIGIT(); + + mHEX_DIGIT(); + + mHEX_DIGIT(); + + } + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "UNICODE_ESC" + + @Override + public void mTokens() throws RecognitionException { + // TarsLexer.g:1:8: ( TARS_VOID | TARS_STRUCT | TARS_UNSIGNED | TARS_BOOL | TARS_BYTE | TARS_SHORT | TARS_INT | TARS_DOUBLE | TARS_FLOAT | TARS_LONG | TARS_STRING | TARS_VECTOR | TARS_MAP | TARS_KEY | TARS_ROUTE_KEY | TARS_INCLUDE | TARS_NAMESPACE | TARS_INTERFACE | TARS_OUT | TARS_REQUIRE | TARS_OPTIONAL | TARS_FALSE | TARS_TRUE | TARS_ENUM | TARS_CONST | TARS_IDENTIFIER | TARS_INTEGER_LITERAL | TARS_FLOATING_POINT_LITERAL | TARS_STRING_LITERAL | LPAREN | RPAREN | LBRACE | RBRACE | LBRACKET | RBRACKET | SEMI | COMMA | QUOTE | DOT | COLON | EQ | GT | LT | COMMENT | WS ) + int alt18=45; + alt18 = dfa18.predict(input); + switch (alt18) { + case 1 : + // TarsLexer.g:1:10: TARS_VOID + { + mTARS_VOID(); + + } + break; + case 2 : + // TarsLexer.g:1:20: TARS_STRUCT + { + mTARS_STRUCT(); + + } + break; + case 3 : + // TarsLexer.g:1:32: TARS_UNSIGNED + { + mTARS_UNSIGNED(); + + } + break; + case 4 : + // TarsLexer.g:1:46: TARS_BOOL + { + mTARS_BOOL(); + + } + break; + case 5 : + // TarsLexer.g:1:56: TARS_BYTE + { + mTARS_BYTE(); + + } + break; + case 6 : + // TarsLexer.g:1:66: TARS_SHORT + { + mTARS_SHORT(); + + } + break; + case 7 : + // TarsLexer.g:1:77: TARS_INT + { + mTARS_INT(); + + } + break; + case 8 : + // TarsLexer.g:1:86: TARS_DOUBLE + { + mTARS_DOUBLE(); + + } + break; + case 9 : + // TarsLexer.g:1:98: TARS_FLOAT + { + mTARS_FLOAT(); + + } + break; + case 10 : + // TarsLexer.g:1:109: TARS_LONG + { + mTARS_LONG(); + + } + break; + case 11 : + // TarsLexer.g:1:119: TARS_STRING + { + mTARS_STRING(); + + } + break; + case 12 : + // TarsLexer.g:1:131: TARS_VECTOR + { + mTARS_VECTOR(); + + } + break; + case 13 : + // TarsLexer.g:1:143: TARS_MAP + { + mTARS_MAP(); + + } + break; + case 14 : + // TarsLexer.g:1:152: TARS_KEY + { + mTARS_KEY(); + + } + break; + case 15 : + // TarsLexer.g:1:161: TARS_ROUTE_KEY + { + mTARS_ROUTE_KEY(); + + } + break; + case 16 : + // TarsLexer.g:1:176: TARS_INCLUDE + { + mTARS_INCLUDE(); + + } + break; + case 17 : + // TarsLexer.g:1:189: TARS_NAMESPACE + { + mTARS_NAMESPACE(); + + } + break; + case 18 : + // TarsLexer.g:1:204: TARS_INTERFACE + { + mTARS_INTERFACE(); + + } + break; + case 19 : + // TarsLexer.g:1:219: TARS_OUT + { + mTARS_OUT(); + + } + break; + case 20 : + // TarsLexer.g:1:228: TARS_REQUIRE + { + mTARS_REQUIRE(); + + } + break; + case 21 : + // TarsLexer.g:1:241: TARS_OPTIONAL + { + mTARS_OPTIONAL(); + + } + break; + case 22 : + // TarsLexer.g:1:255: TARS_FALSE + { + mTARS_FALSE(); + + } + break; + case 23 : + // TarsLexer.g:1:266: TARS_TRUE + { + mTARS_TRUE(); + + } + break; + case 24 : + // TarsLexer.g:1:276: TARS_ENUM + { + mTARS_ENUM(); + + } + break; + case 25 : + // TarsLexer.g:1:286: TARS_CONST + { + mTARS_CONST(); + + } + break; + case 26 : + // TarsLexer.g:1:297: TARS_IDENTIFIER + { + mTARS_IDENTIFIER(); + + } + break; + case 27 : + // TarsLexer.g:1:313: TARS_INTEGER_LITERAL + { + mTARS_INTEGER_LITERAL(); + + } + break; + case 28 : + // TarsLexer.g:1:334: TARS_FLOATING_POINT_LITERAL + { + mTARS_FLOATING_POINT_LITERAL(); + + } + break; + case 29 : + // TarsLexer.g:1:362: TARS_STRING_LITERAL + { + mTARS_STRING_LITERAL(); + + } + break; + case 30 : + // TarsLexer.g:1:382: LPAREN + { + mLPAREN(); + + } + break; + case 31 : + // TarsLexer.g:1:389: RPAREN + { + mRPAREN(); + + } + break; + case 32 : + // TarsLexer.g:1:396: LBRACE + { + mLBRACE(); + + } + break; + case 33 : + // TarsLexer.g:1:403: RBRACE + { + mRBRACE(); + + } + break; + case 34 : + // TarsLexer.g:1:410: LBRACKET + { + mLBRACKET(); + + } + break; + case 35 : + // TarsLexer.g:1:419: RBRACKET + { + mRBRACKET(); + + } + break; + case 36 : + // TarsLexer.g:1:428: SEMI + { + mSEMI(); + + } + break; + case 37 : + // TarsLexer.g:1:433: COMMA + { + mCOMMA(); + + } + break; + case 38 : + // TarsLexer.g:1:439: QUOTE + { + mQUOTE(); + + } + break; + case 39 : + // TarsLexer.g:1:445: DOT + { + mDOT(); + + } + break; + case 40 : + // TarsLexer.g:1:449: COLON + { + mCOLON(); + + } + break; + case 41 : + // TarsLexer.g:1:455: EQ + { + mEQ(); + + } + break; + case 42 : + // TarsLexer.g:1:458: GT + { + mGT(); + + } + break; + case 43 : + // TarsLexer.g:1:461: LT + { + mLT(); + + } + break; + case 44 : + // TarsLexer.g:1:464: COMMENT + { + mCOMMENT(); + + } + break; + case 45 : + // TarsLexer.g:1:472: WS + { + mWS(); + + } + break; + + } + } + + + protected DFA18 dfa18 = new DFA18(this); + static final String DFA18_eotS = + "\1\uffff\13\23\1\uffff\5\23\1\75\2\uffff\1\75\1\100\17\uffff\27\23\4\uffff"+ + "\7\23\1\140\4\23\1\145\1\23\1\147\2\23\1\152\4\23\1\157\5\23\1\165\1\166"+ + "\1\23\1\uffff\3\23\1\173\1\uffff\1\23\1\uffff\2\23\1\uffff\1\23\1\u0080"+ + "\1\u0081\1\23\1\uffff\3\23\1\u0086\1\23\2\uffff\2\23\1\u008a\1\u008b\1"+ + "\uffff\4\23\2\uffff\1\u0090\1\u0091\1\u0092\1\u0093\1\uffff\2\23\1\u0096"+ + "\2\uffff\1\u0097\3\23\4\uffff\2\23\2\uffff\1\23\1\u009e\1\23\1\u00a0\1"+ + "\23\1\u00a2\1\uffff\1\u00a3\1\uffff\1\u00a4\3\uffff"; + static final String DFA18_eofS = + "\u00a5\uffff"; + static final String DFA18_minS = + "\1\11\1\145\1\150\1\156\1\157\1\156\1\157\1\141\1\157\1\141\2\145\1\uffff"+ + "\1\60\1\162\1\156\1\157\1\60\1\56\1\uffff\1\60\1\56\1\0\17\uffff\1\151"+ + "\1\143\1\162\1\157\1\163\1\157\2\164\1\165\1\157\1\154\1\156\1\160\1\144"+ + "\1\171\1\165\1\161\2\164\1\60\2\165\1\156\4\uffff\1\144\1\164\1\151\1"+ + "\162\1\151\1\154\1\145\1\60\1\142\1\141\1\163\1\147\1\60\1\165\1\60\1"+ + "\164\1\165\1\60\1\151\1\145\1\155\1\163\1\60\1\157\1\143\1\156\1\164\1"+ + "\147\2\60\1\162\1\uffff\1\154\1\164\1\145\1\60\1\uffff\1\154\1\uffff\1"+ + "\145\1\151\1\uffff\1\157\2\60\1\164\1\uffff\1\162\1\164\1\147\1\60\1\156"+ + "\2\uffff\1\146\1\145\2\60\1\uffff\1\145\1\153\1\162\1\156\2\uffff\4\60"+ + "\1\uffff\1\145\1\141\1\60\2\uffff\1\60\2\145\1\141\4\uffff\1\144\1\143"+ + "\2\uffff\1\171\1\60\1\154\1\60\1\145\1\60\1\uffff\1\60\1\uffff\1\60\3"+ + "\uffff"; + static final String DFA18_maxS = + "\1\175\1\157\1\164\1\156\1\171\1\156\1\157\1\154\2\157\1\145\1\157\1\uffff"+ + "\1\165\1\162\1\156\1\157\1\67\1\71\1\uffff\2\71\1\uffff\17\uffff\1\151"+ + "\1\143\1\162\1\157\1\163\1\157\2\164\1\165\1\157\1\154\1\156\1\160\1\144"+ + "\1\171\1\165\1\161\2\164\1\67\2\165\1\156\4\uffff\1\144\1\164\1\165\1"+ + "\162\1\151\1\154\1\145\1\172\1\142\1\141\1\163\1\147\1\172\1\165\1\172"+ + "\1\164\1\165\1\172\1\151\1\145\1\155\1\163\1\172\1\157\1\143\1\156\1\164"+ + "\1\147\2\172\1\162\1\uffff\1\154\1\164\1\145\1\172\1\uffff\1\154\1\uffff"+ + "\1\145\1\151\1\uffff\1\157\2\172\1\164\1\uffff\1\162\1\164\1\147\1\172"+ + "\1\156\2\uffff\1\146\1\145\2\172\1\uffff\1\145\1\153\1\162\1\156\2\uffff"+ + "\4\172\1\uffff\1\145\1\141\1\172\2\uffff\1\172\2\145\1\141\4\uffff\1\144"+ + "\1\143\2\uffff\1\171\1\172\1\154\1\172\1\145\1\172\1\uffff\1\172\1\uffff"+ + "\1\172\3\uffff"; + static final String DFA18_acceptS = + "\14\uffff\1\20\6\uffff\1\32\3\uffff\1\36\1\37\1\40\1\41\1\42\1\43\1\44"+ + "\1\45\1\47\1\50\1\51\1\52\1\53\1\54\1\55\27\uffff\1\33\1\34\1\35\1\46"+ + "\37\uffff\1\7\4\uffff\1\15\1\uffff\1\16\2\uffff\1\23\4\uffff\1\1\5\uffff"+ + "\1\4\1\5\4\uffff\1\12\4\uffff\1\27\1\30\4\uffff\1\6\3\uffff\1\11\1\26"+ + "\4\uffff\1\31\1\14\1\2\1\13\2\uffff\1\10\1\21\6\uffff\1\24\1\uffff\1\3"+ + "\1\uffff\1\17\1\25\1\22"; + static final String DFA18_specialS = + "\26\uffff\1\0\u008e\uffff}>"; + static final String[] DFA18_transitionS = { + "\2\45\2\uffff\1\45\22\uffff\1\45\1\uffff\1\26\1\14\4\uffff\1\27\1\30"+ + "\1\uffff\1\24\1\36\1\24\1\37\1\44\1\22\11\25\1\40\1\35\1\43\1\41\1\42"+ + "\2\uffff\16\23\1\21\13\23\1\33\1\uffff\1\34\1\uffff\1\23\1\uffff\1\23"+ + "\1\4\1\20\1\6\1\17\1\7\2\23\1\5\1\23\1\12\1\10\1\11\1\23\1\15\2\23\1"+ + "\13\1\2\1\16\1\3\1\1\4\23\1\31\1\uffff\1\32", + "\1\47\11\uffff\1\46", + "\1\51\13\uffff\1\50", + "\1\52", + "\1\53\11\uffff\1\54", + "\1\55", + "\1\56", + "\1\60\12\uffff\1\57", + "\1\61", + "\1\62\15\uffff\1\63", + "\1\64", + "\1\66\11\uffff\1\65", + "", + "\10\71\70\uffff\1\70\4\uffff\1\67", + "\1\72", + "\1\73", + "\1\74", + "\10\71", + "\1\76\1\uffff\12\25", + "", + "\12\25", + "\1\76\1\uffff\12\25", + "\0\77", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\1\101", + "\1\102", + "\1\103", + "\1\104", + "\1\105", + "\1\106", + "\1\107", + "\1\110", + "\1\111", + "\1\112", + "\1\113", + "\1\114", + "\1\115", + "\1\116", + "\1\117", + "\1\120", + "\1\121", + "\1\122", + "\1\123", + "\10\71", + "\1\124", + "\1\125", + "\1\126", + "", + "", + "", + "", + "\1\127", + "\1\130", + "\1\132\13\uffff\1\131", + "\1\133", + "\1\134", + "\1\135", + "\1\136", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\4\23\1\137\25\23", + "\1\141", + "\1\142", + "\1\143", + "\1\144", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\146", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\150", + "\1\151", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\153", + "\1\154", + "\1\155", + "\1\156", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\160", + "\1\161", + "\1\162", + "\1\163", + "\1\164", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\167", + "", + "\1\170", + "\1\171", + "\1\172", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "", + "\1\174", + "", + "\1\175", + "\1\176", + "", + "\1\177", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\u0082", + "", + "\1\u0083", + "\1\u0084", + "\1\u0085", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\u0087", + "", + "", + "\1\u0088", + "\1\u0089", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "", + "\1\u008c", + "\1\u008d", + "\1\u008e", + "\1\u008f", + "", + "", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "", + "\1\u0094", + "\1\u0095", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "", + "", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\u0098", + "\1\u0099", + "\1\u009a", + "", + "", + "", + "", + "\1\u009b", + "\1\u009c", + "", + "", + "\1\u009d", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\u009f", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "\1\u00a1", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "", + "\12\23\7\uffff\32\23\4\uffff\1\23\1\uffff\32\23", + "", + "", + "" + }; + + static final short[] DFA18_eot = DFA.unpackEncodedString(DFA18_eotS); + static final short[] DFA18_eof = DFA.unpackEncodedString(DFA18_eofS); + static final char[] DFA18_min = DFA.unpackEncodedStringToUnsignedChars(DFA18_minS); + static final char[] DFA18_max = DFA.unpackEncodedStringToUnsignedChars(DFA18_maxS); + static final short[] DFA18_accept = DFA.unpackEncodedString(DFA18_acceptS); + static final short[] DFA18_special = DFA.unpackEncodedString(DFA18_specialS); + static final short[][] DFA18_transition; + + static { + int numStates = DFA18_transitionS.length; + DFA18_transition = new short[numStates][]; + for (int i=0; i= '\u0000' && LA18_22 <= '\uFFFF')) ) {s = 63;} + else s = 64; + if ( s>=0 ) return s; + break; + } + NoViableAltException nvae = + new NoViableAltException(getDescription(), 18, _s, input); + error(nvae); + throw nvae; + } + } + +} diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/useage.md b/tools/tars-maven-plugin/src/main/resources/antlr/useage.md new file mode 100644 index 00000000..4dcb05f7 --- /dev/null +++ b/tools/tars-maven-plugin/src/main/resources/antlr/useage.md @@ -0,0 +1,2 @@ +* 安装antlr工具(3.5版本的依赖包); +* 编译语法文件:java org.antlr.Tool TafLexer.g \ No newline at end of file From 69ca07a9226fce0e57d586dc0384b8be99adea3f Mon Sep 17 00:00:00 2001 From: walker Date: Tue, 10 May 2022 16:17:09 +0800 Subject: [PATCH 3/4] lexer is ready & parser just soso --- .../src/main/resources/antlr/TafParser.g | 240 +-- .../src/main/resources/antlr/TarsLexer.g | 126 +- .../src/main/resources/antlr/TarsLexer.java | 1494 +++++++---------- 3 files changed, 848 insertions(+), 1012 deletions(-) diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g b/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g index 43f6f3a8..71a60db7 100644 --- a/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g +++ b/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g @@ -1,109 +1,139 @@ -grammar Taf; +parser grammar TarsParser; -tokens -{ -COLON;COMMA;COMMENT;DOT; -EQ;ESC_SEQ;GT;HEX_DIGIT;LBRACE;LBRACKET;LPAREN;LT; -OCTAL_ESC; QUOTE; RBRACE; RBRACKET; RPAREN; SEMI; TAF_BOOL; -TAF_BYTE; TAF_CONST; TAF_DOUBLE; TAF_ENUM; TAF_FALSE;TAF_FLOAT; -TAF_FLOATING_POINT_LITERAL; TAF_IDENTIFIER;TAF_INCLUDE;TAF_INT; -TAF_INTEGER_LITERAL;TAF_INTERFACE;TAF_KEY;TAF_LONG;TAF_MAP; -TAF_NAMESPACE;TAF_OPTIONAL;TAF_OUT;TAF_REQUIRE;TAF_ROUTE_KEY; -TAF_SHORT;TAF_STRING;TAF_STRING_LITERAL;TAF_STRUCT;TAF_TRUE; -TAF_UNSIGNED;TAF_VECTOR;TAF_VOID;UNICODE_ESC;WS;TAF_OPERATION; -TAF_PARAM;TAF_REF;TAF_ROOT;TAF_STRUCT_MEMBER; +options { +tokenVocab=TarsLexer; +output = AST; } +tokens +{COLON;COMMA;COMMENT;DOT; +EQ;ESC_SEQ;GT;HEX_DIGIT;LBRACE;LBRACKET;LPAREN;LT; +OCTAL_ESC; QUOTE; RBRACE; RBRACKET; RPAREN; SEMI; TARS_BOOL; +TARS_BYTE; TARS_CONST; TARS_DOUBLE; TARS_ENUM; TARS_FALSE;TARS_FLOAT; +TARS_FLOATING_POINT_LITERAL; TARS_IDENTIFIER;TARS_INCLUDE;TARS_INT; +TARS_INTEGER_LITERAL;TARS_INTERFACE;TARS_KEY;TARS_LONG;TARS_MAP; +TARS_NAMESPACE;TARS_OPTIONAL;TARS_OUT;TARS_REQUIRE;TARS_ROUTE_KEY; +TARS_SHORT;TARS_STRING;TARS_STRING_LITERAL;TARS_STRUCT;TARS_TRUE; +TARS_UNSIGNED;TARS_VECTOR;TARS_VOID;UNICODE_ESC;WS;TARS_OPERATION; +TARS_PARAM;TARS_REF;TARS_ROOT;TARS_STRUCT_MEMBER;} + +@header {package com.qq.tars.maven.parse;} + +start + : include_def* namespace_def + + -> ^( TARS_ROOT (include_def )* ( namespace_def )+ ) ; - - - - -start : - ( include_def )* ( namespace_def )+ ; - - - -include_def : - Taf_INCLUDE Taf_STRING_LITERAL ; - - - -namespace_def : - Taf_NAMESPACE Taf_IDENTIFIER LBRACE ( definition SEMI )+ RBRACE; - - - -definition : - ( const_def | - enum_def | - struct_def | - key_def | - interface_def -); - -const_def : - Taf_CONST type_primitive Taf_IDENTIFIER EQ v= const_initializer ; - - - -enum_def : - ( Taf_ENUM Taf_IDENTIFIER LBRACE Taf_IDENTIFIER ( COMMA Taf_IDENTIFIER )* ( COMMA )? RBRACE ); - - - - - -struct_def : - Taf_STRUCT Taf_IDENTIFIER LBRACE ( struct_member SEMI )+ RBRACE ; - - - -struct_member : - Taf_INTEGER_LITERAL (r= Taf_REQUIRE |r= Taf_OPTIONAL ) type Taf_IDENTIFIER ( EQ v= const_initializer )? ; - - - -key_def : - Taf_KEY LBRACKET n= Taf_IDENTIFIER ( COMMA k+= Taf_IDENTIFIER )+ RBRACKET ; - - - -interface_def : - Taf_INTERFACE Taf_IDENTIFIER LBRACE ( operation SEMI )+ RBRACE ; - - - -operation : - type Taf_IDENTIFIER LPAREN ( param ( COMMA param )* )? RPAREN ; - - - -param : - ( Taf_ROUTE_KEY )? ( Taf_OUT )? type Taf_IDENTIFIER ; - - - - - - - - - - - -type : - ( type_primitive | - type_vector | - type_map | - type_custom - ); - -type_primitive : - ( TAF_VOID); - -type_vector : Taf_VECTOR LT type GT ; -type_map : Taf_MAP LT type COMMA type GT ; -type_custom : ( Taf_IDENTIFIER ) ; -const_initializer : ( Taf_INTEGER_LITERAL | Taf_FLOATING_POINT_LITERAL | Taf_STRING_LITERAL | Taf_FALSE | Taf_TRUE ); - + +include_def + : TARS_INCLUDE TARS_STRING_LITERAL + -> ^( TARS_INCLUDE[$TARS_STRING_LITERAL.text] ) ; + + +namespace_def + : TARS_NAMESPACE TARS_IDENTIFIER LBRACE (definition SEMI)+ RBRACE + -> ^( TARS_NAMESPACE[$TARS_IDENTIFIER.text] ( definition )+ ) ; + + +definition + : const_def | + enum_def | + struct_def | + key_def | + interface_def +; + +const_def + : TARS_CONST type_primitive TARS_IDENTIFIER EQ v= const_initializer + -> ^( TARS_CONST[$TARS_IDENTIFIER.text, $v.text] type_primitive ) ; + + +enum_def + : TARS_ENUM n=TARS_IDENTIFIER LBRACE m+=TARS_IDENTIFIER (COMMA m+=TARS_IDENTIFIER)* COMMA? RBRACE + -> ^( TARS_ENUM[$n.text] ( $m)+ ) | + TARS_ENUM n=TARS_IDENTIFIER LBRACE m+=TARS_IDENTIFIER EQ v+=TARS_INTEGER_LITERAL (COMMA m+=TARS_IDENTIFIER EQ v+=TARS_INTEGER_LITERAL)* COMMA? RBRACE + -> ^( TARS_ENUM[$n.text] ( $m)+ ( $v)+ ); + + +struct_def + : TARS_STRUCT TARS_IDENTIFIER LBRACE (struct_member SEMI)+ RBRACE + -> ^( TARS_STRUCT[$TARS_IDENTIFIER.text] ( struct_member )+ ) ; + + +struct_member + : TARS_INTEGER_LITERAL (r= TARS_REQUIRE |r=TARS_OPTIONAL) type TARS_IDENTIFIER (EQ v= const_initializer )? + -> ^( TARS_STRUCT_MEMBER[$TARS_INTEGER_LITERAL.text, $r, $TARS_IDENTIFIER.text, $v.result] type ) ; + + +key_def + : TARS_KEY LBRACKET n=TARS_IDENTIFIER (COMMA k+= TARS_IDENTIFIER )+ RBRACKET + -> ^( TARS_KEY[$n.text] ( $k)+ ) ; + + +interface_def + : TARS_INTERFACE TARS_IDENTIFIER LBRACE (operation SEMI)+ RBRACE + -> ^( TARS_INTERFACE[$TARS_IDENTIFIER.text] ( operation )+ ) ; + + +operation + : type TARS_IDENTIFIER LPAREN (param (COMMA param )* )? RPAREN + -> ^( TARS_OPERATION[$TARS_IDENTIFIER.text] type ( param )* ); + + +param + : TARS_ROUTE_KEY? TARS_OUT? type TARS_IDENTIFIER + -> ^( TARS_PARAM[$TARS_IDENTIFIER.text, $TARS_OUT, $TARS_ROUTE_KEY] type ) ; + + +const_initializer returns [String result] + : (TARS_INTEGER_LITERAL | + TARS_FLOATING_POINT_LITERAL | + TARS_STRING_LITERAL | + TARS_FALSE | + TARS_TRUE); + + +type + : type_primitive | + type_vector | + type_map | + type_custom; + + +type_primitive + : TARS_VOID + -> ^( TARS_VOID ) | + TARS_BOOL + -> ^( TARS_BOOL ) | + TARS_BYTE + -> ^( TARS_BYTE ) | + TARS_SHORT + -> ^( TARS_SHORT ) | + TARS_INT + -> ^( TARS_INT ) | + TARS_LONG + -> ^( TARS_LONG ) | + TARS_FLOAT + -> ^( TARS_FLOAT ) | + TARS_DOUBLE + -> ^( TARS_DOUBLE ) | + TARS_STRING + -> ^( TARS_STRING ) | + TARS_UNSIGNED TARS_INT + -> ^( TARS_LONG ); + + +type_vector + : TARS_VECTOR LT type GT + -> ^( TARS_VECTOR type ) ; + + +type_map + : TARS_MAP LT type COMMA type GT + -> ^( TARS_MAP type type ) ; + + +type_custom + : TARS_IDENTIFIER + -> ^( TARS_MAP[$TARS_IDENTIFIER.text] ) | + ns= TARS_IDENTIFIER COLON COLON id= TARS_IDENTIFIER + -> ^( TARS_REF[$ns.text,$id.text] ) ; \ No newline at end of file diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g index a8a4d3c3..838438cc 100644 --- a/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g +++ b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g @@ -5,179 +5,179 @@ package com.qq.tars.maven.parse; } TARS_VOID -:( 'void' ); + : 'void'; TARS_STRUCT -:( 'struct' ); + : 'struct'; TARS_UNSIGNED -:( 'unsigned' ); + : 'unsigned'; TARS_BOOL -:( 'bool' ); + : 'bool'; TARS_BYTE -:( 'byte' ); + : 'byte'; TARS_SHORT -:( 'short' ); + : 'short'; TARS_INT -:( 'int' ); + : 'int'; TARS_DOUBLE -:( 'double' ); + : 'double'; TARS_FLOAT -:( 'float' ); + : 'float'; TARS_LONG -:( 'long' ); + : 'long' ; TARS_STRING -:( 'string' ); + : 'string' ; TARS_VECTOR -:( 'vector' ); + : 'vector' ; TARS_MAP -:( 'map' ); + : 'map' ; TARS_KEY -:( 'key' ); + : 'key' ; TARS_ROUTE_KEY -:( 'routekey' ); + : 'routekey' ; TARS_INCLUDE -:( '#include' ); + : '#include' ; TARS_NAMESPACE -:( 'module' ); + : 'module' ; TARS_INTERFACE -:( 'interface' ); + : 'interface' ; TARS_OUT -:( 'out' ); + : 'out' ; TARS_REQUIRE -:( 'require' ); + : 'require' ; TARS_OPTIONAL -:( 'optional' ); + : 'optional' ; TARS_FALSE -:( 'false' ); + : 'false' ; TARS_TRUE -:( 'true' ); + : 'true' ; TARS_ENUM -:( 'enum' ); + : 'enum' ; TARS_CONST -:( 'const' ); + : 'const' ; TARS_IDENTIFIER -: ( ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ); + : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ; TARS_INTEGER_LITERAL -: ( ('0X'|'0x')('0'..'9'|'a'..'f'|'A'..'F')+| + : ('0X'|'0x')('0'..'9'|'a'..'f'|'A'..'F')+| ('O'|'o')('0'..'7')+| - ('+'|'-')?('0'..'9')+ ); + ('+'|'-')?('0'..'9')+; TARS_FLOATING_POINT_LITERAL -: ( ('+'|'-')? ('0'..'9')+ '.' ('0'..'9')+); + : ('+'|'-')? ('0'..'9')+ '.' ('0'..'9')+; TARS_STRING_LITERAL -: ( '"' ( ESC_SEQ | ~ ( '\\' | '"' ) )* '"' ); + : '"' ( ESC_SEQ | ~ ( '\\' | '"' ) )* '"' ; LPAREN -: ( '(' ); + : '(' ; RPAREN -: ( ')' ); + : ')' ; LBRACE -: ( '{' ); + : '{' ; RBRACE -: ( '}' ); + : '}' ; LBRACKET -: ( '[' ); + : '[' ; RBRACKET -: ( ']' ); + : ']' ; SEMI -:( ';' ); + : ';' ; COMMA -:( ',' ); + : ',' ; QUOTE -:( '"' ); + : '"' ; DOT -:( '.' ); + : '.' ; COLON -:( ':' ); + : ':' ; EQ -:( '=' ); + : '=' ; GT -:( '>' ); + : '>' ; LT -:( '<' ); - - - + : '<' ; COMMENT -: ( '//' ~('\n'|'\r')* '\r'? '\n' | + @init{ + boolean isDoc = false; + } + : '//' ~('\n'|'\r')* '\r'? '\n' {skip();}| '/*' - - - - - - ( options {greedy=false; }:. )* '*/' {$channel=HIDDEN;}); - - - - - - - + { + if((char)input.LA(1) == '*'){ + isDoc = true; + } + } + ( options {greedy=false; }:. )* '*/' + { + if(isDoc==true){ + _channel=HIDDEN; + } else{ + skip(); + } + }; WS -: ( ' ' | '\t' | '\r' | '\n' ) {skip();} ; + : (' ' | '\t' | '\r' | '\n') {skip();} ; @@ -185,7 +185,7 @@ WS fragment HEX_DIGIT -: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ; + : ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ; fragment ESC_SEQ diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java index 3e9f6ca1..3e950b4e 100644 --- a/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java +++ b/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.java @@ -1,4 +1,17 @@ -// $ANTLR 3.5 TarsLexer.g 2022-05-07 16:50:45 +// $ANTLR 3.5.3 TarsLexer.g 2022-05-10 16:14:31 + + + + + + + + + + + + + package com.qq.tars.maven.parse; @@ -67,7 +80,7 @@ public Lexer[] getDelegates() { return new Lexer[] {}; } - public TarsLexer() {} + public TarsLexer() {} public TarsLexer(CharStream input) { this(input, new RecognizerSharedState()); } @@ -81,15 +94,10 @@ public final void mTARS_VOID() throws RecognitionException { try { int _type = TARS_VOID; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:8:2: ( ( 'void' ) ) - // TarsLexer.g:8:2: ( 'void' ) - { // TarsLexer.g:8:2: ( 'void' ) // TarsLexer.g:8:4: 'void' { - match("void"); - - } + match("void"); } @@ -107,15 +115,10 @@ public final void mTARS_STRUCT() throws RecognitionException { try { int _type = TARS_STRUCT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:11:2: ( ( 'struct' ) ) - // TarsLexer.g:11:2: ( 'struct' ) - { // TarsLexer.g:11:2: ( 'struct' ) // TarsLexer.g:11:4: 'struct' { - match("struct"); - - } + match("struct"); } @@ -133,15 +136,10 @@ public final void mTARS_UNSIGNED() throws RecognitionException { try { int _type = TARS_UNSIGNED; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:14:2: ( ( 'unsigned' ) ) - // TarsLexer.g:14:2: ( 'unsigned' ) - { // TarsLexer.g:14:2: ( 'unsigned' ) // TarsLexer.g:14:4: 'unsigned' { - match("unsigned"); - - } + match("unsigned"); } @@ -159,15 +157,10 @@ public final void mTARS_BOOL() throws RecognitionException { try { int _type = TARS_BOOL; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:17:2: ( ( 'bool' ) ) - // TarsLexer.g:17:2: ( 'bool' ) - { // TarsLexer.g:17:2: ( 'bool' ) // TarsLexer.g:17:4: 'bool' { - match("bool"); - - } + match("bool"); } @@ -185,15 +178,10 @@ public final void mTARS_BYTE() throws RecognitionException { try { int _type = TARS_BYTE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:20:2: ( ( 'byte' ) ) - // TarsLexer.g:20:2: ( 'byte' ) - { // TarsLexer.g:20:2: ( 'byte' ) // TarsLexer.g:20:4: 'byte' { - match("byte"); - - } + match("byte"); } @@ -211,15 +199,10 @@ public final void mTARS_SHORT() throws RecognitionException { try { int _type = TARS_SHORT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:23:2: ( ( 'short' ) ) - // TarsLexer.g:23:2: ( 'short' ) - { // TarsLexer.g:23:2: ( 'short' ) // TarsLexer.g:23:4: 'short' { - match("short"); - - } + match("short"); } @@ -237,15 +220,10 @@ public final void mTARS_INT() throws RecognitionException { try { int _type = TARS_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:26:2: ( ( 'int' ) ) - // TarsLexer.g:26:2: ( 'int' ) - { // TarsLexer.g:26:2: ( 'int' ) // TarsLexer.g:26:4: 'int' { - match("int"); - - } + match("int"); } @@ -263,15 +241,10 @@ public final void mTARS_DOUBLE() throws RecognitionException { try { int _type = TARS_DOUBLE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:29:2: ( ( 'double' ) ) - // TarsLexer.g:29:2: ( 'double' ) - { // TarsLexer.g:29:2: ( 'double' ) // TarsLexer.g:29:4: 'double' { - match("double"); - - } + match("double"); } @@ -289,15 +262,10 @@ public final void mTARS_FLOAT() throws RecognitionException { try { int _type = TARS_FLOAT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:32:2: ( ( 'float' ) ) - // TarsLexer.g:32:2: ( 'float' ) - { // TarsLexer.g:32:2: ( 'float' ) // TarsLexer.g:32:4: 'float' { - match("float"); - - } + match("float"); } @@ -315,15 +283,10 @@ public final void mTARS_LONG() throws RecognitionException { try { int _type = TARS_LONG; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:35:2: ( ( 'long' ) ) - // TarsLexer.g:35:2: ( 'long' ) - { // TarsLexer.g:35:2: ( 'long' ) // TarsLexer.g:35:4: 'long' { - match("long"); - - } + match("long"); } @@ -341,15 +304,10 @@ public final void mTARS_STRING() throws RecognitionException { try { int _type = TARS_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:38:2: ( ( 'string' ) ) - // TarsLexer.g:38:2: ( 'string' ) - { // TarsLexer.g:38:2: ( 'string' ) // TarsLexer.g:38:4: 'string' { - match("string"); - - } + match("string"); } @@ -367,15 +325,10 @@ public final void mTARS_VECTOR() throws RecognitionException { try { int _type = TARS_VECTOR; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:41:2: ( ( 'vector' ) ) - // TarsLexer.g:41:2: ( 'vector' ) - { // TarsLexer.g:41:2: ( 'vector' ) // TarsLexer.g:41:4: 'vector' { - match("vector"); - - } + match("vector"); } @@ -393,15 +346,10 @@ public final void mTARS_MAP() throws RecognitionException { try { int _type = TARS_MAP; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:44:2: ( ( 'map' ) ) - // TarsLexer.g:44:2: ( 'map' ) - { // TarsLexer.g:44:2: ( 'map' ) // TarsLexer.g:44:4: 'map' { - match("map"); - - } + match("map"); } @@ -419,15 +367,10 @@ public final void mTARS_KEY() throws RecognitionException { try { int _type = TARS_KEY; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:47:2: ( ( 'key' ) ) - // TarsLexer.g:47:2: ( 'key' ) - { // TarsLexer.g:47:2: ( 'key' ) // TarsLexer.g:47:4: 'key' { - match("key"); - - } + match("key"); } @@ -445,15 +388,10 @@ public final void mTARS_ROUTE_KEY() throws RecognitionException { try { int _type = TARS_ROUTE_KEY; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:50:2: ( ( 'routekey' ) ) - // TarsLexer.g:50:2: ( 'routekey' ) - { // TarsLexer.g:50:2: ( 'routekey' ) // TarsLexer.g:50:4: 'routekey' { - match("routekey"); - - } + match("routekey"); } @@ -471,15 +409,10 @@ public final void mTARS_INCLUDE() throws RecognitionException { try { int _type = TARS_INCLUDE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:53:2: ( ( '#include' ) ) - // TarsLexer.g:53:2: ( '#include' ) - { // TarsLexer.g:53:2: ( '#include' ) // TarsLexer.g:53:4: '#include' { - match("#include"); - - } + match("#include"); } @@ -497,15 +430,10 @@ public final void mTARS_NAMESPACE() throws RecognitionException { try { int _type = TARS_NAMESPACE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:56:2: ( ( 'module' ) ) - // TarsLexer.g:56:2: ( 'module' ) - { // TarsLexer.g:56:2: ( 'module' ) // TarsLexer.g:56:4: 'module' { - match("module"); - - } + match("module"); } @@ -523,15 +451,10 @@ public final void mTARS_INTERFACE() throws RecognitionException { try { int _type = TARS_INTERFACE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:59:2: ( ( 'interface' ) ) - // TarsLexer.g:59:2: ( 'interface' ) - { // TarsLexer.g:59:2: ( 'interface' ) // TarsLexer.g:59:4: 'interface' { - match("interface"); - - } + match("interface"); } @@ -549,15 +472,10 @@ public final void mTARS_OUT() throws RecognitionException { try { int _type = TARS_OUT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:62:2: ( ( 'out' ) ) - // TarsLexer.g:62:2: ( 'out' ) - { // TarsLexer.g:62:2: ( 'out' ) // TarsLexer.g:62:4: 'out' { - match("out"); - - } + match("out"); } @@ -575,15 +493,10 @@ public final void mTARS_REQUIRE() throws RecognitionException { try { int _type = TARS_REQUIRE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:65:2: ( ( 'require' ) ) - // TarsLexer.g:65:2: ( 'require' ) - { // TarsLexer.g:65:2: ( 'require' ) // TarsLexer.g:65:4: 'require' { - match("require"); - - } + match("require"); } @@ -601,15 +514,10 @@ public final void mTARS_OPTIONAL() throws RecognitionException { try { int _type = TARS_OPTIONAL; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:68:2: ( ( 'optional' ) ) - // TarsLexer.g:68:2: ( 'optional' ) - { // TarsLexer.g:68:2: ( 'optional' ) // TarsLexer.g:68:4: 'optional' { - match("optional"); - - } + match("optional"); } @@ -627,15 +535,10 @@ public final void mTARS_FALSE() throws RecognitionException { try { int _type = TARS_FALSE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:71:2: ( ( 'false' ) ) - // TarsLexer.g:71:2: ( 'false' ) - { // TarsLexer.g:71:2: ( 'false' ) // TarsLexer.g:71:4: 'false' { - match("false"); - - } + match("false"); } @@ -653,15 +556,10 @@ public final void mTARS_TRUE() throws RecognitionException { try { int _type = TARS_TRUE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:74:2: ( ( 'true' ) ) - // TarsLexer.g:74:2: ( 'true' ) - { // TarsLexer.g:74:2: ( 'true' ) // TarsLexer.g:74:4: 'true' { - match("true"); - - } + match("true"); } @@ -679,15 +577,10 @@ public final void mTARS_ENUM() throws RecognitionException { try { int _type = TARS_ENUM; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:77:2: ( ( 'enum' ) ) - // TarsLexer.g:77:2: ( 'enum' ) - { // TarsLexer.g:77:2: ( 'enum' ) // TarsLexer.g:77:4: 'enum' { - match("enum"); - - } + match("enum"); } @@ -705,15 +598,10 @@ public final void mTARS_CONST() throws RecognitionException { try { int _type = TARS_CONST; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:80:2: ( ( 'const' ) ) - // TarsLexer.g:80:2: ( 'const' ) - { // TarsLexer.g:80:2: ( 'const' ) // TarsLexer.g:80:4: 'const' { - match("const"); - - } + match("const"); } @@ -731,50 +619,45 @@ public final void mTARS_IDENTIFIER() throws RecognitionException { try { int _type = TARS_IDENTIFIER; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:85:5: ( ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) ) - // TarsLexer.g:85:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) - { // TarsLexer.g:85:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) // TarsLexer.g:85:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* { - if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - // TarsLexer.g:85:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* - loop1: - while (true) { - int alt1=2; - int LA1_0 = input.LA(1); - if ( ((LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||LA1_0=='_'||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) { - alt1=1; + if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); } - - switch (alt1) { - case 1 : - // TarsLexer.g: - { - if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + // TarsLexer.g:85:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* + loop1: + while (true) { + int alt1=2; + int LA1_0 = input.LA(1); + if ( ((LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||LA1_0=='_'||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) { + alt1=1; } - break; - default : - break loop1; - } - } + switch (alt1) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; - } + default : + break loop1; + } + } } @@ -792,55 +675,52 @@ public final void mTARS_INTEGER_LITERAL() throws RecognitionException { try { int _type = TARS_INTEGER_LITERAL; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:89:5: ( ( ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ | ( 'O' | 'o' ) ( '0' .. '7' )+ | ( '+' | '-' )? ( '0' .. '9' )+ ) ) - // TarsLexer.g:89:5: ( ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ | ( 'O' | 'o' ) ( '0' .. '7' )+ | ( '+' | '-' )? ( '0' .. '9' )+ ) - { // TarsLexer.g:89:5: ( ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ | ( 'O' | 'o' ) ( '0' .. '7' )+ | ( '+' | '-' )? ( '0' .. '9' )+ ) int alt7=3; switch ( input.LA(1) ) { - case '0': + case '0': { - int LA7_1 = input.LA(2); - if ( (LA7_1=='X'||LA7_1=='x') ) { - alt7=1; - } + int LA7_1 = input.LA(2); + if ( (LA7_1=='X'||LA7_1=='x') ) { + alt7=1; + } - else { - alt7=3; - } + else { + alt7=3; + } } break; - case 'O': - case 'o': + case 'O': + case 'o': { - alt7=2; + alt7=2; } break; - case '+': - case '-': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': + case '+': + case '-': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': { - alt7=3; + alt7=3; } break; - default: - NoViableAltException nvae = - new NoViableAltException("", 7, 0, input); - throw nvae; + default: + NoViableAltException nvae = + new NoViableAltException("", 7, 0, input); + throw nvae; } switch (alt7) { case 1 : // TarsLexer.g:89:7: ( '0X' | '0x' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ - { + { // TarsLexer.g:89:7: ( '0X' | '0x' ) int alt2=2; int LA2_0 = input.LA(1); @@ -858,7 +738,7 @@ else if ( (LA2_1=='x') ) { try { input.consume(); NoViableAltException nvae = - new NoViableAltException("", 2, 1, input); + new NoViableAltException("", 2, 1, input); throw nvae; } finally { input.rewind(nvaeMark); @@ -869,25 +749,25 @@ else if ( (LA2_1=='x') ) { else { NoViableAltException nvae = - new NoViableAltException("", 2, 0, input); + new NoViableAltException("", 2, 0, input); throw nvae; } switch (alt2) { case 1 : // TarsLexer.g:89:8: '0X' - { - match("0X"); + { + match("0X"); - } - break; + } + break; case 2 : // TarsLexer.g:89:13: '0x' - { - match("0x"); + { + match("0x"); - } - break; + } + break; } @@ -902,33 +782,33 @@ else if ( (LA2_1=='x') ) { } switch (alt3) { - case 1 : - // TarsLexer.g: + case 1 : + // TarsLexer.g: { - if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } } break; - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = new EarlyExitException(3, input); - throw eee; + default : + if ( cnt3 >= 1 ) break loop3; + EarlyExitException eee = new EarlyExitException(3, input); + throw eee; } cnt3++; } - } - break; + } + break; case 2 : // TarsLexer.g:90:7: ( 'O' | 'o' ) ( '0' .. '7' )+ - { + { if ( input.LA(1)=='O'||input.LA(1)=='o' ) { input.consume(); } @@ -948,33 +828,33 @@ else if ( (LA2_1=='x') ) { } switch (alt4) { - case 1 : - // TarsLexer.g: + case 1 : + // TarsLexer.g: { - if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } } break; - default : - if ( cnt4 >= 1 ) break loop4; - EarlyExitException eee = new EarlyExitException(4, input); - throw eee; + default : + if ( cnt4 >= 1 ) break loop4; + EarlyExitException eee = new EarlyExitException(4, input); + throw eee; } cnt4++; } - } - break; + } + break; case 3 : // TarsLexer.g:91:7: ( '+' | '-' )? ( '0' .. '9' )+ - { + { // TarsLexer.g:91:7: ( '+' | '-' )? int alt5=2; int LA5_0 = input.LA(1); @@ -984,7 +864,7 @@ else if ( (LA2_1=='x') ) { switch (alt5) { case 1 : // TarsLexer.g: - { + { if ( input.LA(1)=='+'||input.LA(1)=='-' ) { input.consume(); } @@ -993,8 +873,8 @@ else if ( (LA2_1=='x') ) { recover(mse); throw mse; } - } - break; + } + break; } @@ -1009,35 +889,32 @@ else if ( (LA2_1=='x') ) { } switch (alt6) { - case 1 : - // TarsLexer.g: + case 1 : + // TarsLexer.g: { - if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } } break; - default : - if ( cnt6 >= 1 ) break loop6; - EarlyExitException eee = new EarlyExitException(6, input); - throw eee; + default : + if ( cnt6 >= 1 ) break loop6; + EarlyExitException eee = new EarlyExitException(6, input); + throw eee; } cnt6++; } - } - break; - - } + } + break; } - state.type = _type; state.channel = _channel; } @@ -1052,103 +929,98 @@ public final void mTARS_FLOATING_POINT_LITERAL() throws RecognitionException { try { int _type = TARS_FLOATING_POINT_LITERAL; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:95:5: ( ( ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ) ) - // TarsLexer.g:95:5: ( ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ) - { // TarsLexer.g:95:5: ( ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ) // TarsLexer.g:95:9: ( '+' | '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ { - // TarsLexer.g:95:9: ( '+' | '-' )? - int alt8=2; - int LA8_0 = input.LA(1); - if ( (LA8_0=='+'||LA8_0=='-') ) { - alt8=1; - } - switch (alt8) { - case 1 : - // TarsLexer.g: + // TarsLexer.g:95:9: ( '+' | '-' )? + int alt8=2; + int LA8_0 = input.LA(1); + if ( (LA8_0=='+'||LA8_0=='-') ) { + alt8=1; + } + switch (alt8) { + case 1 : + // TarsLexer.g: { - if ( input.LA(1)=='+'||input.LA(1)=='-' ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + if ( input.LA(1)=='+'||input.LA(1)=='-' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } } break; - } - - // TarsLexer.g:95:20: ( '0' .. '9' )+ - int cnt9=0; - loop9: - while (true) { - int alt9=2; - int LA9_0 = input.LA(1); - if ( ((LA9_0 >= '0' && LA9_0 <= '9')) ) { - alt9=1; } - switch (alt9) { - case 1 : - // TarsLexer.g: - { - if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + // TarsLexer.g:95:20: ( '0' .. '9' )+ + int cnt9=0; + loop9: + while (true) { + int alt9=2; + int LA9_0 = input.LA(1); + if ( ((LA9_0 >= '0' && LA9_0 <= '9')) ) { + alt9=1; } - break; - default : - if ( cnt9 >= 1 ) break loop9; - EarlyExitException eee = new EarlyExitException(9, input); - throw eee; - } - cnt9++; - } - - match('.'); - // TarsLexer.g:95:36: ( '0' .. '9' )+ - int cnt10=0; - loop10: - while (true) { - int alt10=2; - int LA10_0 = input.LA(1); - if ( ((LA10_0 >= '0' && LA10_0 <= '9')) ) { - alt10=1; - } + switch (alt9) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; - switch (alt10) { - case 1 : - // TarsLexer.g: - { - if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; + default : + if ( cnt9 >= 1 ) break loop9; + EarlyExitException eee = new EarlyExitException(9, input); + throw eee; } + cnt9++; + } + + match('.'); + // TarsLexer.g:95:36: ( '0' .. '9' )+ + int cnt10=0; + loop10: + while (true) { + int alt10=2; + int LA10_0 = input.LA(1); + if ( ((LA10_0 >= '0' && LA10_0 <= '9')) ) { + alt10=1; } - break; - default : - if ( cnt10 >= 1 ) break loop10; - EarlyExitException eee = new EarlyExitException(10, input); - throw eee; - } - cnt10++; - } + switch (alt10) { + case 1 : + // TarsLexer.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; - } + default : + if ( cnt10 >= 1 ) break loop10; + EarlyExitException eee = new EarlyExitException(10, input); + throw eee; + } + cnt10++; + } } @@ -1166,55 +1038,50 @@ public final void mTARS_STRING_LITERAL() throws RecognitionException { try { int _type = TARS_STRING_LITERAL; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:99:5: ( ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' ) ) - // TarsLexer.g:99:5: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' ) - { // TarsLexer.g:99:5: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' ) // TarsLexer.g:99:7: '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' { - match('\"'); - // TarsLexer.g:99:11: ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* - loop11: - while (true) { - int alt11=3; - int LA11_0 = input.LA(1); - if ( (LA11_0=='\\') ) { - alt11=1; - } - else if ( ((LA11_0 >= '\u0000' && LA11_0 <= '!')||(LA11_0 >= '#' && LA11_0 <= '[')||(LA11_0 >= ']' && LA11_0 <= '\uFFFF')) ) { - alt11=2; - } - - switch (alt11) { - case 1 : - // TarsLexer.g:99:13: ESC_SEQ - { - mESC_SEQ(); - + match('\"'); + // TarsLexer.g:99:11: ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* + loop11: + while (true) { + int alt11=3; + int LA11_0 = input.LA(1); + if ( (LA11_0=='\\') ) { + alt11=1; } - break; - case 2 : - // TarsLexer.g:99:23: ~ ( '\\\\' | '\"' ) - { - if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) { - input.consume(); + else if ( ((LA11_0 >= '\u0000' && LA11_0 <= '!')||(LA11_0 >= '#' && LA11_0 <= '[')||(LA11_0 >= ']' && LA11_0 <= '\uFFFF')) ) { + alt11=2; } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - } - break; - default : - break loop11; - } - } + switch (alt11) { + case 1 : + // TarsLexer.g:99:13: ESC_SEQ + { + mESC_SEQ(); - match('\"'); - } + } + break; + case 2 : + // TarsLexer.g:99:23: ~ ( '\\\\' | '\"' ) + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + default : + break loop11; + } + } + + match('\"'); } state.type = _type; @@ -1231,15 +1098,10 @@ public final void mLPAREN() throws RecognitionException { try { int _type = LPAREN; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:103:5: ( ( '(' ) ) - // TarsLexer.g:103:5: ( '(' ) - { // TarsLexer.g:103:5: ( '(' ) // TarsLexer.g:103:9: '(' { - match('('); - } - + match('('); } state.type = _type; @@ -1256,15 +1118,10 @@ public final void mRPAREN() throws RecognitionException { try { int _type = RPAREN; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:107:5: ( ( ')' ) ) - // TarsLexer.g:107:5: ( ')' ) - { // TarsLexer.g:107:5: ( ')' ) // TarsLexer.g:107:9: ')' { - match(')'); - } - + match(')'); } state.type = _type; @@ -1281,15 +1138,10 @@ public final void mLBRACE() throws RecognitionException { try { int _type = LBRACE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:111:5: ( ( '{' ) ) - // TarsLexer.g:111:5: ( '{' ) - { // TarsLexer.g:111:5: ( '{' ) // TarsLexer.g:111:9: '{' { - match('{'); - } - + match('{'); } state.type = _type; @@ -1306,15 +1158,10 @@ public final void mRBRACE() throws RecognitionException { try { int _type = RBRACE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:115:5: ( ( '}' ) ) - // TarsLexer.g:115:5: ( '}' ) - { // TarsLexer.g:115:5: ( '}' ) // TarsLexer.g:115:9: '}' { - match('}'); - } - + match('}'); } state.type = _type; @@ -1331,15 +1178,10 @@ public final void mLBRACKET() throws RecognitionException { try { int _type = LBRACKET; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:119:5: ( ( '[' ) ) - // TarsLexer.g:119:5: ( '[' ) - { // TarsLexer.g:119:5: ( '[' ) // TarsLexer.g:119:9: '[' { - match('['); - } - + match('['); } state.type = _type; @@ -1356,15 +1198,10 @@ public final void mRBRACKET() throws RecognitionException { try { int _type = RBRACKET; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:123:5: ( ( ']' ) ) - // TarsLexer.g:123:5: ( ']' ) - { // TarsLexer.g:123:5: ( ']' ) // TarsLexer.g:123:9: ']' { - match(']'); - } - + match(']'); } state.type = _type; @@ -1381,15 +1218,10 @@ public final void mSEMI() throws RecognitionException { try { int _type = SEMI; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:127:2: ( ( ';' ) ) - // TarsLexer.g:127:2: ( ';' ) - { // TarsLexer.g:127:2: ( ';' ) // TarsLexer.g:127:4: ';' { - match(';'); - } - + match(';'); } state.type = _type; @@ -1406,15 +1238,10 @@ public final void mCOMMA() throws RecognitionException { try { int _type = COMMA; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:131:2: ( ( ',' ) ) - // TarsLexer.g:131:2: ( ',' ) - { // TarsLexer.g:131:2: ( ',' ) // TarsLexer.g:131:4: ',' { - match(','); - } - + match(','); } state.type = _type; @@ -1431,15 +1258,10 @@ public final void mQUOTE() throws RecognitionException { try { int _type = QUOTE; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:135:2: ( ( '\"' ) ) - // TarsLexer.g:135:2: ( '\"' ) - { // TarsLexer.g:135:2: ( '\"' ) // TarsLexer.g:135:4: '\"' { - match('\"'); - } - + match('\"'); } state.type = _type; @@ -1456,15 +1278,10 @@ public final void mDOT() throws RecognitionException { try { int _type = DOT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:139:2: ( ( '.' ) ) - // TarsLexer.g:139:2: ( '.' ) - { // TarsLexer.g:139:2: ( '.' ) // TarsLexer.g:139:4: '.' { - match('.'); - } - + match('.'); } state.type = _type; @@ -1481,15 +1298,10 @@ public final void mCOLON() throws RecognitionException { try { int _type = COLON; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:143:2: ( ( ':' ) ) - // TarsLexer.g:143:2: ( ':' ) - { - // TarsLexer.g:143:2: ( ':' ) - // TarsLexer.g:143:4: ':' + // TarsLexer.g:143:5: ( ':' ) + // TarsLexer.g:143:9: ':' { - match(':'); - } - + match(':'); } state.type = _type; @@ -1506,15 +1318,10 @@ public final void mEQ() throws RecognitionException { try { int _type = EQ; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:147:2: ( ( '=' ) ) - // TarsLexer.g:147:2: ( '=' ) - { // TarsLexer.g:147:2: ( '=' ) // TarsLexer.g:147:4: '=' { - match('='); - } - + match('='); } state.type = _type; @@ -1531,15 +1338,10 @@ public final void mGT() throws RecognitionException { try { int _type = GT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:151:2: ( ( '>' ) ) - // TarsLexer.g:151:2: ( '>' ) - { // TarsLexer.g:151:2: ( '>' ) // TarsLexer.g:151:4: '>' { - match('>'); - } - + match('>'); } state.type = _type; @@ -1556,15 +1358,10 @@ public final void mLT() throws RecognitionException { try { int _type = LT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:155:2: ( ( '<' ) ) - // TarsLexer.g:155:2: ( '<' ) - { // TarsLexer.g:155:2: ( '<' ) // TarsLexer.g:155:4: '<' { - match('<'); - } - + match('<'); } state.type = _type; @@ -1581,9 +1378,9 @@ public final void mCOMMENT() throws RecognitionException { try { int _type = COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // TarsLexer.g:162:5: ( ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' ) ) - // TarsLexer.g:162:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' ) - { + + boolean isDoc = false; + // TarsLexer.g:162:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' ) int alt15=2; int LA15_0 = input.LA(1); @@ -1601,7 +1398,7 @@ else if ( (LA15_1=='*') ) { try { input.consume(); NoViableAltException nvae = - new NoViableAltException("", 15, 1, input); + new NoViableAltException("", 15, 1, input); throw nvae; } finally { input.rewind(nvaeMark); @@ -1612,15 +1409,15 @@ else if ( (LA15_1=='*') ) { else { NoViableAltException nvae = - new NoViableAltException("", 15, 0, input); + new NoViableAltException("", 15, 0, input); throw nvae; } switch (alt15) { case 1 : // TarsLexer.g:162:9: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' - { - match("//"); + { + match("//"); // TarsLexer.g:162:14: (~ ( '\\n' | '\\r' ) )* loop12: @@ -1632,22 +1429,22 @@ else if ( (LA15_1=='*') ) { } switch (alt12) { - case 1 : - // TarsLexer.g: + case 1 : + // TarsLexer.g: { - if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\f')||(input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\f')||(input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } } break; - default : - break loop12; + default : + break loop12; } } @@ -1660,20 +1457,26 @@ else if ( (LA15_1=='*') ) { switch (alt13) { case 1 : // TarsLexer.g:162:28: '\\r' - { - match('\r'); - } - break; + { + match('\r'); + } + break; } - match('\n'); - } - break; + match('\n'); + skip(); + } + break; case 2 : // TarsLexer.g:163:9: '/*' ( options {greedy=false; } : . )* '*/' - { - match("/*"); + { + match("/*"); + + + if((char)input.LA(1) == '*'){ + isDoc = true; + } // TarsLexer.g:169:9: ( options {greedy=false; } : . )* loop14: @@ -1695,28 +1498,31 @@ else if ( ((LA14_0 >= '\u0000' && LA14_0 <= ')')||(LA14_0 >= '+' && LA14_0 <= '\ } switch (alt14) { - case 1 : - // TarsLexer.g:169:36: . + case 1 : + // TarsLexer.g:169:36: . { - matchAny(); + matchAny(); } break; - default : - break loop14; + default : + break loop14; } } - match("*/"); + match("*/"); + - _channel=HIDDEN; + if(isDoc==true){ + _channel=HIDDEN; + } else{ + skip(); } - break; - } + } + break; } - state.type = _type; state.channel = _channel; } @@ -1732,17 +1538,17 @@ public final void mWS() throws RecognitionException { int _type = WS; int _channel = DEFAULT_TOKEN_CHANNEL; // TarsLexer.g:180:5: ( ( ' ' | '\\t' | '\\r' | '\\n' ) ) - // TarsLexer.g:180:5: ( ' ' | '\\t' | '\\r' | '\\n' ) + // TarsLexer.g:180:9: ( ' ' | '\\t' | '\\r' | '\\n' ) { - if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } - skip(); + if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + skip(); } state.type = _type; @@ -1760,14 +1566,14 @@ public final void mHEX_DIGIT() throws RecognitionException { // TarsLexer.g:188:11: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ) // TarsLexer.g: { - if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { - input.consume(); - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse; - } + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } } } @@ -1785,59 +1591,59 @@ public final void mESC_SEQ() throws RecognitionException { int LA16_0 = input.LA(1); if ( (LA16_0=='\\') ) { switch ( input.LA(2) ) { - case '\"': - case '\'': - case '\\': - case 'b': - case 'f': - case 'n': - case 'r': - case 't': + case '\"': + case '\'': + case '\\': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': { - alt16=1; + alt16=1; } break; - case 'u': + case 'u': { - alt16=2; + alt16=2; } break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': { - alt16=3; + alt16=3; } break; - default: - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 16, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } + default: + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 16, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } } } else { NoViableAltException nvae = - new NoViableAltException("", 16, 0, input); + new NoViableAltException("", 16, 0, input); throw nvae; } switch (alt16) { case 1 : // TarsLexer.g:192:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) - { - match('\\'); + { + match('\\'); if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) { input.consume(); } @@ -1846,22 +1652,22 @@ public final void mESC_SEQ() throws RecognitionException { recover(mse); throw mse; } - } - break; + } + break; case 2 : // TarsLexer.g:193:9: UNICODE_ESC - { - mUNICODE_ESC(); + { + mUNICODE_ESC(); - } - break; + } + break; case 3 : // TarsLexer.g:194:9: OCTAL_ESC - { - mOCTAL_ESC(); + { + mOCTAL_ESC(); - } - break; + } + break; } } @@ -1915,7 +1721,7 @@ else if ( ((LA17_1 >= '4' && LA17_1 <= '7')) ) { try { input.consume(); NoViableAltException nvae = - new NoViableAltException("", 17, 1, input); + new NoViableAltException("", 17, 1, input); throw nvae; } finally { input.rewind(nvaeMark); @@ -1926,15 +1732,15 @@ else if ( ((LA17_1 >= '4' && LA17_1 <= '7')) ) { else { NoViableAltException nvae = - new NoViableAltException("", 17, 0, input); + new NoViableAltException("", 17, 0, input); throw nvae; } switch (alt17) { case 1 : // TarsLexer.g:199:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) - { - match('\\'); + { + match('\\'); if ( (input.LA(1) >= '0' && input.LA(1) <= '3') ) { input.consume(); } @@ -1959,12 +1765,12 @@ else if ( ((LA17_1 >= '4' && LA17_1 <= '7')) ) { recover(mse); throw mse; } - } - break; + } + break; case 2 : // TarsLexer.g:200:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) - { - match('\\'); + { + match('\\'); if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { input.consume(); } @@ -1981,12 +1787,12 @@ else if ( ((LA17_1 >= '4' && LA17_1 <= '7')) ) { recover(mse); throw mse; } - } - break; + } + break; case 3 : // TarsLexer.g:201:9: '\\\\' ( '0' .. '7' ) - { - match('\\'); + { + match('\\'); if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) { input.consume(); } @@ -1995,8 +1801,8 @@ else if ( ((LA17_1 >= '4' && LA17_1 <= '7')) ) { recover(mse); throw mse; } - } - break; + } + break; } } @@ -2012,15 +1818,15 @@ public final void mUNICODE_ESC() throws RecognitionException { // TarsLexer.g:206:5: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ) // TarsLexer.g:206:9: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT { - match('\\'); - match('u'); - mHEX_DIGIT(); + match('\\'); + match('u'); + mHEX_DIGIT(); - mHEX_DIGIT(); + mHEX_DIGIT(); - mHEX_DIGIT(); + mHEX_DIGIT(); - mHEX_DIGIT(); + mHEX_DIGIT(); } @@ -2039,319 +1845,319 @@ public void mTokens() throws RecognitionException { switch (alt18) { case 1 : // TarsLexer.g:1:10: TARS_VOID - { - mTARS_VOID(); + { + mTARS_VOID(); - } - break; + } + break; case 2 : // TarsLexer.g:1:20: TARS_STRUCT - { - mTARS_STRUCT(); + { + mTARS_STRUCT(); - } - break; + } + break; case 3 : // TarsLexer.g:1:32: TARS_UNSIGNED - { - mTARS_UNSIGNED(); + { + mTARS_UNSIGNED(); - } - break; + } + break; case 4 : // TarsLexer.g:1:46: TARS_BOOL - { - mTARS_BOOL(); + { + mTARS_BOOL(); - } - break; + } + break; case 5 : // TarsLexer.g:1:56: TARS_BYTE - { - mTARS_BYTE(); + { + mTARS_BYTE(); - } - break; + } + break; case 6 : // TarsLexer.g:1:66: TARS_SHORT - { - mTARS_SHORT(); + { + mTARS_SHORT(); - } - break; + } + break; case 7 : // TarsLexer.g:1:77: TARS_INT - { - mTARS_INT(); + { + mTARS_INT(); - } - break; + } + break; case 8 : // TarsLexer.g:1:86: TARS_DOUBLE - { - mTARS_DOUBLE(); + { + mTARS_DOUBLE(); - } - break; + } + break; case 9 : // TarsLexer.g:1:98: TARS_FLOAT - { - mTARS_FLOAT(); + { + mTARS_FLOAT(); - } - break; + } + break; case 10 : // TarsLexer.g:1:109: TARS_LONG - { - mTARS_LONG(); + { + mTARS_LONG(); - } - break; + } + break; case 11 : // TarsLexer.g:1:119: TARS_STRING - { - mTARS_STRING(); + { + mTARS_STRING(); - } - break; + } + break; case 12 : // TarsLexer.g:1:131: TARS_VECTOR - { - mTARS_VECTOR(); + { + mTARS_VECTOR(); - } - break; + } + break; case 13 : // TarsLexer.g:1:143: TARS_MAP - { - mTARS_MAP(); + { + mTARS_MAP(); - } - break; + } + break; case 14 : // TarsLexer.g:1:152: TARS_KEY - { - mTARS_KEY(); + { + mTARS_KEY(); - } - break; + } + break; case 15 : // TarsLexer.g:1:161: TARS_ROUTE_KEY - { - mTARS_ROUTE_KEY(); + { + mTARS_ROUTE_KEY(); - } - break; + } + break; case 16 : // TarsLexer.g:1:176: TARS_INCLUDE - { - mTARS_INCLUDE(); + { + mTARS_INCLUDE(); - } - break; + } + break; case 17 : // TarsLexer.g:1:189: TARS_NAMESPACE - { - mTARS_NAMESPACE(); + { + mTARS_NAMESPACE(); - } - break; + } + break; case 18 : // TarsLexer.g:1:204: TARS_INTERFACE - { - mTARS_INTERFACE(); + { + mTARS_INTERFACE(); - } - break; + } + break; case 19 : // TarsLexer.g:1:219: TARS_OUT - { - mTARS_OUT(); + { + mTARS_OUT(); - } - break; + } + break; case 20 : // TarsLexer.g:1:228: TARS_REQUIRE - { - mTARS_REQUIRE(); + { + mTARS_REQUIRE(); - } - break; + } + break; case 21 : // TarsLexer.g:1:241: TARS_OPTIONAL - { - mTARS_OPTIONAL(); + { + mTARS_OPTIONAL(); - } - break; + } + break; case 22 : // TarsLexer.g:1:255: TARS_FALSE - { - mTARS_FALSE(); + { + mTARS_FALSE(); - } - break; + } + break; case 23 : // TarsLexer.g:1:266: TARS_TRUE - { - mTARS_TRUE(); + { + mTARS_TRUE(); - } - break; + } + break; case 24 : // TarsLexer.g:1:276: TARS_ENUM - { - mTARS_ENUM(); + { + mTARS_ENUM(); - } - break; + } + break; case 25 : // TarsLexer.g:1:286: TARS_CONST - { - mTARS_CONST(); + { + mTARS_CONST(); - } - break; + } + break; case 26 : // TarsLexer.g:1:297: TARS_IDENTIFIER - { - mTARS_IDENTIFIER(); + { + mTARS_IDENTIFIER(); - } - break; + } + break; case 27 : // TarsLexer.g:1:313: TARS_INTEGER_LITERAL - { - mTARS_INTEGER_LITERAL(); + { + mTARS_INTEGER_LITERAL(); - } - break; + } + break; case 28 : // TarsLexer.g:1:334: TARS_FLOATING_POINT_LITERAL - { - mTARS_FLOATING_POINT_LITERAL(); + { + mTARS_FLOATING_POINT_LITERAL(); - } - break; + } + break; case 29 : // TarsLexer.g:1:362: TARS_STRING_LITERAL - { - mTARS_STRING_LITERAL(); + { + mTARS_STRING_LITERAL(); - } - break; + } + break; case 30 : // TarsLexer.g:1:382: LPAREN - { - mLPAREN(); + { + mLPAREN(); - } - break; + } + break; case 31 : // TarsLexer.g:1:389: RPAREN - { - mRPAREN(); + { + mRPAREN(); - } - break; + } + break; case 32 : // TarsLexer.g:1:396: LBRACE - { - mLBRACE(); + { + mLBRACE(); - } - break; + } + break; case 33 : // TarsLexer.g:1:403: RBRACE - { - mRBRACE(); + { + mRBRACE(); - } - break; + } + break; case 34 : // TarsLexer.g:1:410: LBRACKET - { - mLBRACKET(); + { + mLBRACKET(); - } - break; + } + break; case 35 : // TarsLexer.g:1:419: RBRACKET - { - mRBRACKET(); + { + mRBRACKET(); - } - break; + } + break; case 36 : // TarsLexer.g:1:428: SEMI - { - mSEMI(); + { + mSEMI(); - } - break; + } + break; case 37 : // TarsLexer.g:1:433: COMMA - { - mCOMMA(); + { + mCOMMA(); - } - break; + } + break; case 38 : // TarsLexer.g:1:439: QUOTE - { - mQUOTE(); + { + mQUOTE(); - } - break; + } + break; case 39 : // TarsLexer.g:1:445: DOT - { - mDOT(); + { + mDOT(); - } - break; + } + break; case 40 : // TarsLexer.g:1:449: COLON - { - mCOLON(); + { + mCOLON(); - } - break; + } + break; case 41 : // TarsLexer.g:1:455: EQ - { - mEQ(); + { + mEQ(); - } - break; + } + break; case 42 : // TarsLexer.g:1:458: GT - { - mGT(); + { + mGT(); - } - break; + } + break; case 43 : // TarsLexer.g:1:461: LT - { - mLT(); + { + mLT(); - } - break; + } + break; case 44 : // TarsLexer.g:1:464: COMMENT - { - mCOMMENT(); + { + mCOMMENT(); - } - break; + } + break; case 45 : // TarsLexer.g:1:472: WS - { - mWS(); + { + mWS(); - } - break; + } + break; } } @@ -2359,56 +2165,56 @@ public void mTokens() throws RecognitionException { protected DFA18 dfa18 = new DFA18(this); static final String DFA18_eotS = - "\1\uffff\13\23\1\uffff\5\23\1\75\2\uffff\1\75\1\100\17\uffff\27\23\4\uffff"+ - "\7\23\1\140\4\23\1\145\1\23\1\147\2\23\1\152\4\23\1\157\5\23\1\165\1\166"+ - "\1\23\1\uffff\3\23\1\173\1\uffff\1\23\1\uffff\2\23\1\uffff\1\23\1\u0080"+ - "\1\u0081\1\23\1\uffff\3\23\1\u0086\1\23\2\uffff\2\23\1\u008a\1\u008b\1"+ - "\uffff\4\23\2\uffff\1\u0090\1\u0091\1\u0092\1\u0093\1\uffff\2\23\1\u0096"+ - "\2\uffff\1\u0097\3\23\4\uffff\2\23\2\uffff\1\23\1\u009e\1\23\1\u00a0\1"+ - "\23\1\u00a2\1\uffff\1\u00a3\1\uffff\1\u00a4\3\uffff"; + "\1\uffff\13\23\1\uffff\5\23\1\75\2\uffff\1\75\1\100\17\uffff\27\23\4\uffff"+ + "\7\23\1\140\4\23\1\145\1\23\1\147\2\23\1\152\4\23\1\157\5\23\1\165\1\166"+ + "\1\23\1\uffff\3\23\1\173\1\uffff\1\23\1\uffff\2\23\1\uffff\1\23\1\u0080"+ + "\1\u0081\1\23\1\uffff\3\23\1\u0086\1\23\2\uffff\2\23\1\u008a\1\u008b\1"+ + "\uffff\4\23\2\uffff\1\u0090\1\u0091\1\u0092\1\u0093\1\uffff\2\23\1\u0096"+ + "\2\uffff\1\u0097\3\23\4\uffff\2\23\2\uffff\1\23\1\u009e\1\23\1\u00a0\1"+ + "\23\1\u00a2\1\uffff\1\u00a3\1\uffff\1\u00a4\3\uffff"; static final String DFA18_eofS = - "\u00a5\uffff"; + "\u00a5\uffff"; static final String DFA18_minS = - "\1\11\1\145\1\150\1\156\1\157\1\156\1\157\1\141\1\157\1\141\2\145\1\uffff"+ - "\1\60\1\162\1\156\1\157\1\60\1\56\1\uffff\1\60\1\56\1\0\17\uffff\1\151"+ - "\1\143\1\162\1\157\1\163\1\157\2\164\1\165\1\157\1\154\1\156\1\160\1\144"+ - "\1\171\1\165\1\161\2\164\1\60\2\165\1\156\4\uffff\1\144\1\164\1\151\1"+ - "\162\1\151\1\154\1\145\1\60\1\142\1\141\1\163\1\147\1\60\1\165\1\60\1"+ - "\164\1\165\1\60\1\151\1\145\1\155\1\163\1\60\1\157\1\143\1\156\1\164\1"+ - "\147\2\60\1\162\1\uffff\1\154\1\164\1\145\1\60\1\uffff\1\154\1\uffff\1"+ - "\145\1\151\1\uffff\1\157\2\60\1\164\1\uffff\1\162\1\164\1\147\1\60\1\156"+ - "\2\uffff\1\146\1\145\2\60\1\uffff\1\145\1\153\1\162\1\156\2\uffff\4\60"+ - "\1\uffff\1\145\1\141\1\60\2\uffff\1\60\2\145\1\141\4\uffff\1\144\1\143"+ - "\2\uffff\1\171\1\60\1\154\1\60\1\145\1\60\1\uffff\1\60\1\uffff\1\60\3"+ - "\uffff"; + "\1\11\1\145\1\150\1\156\1\157\1\156\1\157\1\141\1\157\1\141\2\145\1\uffff"+ + "\1\60\1\162\1\156\1\157\1\60\1\56\1\uffff\1\60\1\56\1\0\17\uffff\1\151"+ + "\1\143\1\162\1\157\1\163\1\157\2\164\1\165\1\157\1\154\1\156\1\160\1\144"+ + "\1\171\1\165\1\161\2\164\1\60\2\165\1\156\4\uffff\1\144\1\164\1\151\1"+ + "\162\1\151\1\154\1\145\1\60\1\142\1\141\1\163\1\147\1\60\1\165\1\60\1"+ + "\164\1\165\1\60\1\151\1\145\1\155\1\163\1\60\1\157\1\143\1\156\1\164\1"+ + "\147\2\60\1\162\1\uffff\1\154\1\164\1\145\1\60\1\uffff\1\154\1\uffff\1"+ + "\145\1\151\1\uffff\1\157\2\60\1\164\1\uffff\1\162\1\164\1\147\1\60\1\156"+ + "\2\uffff\1\146\1\145\2\60\1\uffff\1\145\1\153\1\162\1\156\2\uffff\4\60"+ + "\1\uffff\1\145\1\141\1\60\2\uffff\1\60\2\145\1\141\4\uffff\1\144\1\143"+ + "\2\uffff\1\171\1\60\1\154\1\60\1\145\1\60\1\uffff\1\60\1\uffff\1\60\3"+ + "\uffff"; static final String DFA18_maxS = - "\1\175\1\157\1\164\1\156\1\171\1\156\1\157\1\154\2\157\1\145\1\157\1\uffff"+ - "\1\165\1\162\1\156\1\157\1\67\1\71\1\uffff\2\71\1\uffff\17\uffff\1\151"+ - "\1\143\1\162\1\157\1\163\1\157\2\164\1\165\1\157\1\154\1\156\1\160\1\144"+ - "\1\171\1\165\1\161\2\164\1\67\2\165\1\156\4\uffff\1\144\1\164\1\165\1"+ - "\162\1\151\1\154\1\145\1\172\1\142\1\141\1\163\1\147\1\172\1\165\1\172"+ - "\1\164\1\165\1\172\1\151\1\145\1\155\1\163\1\172\1\157\1\143\1\156\1\164"+ - "\1\147\2\172\1\162\1\uffff\1\154\1\164\1\145\1\172\1\uffff\1\154\1\uffff"+ - "\1\145\1\151\1\uffff\1\157\2\172\1\164\1\uffff\1\162\1\164\1\147\1\172"+ - "\1\156\2\uffff\1\146\1\145\2\172\1\uffff\1\145\1\153\1\162\1\156\2\uffff"+ - "\4\172\1\uffff\1\145\1\141\1\172\2\uffff\1\172\2\145\1\141\4\uffff\1\144"+ - "\1\143\2\uffff\1\171\1\172\1\154\1\172\1\145\1\172\1\uffff\1\172\1\uffff"+ - "\1\172\3\uffff"; + "\1\175\1\157\1\164\1\156\1\171\1\156\1\157\1\154\2\157\1\145\1\157\1\uffff"+ + "\1\165\1\162\1\156\1\157\1\67\1\71\1\uffff\2\71\1\uffff\17\uffff\1\151"+ + "\1\143\1\162\1\157\1\163\1\157\2\164\1\165\1\157\1\154\1\156\1\160\1\144"+ + "\1\171\1\165\1\161\2\164\1\67\2\165\1\156\4\uffff\1\144\1\164\1\165\1"+ + "\162\1\151\1\154\1\145\1\172\1\142\1\141\1\163\1\147\1\172\1\165\1\172"+ + "\1\164\1\165\1\172\1\151\1\145\1\155\1\163\1\172\1\157\1\143\1\156\1\164"+ + "\1\147\2\172\1\162\1\uffff\1\154\1\164\1\145\1\172\1\uffff\1\154\1\uffff"+ + "\1\145\1\151\1\uffff\1\157\2\172\1\164\1\uffff\1\162\1\164\1\147\1\172"+ + "\1\156\2\uffff\1\146\1\145\2\172\1\uffff\1\145\1\153\1\162\1\156\2\uffff"+ + "\4\172\1\uffff\1\145\1\141\1\172\2\uffff\1\172\2\145\1\141\4\uffff\1\144"+ + "\1\143\2\uffff\1\171\1\172\1\154\1\172\1\145\1\172\1\uffff\1\172\1\uffff"+ + "\1\172\3\uffff"; static final String DFA18_acceptS = - "\14\uffff\1\20\6\uffff\1\32\3\uffff\1\36\1\37\1\40\1\41\1\42\1\43\1\44"+ - "\1\45\1\47\1\50\1\51\1\52\1\53\1\54\1\55\27\uffff\1\33\1\34\1\35\1\46"+ - "\37\uffff\1\7\4\uffff\1\15\1\uffff\1\16\2\uffff\1\23\4\uffff\1\1\5\uffff"+ - "\1\4\1\5\4\uffff\1\12\4\uffff\1\27\1\30\4\uffff\1\6\3\uffff\1\11\1\26"+ - "\4\uffff\1\31\1\14\1\2\1\13\2\uffff\1\10\1\21\6\uffff\1\24\1\uffff\1\3"+ - "\1\uffff\1\17\1\25\1\22"; + "\14\uffff\1\20\6\uffff\1\32\3\uffff\1\36\1\37\1\40\1\41\1\42\1\43\1\44"+ + "\1\45\1\47\1\50\1\51\1\52\1\53\1\54\1\55\27\uffff\1\33\1\34\1\35\1\46"+ + "\37\uffff\1\7\4\uffff\1\15\1\uffff\1\16\2\uffff\1\23\4\uffff\1\1\5\uffff"+ + "\1\4\1\5\4\uffff\1\12\4\uffff\1\27\1\30\4\uffff\1\6\3\uffff\1\11\1\26"+ + "\4\uffff\1\31\1\14\1\2\1\13\2\uffff\1\10\1\21\6\uffff\1\24\1\uffff\1\3"+ + "\1\uffff\1\17\1\25\1\22"; static final String DFA18_specialS = - "\26\uffff\1\0\u008e\uffff}>"; + "\26\uffff\1\0\u008e\uffff}>"; static final String[] DFA18_transitionS = { "\2\45\2\uffff\1\45\22\uffff\1\45\1\uffff\1\26\1\14\4\uffff\1\27\1\30"+ - "\1\uffff\1\24\1\36\1\24\1\37\1\44\1\22\11\25\1\40\1\35\1\43\1\41\1\42"+ - "\2\uffff\16\23\1\21\13\23\1\33\1\uffff\1\34\1\uffff\1\23\1\uffff\1\23"+ - "\1\4\1\20\1\6\1\17\1\7\2\23\1\5\1\23\1\12\1\10\1\11\1\23\1\15\2\23\1"+ - "\13\1\2\1\16\1\3\1\1\4\23\1\31\1\uffff\1\32", + "\1\uffff\1\24\1\36\1\24\1\37\1\44\1\22\11\25\1\40\1\35\1\43\1\41\1\42"+ + "\2\uffff\16\23\1\21\13\23\1\33\1\uffff\1\34\1\uffff\1\23\1\uffff\1\23"+ + "\1\4\1\20\1\6\1\17\1\7\2\23\1\5\1\23\1\12\1\10\1\11\1\23\1\15\2\23\1"+ + "\13\1\2\1\16\1\3\1\1\4\23\1\31\1\uffff\1\32", "\1\47\11\uffff\1\46", "\1\51\13\uffff\1\50", "\1\52", @@ -2613,16 +2419,16 @@ public int specialStateTransition(int s, IntStream _input) throws NoViableAltExc IntStream input = _input; int _s = s; switch ( s ) { - case 0 : - int LA18_22 = input.LA(1); - s = -1; - if ( ((LA18_22 >= '\u0000' && LA18_22 <= '\uFFFF')) ) {s = 63;} - else s = 64; - if ( s>=0 ) return s; - break; + case 0 : + int LA18_22 = input.LA(1); + s = -1; + if ( ((LA18_22 >= '\u0000' && LA18_22 <= '\uFFFF')) ) {s = 63;} + else s = 64; + if ( s>=0 ) return s; + break; } NoViableAltException nvae = - new NoViableAltException(getDescription(), 18, _s, input); + new NoViableAltException(getDescription(), 18, _s, input); error(nvae); throw nvae; } From 0a1db80b6b94d6907db03137f75e8aee13b5a582 Mon Sep 17 00:00:00 2001 From: walker Date: Tue, 10 May 2022 19:47:41 +0800 Subject: [PATCH 4/4] const ini --- .../src/main/resources/antlr/TafParser.g | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g b/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g index 71a60db7..1171b2bc 100644 --- a/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g +++ b/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g @@ -85,11 +85,11 @@ param const_initializer returns [String result] - : (TARS_INTEGER_LITERAL | - TARS_FLOATING_POINT_LITERAL | - TARS_STRING_LITERAL | - TARS_FALSE | - TARS_TRUE); + : TARS_INTEGER_LITERAL | + TARS_FLOATING_POINT_LITERAL | + TARS_STRING_LITERAL | + TARS_FALSE | + TARS_TRUE; type