From 980d7826b99eaa92598ff66dd90604c009a38ecf Mon Sep 17 00:00:00 2001 From: Mike Lischke Date: Sat, 4 Jan 2025 15:15:24 +0100 Subject: [PATCH] Starting tree walkers cleanup --- src/tree-walkers/ATNBuilder.java | 2431 -------- src/tree-walkers/ATNBuilder.ts | 1705 ++---- src/tree-walkers/BlockSetTransformer.java | 2091 ------- src/tree-walkers/BlockSetTransformer.ts | 4 - src/tree-walkers/GrammarTreeVisitor.java | 5434 ----------------- src/tree-walkers/LeftRecursiveRuleWalker.java | 2954 --------- src/tree-walkers/SourceGenTriggers.java | 1978 ------ src/types.ts | 8 + 8 files changed, 661 insertions(+), 15944 deletions(-) delete mode 100644 src/tree-walkers/ATNBuilder.java delete mode 100644 src/tree-walkers/BlockSetTransformer.java delete mode 100644 src/tree-walkers/GrammarTreeVisitor.java delete mode 100644 src/tree-walkers/LeftRecursiveRuleWalker.java delete mode 100644 src/tree-walkers/SourceGenTriggers.java diff --git a/src/tree-walkers/ATNBuilder.java b/src/tree-walkers/ATNBuilder.java deleted file mode 100644 index 87051d1..0000000 --- a/src/tree-walkers/ATNBuilder.java +++ /dev/null @@ -1,2431 +0,0 @@ -// $ANTLR 3.5.3 org/antlr/v4/parse/ATNBuilder.g - -/* - [The "BSD license"] - Copyright (c) 2010 Terence Parr - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -package org.antlr.v4.parse; -import org.antlr.v4.tool.*; -import org.antlr.v4.tool.ast.*; -import org.antlr.v4.automata.ATNFactory; - - -import org.antlr.runtime.*; -import org.antlr.runtime.tree.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class ATNBuilder extends TreeParser { - public static final String[] tokenNames = new String[] { - "", "", "", "", "ACTION", "ACTION_CHAR_LITERAL", - "ACTION_ESC", "ACTION_STRING_LITERAL", "ARG_ACTION", "ARG_OR_CHARSET", - "ASSIGN", "AT", "CATCH", "CHANNELS", "COLON", "COLONCOLON", "COMMA", "COMMENT", - "DOC_COMMENT", "DOLLAR", "DOT", "ERRCHAR", "ESC_SEQ", "FINALLY", "FRAGMENT", - "GRAMMAR", "GT", "HEX_DIGIT", "ID", "IMPORT", "INT", "LEXER", "LEXER_CHAR_SET", - "LOCALS", "LPAREN", "LT", "MODE", "NESTED_ACTION", "NLCHARS", "NOT", "NameChar", - "NameStartChar", "OPTIONS", "OR", "PARSER", "PLUS", "PLUS_ASSIGN", "POUND", - "QUESTION", "RANGE", "RARROW", "RBRACE", "RETURNS", "RPAREN", "RULE_REF", - "SEMI", "SEMPRED", "SRC", "STAR", "STRING_LITERAL", "THROWS", "TOKENS_SPEC", - "TOKEN_REF", "UNICODE_ESC", "UNICODE_EXTENDED_ESC", "UnicodeBOM", "WS", - "WSCHARS", "WSNLCHARS", "ALT", "BLOCK", "CLOSURE", "COMBINED", "ELEMENT_OPTIONS", - "EPSILON", "LEXER_ACTION_CALL", "LEXER_ALT_ACTION", "OPTIONAL", "POSITIVE_CLOSURE", - "RULE", "RULEMODIFIERS", "RULES", "SET", "WILDCARD" - }; - public static final int EOF=-1; - public static final int ACTION=4; - public static final int ACTION_CHAR_LITERAL=5; - public static final int ACTION_ESC=6; - public static final int ACTION_STRING_LITERAL=7; - public static final int ARG_ACTION=8; - public static final int ARG_OR_CHARSET=9; - public static final int ASSIGN=10; - public static final int AT=11; - public static final int CATCH=12; - public static final int CHANNELS=13; - public static final int COLON=14; - public static final int COLONCOLON=15; - public static final int COMMA=16; - public static final int COMMENT=17; - public static final int DOC_COMMENT=18; - public static final int DOLLAR=19; - public static final int DOT=20; - public static final int ERRCHAR=21; - public static final int ESC_SEQ=22; - public static final int FINALLY=23; - public static final int FRAGMENT=24; - public static final int GRAMMAR=25; - public static final int GT=26; - public static final int HEX_DIGIT=27; - public static final int ID=28; - public static final int IMPORT=29; - public static final int INT=30; - public static final int LEXER=31; - public static final int LEXER_CHAR_SET=32; - public static final int LOCALS=33; - public static final int LPAREN=34; - public static final int LT=35; - public static final int MODE=36; - public static final int NESTED_ACTION=37; - public static final int NLCHARS=38; - public static final int NOT=39; - public static final int NameChar=40; - public static final int NameStartChar=41; - public static final int OPTIONS=42; - public static final int OR=43; - public static final int PARSER=44; - public static final int PLUS=45; - public static final int PLUS_ASSIGN=46; - public static final int POUND=47; - public static final int QUESTION=48; - public static final int RANGE=49; - public static final int RARROW=50; - public static final int RBRACE=51; - public static final int RETURNS=52; - public static final int RPAREN=53; - public static final int RULE_REF=54; - public static final int SEMI=55; - public static final int SEMPRED=56; - public static final int SRC=57; - public static final int STAR=58; - public static final int STRING_LITERAL=59; - public static final int THROWS=60; - public static final int TOKENS_SPEC=61; - public static final int TOKEN_REF=62; - public static final int UNICODE_ESC=63; - public static final int UNICODE_EXTENDED_ESC=64; - public static final int UnicodeBOM=65; - public static final int WS=66; - public static final int WSCHARS=67; - public static final int WSNLCHARS=68; - public static final int ALT=69; - public static final int BLOCK=70; - public static final int CLOSURE=71; - public static final int COMBINED=72; - public static final int ELEMENT_OPTIONS=73; - public static final int EPSILON=74; - public static final int LEXER_ACTION_CALL=75; - public static final int LEXER_ALT_ACTION=76; - public static final int OPTIONAL=77; - public static final int POSITIVE_CLOSURE=78; - public static final int RULE=79; - public static final int RULEMODIFIERS=80; - public static final int RULES=81; - public static final int SET=82; - public static final int WILDCARD=83; - - // delegates - public TreeParser[] getDelegates() { - return new TreeParser[] {}; - } - - // delegators - - - public ATNBuilder(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public ATNBuilder(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - @Override public String[] getTokenNames() { return ATNBuilder.tokenNames; } - @Override public String getGrammarFileName() { return "org/antlr/v4/parse/ATNBuilder.g"; } - - - ATNFactory factory; - public ATNBuilder(TreeNodeStream input, ATNFactory factory) { - this(input); - this.factory = factory; - } - - - - // $ANTLR start "dummy" - // org/antlr/v4/parse/ATNBuilder.g:80:1: dummy : block[null] ; - public final void dummy() throws RecognitionException { - try { - // org/antlr/v4/parse/ATNBuilder.g:80:7: ( block[null] ) - // org/antlr/v4/parse/ATNBuilder.g:80:9: block[null] - { - pushFollow(FOLLOW_block_in_dummy63); - block(null); - state._fsp--; - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "dummy" - - - - // $ANTLR start "ruleBlock" - // org/antlr/v4/parse/ATNBuilder.g:82:1: ruleBlock[GrammarAST ebnfRoot] returns [ATNFactory.Handle p] : ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ; - public final ATNFactory.Handle ruleBlock(GrammarAST ebnfRoot) throws RecognitionException { - ATNFactory.Handle p = null; - - - GrammarAST BLOCK1=null; - ATNFactory.Handle a =null; - - - List alts = new ArrayList(); - int alt = 1; - factory.setCurrentOuterAlt(alt); - - try { - // org/antlr/v4/parse/ATNBuilder.g:88:5: ( ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ) - // org/antlr/v4/parse/ATNBuilder.g:88:7: ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) - { - BLOCK1=(GrammarAST)match(input,BLOCK,FOLLOW_BLOCK_in_ruleBlock89); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:89:13: ( ^( OPTIONS ( . )* ) )? - int alt2=2; - int LA2_0 = input.LA(1); - if ( (LA2_0==OPTIONS) ) { - alt2=1; - } - switch (alt2) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:89:14: ^( OPTIONS ( . )* ) - { - match(input,OPTIONS,FOLLOW_OPTIONS_in_ruleBlock105); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:89:24: ( . )* - loop1: - while (true) { - int alt1=2; - int LA1_0 = input.LA(1); - if ( ((LA1_0 >= ACTION && LA1_0 <= WILDCARD)) ) { - alt1=1; - } - else if ( (LA1_0==UP) ) { - alt1=2; - } - - switch (alt1) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:89:24: . - { - matchAny(input); - } - break; - - default : - break loop1; - } - } - - match(input, Token.UP, null); - } - - } - break; - - } - - // org/antlr/v4/parse/ATNBuilder.g:90:13: (a= alternative )+ - int cnt3=0; - loop3: - while (true) { - int alt3=2; - int LA3_0 = input.LA(1); - if ( (LA3_0==ALT||LA3_0==LEXER_ALT_ACTION) ) { - alt3=1; - } - - switch (alt3) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:90:17: a= alternative - { - pushFollow(FOLLOW_alternative_in_ruleBlock131); - a=alternative(); - state._fsp--; - - alts.add(a); factory.setCurrentOuterAlt(++alt); - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } - - match(input, Token.UP, null); - - p = factory.block((BlockAST)BLOCK1, ebnfRoot, alts); - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "ruleBlock" - - - - // $ANTLR start "block" - // org/antlr/v4/parse/ATNBuilder.g:97:1: block[GrammarAST ebnfRoot] returns [ATNFactory.Handle p] : ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ; - public final ATNFactory.Handle block(GrammarAST ebnfRoot) throws RecognitionException { - ATNFactory.Handle p = null; - - - GrammarAST BLOCK2=null; - ATNFactory.Handle a =null; - - List alts = new ArrayList(); - try { - // org/antlr/v4/parse/ATNBuilder.g:99:5: ( ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ) - // org/antlr/v4/parse/ATNBuilder.g:99:7: ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) - { - BLOCK2=(GrammarAST)match(input,BLOCK,FOLLOW_BLOCK_in_block209); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:99:15: ( ^( OPTIONS ( . )* ) )? - int alt5=2; - int LA5_0 = input.LA(1); - if ( (LA5_0==OPTIONS) ) { - alt5=1; - } - switch (alt5) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:99:16: ^( OPTIONS ( . )* ) - { - match(input,OPTIONS,FOLLOW_OPTIONS_in_block213); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:99:26: ( . )* - loop4: - while (true) { - int alt4=2; - int LA4_0 = input.LA(1); - if ( ((LA4_0 >= ACTION && LA4_0 <= WILDCARD)) ) { - alt4=1; - } - else if ( (LA4_0==UP) ) { - alt4=2; - } - - switch (alt4) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:99:26: . - { - matchAny(input); - } - break; - - default : - break loop4; - } - } - - match(input, Token.UP, null); - } - - } - break; - - } - - // org/antlr/v4/parse/ATNBuilder.g:99:32: (a= alternative )+ - int cnt6=0; - loop6: - while (true) { - int alt6=2; - int LA6_0 = input.LA(1); - if ( (LA6_0==ALT||LA6_0==LEXER_ALT_ACTION) ) { - alt6=1; - } - - switch (alt6) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:99:33: a= alternative - { - pushFollow(FOLLOW_alternative_in_block224); - a=alternative(); - state._fsp--; - - alts.add(a); - } - break; - - default : - if ( cnt6 >= 1 ) break loop6; - EarlyExitException eee = new EarlyExitException(6, input); - throw eee; - } - cnt6++; - } - - match(input, Token.UP, null); - - p = factory.block((BlockAST)BLOCK2, ebnfRoot, alts); - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "block" - - - - // $ANTLR start "alternative" - // org/antlr/v4/parse/ATNBuilder.g:103:1: alternative returns [ATNFactory.Handle p] : ( ^( LEXER_ALT_ACTION a= alternative lexerCommands ) | ^( ALT ( elementOptions )? EPSILON ) | ^( ALT ( elementOptions )? (e= element )+ ) ); - public final ATNFactory.Handle alternative() throws RecognitionException { - ATNFactory.Handle p = null; - - - GrammarAST EPSILON4=null; - ATNFactory.Handle a =null; - TreeRuleReturnScope e =null; - ATNFactory.Handle lexerCommands3 =null; - - List els = new ArrayList(); - try { - // org/antlr/v4/parse/ATNBuilder.g:105:5: ( ^( LEXER_ALT_ACTION a= alternative lexerCommands ) | ^( ALT ( elementOptions )? EPSILON ) | ^( ALT ( elementOptions )? (e= element )+ ) ) - int alt10=3; - alt10 = dfa10.predict(input); - switch (alt10) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:105:7: ^( LEXER_ALT_ACTION a= alternative lexerCommands ) - { - match(input,LEXER_ALT_ACTION,FOLLOW_LEXER_ALT_ACTION_in_alternative263); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_alternative_in_alternative267); - a=alternative(); - state._fsp--; - - pushFollow(FOLLOW_lexerCommands_in_alternative269); - lexerCommands3=lexerCommands(); - state._fsp--; - - match(input, Token.UP, null); - - p = factory.lexerAltCommands(a,lexerCommands3); - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:107:7: ^( ALT ( elementOptions )? EPSILON ) - { - match(input,ALT,FOLLOW_ALT_in_alternative289); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:107:13: ( elementOptions )? - int alt7=2; - int LA7_0 = input.LA(1); - if ( (LA7_0==ELEMENT_OPTIONS) ) { - alt7=1; - } - switch (alt7) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:107:13: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_alternative291); - elementOptions(); - state._fsp--; - - } - break; - - } - - EPSILON4=(GrammarAST)match(input,EPSILON,FOLLOW_EPSILON_in_alternative294); - match(input, Token.UP, null); - - p = factory.epsilon(EPSILON4); - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:108:9: ^( ALT ( elementOptions )? (e= element )+ ) - { - match(input,ALT,FOLLOW_ALT_in_alternative314); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:108:15: ( elementOptions )? - int alt8=2; - int LA8_0 = input.LA(1); - if ( (LA8_0==ELEMENT_OPTIONS) ) { - alt8=1; - } - switch (alt8) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:108:15: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_alternative316); - elementOptions(); - state._fsp--; - - } - break; - - } - - // org/antlr/v4/parse/ATNBuilder.g:108:31: (e= element )+ - int cnt9=0; - loop9: - while (true) { - int alt9=2; - int LA9_0 = input.LA(1); - if ( (LA9_0==ACTION||LA9_0==ASSIGN||LA9_0==DOT||LA9_0==LEXER_CHAR_SET||LA9_0==NOT||LA9_0==PLUS_ASSIGN||LA9_0==RANGE||LA9_0==RULE_REF||LA9_0==SEMPRED||LA9_0==STRING_LITERAL||LA9_0==TOKEN_REF||(LA9_0 >= BLOCK && LA9_0 <= CLOSURE)||(LA9_0 >= OPTIONAL && LA9_0 <= POSITIVE_CLOSURE)||(LA9_0 >= SET && LA9_0 <= WILDCARD)) ) { - alt9=1; - } - - switch (alt9) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:108:32: e= element - { - pushFollow(FOLLOW_element_in_alternative322); - e=element(); - state._fsp--; - - els.add((e!=null?((ATNBuilder.element_return)e).p:null)); - } - break; - - default : - if ( cnt9 >= 1 ) break loop9; - EarlyExitException eee = new EarlyExitException(9, input); - throw eee; - } - cnt9++; - } - - match(input, Token.UP, null); - - p = factory.alt(els); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "alternative" - - - - // $ANTLR start "lexerCommands" - // org/antlr/v4/parse/ATNBuilder.g:111:1: lexerCommands returns [ATNFactory.Handle p] : (c= lexerCommand )+ ; - public final ATNFactory.Handle lexerCommands() throws RecognitionException { - ATNFactory.Handle p = null; - - - ATNFactory.Handle c =null; - - List cmds = new ArrayList(); - try { - // org/antlr/v4/parse/ATNBuilder.g:113:5: ( (c= lexerCommand )+ ) - // org/antlr/v4/parse/ATNBuilder.g:113:9: (c= lexerCommand )+ - { - // org/antlr/v4/parse/ATNBuilder.g:113:9: (c= lexerCommand )+ - int cnt11=0; - loop11: - while (true) { - int alt11=2; - int LA11_0 = input.LA(1); - if ( (LA11_0==ID||LA11_0==LEXER_ACTION_CALL) ) { - alt11=1; - } - - switch (alt11) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:113:10: c= lexerCommand - { - pushFollow(FOLLOW_lexerCommand_in_lexerCommands360); - c=lexerCommand(); - state._fsp--; - - if (c != null) cmds.add(c); - } - break; - - default : - if ( cnt11 >= 1 ) break loop11; - EarlyExitException eee = new EarlyExitException(11, input); - throw eee; - } - cnt11++; - } - - - p = factory.alt(cmds); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "lexerCommands" - - - - // $ANTLR start "lexerCommand" - // org/antlr/v4/parse/ATNBuilder.g:119:1: lexerCommand returns [ATNFactory.Handle cmd] : ( ^( LEXER_ACTION_CALL ID lexerCommandExpr ) | ID ); - public final ATNFactory.Handle lexerCommand() throws RecognitionException { - ATNFactory.Handle cmd = null; - - - GrammarAST ID5=null; - GrammarAST ID7=null; - TreeRuleReturnScope lexerCommandExpr6 =null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:120:2: ( ^( LEXER_ACTION_CALL ID lexerCommandExpr ) | ID ) - int alt12=2; - int LA12_0 = input.LA(1); - if ( (LA12_0==LEXER_ACTION_CALL) ) { - alt12=1; - } - else if ( (LA12_0==ID) ) { - alt12=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 12, 0, input); - throw nvae; - } - - switch (alt12) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:120:4: ^( LEXER_ACTION_CALL ID lexerCommandExpr ) - { - match(input,LEXER_ACTION_CALL,FOLLOW_LEXER_ACTION_CALL_in_lexerCommand393); - match(input, Token.DOWN, null); - ID5=(GrammarAST)match(input,ID,FOLLOW_ID_in_lexerCommand395); - pushFollow(FOLLOW_lexerCommandExpr_in_lexerCommand397); - lexerCommandExpr6=lexerCommandExpr(); - state._fsp--; - - match(input, Token.UP, null); - - cmd = factory.lexerCallCommand(ID5, (lexerCommandExpr6!=null?((GrammarAST)lexerCommandExpr6.start):null)); - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:122:4: ID - { - ID7=(GrammarAST)match(input,ID,FOLLOW_ID_in_lexerCommand413); - cmd = factory.lexerCommand(ID7); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return cmd; - } - // $ANTLR end "lexerCommand" - - - public static class lexerCommandExpr_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerCommandExpr" - // org/antlr/v4/parse/ATNBuilder.g:126:1: lexerCommandExpr : ( ID | INT ); - public final ATNBuilder.lexerCommandExpr_return lexerCommandExpr() throws RecognitionException { - ATNBuilder.lexerCommandExpr_return retval = new ATNBuilder.lexerCommandExpr_return(); - retval.start = input.LT(1); - - try { - // org/antlr/v4/parse/ATNBuilder.g:127:2: ( ID | INT ) - // org/antlr/v4/parse/ATNBuilder.g: - { - if ( input.LA(1)==ID||input.LA(1)==INT ) { - input.consume(); - state.errorRecovery=false; - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerCommandExpr" - - - public static class element_return extends TreeRuleReturnScope { - public ATNFactory.Handle p; - }; - - - // $ANTLR start "element" - // org/antlr/v4/parse/ATNBuilder.g:131:1: element returns [ATNFactory.Handle p] : ( labeledElement | atom | subrule | ACTION | SEMPRED | ^( ACTION . ) | ^( SEMPRED . ) | ^( NOT b= blockSet[true] ) | LEXER_CHAR_SET ); - public final ATNBuilder.element_return element() throws RecognitionException { - ATNBuilder.element_return retval = new ATNBuilder.element_return(); - retval.start = input.LT(1); - - GrammarAST ACTION11=null; - GrammarAST SEMPRED12=null; - GrammarAST ACTION13=null; - GrammarAST SEMPRED14=null; - TreeRuleReturnScope b =null; - ATNFactory.Handle labeledElement8 =null; - TreeRuleReturnScope atom9 =null; - TreeRuleReturnScope subrule10 =null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:132:2: ( labeledElement | atom | subrule | ACTION | SEMPRED | ^( ACTION . ) | ^( SEMPRED . ) | ^( NOT b= blockSet[true] ) | LEXER_CHAR_SET ) - int alt13=9; - switch ( input.LA(1) ) { - case ASSIGN: - case PLUS_ASSIGN: - { - alt13=1; - } - break; - case DOT: - case RANGE: - case RULE_REF: - case STRING_LITERAL: - case TOKEN_REF: - case SET: - case WILDCARD: - { - alt13=2; - } - break; - case BLOCK: - case CLOSURE: - case OPTIONAL: - case POSITIVE_CLOSURE: - { - alt13=3; - } - break; - case ACTION: - { - int LA13_4 = input.LA(2); - if ( (LA13_4==DOWN) ) { - alt13=6; - } - else if ( ((LA13_4 >= UP && LA13_4 <= ACTION)||LA13_4==ASSIGN||LA13_4==DOT||LA13_4==LEXER_CHAR_SET||LA13_4==NOT||LA13_4==PLUS_ASSIGN||LA13_4==RANGE||LA13_4==RULE_REF||LA13_4==SEMPRED||LA13_4==STRING_LITERAL||LA13_4==TOKEN_REF||(LA13_4 >= BLOCK && LA13_4 <= CLOSURE)||(LA13_4 >= OPTIONAL && LA13_4 <= POSITIVE_CLOSURE)||(LA13_4 >= SET && LA13_4 <= WILDCARD)) ) { - alt13=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 13, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case SEMPRED: - { - int LA13_5 = input.LA(2); - if ( (LA13_5==DOWN) ) { - alt13=7; - } - else if ( ((LA13_5 >= UP && LA13_5 <= ACTION)||LA13_5==ASSIGN||LA13_5==DOT||LA13_5==LEXER_CHAR_SET||LA13_5==NOT||LA13_5==PLUS_ASSIGN||LA13_5==RANGE||LA13_5==RULE_REF||LA13_5==SEMPRED||LA13_5==STRING_LITERAL||LA13_5==TOKEN_REF||(LA13_5 >= BLOCK && LA13_5 <= CLOSURE)||(LA13_5 >= OPTIONAL && LA13_5 <= POSITIVE_CLOSURE)||(LA13_5 >= SET && LA13_5 <= WILDCARD)) ) { - alt13=5; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 13, 5, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case NOT: - { - alt13=8; - } - break; - case LEXER_CHAR_SET: - { - alt13=9; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 13, 0, input); - throw nvae; - } - switch (alt13) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:132:4: labeledElement - { - pushFollow(FOLLOW_labeledElement_in_element454); - labeledElement8=labeledElement(); - state._fsp--; - - retval.p = labeledElement8; - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:133:4: atom - { - pushFollow(FOLLOW_atom_in_element464); - atom9=atom(); - state._fsp--; - - retval.p = (atom9!=null?((ATNBuilder.atom_return)atom9).p:null); - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:134:4: subrule - { - pushFollow(FOLLOW_subrule_in_element476); - subrule10=subrule(); - state._fsp--; - - retval.p = (subrule10!=null?((ATNBuilder.subrule_return)subrule10).p:null); - } - break; - case 4 : - // org/antlr/v4/parse/ATNBuilder.g:135:6: ACTION - { - ACTION11=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_element490); - retval.p = factory.action((ActionAST)ACTION11); - } - break; - case 5 : - // org/antlr/v4/parse/ATNBuilder.g:136:6: SEMPRED - { - SEMPRED12=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_element504); - retval.p = factory.sempred((PredAST)SEMPRED12); - } - break; - case 6 : - // org/antlr/v4/parse/ATNBuilder.g:137:6: ^( ACTION . ) - { - ACTION13=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_element519); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - retval.p = factory.action((ActionAST)ACTION13); - } - break; - case 7 : - // org/antlr/v4/parse/ATNBuilder.g:138:6: ^( SEMPRED . ) - { - SEMPRED14=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_element536); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - retval.p = factory.sempred((PredAST)SEMPRED14); - } - break; - case 8 : - // org/antlr/v4/parse/ATNBuilder.g:139:7: ^( NOT b= blockSet[true] ) - { - match(input,NOT,FOLLOW_NOT_in_element553); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_blockSet_in_element557); - b=blockSet(true); - state._fsp--; - - match(input, Token.UP, null); - - retval.p = (b!=null?((ATNBuilder.blockSet_return)b).p:null); - } - break; - case 9 : - // org/antlr/v4/parse/ATNBuilder.g:140:7: LEXER_CHAR_SET - { - match(input,LEXER_CHAR_SET,FOLLOW_LEXER_CHAR_SET_in_element570); - retval.p = factory.charSetLiteral(((GrammarAST)retval.start)); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "element" - - - - // $ANTLR start "astOperand" - // org/antlr/v4/parse/ATNBuilder.g:143:1: astOperand returns [ATNFactory.Handle p] : ( atom | ^( NOT blockSet[true] ) ); - public final ATNFactory.Handle astOperand() throws RecognitionException { - ATNFactory.Handle p = null; - - - TreeRuleReturnScope atom15 =null; - TreeRuleReturnScope blockSet16 =null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:144:2: ( atom | ^( NOT blockSet[true] ) ) - int alt14=2; - int LA14_0 = input.LA(1); - if ( (LA14_0==DOT||LA14_0==RANGE||LA14_0==RULE_REF||LA14_0==STRING_LITERAL||LA14_0==TOKEN_REF||(LA14_0 >= SET && LA14_0 <= WILDCARD)) ) { - alt14=1; - } - else if ( (LA14_0==NOT) ) { - alt14=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 14, 0, input); - throw nvae; - } - - switch (alt14) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:144:4: atom - { - pushFollow(FOLLOW_atom_in_astOperand590); - atom15=atom(); - state._fsp--; - - p = (atom15!=null?((ATNBuilder.atom_return)atom15).p:null); - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:145:4: ^( NOT blockSet[true] ) - { - match(input,NOT,FOLLOW_NOT_in_astOperand603); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_blockSet_in_astOperand605); - blockSet16=blockSet(true); - state._fsp--; - - match(input, Token.UP, null); - - p = (blockSet16!=null?((ATNBuilder.blockSet_return)blockSet16).p:null); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "astOperand" - - - - // $ANTLR start "labeledElement" - // org/antlr/v4/parse/ATNBuilder.g:148:1: labeledElement returns [ATNFactory.Handle p] : ( ^( ASSIGN ID element ) | ^( PLUS_ASSIGN ID element ) ); - public final ATNFactory.Handle labeledElement() throws RecognitionException { - ATNFactory.Handle p = null; - - - TreeRuleReturnScope element17 =null; - TreeRuleReturnScope element18 =null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:149:2: ( ^( ASSIGN ID element ) | ^( PLUS_ASSIGN ID element ) ) - int alt15=2; - int LA15_0 = input.LA(1); - if ( (LA15_0==ASSIGN) ) { - alt15=1; - } - else if ( (LA15_0==PLUS_ASSIGN) ) { - alt15=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 15, 0, input); - throw nvae; - } - - switch (alt15) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:149:4: ^( ASSIGN ID element ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement626); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_labeledElement628); - pushFollow(FOLLOW_element_in_labeledElement630); - element17=element(); - state._fsp--; - - match(input, Token.UP, null); - - p = factory.label((element17!=null?((ATNBuilder.element_return)element17).p:null)); - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:150:4: ^( PLUS_ASSIGN ID element ) - { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement643); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_labeledElement645); - pushFollow(FOLLOW_element_in_labeledElement647); - element18=element(); - state._fsp--; - - match(input, Token.UP, null); - - p = factory.listLabel((element18!=null?((ATNBuilder.element_return)element18).p:null)); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "labeledElement" - - - public static class subrule_return extends TreeRuleReturnScope { - public ATNFactory.Handle p; - }; - - - // $ANTLR start "subrule" - // org/antlr/v4/parse/ATNBuilder.g:153:1: subrule returns [ATNFactory.Handle p] : ( ^( OPTIONAL block[$start] ) | ^( CLOSURE block[$start] ) | ^( POSITIVE_CLOSURE block[$start] ) | block[null] ); - public final ATNBuilder.subrule_return subrule() throws RecognitionException { - ATNBuilder.subrule_return retval = new ATNBuilder.subrule_return(); - retval.start = input.LT(1); - - ATNFactory.Handle block19 =null; - ATNFactory.Handle block20 =null; - ATNFactory.Handle block21 =null; - ATNFactory.Handle block22 =null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:154:2: ( ^( OPTIONAL block[$start] ) | ^( CLOSURE block[$start] ) | ^( POSITIVE_CLOSURE block[$start] ) | block[null] ) - int alt16=4; - switch ( input.LA(1) ) { - case OPTIONAL: - { - alt16=1; - } - break; - case CLOSURE: - { - alt16=2; - } - break; - case POSITIVE_CLOSURE: - { - alt16=3; - } - break; - case BLOCK: - { - alt16=4; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 16, 0, input); - throw nvae; - } - switch (alt16) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:154:4: ^( OPTIONAL block[$start] ) - { - match(input,OPTIONAL,FOLLOW_OPTIONAL_in_subrule668); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_subrule670); - block19=block(((GrammarAST)retval.start)); - state._fsp--; - - match(input, Token.UP, null); - - retval.p = block19; - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:155:4: ^( CLOSURE block[$start] ) - { - match(input,CLOSURE,FOLLOW_CLOSURE_in_subrule682); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_subrule684); - block20=block(((GrammarAST)retval.start)); - state._fsp--; - - match(input, Token.UP, null); - - retval.p = block20; - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:156:4: ^( POSITIVE_CLOSURE block[$start] ) - { - match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_subrule696); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_subrule698); - block21=block(((GrammarAST)retval.start)); - state._fsp--; - - match(input, Token.UP, null); - - retval.p = block21; - } - break; - case 4 : - // org/antlr/v4/parse/ATNBuilder.g:157:5: block[null] - { - pushFollow(FOLLOW_block_in_subrule708); - block22=block(null); - state._fsp--; - - retval.p = block22; - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "subrule" - - - public static class blockSet_return extends TreeRuleReturnScope { - public ATNFactory.Handle p; - }; - - - // $ANTLR start "blockSet" - // org/antlr/v4/parse/ATNBuilder.g:160:1: blockSet[boolean invert] returns [ATNFactory.Handle p] : ^( SET ( setElement )+ ) ; - public final ATNBuilder.blockSet_return blockSet(boolean invert) throws RecognitionException { - ATNBuilder.blockSet_return retval = new ATNBuilder.blockSet_return(); - retval.start = input.LT(1); - - TreeRuleReturnScope setElement23 =null; - - List alts = new ArrayList(); - try { - // org/antlr/v4/parse/ATNBuilder.g:162:2: ( ^( SET ( setElement )+ ) ) - // org/antlr/v4/parse/ATNBuilder.g:162:4: ^( SET ( setElement )+ ) - { - match(input,SET,FOLLOW_SET_in_blockSet742); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:162:10: ( setElement )+ - int cnt17=0; - loop17: - while (true) { - int alt17=2; - int LA17_0 = input.LA(1); - if ( (LA17_0==LEXER_CHAR_SET||LA17_0==RANGE||LA17_0==STRING_LITERAL||LA17_0==TOKEN_REF) ) { - alt17=1; - } - - switch (alt17) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:162:11: setElement - { - pushFollow(FOLLOW_setElement_in_blockSet745); - setElement23=setElement(); - state._fsp--; - - alts.add((setElement23!=null?((GrammarAST)setElement23.start):null)); - } - break; - - default : - if ( cnt17 >= 1 ) break loop17; - EarlyExitException eee = new EarlyExitException(17, input); - throw eee; - } - cnt17++; - } - - match(input, Token.UP, null); - - retval.p = factory.set(((GrammarAST)retval.start), alts, invert); - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "blockSet" - - - public static class setElement_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "setElement" - // org/antlr/v4/parse/ATNBuilder.g:166:1: setElement : ( ^( STRING_LITERAL . ) | ^( TOKEN_REF . ) | STRING_LITERAL | TOKEN_REF | ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) | LEXER_CHAR_SET ); - public final ATNBuilder.setElement_return setElement() throws RecognitionException { - ATNBuilder.setElement_return retval = new ATNBuilder.setElement_return(); - retval.start = input.LT(1); - - GrammarAST a=null; - GrammarAST b=null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:167:2: ( ^( STRING_LITERAL . ) | ^( TOKEN_REF . ) | STRING_LITERAL | TOKEN_REF | ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) | LEXER_CHAR_SET ) - int alt18=6; - switch ( input.LA(1) ) { - case STRING_LITERAL: - { - int LA18_1 = input.LA(2); - if ( (LA18_1==DOWN) ) { - alt18=1; - } - else if ( (LA18_1==UP||LA18_1==LEXER_CHAR_SET||LA18_1==RANGE||LA18_1==STRING_LITERAL||LA18_1==TOKEN_REF) ) { - alt18=3; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 18, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case TOKEN_REF: - { - int LA18_2 = input.LA(2); - if ( (LA18_2==DOWN) ) { - alt18=2; - } - else if ( (LA18_2==UP||LA18_2==LEXER_CHAR_SET||LA18_2==RANGE||LA18_2==STRING_LITERAL||LA18_2==TOKEN_REF) ) { - alt18=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 18, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case RANGE: - { - alt18=5; - } - break; - case LEXER_CHAR_SET: - { - alt18=6; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 18, 0, input); - throw nvae; - } - switch (alt18) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:167:4: ^( STRING_LITERAL . ) - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement766); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:168:4: ^( TOKEN_REF . ) - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement775); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:169:4: STRING_LITERAL - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement783); - } - break; - case 4 : - // org/antlr/v4/parse/ATNBuilder.g:170:4: TOKEN_REF - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement788); - } - break; - case 5 : - // org/antlr/v4/parse/ATNBuilder.g:171:4: ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) - { - match(input,RANGE,FOLLOW_RANGE_in_setElement794); - match(input, Token.DOWN, null); - a=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement798); - b=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement802); - match(input, Token.UP, null); - - } - break; - case 6 : - // org/antlr/v4/parse/ATNBuilder.g:172:9: LEXER_CHAR_SET - { - match(input,LEXER_CHAR_SET,FOLLOW_LEXER_CHAR_SET_in_setElement813); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "setElement" - - - public static class atom_return extends TreeRuleReturnScope { - public ATNFactory.Handle p; - }; - - - // $ANTLR start "atom" - // org/antlr/v4/parse/ATNBuilder.g:175:1: atom returns [ATNFactory.Handle p] : ( range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | ^( WILDCARD . ) | WILDCARD | blockSet[false] | terminal | ruleref ); - public final ATNBuilder.atom_return atom() throws RecognitionException { - ATNBuilder.atom_return retval = new ATNBuilder.atom_return(); - retval.start = input.LT(1); - - ATNFactory.Handle range24 =null; - TreeRuleReturnScope terminal25 =null; - ATNFactory.Handle ruleref26 =null; - TreeRuleReturnScope blockSet27 =null; - TreeRuleReturnScope terminal28 =null; - ATNFactory.Handle ruleref29 =null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:176:2: ( range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | ^( WILDCARD . ) | WILDCARD | blockSet[false] | terminal | ruleref ) - int alt19=8; - switch ( input.LA(1) ) { - case RANGE: - { - alt19=1; - } - break; - case DOT: - { - int LA19_2 = input.LA(2); - if ( (LA19_2==DOWN) ) { - int LA19_7 = input.LA(3); - if ( (LA19_7==ID) ) { - int LA19_10 = input.LA(4); - if ( (LA19_10==STRING_LITERAL||LA19_10==TOKEN_REF) ) { - alt19=2; - } - else if ( (LA19_10==RULE_REF) ) { - alt19=3; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 19, 10, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 19, 7, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 19, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case WILDCARD: - { - int LA19_3 = input.LA(2); - if ( (LA19_3==DOWN) ) { - alt19=4; - } - else if ( (LA19_3==EOF||(LA19_3 >= UP && LA19_3 <= ACTION)||LA19_3==ASSIGN||LA19_3==DOT||LA19_3==LEXER_CHAR_SET||LA19_3==NOT||LA19_3==PLUS_ASSIGN||LA19_3==RANGE||LA19_3==RULE_REF||LA19_3==SEMPRED||LA19_3==STRING_LITERAL||LA19_3==TOKEN_REF||(LA19_3 >= BLOCK && LA19_3 <= CLOSURE)||(LA19_3 >= OPTIONAL && LA19_3 <= POSITIVE_CLOSURE)||(LA19_3 >= SET && LA19_3 <= WILDCARD)) ) { - alt19=5; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 19, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case SET: - { - alt19=6; - } - break; - case STRING_LITERAL: - case TOKEN_REF: - { - alt19=7; - } - break; - case RULE_REF: - { - alt19=8; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 19, 0, input); - throw nvae; - } - switch (alt19) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:176:4: range - { - pushFollow(FOLLOW_range_in_atom828); - range24=range(); - state._fsp--; - - retval.p = range24; - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:177:4: ^( DOT ID terminal ) - { - match(input,DOT,FOLLOW_DOT_in_atom840); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom842); - pushFollow(FOLLOW_terminal_in_atom844); - terminal25=terminal(); - state._fsp--; - - match(input, Token.UP, null); - - retval.p = (terminal25!=null?((ATNBuilder.terminal_return)terminal25).p:null); - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:178:4: ^( DOT ID ruleref ) - { - match(input,DOT,FOLLOW_DOT_in_atom854); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom856); - pushFollow(FOLLOW_ruleref_in_atom858); - ruleref26=ruleref(); - state._fsp--; - - match(input, Token.UP, null); - - retval.p = ruleref26; - } - break; - case 4 : - // org/antlr/v4/parse/ATNBuilder.g:179:7: ^( WILDCARD . ) - { - match(input,WILDCARD,FOLLOW_WILDCARD_in_atom871); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - retval.p = factory.wildcard(((GrammarAST)retval.start)); - } - break; - case 5 : - // org/antlr/v4/parse/ATNBuilder.g:180:7: WILDCARD - { - match(input,WILDCARD,FOLLOW_WILDCARD_in_atom886); - retval.p = factory.wildcard(((GrammarAST)retval.start)); - } - break; - case 6 : - // org/antlr/v4/parse/ATNBuilder.g:181:7: blockSet[false] - { - pushFollow(FOLLOW_blockSet_in_atom899); - blockSet27=blockSet(false); - state._fsp--; - - retval.p = (blockSet27!=null?((ATNBuilder.blockSet_return)blockSet27).p:null); - } - break; - case 7 : - // org/antlr/v4/parse/ATNBuilder.g:182:9: terminal - { - pushFollow(FOLLOW_terminal_in_atom914); - terminal28=terminal(); - state._fsp--; - - retval.p = (terminal28!=null?((ATNBuilder.terminal_return)terminal28).p:null); - } - break; - case 8 : - // org/antlr/v4/parse/ATNBuilder.g:183:9: ruleref - { - pushFollow(FOLLOW_ruleref_in_atom929); - ruleref29=ruleref(); - state._fsp--; - - retval.p = ruleref29; - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "atom" - - - - // $ANTLR start "ruleref" - // org/antlr/v4/parse/ATNBuilder.g:186:1: ruleref returns [ATNFactory.Handle p] : ( ^( RULE_REF ( ARG_ACTION )? ^( ELEMENT_OPTIONS ( . )* ) ) | ^( RULE_REF ( ARG_ACTION )? ) | RULE_REF ); - public final ATNFactory.Handle ruleref() throws RecognitionException { - ATNFactory.Handle p = null; - - - GrammarAST RULE_REF30=null; - GrammarAST RULE_REF31=null; - GrammarAST RULE_REF32=null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:187:5: ( ^( RULE_REF ( ARG_ACTION )? ^( ELEMENT_OPTIONS ( . )* ) ) | ^( RULE_REF ( ARG_ACTION )? ) | RULE_REF ) - int alt23=3; - int LA23_0 = input.LA(1); - if ( (LA23_0==RULE_REF) ) { - int LA23_1 = input.LA(2); - if ( (LA23_1==DOWN) ) { - switch ( input.LA(3) ) { - case ARG_ACTION: - { - int LA23_4 = input.LA(4); - if ( (LA23_4==ELEMENT_OPTIONS) ) { - alt23=1; - } - else if ( (LA23_4==UP) ) { - alt23=2; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 23, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case ELEMENT_OPTIONS: - { - alt23=1; - } - break; - case UP: - { - alt23=2; - } - break; - default: - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 23, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - } - else if ( (LA23_1==EOF||(LA23_1 >= UP && LA23_1 <= ACTION)||LA23_1==ASSIGN||LA23_1==DOT||LA23_1==LEXER_CHAR_SET||LA23_1==NOT||LA23_1==PLUS_ASSIGN||LA23_1==RANGE||LA23_1==RULE_REF||LA23_1==SEMPRED||LA23_1==STRING_LITERAL||LA23_1==TOKEN_REF||(LA23_1 >= BLOCK && LA23_1 <= CLOSURE)||(LA23_1 >= OPTIONAL && LA23_1 <= POSITIVE_CLOSURE)||(LA23_1 >= SET && LA23_1 <= WILDCARD)) ) { - alt23=3; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 23, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 23, 0, input); - throw nvae; - } - - switch (alt23) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:187:7: ^( RULE_REF ( ARG_ACTION )? ^( ELEMENT_OPTIONS ( . )* ) ) - { - RULE_REF30=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref957); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:187:18: ( ARG_ACTION )? - int alt20=2; - int LA20_0 = input.LA(1); - if ( (LA20_0==ARG_ACTION) ) { - alt20=1; - } - switch (alt20) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:187:18: ARG_ACTION - { - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref959); - } - break; - - } - - match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_ruleref963); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:187:48: ( . )* - loop21: - while (true) { - int alt21=2; - int LA21_0 = input.LA(1); - if ( ((LA21_0 >= ACTION && LA21_0 <= WILDCARD)) ) { - alt21=1; - } - else if ( (LA21_0==UP) ) { - alt21=2; - } - - switch (alt21) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:187:48: . - { - matchAny(input); - } - break; - - default : - break loop21; - } - } - - match(input, Token.UP, null); - } - - match(input, Token.UP, null); - - p = factory.ruleRef(RULE_REF30); - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:188:7: ^( RULE_REF ( ARG_ACTION )? ) - { - RULE_REF31=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref980); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:188:18: ( ARG_ACTION )? - int alt22=2; - int LA22_0 = input.LA(1); - if ( (LA22_0==ARG_ACTION) ) { - alt22=1; - } - switch (alt22) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:188:18: ARG_ACTION - { - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref982); - } - break; - - } - - match(input, Token.UP, null); - } - - p = factory.ruleRef(RULE_REF31); - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:189:7: RULE_REF - { - RULE_REF32=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref1001); - p = factory.ruleRef(RULE_REF32); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "ruleref" - - - - // $ANTLR start "range" - // org/antlr/v4/parse/ATNBuilder.g:192:1: range returns [ATNFactory.Handle p] : ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) ; - public final ATNFactory.Handle range() throws RecognitionException { - ATNFactory.Handle p = null; - - - GrammarAST a=null; - GrammarAST b=null; - - try { - // org/antlr/v4/parse/ATNBuilder.g:193:5: ( ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) ) - // org/antlr/v4/parse/ATNBuilder.g:193:7: ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) - { - match(input,RANGE,FOLLOW_RANGE_in_range1035); - match(input, Token.DOWN, null); - a=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_range1039); - b=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_range1043); - match(input, Token.UP, null); - - p = factory.range(a,b); - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return p; - } - // $ANTLR end "range" - - - public static class terminal_return extends TreeRuleReturnScope { - public ATNFactory.Handle p; - }; - - - // $ANTLR start "terminal" - // org/antlr/v4/parse/ATNBuilder.g:196:1: terminal returns [ATNFactory.Handle p] : ( ^( STRING_LITERAL . ) | STRING_LITERAL | ^( TOKEN_REF ARG_ACTION . ) | ^( TOKEN_REF . ) | TOKEN_REF ); - public final ATNBuilder.terminal_return terminal() throws RecognitionException { - ATNBuilder.terminal_return retval = new ATNBuilder.terminal_return(); - retval.start = input.LT(1); - - try { - // org/antlr/v4/parse/ATNBuilder.g:197:5: ( ^( STRING_LITERAL . ) | STRING_LITERAL | ^( TOKEN_REF ARG_ACTION . ) | ^( TOKEN_REF . ) | TOKEN_REF ) - int alt24=5; - int LA24_0 = input.LA(1); - if ( (LA24_0==STRING_LITERAL) ) { - int LA24_1 = input.LA(2); - if ( (LA24_1==DOWN) ) { - alt24=1; - } - else if ( (LA24_1==EOF||(LA24_1 >= UP && LA24_1 <= ACTION)||LA24_1==ASSIGN||LA24_1==DOT||LA24_1==LEXER_CHAR_SET||LA24_1==NOT||LA24_1==PLUS_ASSIGN||LA24_1==RANGE||LA24_1==RULE_REF||LA24_1==SEMPRED||LA24_1==STRING_LITERAL||LA24_1==TOKEN_REF||(LA24_1 >= BLOCK && LA24_1 <= CLOSURE)||(LA24_1 >= OPTIONAL && LA24_1 <= POSITIVE_CLOSURE)||(LA24_1 >= SET && LA24_1 <= WILDCARD)) ) { - alt24=2; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 24, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA24_0==TOKEN_REF) ) { - int LA24_2 = input.LA(2); - if ( (LA24_2==DOWN) ) { - int LA24_5 = input.LA(3); - if ( (LA24_5==ARG_ACTION) ) { - int LA24_7 = input.LA(4); - if ( ((LA24_7 >= ACTION && LA24_7 <= WILDCARD)) ) { - alt24=3; - } - else if ( ((LA24_7 >= DOWN && LA24_7 <= UP)) ) { - alt24=4; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 24, 7, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( ((LA24_5 >= ACTION && LA24_5 <= ACTION_STRING_LITERAL)||(LA24_5 >= ARG_OR_CHARSET && LA24_5 <= WILDCARD)) ) { - alt24=4; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 24, 5, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA24_2==EOF||(LA24_2 >= UP && LA24_2 <= ACTION)||LA24_2==ASSIGN||LA24_2==DOT||LA24_2==LEXER_CHAR_SET||LA24_2==NOT||LA24_2==PLUS_ASSIGN||LA24_2==RANGE||LA24_2==RULE_REF||LA24_2==SEMPRED||LA24_2==STRING_LITERAL||LA24_2==TOKEN_REF||(LA24_2 >= BLOCK && LA24_2 <= CLOSURE)||(LA24_2 >= OPTIONAL && LA24_2 <= POSITIVE_CLOSURE)||(LA24_2 >= SET && LA24_2 <= WILDCARD)) ) { - alt24=5; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 24, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 24, 0, input); - throw nvae; - } - - switch (alt24) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:197:8: ^( STRING_LITERAL . ) - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal1069); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - retval.p = factory.stringLiteral((TerminalAST)((GrammarAST)retval.start)); - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:198:7: STRING_LITERAL - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal1084); - retval.p = factory.stringLiteral((TerminalAST)((GrammarAST)retval.start)); - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:199:7: ^( TOKEN_REF ARG_ACTION . ) - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal1098); - match(input, Token.DOWN, null); - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_terminal1100); - matchAny(input); - match(input, Token.UP, null); - - retval.p = factory.tokenRef((TerminalAST)((GrammarAST)retval.start)); - } - break; - case 4 : - // org/antlr/v4/parse/ATNBuilder.g:200:7: ^( TOKEN_REF . ) - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal1114); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - retval.p = factory.tokenRef((TerminalAST)((GrammarAST)retval.start)); - } - break; - case 5 : - // org/antlr/v4/parse/ATNBuilder.g:201:7: TOKEN_REF - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal1130); - retval.p = factory.tokenRef((TerminalAST)((GrammarAST)retval.start)); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "terminal" - - - - // $ANTLR start "elementOptions" - // org/antlr/v4/parse/ATNBuilder.g:204:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption )* ) ; - public final void elementOptions() throws RecognitionException { - try { - // org/antlr/v4/parse/ATNBuilder.g:205:2: ( ^( ELEMENT_OPTIONS ( elementOption )* ) ) - // org/antlr/v4/parse/ATNBuilder.g:205:4: ^( ELEMENT_OPTIONS ( elementOption )* ) - { - match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOptions1151); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:205:22: ( elementOption )* - loop25: - while (true) { - int alt25=2; - int LA25_0 = input.LA(1); - if ( (LA25_0==ASSIGN||LA25_0==ID) ) { - alt25=1; - } - - switch (alt25) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:205:22: elementOption - { - pushFollow(FOLLOW_elementOption_in_elementOptions1153); - elementOption(); - state._fsp--; - - } - break; - - default : - break loop25; - } - } - - match(input, Token.UP, null); - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "elementOptions" - - - - // $ANTLR start "elementOption" - // org/antlr/v4/parse/ATNBuilder.g:208:1: elementOption : ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ); - public final void elementOption() throws RecognitionException { - try { - // org/antlr/v4/parse/ATNBuilder.g:209:2: ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ) - int alt26=5; - int LA26_0 = input.LA(1); - if ( (LA26_0==ID) ) { - alt26=1; - } - else if ( (LA26_0==ASSIGN) ) { - int LA26_2 = input.LA(2); - if ( (LA26_2==DOWN) ) { - int LA26_3 = input.LA(3); - if ( (LA26_3==ID) ) { - switch ( input.LA(4) ) { - case ID: - { - alt26=2; - } - break; - case STRING_LITERAL: - { - alt26=3; - } - break; - case ACTION: - { - alt26=4; - } - break; - case INT: - { - alt26=5; - } - break; - default: - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 26, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 26, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 26, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 26, 0, input); - throw nvae; - } - - switch (alt26) { - case 1 : - // org/antlr/v4/parse/ATNBuilder.g:209:4: ID - { - match(input,ID,FOLLOW_ID_in_elementOption1166); - } - break; - case 2 : - // org/antlr/v4/parse/ATNBuilder.g:210:4: ^( ASSIGN ID ID ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1172); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption1174); - match(input,ID,FOLLOW_ID_in_elementOption1176); - match(input, Token.UP, null); - - } - break; - case 3 : - // org/antlr/v4/parse/ATNBuilder.g:211:4: ^( ASSIGN ID STRING_LITERAL ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1183); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption1185); - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption1187); - match(input, Token.UP, null); - - } - break; - case 4 : - // org/antlr/v4/parse/ATNBuilder.g:212:4: ^( ASSIGN ID ACTION ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1194); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption1196); - match(input,ACTION,FOLLOW_ACTION_in_elementOption1198); - match(input, Token.UP, null); - - } - break; - case 5 : - // org/antlr/v4/parse/ATNBuilder.g:213:4: ^( ASSIGN ID INT ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1205); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption1207); - match(input,INT,FOLLOW_INT_in_elementOption1209); - match(input, Token.UP, null); - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "elementOption" - - // Delegated rules - - - protected DFA10 dfa10 = new DFA10(this); - static final String DFA10_eotS = - "\25\uffff"; - static final String DFA10_eofS = - "\25\uffff"; - static final String DFA10_minS = - "\1\105\1\uffff\1\2\1\4\1\2\2\uffff\2\3\1\2\1\4\1\34\1\4\10\3"; - static final String DFA10_maxS = - "\1\114\1\uffff\1\2\1\123\1\2\2\uffff\2\34\1\2\1\123\1\34\1\73\4\3\4\34"; - static final String DFA10_acceptS = - "\1\uffff\1\1\3\uffff\1\2\1\3\16\uffff"; - static final String DFA10_specialS = - "\25\uffff}>"; - static final String[] DFA10_transitionS = { - "\1\2\6\uffff\1\1", - "", - "\1\3", - "\1\6\5\uffff\1\6\11\uffff\1\6\13\uffff\1\6\6\uffff\1\6\6\uffff\1\6\2"+ - "\uffff\1\6\4\uffff\1\6\1\uffff\1\6\2\uffff\1\6\2\uffff\1\6\7\uffff\2"+ - "\6\1\uffff\1\4\1\5\2\uffff\2\6\3\uffff\2\6", - "\1\7", - "", - "", - "\1\12\6\uffff\1\11\21\uffff\1\10", - "\1\12\6\uffff\1\11\21\uffff\1\10", - "\1\13", - "\1\6\5\uffff\1\6\11\uffff\1\6\13\uffff\1\6\6\uffff\1\6\6\uffff\1\6\2"+ - "\uffff\1\6\4\uffff\1\6\1\uffff\1\6\2\uffff\1\6\2\uffff\1\6\7\uffff\2"+ - "\6\2\uffff\1\5\2\uffff\2\6\3\uffff\2\6", - "\1\14", - "\1\17\27\uffff\1\15\1\uffff\1\20\34\uffff\1\16", - "\1\21", - "\1\22", - "\1\23", - "\1\24", - "\1\12\6\uffff\1\11\21\uffff\1\10", - "\1\12\6\uffff\1\11\21\uffff\1\10", - "\1\12\6\uffff\1\11\21\uffff\1\10", - "\1\12\6\uffff\1\11\21\uffff\1\10" - }; - - static final short[] DFA10_eot = DFA.unpackEncodedString(DFA10_eotS); - static final short[] DFA10_eof = DFA.unpackEncodedString(DFA10_eofS); - static final char[] DFA10_min = DFA.unpackEncodedStringToUnsignedChars(DFA10_minS); - static final char[] DFA10_max = DFA.unpackEncodedStringToUnsignedChars(DFA10_maxS); - static final short[] DFA10_accept = DFA.unpackEncodedString(DFA10_acceptS); - static final short[] DFA10_special = DFA.unpackEncodedString(DFA10_specialS); - static final short[][] DFA10_transition; - - static { - int numStates = DFA10_transitionS.length; - DFA10_transition = new short[numStates][]; - for (int i=0; i { + p?: IStatePair; +} export class ATNBuilder extends TreeParser { public static readonly tokenNames = [ @@ -44,42 +49,6 @@ export class ATNBuilder extends TreeParser { "RULE", "RULEMODIFIERS", "RULES", "SET", "WILDCARD" ]; - public static lexerCommandExpr_return = class lexerCommandExpr_return extends TreeRuleReturnScope { - }; - - // $ANTLR end "lexerCommandExpr" - - public static element_return = class element_return extends TreeRuleReturnScope { - public p: IStatePair; - }; - - // $ANTLR end "labeledElement" - - public static subrule_return = class subrule_return extends TreeRuleReturnScope { - public p: IStatePair; - }; - - // $ANTLR end "subrule" - - public static blockSet_return = class blockSet_return extends TreeRuleReturnScope { - public p: IStatePair; - }; - - // $ANTLR end "blockSet" - - public static setElement_return = class setElement_return extends TreeRuleReturnScope { - }; - - // $ANTLR end "setElement" - - public static atom_return = class atom_return extends TreeRuleReturnScope { - public p: IStatePair; - }; - - public static terminal_return = class terminal_return extends TreeRuleReturnScope { - public p: IStatePair; - }; - protected factory?: IATNFactory; public constructor(input: TreeNodeStream, stateOrFactory?: IRecognizerSharedState | IATNFactory) { @@ -104,34 +73,6 @@ export class ATNBuilder extends TreeParser { return ATNBuilder.tokenNames; } - public override getGrammarFileName(): string { - return "org/antlr/v4/parse/ATNBuilder.g"; - } - - // $ANTLR start "dummy" - // org/antlr/v4/parse/ATNBuilder.g:80:1: dummy : block[null] ; - public dummy(): void { - try { - // org/antlr/v4/parse/ATNBuilder.g:80:7: ( block[null] ) - // org/antlr/v4/parse/ATNBuilder.g:80:9: block[null] - { - this.block(null); - - } - - } catch (re) { - if (re instanceof RecognitionException) { - this.reportError(re); - } else { - throw re; - } - } - - } - // $ANTLR end "dummy" - - // $ANTLR start "ruleBlock" - // org/antlr/v4/parse/ATNBuilder.g:82:1: ruleBlock[GrammarAST ebnfRoot] returns [IStatePair p] : ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ; public ruleBlock(ebnfRoot: GrammarAST | null): IStatePair | null { let p = null; @@ -142,57 +83,51 @@ export class ATNBuilder extends TreeParser { this.factory!.setCurrentOuterAlt(alt); try { - // org/antlr/v4/parse/ATNBuilder.g:88:5: ( ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ) - // org/antlr/v4/parse/ATNBuilder.g:88:7: ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) { BLOCK1 = this.match(this.input, ANTLRv4Lexer.BLOCK, null) as GrammarAST; this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:89:13: ( ^( OPTIONS ( . )* ) )? + let alt2 = 2; const LA2_0 = this.input.LA(1); if ((LA2_0 === ANTLRv4Lexer.OPTIONS)) { alt2 = 1; } + switch (alt2) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:89:14: ^( OPTIONS ( . )* ) - { - this.match(this.input, ANTLRv4Lexer.OPTIONS, null); - if (this.input.LA(1) === Constants.DOWN) { - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:89:24: ( . )* - loop1: - while (true) { - let alt1 = 2; - const LA1_0 = this.input.LA(1); - if (((LA1_0 >= ANTLRv4Lexer.ACTION && LA1_0 <= ANTLRv4Lexer.WILDCARD))) { - alt1 = 1; - } else { - if ((LA1_0 === Constants.UP)) { - alt1 = 2; - } + this.match(this.input, ANTLRv4Lexer.OPTIONS, null); + if (this.input.LA(1) === Constants.DOWN) { + this.match(this.input, Constants.DOWN, null); + + loop1: + while (true) { + let alt1 = 2; + const LA1_0 = this.input.LA(1); + if (((LA1_0 >= ANTLRv4Lexer.ACTION && LA1_0 <= ANTLRv4Lexer.WILDCARD))) { + alt1 = 1; + } else { + if ((LA1_0 === Constants.UP)) { + alt1 = 2; } + } - switch (alt1) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:89:24: . - { - this.matchAny(this.input); - } - break; - } + switch (alt1) { + case 1: { + this.matchAny(this.input); - default: { - break loop1; - } + break; + } + default: { + break loop1; } - } - this.match(this.input, Constants.UP, null); + } } + this.match(this.input, Constants.UP, null); } + break; } @@ -200,8 +135,8 @@ export class ATNBuilder extends TreeParser { } - // org/antlr/v4/parse/ATNBuilder.g:90:13: (a= alternative )+ let cnt3 = 0; + loop3: while (true) { let alt3 = 2; @@ -212,13 +147,11 @@ export class ATNBuilder extends TreeParser { switch (alt3) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:90:17: a= alternative - { - const a = this.alternative(); + const a = this.alternative(); + + alts.push(a!); + this.factory!.setCurrentOuterAlt(++alt); - alts.push(a!); - this.factory!.setCurrentOuterAlt(++alt); - } break; } @@ -227,10 +160,8 @@ export class ATNBuilder extends TreeParser { break loop3; } - const eee = new EarlyExitException(3, this.input); - throw eee; + throw new EarlyExitException(3, this.input); } - } cnt3++; } @@ -239,7 +170,6 @@ export class ATNBuilder extends TreeParser { p = this.factory!.block(BLOCK1 as BlockAST, ebnfRoot, alts); } - } catch (re) { if (re instanceof RecognitionException) { this.reportError(re); @@ -250,10 +180,7 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR end "ruleBlock" - // $ANTLR start "block" - // org/antlr/v4/parse/ATNBuilder.g:97:1: block[GrammarAST ebnfRoot] returns [IStatePair p] : ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ; public block(ebnfRoot: GrammarAST | null): IStatePair | null { let p = null; @@ -261,57 +188,51 @@ export class ATNBuilder extends TreeParser { const alts = new Array(); try { - // org/antlr/v4/parse/ATNBuilder.g:99:5: ( ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) ) - // org/antlr/v4/parse/ATNBuilder.g:99:7: ^( BLOCK ( ^( OPTIONS ( . )* ) )? (a= alternative )+ ) { BLOCK2 = this.match(this.input, ANTLRv4Lexer.BLOCK, null) as GrammarAST; this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:99:15: ( ^( OPTIONS ( . )* ) )? + let alt5 = 2; const LA5_0 = this.input.LA(1); if ((LA5_0 === ANTLRv4Lexer.OPTIONS)) { alt5 = 1; } + switch (alt5) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:99:16: ^( OPTIONS ( . )* ) - { - this.match(this.input, ANTLRv4Lexer.OPTIONS, null); - if (this.input.LA(1) === Constants.DOWN) { - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:99:26: ( . )* - loop4: - while (true) { - let alt4 = 2; - const LA4_0 = this.input.LA(1); - if (((LA4_0 >= ANTLRv4Lexer.ACTION && LA4_0 <= ANTLRv4Lexer.WILDCARD))) { - alt4 = 1; - } else { - if ((LA4_0 === Constants.UP)) { - alt4 = 2; - } + this.match(this.input, ANTLRv4Lexer.OPTIONS, null); + if (this.input.LA(1) === Constants.DOWN) { + this.match(this.input, Constants.DOWN, null); + + loop4: + while (true) { + let alt4 = 2; + const LA4_0 = this.input.LA(1); + if (((LA4_0 >= ANTLRv4Lexer.ACTION && LA4_0 <= ANTLRv4Lexer.WILDCARD))) { + alt4 = 1; + } else { + if ((LA4_0 === Constants.UP)) { + alt4 = 2; } + } - switch (alt4) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:99:26: . - { - this.matchAny(this.input); - } - break; - } + switch (alt4) { + case 1: { + this.matchAny(this.input); - default: { - break loop4; - } + break; + } + default: { + break loop4; } - } - this.match(this.input, Constants.UP, null); + } } + this.match(this.input, Constants.UP, null); } + break; } @@ -319,8 +240,8 @@ export class ATNBuilder extends TreeParser { } - // org/antlr/v4/parse/ATNBuilder.g:99:32: (a= alternative )+ let cnt6 = 0; + loop6: while (true) { let alt6 = 2; @@ -331,12 +252,10 @@ export class ATNBuilder extends TreeParser { switch (alt6) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:99:33: a= alternative - { - const a = this.alternative(); + const a = this.alternative(); + + alts.push(a!); - alts.push(a!); - } break; } @@ -345,8 +264,7 @@ export class ATNBuilder extends TreeParser { break loop6; } - const eee = new EarlyExitException(6, this.input); - throw eee; + throw new EarlyExitException(6, this.input); } } @@ -368,10 +286,7 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR end "block" - // $ANTLR start "alternative" - // org/antlr/v4/parse/ATNBuilder.g:103:1: alternative returns [IStatePair p] : ( ^( LEXER_ALT_ACTION a= alternative lexerCommands ) | ^( ALT ( elementOptions )? EPSILON ) | ^( ALT ( elementOptions )? (e= element )+ ) ); public alternative(): IStatePair | null { let p = null; @@ -379,7 +294,6 @@ export class ATNBuilder extends TreeParser { const els = new Array(); try { - // org/antlr/v4/parse/ATNBuilder.g:105:5: ( ^( LEXER_ALT_ACTION a= alternative lexerCommands ) | ^( ALT ( elementOptions )? EPSILON ) | ^( ALT ( elementOptions )? (e= element )+ ) ) let alt10 = 3; if (this.input.LA(1) === ANTLRv4Lexer.LEXER_ALT_ACTION) { @@ -393,117 +307,105 @@ export class ATNBuilder extends TreeParser { switch (alt10) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:105:7: ^( LEXER_ALT_ACTION a= alternative lexerCommands ) - { - this.match(this.input, ANTLRv4Lexer.LEXER_ALT_ACTION, null); - this.match(this.input, Constants.DOWN, null); - const a = this.alternative(); + this.match(this.input, ANTLRv4Lexer.LEXER_ALT_ACTION, null); + this.match(this.input, Constants.DOWN, null); + const a = this.alternative(); - const lexerCommands3 = this.lexerCommands(); + const lexerCommands3 = this.lexerCommands(); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + p = this.factory!.lexerAltCommands(a!, lexerCommands3!); - p = this.factory!.lexerAltCommands(a!, lexerCommands3!); - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:107:7: ^( ALT ( elementOptions )? EPSILON ) - { - this.match(this.input, ANTLRv4Lexer.ALT, null); - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:107:13: ( elementOptions )? - let alt7 = 2; - const LA7_0 = this.input.LA(1); - if ((LA7_0 === ANTLRv4Lexer.ELEMENT_OPTIONS)) { - alt7 = 1; - } - switch (alt7) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:107:13: elementOptions - { - this.elementOptions(); + this.match(this.input, ANTLRv4Lexer.ALT, null); + this.match(this.input, Constants.DOWN, null); - } - break; - } + let alt7 = 2; + const LA7_0 = this.input.LA(1); + if ((LA7_0 === ANTLRv4Lexer.ELEMENT_OPTIONS)) { + alt7 = 1; + } - default: + switch (alt7) { + case 1: { + this.elementOptions(); + break; } - EPSILON4 = this.match(this.input, ANTLRv4Lexer.EPSILON, null) as GrammarAST; - this.match(this.input, Constants.UP, null); + default: - p = this.factory!.epsilon(EPSILON4); } + + EPSILON4 = this.match(this.input, ANTLRv4Lexer.EPSILON, null) as GrammarAST; + this.match(this.input, Constants.UP, null); + + p = this.factory!.epsilon(EPSILON4); + break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:108:9: ^( ALT ( elementOptions )? (e= element )+ ) - { - this.match(this.input, ANTLRv4Lexer.ALT, null); - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:108:15: ( elementOptions )? - let alt8 = 2; - const LA8_0 = this.input.LA(1); - if ((LA8_0 === ANTLRv4Lexer.ELEMENT_OPTIONS)) { - alt8 = 1; - } - switch (alt8) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:108:15: elementOptions - { - this.elementOptions(); + this.match(this.input, ANTLRv4Lexer.ALT, null); + this.match(this.input, Constants.DOWN, null); - } - break; - } + let alt8 = 2; + const LA8_0 = this.input.LA(1); + if ((LA8_0 === ANTLRv4Lexer.ELEMENT_OPTIONS)) { + alt8 = 1; + } - default: + switch (alt8) { + case 1: { + this.elementOptions(); + break; } - // org/antlr/v4/parse/ATNBuilder.g:108:31: (e= element )+ - let cnt9 = 0; - loop9: - while (true) { - let alt9 = 2; - const LA9_0 = this.input.LA(1); - if ((LA9_0 === ANTLRv4Lexer.ACTION || LA9_0 === ANTLRv4Lexer.ASSIGN || LA9_0 === ANTLRv4Lexer.DOT || LA9_0 === ANTLRv4Lexer.LEXER_CHAR_SET || LA9_0 === ANTLRv4Lexer.NOT || LA9_0 === ANTLRv4Lexer.PLUS_ASSIGN || LA9_0 === ANTLRv4Lexer.RANGE || LA9_0 === ANTLRv4Lexer.RULE_REF || LA9_0 === ANTLRv4Lexer.SEMPRED || LA9_0 === ANTLRv4Lexer.STRING_LITERAL || LA9_0 === ANTLRv4Lexer.TOKEN_REF || (LA9_0 >= ANTLRv4Lexer.BLOCK && LA9_0 <= ANTLRv4Lexer.CLOSURE) || (LA9_0 >= ANTLRv4Lexer.OPTIONAL && LA9_0 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA9_0 >= ANTLRv4Lexer.SET && LA9_0 <= ANTLRv4Lexer.WILDCARD))) { - alt9 = 1; - } + default: - switch (alt9) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:108:32: e= element - { - const e = this.element(); + } - els.push(e.p); - } - break; + let cnt9 = 0; + + loop9: + while (true) { + let alt9 = 2; + const LA9_0 = this.input.LA(1); + if ((LA9_0 === ANTLRv4Lexer.ACTION || LA9_0 === ANTLRv4Lexer.ASSIGN || LA9_0 === ANTLRv4Lexer.DOT || LA9_0 === ANTLRv4Lexer.LEXER_CHAR_SET || LA9_0 === ANTLRv4Lexer.NOT || LA9_0 === ANTLRv4Lexer.PLUS_ASSIGN || LA9_0 === ANTLRv4Lexer.RANGE || LA9_0 === ANTLRv4Lexer.RULE_REF || LA9_0 === ANTLRv4Lexer.SEMPRED || LA9_0 === ANTLRv4Lexer.STRING_LITERAL || LA9_0 === ANTLRv4Lexer.TOKEN_REF || (LA9_0 >= ANTLRv4Lexer.BLOCK && LA9_0 <= ANTLRv4Lexer.CLOSURE) || (LA9_0 >= ANTLRv4Lexer.OPTIONAL && LA9_0 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA9_0 >= ANTLRv4Lexer.SET && LA9_0 <= ANTLRv4Lexer.WILDCARD))) { + alt9 = 1; + } + + switch (alt9) { + case 1: { + const e = this.element(); + if (e.p) { + els.push(e.p); } - default: { - if (cnt9 >= 1) { - break loop9; - } + break; + } - const eee = new EarlyExitException(9, this.input); - throw eee; + default: { + if (cnt9 >= 1) { + break loop9; } + throw new EarlyExitException(9, this.input); } - cnt9++; + } + cnt9++; + } - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + p = this.factory!.alt(els); - p = this.factory!.alt(els); - } break; } @@ -520,10 +422,7 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR end "alternative" - // $ANTLR start "lexerCommands" - // org/antlr/v4/parse/ATNBuilder.g:111:1: lexerCommands returns [IStatePair p] : (c= lexerCommand )+ ; public lexerCommands(): IStatePair | null { let p = null; @@ -531,50 +430,41 @@ export class ATNBuilder extends TreeParser { const cmds = new Array(); try { - // org/antlr/v4/parse/ATNBuilder.g:113:5: ( (c= lexerCommand )+ ) - // org/antlr/v4/parse/ATNBuilder.g:113:9: (c= lexerCommand )+ - { - // org/antlr/v4/parse/ATNBuilder.g:113:9: (c= lexerCommand )+ - let cnt11 = 0; - loop11: - while (true) { - let alt11 = 2; - const LA11_0 = this.input.LA(1); - if ((LA11_0 === ANTLRv4Lexer.ID || LA11_0 === ANTLRv4Lexer.LEXER_ACTION_CALL)) { - alt11 = 1; - } + let cnt11 = 0; - switch (alt11) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:113:10: c= lexerCommand - { - c = this.lexerCommand(); + loop11: + while (true) { + let alt11 = 2; + const LA11_0 = this.input.LA(1); + if ((LA11_0 === ANTLRv4Lexer.ID || LA11_0 === ANTLRv4Lexer.LEXER_ACTION_CALL)) { + alt11 = 1; + } - if (c !== null) { - cmds.push(c); - } + switch (alt11) { + case 1: { + c = this.lexerCommand(); - } - break; + if (c !== null) { + cmds.push(c); } - default: { - if (cnt11 >= 1) { - break loop11; - } + break; + } - const eee = new EarlyExitException(11, this.input); - throw eee; + default: { + if (cnt11 >= 1) { + break loop11; } + const eee = new EarlyExitException(11, this.input); + throw eee; } - cnt11++; - } - - p = this.factory!.alt(cmds); + } + cnt11++; } + p = this.factory!.alt(cmds); } catch (re) { if (re instanceof RecognitionException) { this.reportError(re); @@ -585,10 +475,7 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR end "lexerCommands" - // $ANTLR start "lexerCommand" - // org/antlr/v4/parse/ATNBuilder.g:119:1: lexerCommand returns [IStatePair cmd] : ( ^( LEXER_ACTION_CALL ID lexerCommandExpr ) | ID ); public lexerCommand(): IStatePair | null { let cmd = null; @@ -596,7 +483,6 @@ export class ATNBuilder extends TreeParser { let ID7 = null; try { - // org/antlr/v4/parse/ATNBuilder.g:120:2: ( ^( LEXER_ACTION_CALL ID lexerCommandExpr ) | ID ) let alt12 = 2; const LA12_0 = this.input.LA(1); if ((LA12_0 === ANTLRv4Lexer.LEXER_ACTION_CALL)) { @@ -605,39 +491,32 @@ export class ATNBuilder extends TreeParser { if ((LA12_0 === ANTLRv4Lexer.ID)) { alt12 = 2; } else { - const nvae = - new NoViableAltException("", 12, 0, this.input); - throw nvae; + throw new NoViableAltException("", 12, 0, this.input); } } switch (alt12) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:120:4: ^( LEXER_ACTION_CALL ID lexerCommandExpr ) - { - this.match(this.input, ANTLRv4Lexer.LEXER_ACTION_CALL, null); - this.match(this.input, Constants.DOWN, null); - ID5 = this.match(this.input, ANTLRv4Lexer.ID, null) as GrammarAST; - const lexerCommandExpr6 = this.lexerCommandExpr(); + this.match(this.input, ANTLRv4Lexer.LEXER_ACTION_CALL, null); + this.match(this.input, Constants.DOWN, null); + ID5 = this.match(this.input, ANTLRv4Lexer.ID, null) as GrammarAST; + const lexerCommandExpr6 = this.lexerCommandExpr(); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + cmd = this.factory!.lexerCallCommand(ID5, lexerCommandExpr6.start as GrammarAST); - cmd = this.factory!.lexerCallCommand(ID5, lexerCommandExpr6.start as GrammarAST); - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:122:4: ID - { - ID7 = this.match(this.input, ANTLRv4Lexer.ID, null) as GrammarAST; - cmd = this.factory!.lexerCommand(ID7); - } + ID7 = this.match(this.input, ANTLRv4Lexer.ID, null) as GrammarAST; + cmd = this.factory!.lexerCommand(ID7); + break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -650,25 +529,17 @@ export class ATNBuilder extends TreeParser { return cmd; } - // $ANTLR start "lexerCommandExpr" - // org/antlr/v4/parse/ATNBuilder.g:126:1: lexerCommandExpr : ( ID | INT ); - public lexerCommandExpr(): ATNBuilder.lexerCommandExpr_return { - const retval = new ATNBuilder.lexerCommandExpr_return(); - retval.start = this.input.LT(1); + public lexerCommandExpr(): ITreeRuleReturnScope { + const retval = { start: this.input.LT(1) ?? undefined }; try { - // org/antlr/v4/parse/ATNBuilder.g:127:2: ( ID | INT ) - // org/antlr/v4/parse/ATNBuilder.g: - { - if (this.input.LA(1) === ANTLRv4Lexer.ID || this.input.LA(1) === ANTLRv4Lexer.INT) { - this.input.consume(); - this.state.errorRecovery = false; - } else { - const mse = new MismatchedSetException(null, this.input); - throw mse; - } + if (this.input.LA(1) === ANTLRv4Lexer.ID || this.input.LA(1) === ANTLRv4Lexer.INT) { + this.input.consume(); + this.state.errorRecovery = false; + } else { + const mse = new MismatchedSetException(null, this.input); + throw mse; } - } catch (re) { if (re instanceof RecognitionException) { this.reportError(re); @@ -680,11 +551,8 @@ export class ATNBuilder extends TreeParser { return retval; } - // $ANTLR start "element" - // org/antlr/v4/parse/ATNBuilder.g:131:1: element returns [IStatePair p] : ( labeledElement | atom | subrule | ACTION | SEMPRED | ^( ACTION . ) | ^( SEMPRED . ) | ^( NOT b= blockSet[true] ) | LEXER_CHAR_SET ); - public element(): ATNBuilder.element_return { - const retval = new ATNBuilder.element_return(); - retval.start = this.input.LT(1); + public element(): IPairedReturnScope { + const retval: IPairedReturnScope = { start: this.input.LT(1) ?? undefined }; let ACTION11 = null; let SEMPRED12 = null; @@ -696,14 +564,12 @@ export class ATNBuilder extends TreeParser { let subrule10 = null; try { - // org/antlr/v4/parse/ATNBuilder.g:132:2: ( labeledElement | atom | subrule | ACTION | SEMPRED | ^( ACTION . ) | ^( SEMPRED . ) | ^( NOT b= blockSet[true] ) | LEXER_CHAR_SET ) let alt13 = 9; switch (this.input.LA(1)) { case ANTLRv4Lexer.ASSIGN: case ANTLRv4Lexer.PLUS_ASSIGN: { - { - alt13 = 1; - } + alt13 = 1; + break; } @@ -714,9 +580,8 @@ export class ATNBuilder extends TreeParser { case ANTLRv4Lexer.TOKEN_REF: case ANTLRv4Lexer.SET: case ANTLRv4Lexer.WILDCARD: { - { - alt13 = 2; - } + alt13 = 2; + break; } @@ -724,188 +589,152 @@ export class ATNBuilder extends TreeParser { case ANTLRv4Lexer.CLOSURE: case ANTLRv4Lexer.OPTIONAL: case ANTLRv4Lexer.POSITIVE_CLOSURE: { - { - alt13 = 3; - } + alt13 = 3; + break; } case ANTLRv4Lexer.ACTION: { - { - const LA13_4 = this.input.LA(2); - if ((LA13_4 === Constants.DOWN)) { - alt13 = 6; + const LA13_4 = this.input.LA(2); + if ((LA13_4 === Constants.DOWN)) { + alt13 = 6; + } else { + if (((LA13_4 >= Constants.UP && LA13_4 <= ANTLRv4Lexer.ACTION) || LA13_4 === ANTLRv4Lexer.ASSIGN || LA13_4 === ANTLRv4Lexer.DOT || LA13_4 === ANTLRv4Lexer.LEXER_CHAR_SET || LA13_4 === ANTLRv4Lexer.NOT || LA13_4 === ANTLRv4Lexer.PLUS_ASSIGN || LA13_4 === ANTLRv4Lexer.RANGE || LA13_4 === ANTLRv4Lexer.RULE_REF || LA13_4 === ANTLRv4Lexer.SEMPRED || LA13_4 === ANTLRv4Lexer.STRING_LITERAL || LA13_4 === ANTLRv4Lexer.TOKEN_REF || (LA13_4 >= ANTLRv4Lexer.BLOCK && LA13_4 <= ANTLRv4Lexer.CLOSURE) || (LA13_4 >= ANTLRv4Lexer.OPTIONAL && LA13_4 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA13_4 >= ANTLRv4Lexer.SET && LA13_4 <= ANTLRv4Lexer.WILDCARD))) { + alt13 = 4; } else { - if (((LA13_4 >= Constants.UP && LA13_4 <= ANTLRv4Lexer.ACTION) || LA13_4 === ANTLRv4Lexer.ASSIGN || LA13_4 === ANTLRv4Lexer.DOT || LA13_4 === ANTLRv4Lexer.LEXER_CHAR_SET || LA13_4 === ANTLRv4Lexer.NOT || LA13_4 === ANTLRv4Lexer.PLUS_ASSIGN || LA13_4 === ANTLRv4Lexer.RANGE || LA13_4 === ANTLRv4Lexer.RULE_REF || LA13_4 === ANTLRv4Lexer.SEMPRED || LA13_4 === ANTLRv4Lexer.STRING_LITERAL || LA13_4 === ANTLRv4Lexer.TOKEN_REF || (LA13_4 >= ANTLRv4Lexer.BLOCK && LA13_4 <= ANTLRv4Lexer.CLOSURE) || (LA13_4 >= ANTLRv4Lexer.OPTIONAL && LA13_4 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA13_4 >= ANTLRv4Lexer.SET && LA13_4 <= ANTLRv4Lexer.WILDCARD))) { - alt13 = 4; - } else { - const nvaeMark = this.input.mark(); - const lastIndex = this.input.index; - try { - this.input.consume(); - const nvae = - new NoViableAltException("", 13, 4, this.input); - throw nvae; - } finally { - this.input.seek(lastIndex); - this.input.release(nvaeMark); - } + const nvaeMark = this.input.mark(); + const lastIndex = this.input.index; + try { + this.input.consume(); + throw new NoViableAltException("", 13, 4, this.input); + } finally { + this.input.seek(lastIndex); + this.input.release(nvaeMark); } } - } + break; } case ANTLRv4Lexer.SEMPRED: { - { - const LA13_5 = this.input.LA(2); - if ((LA13_5 === Constants.DOWN)) { - alt13 = 7; + const LA13_5 = this.input.LA(2); + if ((LA13_5 === Constants.DOWN)) { + alt13 = 7; + } else { + if (((LA13_5 >= Constants.UP && LA13_5 <= ANTLRv4Lexer.ACTION) || LA13_5 === ANTLRv4Lexer.ASSIGN || LA13_5 === ANTLRv4Lexer.DOT || LA13_5 === ANTLRv4Lexer.LEXER_CHAR_SET || LA13_5 === ANTLRv4Lexer.NOT || LA13_5 === ANTLRv4Lexer.PLUS_ASSIGN || LA13_5 === ANTLRv4Lexer.RANGE || LA13_5 === ANTLRv4Lexer.RULE_REF || LA13_5 === ANTLRv4Lexer.SEMPRED || LA13_5 === ANTLRv4Lexer.STRING_LITERAL || LA13_5 === ANTLRv4Lexer.TOKEN_REF || (LA13_5 >= ANTLRv4Lexer.BLOCK && LA13_5 <= ANTLRv4Lexer.CLOSURE) || (LA13_5 >= ANTLRv4Lexer.OPTIONAL && LA13_5 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA13_5 >= ANTLRv4Lexer.SET && LA13_5 <= ANTLRv4Lexer.WILDCARD))) { + alt13 = 5; } else { - if (((LA13_5 >= Constants.UP && LA13_5 <= ANTLRv4Lexer.ACTION) || LA13_5 === ANTLRv4Lexer.ASSIGN || LA13_5 === ANTLRv4Lexer.DOT || LA13_5 === ANTLRv4Lexer.LEXER_CHAR_SET || LA13_5 === ANTLRv4Lexer.NOT || LA13_5 === ANTLRv4Lexer.PLUS_ASSIGN || LA13_5 === ANTLRv4Lexer.RANGE || LA13_5 === ANTLRv4Lexer.RULE_REF || LA13_5 === ANTLRv4Lexer.SEMPRED || LA13_5 === ANTLRv4Lexer.STRING_LITERAL || LA13_5 === ANTLRv4Lexer.TOKEN_REF || (LA13_5 >= ANTLRv4Lexer.BLOCK && LA13_5 <= ANTLRv4Lexer.CLOSURE) || (LA13_5 >= ANTLRv4Lexer.OPTIONAL && LA13_5 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA13_5 >= ANTLRv4Lexer.SET && LA13_5 <= ANTLRv4Lexer.WILDCARD))) { - alt13 = 5; - } else { - const nvaeMark = this.input.mark(); - const lastIndex = this.input.index; - try { - this.input.consume(); - const nvae = - new NoViableAltException("", 13, 5, this.input); - throw nvae; - } finally { - this.input.seek(lastIndex); - this.input.release(nvaeMark); - } + const nvaeMark = this.input.mark(); + const lastIndex = this.input.index; + try { + this.input.consume(); + throw new NoViableAltException("", 13, 5, this.input); + } finally { + this.input.seek(lastIndex); + this.input.release(nvaeMark); } } - } + break; } case ANTLRv4Lexer.NOT: { - { - alt13 = 8; - } + alt13 = 8; + break; } case ANTLRv4Lexer.LEXER_CHAR_SET: { - { - alt13 = 9; - } + alt13 = 9; + break; } default: { - const nvae = new NoViableAltException("", 13, 0, this.input); - throw nvae; + throw new NoViableAltException("", 13, 0, this.input); } - } switch (alt13) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:132:4: labeledElement - { - labeledElement8 = this.labeledElement(); + labeledElement8 = this.labeledElement(); + retval.p = labeledElement8!; - retval.p = labeledElement8!; - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:133:4: atom - { - atom9 = this.atom(); - - retval.p = atom9.p; - } + atom9 = this.atom(); + retval.p = atom9.p; break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:134:4: subrule - { - subrule10 = this.subrule(); + subrule10 = this.subrule(); + retval.p = subrule10.p; - retval.p = subrule10.p; - } break; } case 4: { - // org/antlr/v4/parse/ATNBuilder.g:135:6: ACTION - { - ACTION11 = this.match(this.input, ANTLRv4Lexer.ACTION, null) as GrammarAST; - retval.p = this.factory!.action(ACTION11 as ActionAST); - } + ACTION11 = this.match(this.input, ANTLRv4Lexer.ACTION, null) as GrammarAST; + retval.p = this.factory!.action(ACTION11 as ActionAST); + break; } case 5: { - // org/antlr/v4/parse/ATNBuilder.g:136:6: SEMPRED - { - SEMPRED12 = this.match(this.input, ANTLRv4Lexer.SEMPRED, null) as GrammarAST; - retval.p = this.factory!.sempred(SEMPRED12 as PredAST); - } + SEMPRED12 = this.match(this.input, ANTLRv4Lexer.SEMPRED, null) as GrammarAST; + retval.p = this.factory!.sempred(SEMPRED12 as PredAST); + break; } case 6: { - // org/antlr/v4/parse/ATNBuilder.g:137:6: ^( ACTION . ) - { - ACTION13 = this.match(this.input, ANTLRv4Lexer.ACTION, null) as GrammarAST; - this.match(this.input, Constants.DOWN, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + ACTION13 = this.match(this.input, ANTLRv4Lexer.ACTION, null) as GrammarAST; + this.match(this.input, Constants.DOWN, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); + + retval.p = this.factory!.action(ACTION13 as ActionAST); - retval.p = this.factory!.action(ACTION13 as ActionAST); - } break; } case 7: { - // org/antlr/v4/parse/ATNBuilder.g:138:6: ^( SEMPRED . ) - { - SEMPRED14 = this.match(this.input, ANTLRv4Lexer.SEMPRED, null) as GrammarAST; - this.match(this.input, Constants.DOWN, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + SEMPRED14 = this.match(this.input, ANTLRv4Lexer.SEMPRED, null) as GrammarAST; + this.match(this.input, Constants.DOWN, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); + + retval.p = this.factory!.sempred(SEMPRED14 as PredAST); - retval.p = this.factory!.sempred(SEMPRED14 as PredAST); - } break; } case 8: { - // org/antlr/v4/parse/ATNBuilder.g:139:7: ^( NOT b= blockSet[true] ) - { - this.match(this.input, ANTLRv4Lexer.NOT, null); - this.match(this.input, Constants.DOWN, null); - b = this.blockSet(true); + this.match(this.input, ANTLRv4Lexer.NOT, null); + this.match(this.input, Constants.DOWN, null); + b = this.blockSet(true); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + retval.p = b.p; - retval.p = b.p; - } break; } case 9: { - // org/antlr/v4/parse/ATNBuilder.g:140:7: LEXER_CHAR_SET - { - this.match(this.input, ANTLRv4Lexer.LEXER_CHAR_SET, null); - retval.p = this.factory!.charSetLiteral((retval.start as GrammarAST))!; - } + this.match(this.input, ANTLRv4Lexer.LEXER_CHAR_SET, null); + retval.p = this.factory!.charSetLiteral((retval.start as GrammarAST))!; + break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -917,15 +746,11 @@ export class ATNBuilder extends TreeParser { return retval; } - // $ANTLR end "element" - // $ANTLR start "astOperand" - // org/antlr/v4/parse/ATNBuilder.g:143:1: astOperand returns [IStatePair p] : ( atom | ^( NOT blockSet[true] ) ); - public astOperand(): IStatePair | null { - let p = null; + public astOperand(): IStatePair | undefined { + let p: IStatePair | undefined; try { - // org/antlr/v4/parse/ATNBuilder.g:144:2: ( atom | ^( NOT blockSet[true] ) ) let alt14 = 2; const LA14_0 = this.input.LA(1); if ((LA14_0 === ANTLRv4Lexer.DOT || LA14_0 === ANTLRv4Lexer.RANGE || LA14_0 === ANTLRv4Lexer.RULE_REF || LA14_0 === ANTLRv4Lexer.STRING_LITERAL || LA14_0 === ANTLRv4Lexer.TOKEN_REF || (LA14_0 >= ANTLRv4Lexer.SET && LA14_0 <= ANTLRv4Lexer.WILDCARD))) { @@ -942,31 +767,25 @@ export class ATNBuilder extends TreeParser { switch (alt14) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:144:4: atom - { - const atom15 = this.atom(); + const atom15 = this.atom(); + p = atom15.p; - p = atom15.p; - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:145:4: ^( NOT blockSet[true] ) - { - this.match(this.input, ANTLRv4Lexer.NOT, null); - this.match(this.input, Constants.DOWN, null); - const blockSet16 = this.blockSet(true); + this.match(this.input, ANTLRv4Lexer.NOT, null); + this.match(this.input, Constants.DOWN, null); + const blockSet16 = this.blockSet(true); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + p = blockSet16.p; - p = blockSet16.p; - } break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -978,15 +797,11 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR end "astOperand" - // $ANTLR start "labeledElement" - // org/antlr/v4/parse/ATNBuilder.g:148:1: labeledElement returns [IStatePair p] : ( ^( ASSIGN ID element ) | ^( PLUS_ASSIGN ID element ) ); public labeledElement(): IStatePair | null { let p = null; try { - // org/antlr/v4/parse/ATNBuilder.g:149:2: ( ^( ASSIGN ID element ) | ^( PLUS_ASSIGN ID element ) ) let alt15 = 2; const LA15_0 = this.input.LA(1); if ((LA15_0 === ANTLRv4Lexer.ASSIGN)) { @@ -1003,37 +818,34 @@ export class ATNBuilder extends TreeParser { switch (alt15) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:149:4: ^( ASSIGN ID element ) - { - this.match(this.input, ANTLRv4Lexer.ASSIGN, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - const element17 = this.element(); - - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.ASSIGN, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + const element17 = this.element(); + this.match(this.input, Constants.UP, null); + if (element17.p) { p = this.factory!.label(element17.p); } + break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:150:4: ^( PLUS_ASSIGN ID element ) - { - this.match(this.input, ANTLRv4Lexer.PLUS_ASSIGN, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - const element18 = this.element(); - - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.PLUS_ASSIGN, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + const element18 = this.element(); + this.match(this.input, Constants.UP, null); + if (element18.p) { p = this.factory!.listLabel(element18.p); } + break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -1046,100 +858,82 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR start "subrule" - // org/antlr/v4/parse/ATNBuilder.g:153:1: subrule returns [IStatePair p] : ( ^( OPTIONAL block[$start] ) | ^( CLOSURE block[$start] ) | ^( POSITIVE_CLOSURE block[$start] ) | block[null] ); - public subrule(): ATNBuilder.subrule_return { - const retval = new ATNBuilder.subrule_return(); - retval.start = this.input.LT(1); + public subrule(): IPairedReturnScope { + const retval: IPairedReturnScope = { start: this.input.LT(1) ?? undefined }; try { - // org/antlr/v4/parse/ATNBuilder.g:154:2: ( ^( OPTIONAL block[$start] ) | ^( CLOSURE block[$start] ) | ^( POSITIVE_CLOSURE block[$start] ) | block[null] ) let alt16 = 4; switch (this.input.LA(1)) { case ANTLRv4Lexer.OPTIONAL: { - { - alt16 = 1; - } + alt16 = 1; + break; } case ANTLRv4Lexer.CLOSURE: { - { - alt16 = 2; - } + alt16 = 2; + break; } case ANTLRv4Lexer.POSITIVE_CLOSURE: { - { - alt16 = 3; - } + alt16 = 3; + break; } case ANTLRv4Lexer.BLOCK: { - { - alt16 = 4; - } + alt16 = 4; + break; } default: { - const nvae = new NoViableAltException("", 16, 0, this.input); - throw nvae; + throw new NoViableAltException("", 16, 0, this.input); } } switch (alt16) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:154:4: ^( OPTIONAL block[$start] ) - { - this.match(this.input, ANTLRv4Lexer.OPTIONAL, null); - this.match(this.input, Constants.DOWN, null); - const block19 = this.block((retval.start as GrammarAST)); + this.match(this.input, ANTLRv4Lexer.OPTIONAL, null); + this.match(this.input, Constants.DOWN, null); + const block19 = this.block((retval.start as GrammarAST)); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + retval.p = block19!; - retval.p = block19!; - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:155:4: ^( CLOSURE block[$start] ) - { - this.match(this.input, ANTLRv4Lexer.CLOSURE, null); - this.match(this.input, Constants.DOWN, null); - const block20 = this.block((retval.start as GrammarAST)); + this.match(this.input, ANTLRv4Lexer.CLOSURE, null); + this.match(this.input, Constants.DOWN, null); + const block20 = this.block((retval.start as GrammarAST)); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + retval.p = block20!; - retval.p = block20!; - } break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:156:4: ^( POSITIVE_CLOSURE block[$start] ) - { - this.match(this.input, ANTLRv4Lexer.POSITIVE_CLOSURE, null); - this.match(this.input, Constants.DOWN, null); - const block21 = this.block((retval.start as GrammarAST)); + this.match(this.input, ANTLRv4Lexer.POSITIVE_CLOSURE, null); + this.match(this.input, Constants.DOWN, null); + const block21 = this.block((retval.start as GrammarAST)); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + retval.p = block21!; - retval.p = block21!; - } break; } case 4: { - // org/antlr/v4/parse/ATNBuilder.g:157:5: block[null] - { - const block22 = this.block(null); + const block22 = this.block(null); + retval.p = block22!; - retval.p = block22!; - } break; } @@ -1157,58 +951,49 @@ export class ATNBuilder extends TreeParser { return retval; } - // $ANTLR start "blockSet" - // org/antlr/v4/parse/ATNBuilder.g:160:1: blockSet[boolean invert] returns [IStatePair p] : ^( SET ( setElement )+ ) ; - public blockSet(invert: boolean): ATNBuilder.blockSet_return { - const retval = new ATNBuilder.blockSet_return(); - retval.start = this.input.LT(1); + public blockSet(invert: boolean): IPairedReturnScope { + const retval: IPairedReturnScope = { start: this.input.LT(1) ?? undefined }; const alts = new Array(); try { - // org/antlr/v4/parse/ATNBuilder.g:162:2: ( ^( SET ( setElement )+ ) ) - // org/antlr/v4/parse/ATNBuilder.g:162:4: ^( SET ( setElement )+ ) - { - this.match(this.input, ANTLRv4Lexer.SET, null); - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:162:10: ( setElement )+ - let cnt17 = 0; - loop17: - while (true) { - let alt17 = 2; - const LA17_0 = this.input.LA(1); - if ((LA17_0 === ANTLRv4Lexer.LEXER_CHAR_SET || LA17_0 === ANTLRv4Lexer.RANGE || LA17_0 === ANTLRv4Lexer.STRING_LITERAL || LA17_0 === ANTLRv4Lexer.TOKEN_REF)) { - alt17 = 1; - } + this.match(this.input, ANTLRv4Lexer.SET, null); + this.match(this.input, Constants.DOWN, null); - switch (alt17) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:162:11: setElement - { - const setElement23 = this.setElement(); + let cnt17 = 0; - alts.push(setElement23.start as GrammarAST); - } - break; - } + loop17: + while (true) { + let alt17 = 2; + const LA17_0 = this.input.LA(1); + if ((LA17_0 === ANTLRv4Lexer.LEXER_CHAR_SET || LA17_0 === ANTLRv4Lexer.RANGE || LA17_0 === ANTLRv4Lexer.STRING_LITERAL || LA17_0 === ANTLRv4Lexer.TOKEN_REF)) { + alt17 = 1; + } - default: { - if (cnt17 >= 1) { - break loop17; - } + switch (alt17) { + case 1: { + const setElement23 = this.setElement(); - const eee = new EarlyExitException(17, this.input); - throw eee; - } + alts.push(setElement23.start as GrammarAST); + break; } - cnt17++; - } - this.match(this.input, Constants.UP, null); + default: { + if (cnt17 >= 1) { + break loop17; + } + + const eee = new EarlyExitException(17, this.input); + throw eee; + } - retval.p = this.factory!.set((retval.start as GrammarAST), alts, invert); + } + cnt17++; } + this.match(this.input, Constants.UP, null); + + retval.p = this.factory!.set((retval.start as GrammarAST), alts, invert); } catch (re) { if (re instanceof RecognitionException) { this.reportError(re); @@ -1220,159 +1005,127 @@ export class ATNBuilder extends TreeParser { return retval; } - // $ANTLR start "setElement" - // org/antlr/v4/parse/ATNBuilder.g:166:1: setElement : ( ^( STRING_LITERAL . ) | ^( TOKEN_REF . ) | STRING_LITERAL | TOKEN_REF | ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) | LEXER_CHAR_SET ); - public setElement(): ATNBuilder.setElement_return { - const retval = new ATNBuilder.setElement_return(); - retval.start = this.input.LT(1); + public setElement(): IPairedReturnScope { + const retval: IPairedReturnScope = { start: this.input.LT(1) ?? undefined }; try { - // org/antlr/v4/parse/ATNBuilder.g:167:2: ( ^( STRING_LITERAL . ) | ^( TOKEN_REF . ) | STRING_LITERAL | TOKEN_REF | ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) | LEXER_CHAR_SET ) let alt18 = 6; switch (this.input.LA(1)) { case ANTLRv4Lexer.STRING_LITERAL: { - { - const LA18_1 = this.input.LA(2); - if ((LA18_1 === Constants.DOWN)) { - alt18 = 1; + const LA18_1 = this.input.LA(2); + if ((LA18_1 === Constants.DOWN)) { + alt18 = 1; + } else { + if ((LA18_1 === Constants.UP || LA18_1 === ANTLRv4Lexer.LEXER_CHAR_SET + || LA18_1 === ANTLRv4Lexer.RANGE || LA18_1 === ANTLRv4Lexer.STRING_LITERAL + || LA18_1 === ANTLRv4Lexer.TOKEN_REF)) { + alt18 = 3; } else { - if ((LA18_1 === Constants.UP || LA18_1 === ANTLRv4Lexer.LEXER_CHAR_SET - || LA18_1 === ANTLRv4Lexer.RANGE || LA18_1 === ANTLRv4Lexer.STRING_LITERAL - || LA18_1 === ANTLRv4Lexer.TOKEN_REF)) { - alt18 = 3; - } else { - const nvaeMark = this.input.mark(); - const lastIndex = this.input.index; - try { - this.input.consume(); - const nvae = - new NoViableAltException("", 18, 1, this.input); - throw nvae; - } finally { - this.input.seek(lastIndex); - this.input.release(nvaeMark); - } + const nvaeMark = this.input.mark(); + const lastIndex = this.input.index; + try { + this.input.consume(); + throw new NoViableAltException("", 18, 1, this.input); + } finally { + this.input.seek(lastIndex); + this.input.release(nvaeMark); } } - } + break; } case ANTLRv4Lexer.TOKEN_REF: { - { - const LA18_2 = this.input.LA(2); - if ((LA18_2 === Constants.DOWN)) { - alt18 = 2; + const LA18_2 = this.input.LA(2); + if ((LA18_2 === Constants.DOWN)) { + alt18 = 2; + } else { + if ((LA18_2 === Constants.UP || LA18_2 === ANTLRv4Lexer.LEXER_CHAR_SET + || LA18_2 === ANTLRv4Lexer.RANGE || LA18_2 === ANTLRv4Lexer.STRING_LITERAL + || LA18_2 === ANTLRv4Lexer.TOKEN_REF)) { + alt18 = 4; } else { - if ((LA18_2 === Constants.UP || LA18_2 === ANTLRv4Lexer.LEXER_CHAR_SET - || LA18_2 === ANTLRv4Lexer.RANGE || LA18_2 === ANTLRv4Lexer.STRING_LITERAL - || LA18_2 === ANTLRv4Lexer.TOKEN_REF)) { - alt18 = 4; - } else { - const nvaeMark = this.input.mark(); - const lastIndex = this.input.index; - try { - this.input.consume(); - const nvae = - new NoViableAltException("", 18, 2, this.input); - throw nvae; - } finally { - this.input.seek(lastIndex); - this.input.release(nvaeMark); - } + const nvaeMark = this.input.mark(); + const lastIndex = this.input.index; + try { + this.input.consume(); + throw new NoViableAltException("", 18, 2, this.input); + } finally { + this.input.seek(lastIndex); + this.input.release(nvaeMark); } } - } + break; } case ANTLRv4Lexer.RANGE: { - { - alt18 = 5; - } + alt18 = 5; + break; } case ANTLRv4Lexer.LEXER_CHAR_SET: { - { - alt18 = 6; - } + alt18 = 6; + break; } default: { - const nvae = - new NoViableAltException("", 18, 0, this.input); - throw nvae; + throw new NoViableAltException("", 18, 0, this.input); } } switch (alt18) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:167:4: ^( STRING_LITERAL . ) - { - this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); - this.match(this.input, Constants.DOWN, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); + this.match(this.input, Constants.DOWN, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:168:4: ^( TOKEN_REF . ) - { - this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); - this.match(this.input, Constants.DOWN, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); + this.match(this.input, Constants.DOWN, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); - } break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:169:4: STRING_LITERAL - { - this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); - } + this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); + break; } case 4: { - // org/antlr/v4/parse/ATNBuilder.g:170:4: TOKEN_REF - { - this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); - } + this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); + break; } case 5: { - // org/antlr/v4/parse/ATNBuilder.g:171:4: ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) - { - this.match(this.input, ANTLRv4Lexer.RANGE, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); - this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.RANGE, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); + this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); + this.match(this.input, Constants.UP, null); - } break; } case 6: { - // org/antlr/v4/parse/ATNBuilder.g:172:9: LEXER_CHAR_SET - { - this.match(this.input, ANTLRv4Lexer.LEXER_CHAR_SET, null); - } + this.match(this.input, ANTLRv4Lexer.LEXER_CHAR_SET, null); + break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -1385,232 +1138,193 @@ export class ATNBuilder extends TreeParser { return retval; } - // $ANTLR start "atom" - // org/antlr/v4/parse/ATNBuilder.g:175:1: atom returns [IStatePair p] : ( range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | ^( WILDCARD . ) | WILDCARD | blockSet[false] | terminal | ruleref ); - public atom(): ATNBuilder.atom_return { - const retval = new ATNBuilder.atom_return(); - retval.start = this.input.LT(1); + public atom(): IPairedReturnScope { + const retval: IPairedReturnScope = { start: this.input.LT(1) ?? undefined }; try { - // org/antlr/v4/parse/ATNBuilder.g:176:2: ( range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | ^( WILDCARD . ) | WILDCARD | blockSet[false] | terminal | ruleref ) let alt19 = 8; switch (this.input.LA(1)) { case ANTLRv4Lexer.RANGE: { - { - alt19 = 1; - } + alt19 = 1; + break; } case ANTLRv4Lexer.DOT: { - { - const LA19_2 = this.input.LA(2); - if ((LA19_2 === Constants.DOWN)) { - const LA19_7 = this.input.LA(3); - if ((LA19_7 === ANTLRv4Lexer.ID)) { - const LA19_10 = this.input.LA(4); - if ((LA19_10 === ANTLRv4Lexer.STRING_LITERAL || LA19_10 === ANTLRv4Lexer.TOKEN_REF)) { - alt19 = 2; + const LA19_2 = this.input.LA(2); + if ((LA19_2 === Constants.DOWN)) { + const LA19_7 = this.input.LA(3); + if ((LA19_7 === ANTLRv4Lexer.ID)) { + const LA19_10 = this.input.LA(4); + if ((LA19_10 === ANTLRv4Lexer.STRING_LITERAL || LA19_10 === ANTLRv4Lexer.TOKEN_REF)) { + alt19 = 2; + } else { + if ((LA19_10 === ANTLRv4Lexer.RULE_REF)) { + alt19 = 3; } else { - if ((LA19_10 === ANTLRv4Lexer.RULE_REF)) { - alt19 = 3; - } else { - const nvaeMark = this.input.mark(); - const lastIndex = this.input.index; - try { - for (let nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - this.input.consume(); - } - const nvae = new NoViableAltException("", 19, 10, this.input); - throw nvae; - } finally { - this.input.seek(lastIndex); - this.input.release(nvaeMark); + const nvaeMark = this.input.mark(); + const lastIndex = this.input.index; + try { + for (let nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + this.input.consume(); } + throw new NoViableAltException("", 19, 10, this.input); + } finally { + this.input.seek(lastIndex); + this.input.release(nvaeMark); } } - - } else { - const nvaeMark = this.input.mark(); - const lastIndex = this.input.index; - try { - for (let nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - this.input.consume(); - } - const nvae = new NoViableAltException("", 19, 7, this.input); - throw nvae; - } finally { - this.input.seek(lastIndex); - this.input.release(nvaeMark); - } } - } else { const nvaeMark = this.input.mark(); const lastIndex = this.input.index; try { - this.input.consume(); - const nvae = new NoViableAltException("", 19, 2, this.input); - throw nvae; + for (let nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + this.input.consume(); + } + throw new NoViableAltException("", 19, 7, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } + } else { + const nvaeMark = this.input.mark(); + const lastIndex = this.input.index; + try { + this.input.consume(); + throw new NoViableAltException("", 19, 2, this.input); + } finally { + this.input.seek(lastIndex); + this.input.release(nvaeMark); + } } + break; } case ANTLRv4Lexer.WILDCARD: { - { - const LA19_3 = this.input.LA(2); - if ((LA19_3 === Constants.DOWN)) { - alt19 = 4; + const LA19_3 = this.input.LA(2); + if ((LA19_3 === Constants.DOWN)) { + alt19 = 4; + } else { + if ((LA19_3 === ANTLRv4Lexer.EOF || (LA19_3 >= Constants.UP && LA19_3 <= ANTLRv4Lexer.ACTION) || LA19_3 === ANTLRv4Lexer.ASSIGN || LA19_3 === ANTLRv4Lexer.DOT || LA19_3 === ANTLRv4Lexer.LEXER_CHAR_SET || LA19_3 === ANTLRv4Lexer.NOT || LA19_3 === ANTLRv4Lexer.PLUS_ASSIGN || LA19_3 === ANTLRv4Lexer.RANGE || LA19_3 === ANTLRv4Lexer.RULE_REF || LA19_3 === ANTLRv4Lexer.SEMPRED || LA19_3 === ANTLRv4Lexer.STRING_LITERAL || LA19_3 === ANTLRv4Lexer.TOKEN_REF || (LA19_3 >= ANTLRv4Lexer.BLOCK && LA19_3 <= ANTLRv4Lexer.CLOSURE) || (LA19_3 >= ANTLRv4Lexer.OPTIONAL && LA19_3 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA19_3 >= ANTLRv4Lexer.SET && LA19_3 <= ANTLRv4Lexer.WILDCARD))) { + alt19 = 5; } else { - if ((LA19_3 === ANTLRv4Lexer.EOF || (LA19_3 >= Constants.UP && LA19_3 <= ANTLRv4Lexer.ACTION) || LA19_3 === ANTLRv4Lexer.ASSIGN || LA19_3 === ANTLRv4Lexer.DOT || LA19_3 === ANTLRv4Lexer.LEXER_CHAR_SET || LA19_3 === ANTLRv4Lexer.NOT || LA19_3 === ANTLRv4Lexer.PLUS_ASSIGN || LA19_3 === ANTLRv4Lexer.RANGE || LA19_3 === ANTLRv4Lexer.RULE_REF || LA19_3 === ANTLRv4Lexer.SEMPRED || LA19_3 === ANTLRv4Lexer.STRING_LITERAL || LA19_3 === ANTLRv4Lexer.TOKEN_REF || (LA19_3 >= ANTLRv4Lexer.BLOCK && LA19_3 <= ANTLRv4Lexer.CLOSURE) || (LA19_3 >= ANTLRv4Lexer.OPTIONAL && LA19_3 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA19_3 >= ANTLRv4Lexer.SET && LA19_3 <= ANTLRv4Lexer.WILDCARD))) { - alt19 = 5; - } else { - const nvaeMark = this.input.mark(); - const lastIndex = this.input.index; - try { - this.input.consume(); - const nvae = new NoViableAltException("", 19, 3, this.input); - throw nvae; - } finally { - this.input.seek(lastIndex); - this.input.release(nvaeMark); - } + const nvaeMark = this.input.mark(); + const lastIndex = this.input.index; + try { + this.input.consume(); + throw new NoViableAltException("", 19, 3, this.input); + } finally { + this.input.seek(lastIndex); + this.input.release(nvaeMark); } } - } + break; } case ANTLRv4Lexer.SET: { - { - alt19 = 6; - } + alt19 = 6; + break; } case ANTLRv4Lexer.STRING_LITERAL: case ANTLRv4Lexer.TOKEN_REF: { - { - alt19 = 7; - } + alt19 = 7; + break; } case ANTLRv4Lexer.RULE_REF: { - { - alt19 = 8; - } + alt19 = 8; + break; } default: { - const nvae = new NoViableAltException("", 19, 0, this.input); - throw nvae; + throw new NoViableAltException("", 19, 0, this.input); } } switch (alt19) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:176:4: range - { - const range24 = this.range(); + const range24 = this.range(); + retval.p = range24!; - retval.p = range24!; - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:177:4: ^( DOT ID terminal ) - { - this.match(this.input, ANTLRv4Lexer.DOT, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - const terminal25 = this.terminal(); + this.match(this.input, ANTLRv4Lexer.DOT, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + const terminal25 = this.terminal(); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + retval.p = terminal25.p; - retval.p = terminal25.p; - } break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:178:4: ^( DOT ID ruleref ) - { - this.match(this.input, ANTLRv4Lexer.DOT, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - const ruleref26 = this.ruleref(); + this.match(this.input, ANTLRv4Lexer.DOT, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + const ruleref26 = this.ruleref(); - this.match(this.input, Constants.UP, null); + this.match(this.input, Constants.UP, null); + + retval.p = ruleref26!; - retval.p = ruleref26!; - } break; } case 4: { - // org/antlr/v4/parse/ATNBuilder.g:179:7: ^( WILDCARD . ) - { - this.match(this.input, ANTLRv4Lexer.WILDCARD, null); - this.match(this.input, Constants.DOWN, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.WILDCARD, null); + this.match(this.input, Constants.DOWN, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); + + retval.p = this.factory!.wildcard((retval.start as GrammarAST)); - retval.p = this.factory!.wildcard((retval.start as GrammarAST)); - } break; } case 5: { - // org/antlr/v4/parse/ATNBuilder.g:180:7: WILDCARD - { - this.match(this.input, ANTLRv4Lexer.WILDCARD, null); - retval.p = this.factory!.wildcard((retval.start as GrammarAST)); - } + this.match(this.input, ANTLRv4Lexer.WILDCARD, null); + retval.p = this.factory!.wildcard((retval.start as GrammarAST)); + break; } case 6: { - // org/antlr/v4/parse/ATNBuilder.g:181:7: blockSet[false] - { - const blockSet27 = this.blockSet(false); + const blockSet27 = this.blockSet(false); - retval.p = blockSet27.p; - } + retval.p = blockSet27.p; break; } case 7: { - // org/antlr/v4/parse/ATNBuilder.g:182:9: terminal - { - const terminal28 = this.terminal(); + const terminal28 = this.terminal(); - retval.p = terminal28.p; - } + retval.p = terminal28.p; break; } case 8: { - // org/antlr/v4/parse/ATNBuilder.g:183:9: ruleref - { - const ruleref29 = this.ruleref(); + const ruleref29 = this.ruleref(); + retval.p = ruleref29!; - retval.p = ruleref29!; - } break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -1622,10 +1336,7 @@ export class ATNBuilder extends TreeParser { return retval; } - // $ANTLR end "atom" - // $ANTLR start "ruleref" - // org/antlr/v4/parse/ATNBuilder.g:186:1: ruleref returns [IStatePair p] : ( ^( RULE_REF ( ARG_ACTION )? ^( ELEMENT_OPTIONS ( . )* ) ) | ^( RULE_REF ( ARG_ACTION )? ) | RULE_REF ); public ruleref(): IStatePair | null { let p = null; @@ -1634,7 +1345,6 @@ export class ATNBuilder extends TreeParser { let RULE_REF32 = null; try { - // org/antlr/v4/parse/ATNBuilder.g:187:5: ( ^( RULE_REF ( ARG_ACTION )? ^( ELEMENT_OPTIONS ( . )* ) ) | ^( RULE_REF ( ARG_ACTION )? ) | RULE_REF ) let alt23 = 3; const LA23_0 = this.input.LA(1); if ((LA23_0 === ANTLRv4Lexer.RULE_REF)) { @@ -1656,30 +1366,27 @@ export class ATNBuilder extends TreeParser { for (let nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { this.input.consume(); } - const nvae = new NoViableAltException("", 23, 4, this.input); - throw nvae; + throw new NoViableAltException("", 23, 4, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } } - } + break; } case ANTLRv4Lexer.ELEMENT_OPTIONS: { - { - alt23 = 1; - } + alt23 = 1; + break; } case Constants.UP: { - { - alt23 = 2; - } + alt23 = 2; + break; } @@ -1690,15 +1397,12 @@ export class ATNBuilder extends TreeParser { for (let nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { this.input.consume(); } - const nvae = - new NoViableAltException("", 23, 2, this.input); - throw nvae; + throw new NoViableAltException("", 23, 2, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } - } } else { if ((LA23_1 === ANTLRv4Lexer.EOF || (LA23_1 >= Constants.UP && LA23_1 <= ANTLRv4Lexer.ACTION) || LA23_1 === ANTLRv4Lexer.ASSIGN || LA23_1 === ANTLRv4Lexer.DOT || LA23_1 === ANTLRv4Lexer.LEXER_CHAR_SET || LA23_1 === ANTLRv4Lexer.NOT || LA23_1 === ANTLRv4Lexer.PLUS_ASSIGN || LA23_1 === ANTLRv4Lexer.RANGE || LA23_1 === ANTLRv4Lexer.RULE_REF || LA23_1 === ANTLRv4Lexer.SEMPRED || LA23_1 === ANTLRv4Lexer.STRING_LITERAL || LA23_1 === ANTLRv4Lexer.TOKEN_REF || (LA23_1 >= ANTLRv4Lexer.BLOCK && LA23_1 <= ANTLRv4Lexer.CLOSURE) || (LA23_1 >= ANTLRv4Lexer.OPTIONAL && LA23_1 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA23_1 >= ANTLRv4Lexer.SET && LA23_1 <= ANTLRv4Lexer.WILDCARD))) { @@ -1708,133 +1412,116 @@ export class ATNBuilder extends TreeParser { const lastIndex = this.input.index; try { this.input.consume(); - const nvae = - new NoViableAltException("", 23, 1, this.input); - throw nvae; + throw new NoViableAltException("", 23, 1, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } } - } else { - const nvae = - new NoViableAltException("", 23, 0, this.input); - throw nvae; + throw new NoViableAltException("", 23, 0, this.input); } switch (alt23) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:187:7: ^( RULE_REF ( ARG_ACTION )? ^( ELEMENT_OPTIONS ( . )* ) ) - { - RULE_REF30 = this.match(this.input, ANTLRv4Lexer.RULE_REF, null) as GrammarAST; - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:187:18: ( ARG_ACTION )? - let alt20 = 2; - const LA20_0 = this.input.LA(1); - if ((LA20_0 === ANTLRv4Lexer.ARG_ACTION)) { - alt20 = 1; - } - switch (alt20) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:187:18: ARG_ACTION - { - this.match(this.input, ANTLRv4Lexer.ARG_ACTION, null); - } - break; - } + RULE_REF30 = this.match(this.input, ANTLRv4Lexer.RULE_REF, null) as GrammarAST; + this.match(this.input, Constants.DOWN, null); - default: + let alt20 = 2; + const LA20_0 = this.input.LA(1); + if ((LA20_0 === ANTLRv4Lexer.ARG_ACTION)) { + alt20 = 1; + } + + switch (alt20) { + case 1: { + this.match(this.input, ANTLRv4Lexer.ARG_ACTION, null); + break; } - this.match(this.input, ANTLRv4Lexer.ELEMENT_OPTIONS, null); - if (this.input.LA(1) === Constants.DOWN) { - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:187:48: ( . )* - loop21: - while (true) { - let alt21 = 2; - const LA21_0 = this.input.LA(1); - if (((LA21_0 >= ANTLRv4Lexer.ACTION && LA21_0 <= ANTLRv4Lexer.WILDCARD))) { - alt21 = 1; - } else { - if ((LA21_0 === Constants.UP)) { - alt21 = 2; - } + default: + } + + this.match(this.input, ANTLRv4Lexer.ELEMENT_OPTIONS, null); + if (this.input.LA(1) === Constants.DOWN) { + this.match(this.input, Constants.DOWN, null); + + loop21: + while (true) { + let alt21 = 2; + const LA21_0 = this.input.LA(1); + if (((LA21_0 >= ANTLRv4Lexer.ACTION && LA21_0 <= ANTLRv4Lexer.WILDCARD))) { + alt21 = 1; + } else { + if ((LA21_0 === Constants.UP)) { + alt21 = 2; } + } - switch (alt21) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:187:48: . - { - this.matchAny(this.input); - } - break; - } + switch (alt21) { + case 1: { + this.matchAny(this.input); - default: { - break loop21; - } + break; + } + default: { + break loop21; } } - - this.match(this.input, Constants.UP, null); } this.match(this.input, Constants.UP, null); - - p = this.factory!.ruleRef(RULE_REF30); } + + this.match(this.input, Constants.UP, null); + + p = this.factory!.ruleRef(RULE_REF30); + break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:188:7: ^( RULE_REF ( ARG_ACTION )? ) - { - RULE_REF31 = this.match(this.input, ANTLRv4Lexer.RULE_REF, null) as GrammarAST; - if (this.input.LA(1) === Constants.DOWN) { - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:188:18: ( ARG_ACTION )? - let alt22 = 2; - const LA22_0 = this.input.LA(1); - if ((LA22_0 === ANTLRv4Lexer.ARG_ACTION)) { - alt22 = 1; - } - switch (alt22) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:188:18: ARG_ACTION - { - this.match(this.input, ANTLRv4Lexer.ARG_ACTION, null); - } - break; + RULE_REF31 = this.match(this.input, ANTLRv4Lexer.RULE_REF, null) as GrammarAST; + if (this.input.LA(1) === Constants.DOWN) { + this.match(this.input, Constants.DOWN, null); + // org/antlr/v4/parse/ATNBuilder.g:188:18: ( ARG_ACTION )? + let alt22 = 2; + const LA22_0 = this.input.LA(1); + if ((LA22_0 === ANTLRv4Lexer.ARG_ACTION)) { + alt22 = 1; + } + switch (alt22) { + case 1: { + // org/antlr/v4/parse/ATNBuilder.g:188:18: ARG_ACTION + { + this.match(this.input, ANTLRv4Lexer.ARG_ACTION, null); } - - default: - + break; } - this.match(this.input, Constants.UP, null); + default: + } - p = this.factory!.ruleRef(RULE_REF31); + this.match(this.input, Constants.UP, null); } + + p = this.factory!.ruleRef(RULE_REF31); + break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:189:7: RULE_REF - { - RULE_REF32 = this.match(this.input, ANTLRv4Lexer.RULE_REF, null) as GrammarAST; - p = this.factory!.ruleRef(RULE_REF32); - } + RULE_REF32 = this.match(this.input, ANTLRv4Lexer.RULE_REF, null) as GrammarAST; + p = this.factory!.ruleRef(RULE_REF32); + break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -1846,10 +1533,7 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR end "ruleref" - // $ANTLR start "range" - // org/antlr/v4/parse/ATNBuilder.g:192:1: range returns [IStatePair p] : ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) ; public range(): IStatePair | null { let p = null; @@ -1857,18 +1541,13 @@ export class ATNBuilder extends TreeParser { let b = null; try { - // org/antlr/v4/parse/ATNBuilder.g:193:5: ( ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) ) - // org/antlr/v4/parse/ATNBuilder.g:193:7: ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) - { - this.match(this.input, ANTLRv4Lexer.RANGE, null); - this.match(this.input, Constants.DOWN, null); - a = this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null) as GrammarAST; - b = this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null) as GrammarAST; - this.match(this.input, Constants.UP, null); - - p = this.factory!.range(a, b); - } + this.match(this.input, ANTLRv4Lexer.RANGE, null); + this.match(this.input, Constants.DOWN, null); + a = this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null) as GrammarAST; + b = this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null) as GrammarAST; + this.match(this.input, Constants.UP, null); + p = this.factory!.range(a, b); } catch (re) { if (re instanceof RecognitionException) { this.reportError(re); @@ -1880,14 +1559,10 @@ export class ATNBuilder extends TreeParser { return p; } - // $ANTLR start "terminal" - // org/antlr/v4/parse/ATNBuilder.g:196:1: terminal returns [IStatePair p] : ( ^( STRING_LITERAL . ) | STRING_LITERAL | ^( TOKEN_REF ARG_ACTION . ) | ^( TOKEN_REF . ) | TOKEN_REF ); - public terminal(): ATNBuilder.terminal_return { - const retval = new ATNBuilder.terminal_return(); - retval.start = this.input.LT(1); + public terminal(): IPairedReturnScope { + const retval: IPairedReturnScope = { start: this.input.LT(1) ?? undefined }; try { - // org/antlr/v4/parse/ATNBuilder.g:197:5: ( ^( STRING_LITERAL . ) | STRING_LITERAL | ^( TOKEN_REF ARG_ACTION . ) | ^( TOKEN_REF . ) | TOKEN_REF ) let alt24 = 5; const LA24_0 = this.input.LA(1); if ((LA24_0 === ANTLRv4Lexer.STRING_LITERAL)) { @@ -1902,15 +1577,13 @@ export class ATNBuilder extends TreeParser { const lastIndex = this.input.index; try { this.input.consume(); - const nvae = new NoViableAltException("", 24, 1, this.input); - throw nvae; + throw new NoViableAltException("", 24, 1, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } } - } else { if ((LA24_0 === ANTLRv4Lexer.TOKEN_REF)) { const LA24_2 = this.input.LA(2); @@ -1930,15 +1603,13 @@ export class ATNBuilder extends TreeParser { for (let nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { this.input.consume(); } - const nvae = new NoViableAltException("", 24, 7, this.input); - throw nvae; + throw new NoViableAltException("", 24, 7, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } } - } else { if (((LA24_5 >= ANTLRv4Lexer.ACTION && LA24_5 <= ANTLRv4Lexer.ACTION_STRING_LITERAL) || (LA24_5 >= ANTLRv4Lexer.ARG_OR_CHARSET && LA24_5 <= ANTLRv4Lexer.WILDCARD))) { alt24 = 4; @@ -1949,15 +1620,13 @@ export class ATNBuilder extends TreeParser { for (let nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { this.input.consume(); } - const nvae = new NoViableAltException("", 24, 5, this.input); - throw nvae; + throw new NoViableAltException("", 24, 5, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } } - } else { if ((LA24_2 === ANTLRv4Lexer.EOF || (LA24_2 >= Constants.UP && LA24_2 <= ANTLRv4Lexer.ACTION) || LA24_2 === ANTLRv4Lexer.ASSIGN || LA24_2 === ANTLRv4Lexer.DOT || LA24_2 === ANTLRv4Lexer.LEXER_CHAR_SET || LA24_2 === ANTLRv4Lexer.NOT || LA24_2 === ANTLRv4Lexer.PLUS_ASSIGN || LA24_2 === ANTLRv4Lexer.RANGE || LA24_2 === ANTLRv4Lexer.RULE_REF || LA24_2 === ANTLRv4Lexer.SEMPRED || LA24_2 === ANTLRv4Lexer.STRING_LITERAL || LA24_2 === ANTLRv4Lexer.TOKEN_REF || (LA24_2 >= ANTLRv4Lexer.BLOCK && LA24_2 <= ANTLRv4Lexer.CLOSURE) || (LA24_2 >= ANTLRv4Lexer.OPTIONAL && LA24_2 <= ANTLRv4Lexer.POSITIVE_CLOSURE) || (LA24_2 >= ANTLRv4Lexer.SET && LA24_2 <= ANTLRv4Lexer.WILDCARD))) { alt24 = 5; @@ -1966,83 +1635,68 @@ export class ATNBuilder extends TreeParser { const lastIndex = this.input.index; try { this.input.consume(); - const nvae = new NoViableAltException("", 24, 2, this.input); - throw nvae; + throw new NoViableAltException("", 24, 2, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } } - } else { - const nvae = - new NoViableAltException("", 24, 0, this.input); - throw nvae; + throw new NoViableAltException("", 24, 0, this.input); } } switch (alt24) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:197:8: ^( STRING_LITERAL . ) - { - this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); - this.match(this.input, Constants.DOWN, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); + this.match(this.input, Constants.DOWN, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); + + retval.p = this.factory!.stringLiteral((retval.start as GrammarAST) as TerminalAST)!; - retval.p = this.factory!.stringLiteral((retval.start as GrammarAST) as TerminalAST)!; - } break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:198:7: STRING_LITERAL - { - this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); - retval.p = this.factory!.stringLiteral((retval.start as GrammarAST) as TerminalAST)!; - } + this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); + retval.p = this.factory!.stringLiteral((retval.start as GrammarAST) as TerminalAST)!; + break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:199:7: ^( TOKEN_REF ARG_ACTION . ) - { - this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ARG_ACTION, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ARG_ACTION, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); + + retval.p = this.factory!.tokenRef((retval.start as GrammarAST) as TerminalAST)!; - retval.p = this.factory!.tokenRef((retval.start as GrammarAST) as TerminalAST)!; - } break; } case 4: { - // org/antlr/v4/parse/ATNBuilder.g:200:7: ^( TOKEN_REF . ) - { - this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); - this.match(this.input, Constants.DOWN, null); - this.matchAny(this.input); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); + this.match(this.input, Constants.DOWN, null); + this.matchAny(this.input); + this.match(this.input, Constants.UP, null); + + retval.p = this.factory!.tokenRef((retval.start as GrammarAST) as TerminalAST)!; - retval.p = this.factory!.tokenRef((retval.start as GrammarAST) as TerminalAST)!; - } break; } case 5: { - // org/antlr/v4/parse/ATNBuilder.g:201:7: TOKEN_REF - { - this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); - retval.p = this.factory!.tokenRef((retval.start as GrammarAST) as TerminalAST)!; - } + this.match(this.input, ANTLRv4Lexer.TOKEN_REF, null); + retval.p = this.factory!.tokenRef((retval.start as GrammarAST) as TerminalAST)!; + break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -2054,49 +1708,37 @@ export class ATNBuilder extends TreeParser { return retval; } - // $ANTLR end "terminal" - // $ANTLR start "elementOptions" - // org/antlr/v4/parse/ATNBuilder.g:204:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption )* ) ; public elementOptions(): void { try { - // org/antlr/v4/parse/ATNBuilder.g:205:2: ( ^( ELEMENT_OPTIONS ( elementOption )* ) ) - // org/antlr/v4/parse/ATNBuilder.g:205:4: ^( ELEMENT_OPTIONS ( elementOption )* ) - { - this.match(this.input, ANTLRv4Lexer.ELEMENT_OPTIONS, null); - if (this.input.LA(1) === Constants.DOWN) { - this.match(this.input, Constants.DOWN, null); - // org/antlr/v4/parse/ATNBuilder.g:205:22: ( elementOption )* - loop25: - while (true) { - let alt25 = 2; - const LA25_0 = this.input.LA(1); - if ((LA25_0 === ANTLRv4Lexer.ASSIGN || LA25_0 === ANTLRv4Lexer.ID)) { - alt25 = 1; - } + this.match(this.input, ANTLRv4Lexer.ELEMENT_OPTIONS, null); + if (this.input.LA(1) === Constants.DOWN) { + this.match(this.input, Constants.DOWN, null); - switch (alt25) { - case 1: { - // org/antlr/v4/parse/ATNBuilder.g:205:22: elementOption - { - this.elementOption(); + loop25: + while (true) { + let alt25 = 2; + const LA25_0 = this.input.LA(1); + if ((LA25_0 === ANTLRv4Lexer.ASSIGN || LA25_0 === ANTLRv4Lexer.ID)) { + alt25 = 1; + } - } - break; - } + switch (alt25) { + case 1: { + this.elementOption(); - default: { - break loop25; - } + break; + } + default: { + break loop25; } - } - this.match(this.input, Constants.UP, null); + } } + this.match(this.input, Constants.UP, null); } - } catch (re) { if (re instanceof RecognitionException) { this.reportError(re); @@ -2106,13 +1748,9 @@ export class ATNBuilder extends TreeParser { } } - // $ANTLR end "elementOptions" - // $ANTLR start "elementOption" - // org/antlr/v4/parse/ATNBuilder.g:208:1: elementOption : ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ); public elementOption(): void { try { - // org/antlr/v4/parse/ATNBuilder.g:209:2: ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ) let alt26 = 5; const LA26_0 = this.input.LA(1); if ((LA26_0 === ANTLRv4Lexer.ID)) { @@ -2125,30 +1763,26 @@ export class ATNBuilder extends TreeParser { if ((LA26_3 === ANTLRv4Lexer.ID)) { switch (this.input.LA(4)) { case ANTLRv4Lexer.ID: { - { - alt26 = 2; - } + alt26 = 2; + break; } case ANTLRv4Lexer.STRING_LITERAL: { - { - alt26 = 3; - } + alt26 = 3; + break; } case ANTLRv4Lexer.ACTION: { - { - alt26 = 4; - } + alt26 = 4; + break; } case ANTLRv4Lexer.INT: { - { - alt26 = 5; - } + alt26 = 5; + break; } @@ -2159,14 +1793,12 @@ export class ATNBuilder extends TreeParser { for (let nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { this.input.consume(); } - const nvae = new NoViableAltException("", 26, 4, this.input); - throw nvae; + throw new NoViableAltException("", 26, 4, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } - } } else { const nvaeMark = this.input.mark(); @@ -2175,97 +1807,76 @@ export class ATNBuilder extends TreeParser { for (let nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { this.input.consume(); } - const nvae = new NoViableAltException("", 26, 3, this.input); - throw nvae; + throw new NoViableAltException("", 26, 3, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } - } else { const nvaeMark = this.input.mark(); const lastIndex = this.input.index; try { this.input.consume(); - const nvae = new NoViableAltException("", 26, 2, this.input); - throw nvae; + throw new NoViableAltException("", 26, 2, this.input); } finally { this.input.seek(lastIndex); this.input.release(nvaeMark); } } - } else { - const nvae = - new NoViableAltException("", 26, 0, this.input); - throw nvae; + throw new NoViableAltException("", 26, 0, this.input); } } switch (alt26) { case 1: { - // org/antlr/v4/parse/ATNBuilder.g:209:4: ID - { - this.match(this.input, ANTLRv4Lexer.ID, null); - } + this.match(this.input, ANTLRv4Lexer.ID, null); + break; } case 2: { - // org/antlr/v4/parse/ATNBuilder.g:210:4: ^( ASSIGN ID ID ) - { - this.match(this.input, ANTLRv4Lexer.ASSIGN, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.ASSIGN, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + this.match(this.input, Constants.UP, null); - } break; } case 3: { - // org/antlr/v4/parse/ATNBuilder.g:211:4: ^( ASSIGN ID STRING_LITERAL ) - { - this.match(this.input, ANTLRv4Lexer.ASSIGN, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.ASSIGN, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + this.match(this.input, ANTLRv4Lexer.STRING_LITERAL, null); + this.match(this.input, Constants.UP, null); - } break; } case 4: { - // org/antlr/v4/parse/ATNBuilder.g:212:4: ^( ASSIGN ID ACTION ) - { - this.match(this.input, ANTLRv4Lexer.ASSIGN, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - this.match(this.input, ANTLRv4Lexer.ACTION, null); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.ASSIGN, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + this.match(this.input, ANTLRv4Lexer.ACTION, null); + this.match(this.input, Constants.UP, null); - } break; } case 5: { - // org/antlr/v4/parse/ATNBuilder.g:213:4: ^( ASSIGN ID INT ) - { - this.match(this.input, ANTLRv4Lexer.ASSIGN, null); - this.match(this.input, Constants.DOWN, null); - this.match(this.input, ANTLRv4Lexer.ID, null); - this.match(this.input, ANTLRv4Lexer.INT, null); - this.match(this.input, Constants.UP, null); + this.match(this.input, ANTLRv4Lexer.ASSIGN, null); + this.match(this.input, Constants.DOWN, null); + this.match(this.input, ANTLRv4Lexer.ID, null); + this.match(this.input, ANTLRv4Lexer.INT, null); + this.match(this.input, Constants.UP, null); - } break; } default: - } } catch (re) { if (re instanceof RecognitionException) { @@ -2276,13 +1887,3 @@ export class ATNBuilder extends TreeParser { } } } - -export namespace ATNBuilder { - export type lexerCommandExpr_return = InstanceType; - export type element_return = InstanceType; - export type subrule_return = InstanceType; - export type blockSet_return = InstanceType; - export type setElement_return = InstanceType; - export type atom_return = InstanceType; - export type terminal_return = InstanceType; -} diff --git a/src/tree-walkers/BlockSetTransformer.java b/src/tree-walkers/BlockSetTransformer.java deleted file mode 100644 index 76f1e8b..0000000 --- a/src/tree-walkers/BlockSetTransformer.java +++ /dev/null @@ -1,2091 +0,0 @@ -// $ANTLR 3.5.3 org/antlr/v4/parse/BlockSetTransformer.g - -package org.antlr.v4.parse; -import org.antlr.v4.misc.Utils; -import org.antlr.v4.misc.*; -import org.antlr.v4.tool.*; -import org.antlr.v4.tool.ast.*; -import java.util.List; -import java.util.Set; -import java.util.HashSet; -import java.util.ArrayList; -import org.antlr.v4.runtime.misc.IntervalSet; - - -import org.antlr.runtime.*; -import org.antlr.runtime.tree.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; - - -@SuppressWarnings("all") -public class BlockSetTransformer extends TreeRewriter { - public static final String[] tokenNames = new String[] { - "", "", "", "", "ACTION", "ACTION_CHAR_LITERAL", - "ACTION_ESC", "ACTION_STRING_LITERAL", "ARG_ACTION", "ARG_OR_CHARSET", - "ASSIGN", "AT", "CATCH", "CHANNELS", "COLON", "COLONCOLON", "COMMA", "COMMENT", - "DOC_COMMENT", "DOLLAR", "DOT", "ERRCHAR", "ESC_SEQ", "FINALLY", "FRAGMENT", - "GRAMMAR", "GT", "HEX_DIGIT", "ID", "IMPORT", "INT", "LEXER", "LEXER_CHAR_SET", - "LOCALS", "LPAREN", "LT", "MODE", "NESTED_ACTION", "NLCHARS", "NOT", "NameChar", - "NameStartChar", "OPTIONS", "OR", "PARSER", "PLUS", "PLUS_ASSIGN", "POUND", - "QUESTION", "RANGE", "RARROW", "RBRACE", "RETURNS", "RPAREN", "RULE_REF", - "SEMI", "SEMPRED", "SRC", "STAR", "STRING_LITERAL", "THROWS", "TOKENS_SPEC", - "TOKEN_REF", "UNICODE_ESC", "UNICODE_EXTENDED_ESC", "UnicodeBOM", "WS", - "WSCHARS", "WSNLCHARS", "ALT", "BLOCK", "CLOSURE", "COMBINED", "ELEMENT_OPTIONS", - "EPSILON", "LEXER_ACTION_CALL", "LEXER_ALT_ACTION", "OPTIONAL", "POSITIVE_CLOSURE", - "RULE", "RULEMODIFIERS", "RULES", "SET", "WILDCARD" - }; - public static final int EOF=-1; - public static final int ACTION=4; - public static final int ACTION_CHAR_LITERAL=5; - public static final int ACTION_ESC=6; - public static final int ACTION_STRING_LITERAL=7; - public static final int ARG_ACTION=8; - public static final int ARG_OR_CHARSET=9; - public static final int ASSIGN=10; - public static final int AT=11; - public static final int CATCH=12; - public static final int CHANNELS=13; - public static final int COLON=14; - public static final int COLONCOLON=15; - public static final int COMMA=16; - public static final int COMMENT=17; - public static final int DOC_COMMENT=18; - public static final int DOLLAR=19; - public static final int DOT=20; - public static final int ERRCHAR=21; - public static final int ESC_SEQ=22; - public static final int FINALLY=23; - public static final int FRAGMENT=24; - public static final int GRAMMAR=25; - public static final int GT=26; - public static final int HEX_DIGIT=27; - public static final int ID=28; - public static final int IMPORT=29; - public static final int INT=30; - public static final int LEXER=31; - public static final int LEXER_CHAR_SET=32; - public static final int LOCALS=33; - public static final int LPAREN=34; - public static final int LT=35; - public static final int MODE=36; - public static final int NESTED_ACTION=37; - public static final int NLCHARS=38; - public static final int NOT=39; - public static final int NameChar=40; - public static final int NameStartChar=41; - public static final int OPTIONS=42; - public static final int OR=43; - public static final int PARSER=44; - public static final int PLUS=45; - public static final int PLUS_ASSIGN=46; - public static final int POUND=47; - public static final int QUESTION=48; - public static final int RANGE=49; - public static final int RARROW=50; - public static final int RBRACE=51; - public static final int RETURNS=52; - public static final int RPAREN=53; - public static final int RULE_REF=54; - public static final int SEMI=55; - public static final int SEMPRED=56; - public static final int SRC=57; - public static final int STAR=58; - public static final int STRING_LITERAL=59; - public static final int THROWS=60; - public static final int TOKENS_SPEC=61; - public static final int TOKEN_REF=62; - public static final int UNICODE_ESC=63; - public static final int UNICODE_EXTENDED_ESC=64; - public static final int UnicodeBOM=65; - public static final int WS=66; - public static final int WSCHARS=67; - public static final int WSNLCHARS=68; - public static final int ALT=69; - public static final int BLOCK=70; - public static final int CLOSURE=71; - public static final int COMBINED=72; - public static final int ELEMENT_OPTIONS=73; - public static final int EPSILON=74; - public static final int LEXER_ACTION_CALL=75; - public static final int LEXER_ALT_ACTION=76; - public static final int OPTIONAL=77; - public static final int POSITIVE_CLOSURE=78; - public static final int RULE=79; - public static final int RULEMODIFIERS=80; - public static final int RULES=81; - public static final int SET=82; - public static final int WILDCARD=83; - - // delegates - public TreeRewriter[] getDelegates() { - return new TreeRewriter[] {}; - } - - // delegators - - - public BlockSetTransformer(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public BlockSetTransformer(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - protected TreeAdaptor adaptor = new CommonTreeAdaptor(); - - public void setTreeAdaptor(TreeAdaptor adaptor) { - this.adaptor = adaptor; - } - public TreeAdaptor getTreeAdaptor() { - return adaptor; - } - @Override public String[] getTokenNames() { return BlockSetTransformer.tokenNames; } - @Override public String getGrammarFileName() { return "org/antlr/v4/parse/BlockSetTransformer.g"; } - - - public String currentRuleName; - public GrammarAST currentAlt; - public Grammar g; - public BlockSetTransformer(TreeNodeStream input, Grammar g) { - this(input, new RecognizerSharedState()); - this.g = g; - } - - - public static class topdown_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "topdown" - // org/antlr/v4/parse/BlockSetTransformer.g:63:1: topdown : ( ^( RULE (id= TOKEN_REF |id= RULE_REF ) ( . )+ ) | setAlt | ebnfBlockSet | blockSet ); - @Override - public final BlockSetTransformer.topdown_return topdown() throws RecognitionException { - BlockSetTransformer.topdown_return retval = new BlockSetTransformer.topdown_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - GrammarAST id=null; - GrammarAST RULE1=null; - GrammarAST wildcard2=null; - TreeRuleReturnScope setAlt3 =null; - TreeRuleReturnScope ebnfBlockSet4 =null; - TreeRuleReturnScope blockSet5 =null; - - GrammarAST id_tree=null; - GrammarAST RULE1_tree=null; - GrammarAST wildcard2_tree=null; - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:64:5: ( ^( RULE (id= TOKEN_REF |id= RULE_REF ) ( . )+ ) | setAlt | ebnfBlockSet | blockSet ) - int alt3=4; - switch ( input.LA(1) ) { - case RULE: - { - alt3=1; - } - break; - case ALT: - { - alt3=2; - } - break; - case CLOSURE: - case OPTIONAL: - case POSITIVE_CLOSURE: - { - alt3=3; - } - break; - case BLOCK: - { - alt3=4; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 3, 0, input); - throw nvae; - } - switch (alt3) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:64:7: ^( RULE (id= TOKEN_REF |id= RULE_REF ) ( . )+ ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - RULE1=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_topdown86); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = RULE1; - match(input, Token.DOWN, null); if (state.failed) return retval; - // org/antlr/v4/parse/BlockSetTransformer.g:64:14: (id= TOKEN_REF |id= RULE_REF ) - int alt1=2; - int LA1_0 = input.LA(1); - if ( (LA1_0==TOKEN_REF) ) { - alt1=1; - } - else if ( (LA1_0==RULE_REF) ) { - alt1=2; - } - - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 1, 0, input); - throw nvae; - } - - switch (alt1) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:64:15: id= TOKEN_REF - { - _last = (GrammarAST)input.LT(1); - id=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_topdown91); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = id; - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 2 : - // org/antlr/v4/parse/BlockSetTransformer.g:64:28: id= RULE_REF - { - _last = (GrammarAST)input.LT(1); - id=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_topdown95); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = id; - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - - if ( state.backtracking==1 ) {currentRuleName=(id!=null?id.getText():null);} - // org/antlr/v4/parse/BlockSetTransformer.g:64:69: ( . )+ - int cnt2=0; - loop2: - while (true) { - int alt2=2; - int LA2_0 = input.LA(1); - if ( ((LA2_0 >= ACTION && LA2_0 <= WILDCARD)) ) { - alt2=1; - } - else if ( (LA2_0==UP) ) { - alt2=2; - } - - switch (alt2) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:64:69: . - { - _last = (GrammarAST)input.LT(1); - wildcard2=(GrammarAST)input.LT(1); - matchAny(input); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = wildcard2; - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - default : - if ( cnt2 >= 1 ) break loop2; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = new EarlyExitException(2, input); - throw eee; - } - cnt2++; - } - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 2 : - // org/antlr/v4/parse/BlockSetTransformer.g:65:7: setAlt - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_setAlt_in_topdown110); - setAlt3=setAlt(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) - - if ( _first_0==null ) _first_0 = (GrammarAST)setAlt3.getTree(); - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 3 : - // org/antlr/v4/parse/BlockSetTransformer.g:66:7: ebnfBlockSet - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_ebnfBlockSet_in_topdown118); - ebnfBlockSet4=ebnfBlockSet(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) - - if ( _first_0==null ) _first_0 = (GrammarAST)ebnfBlockSet4.getTree(); - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 4 : - // org/antlr/v4/parse/BlockSetTransformer.g:67:7: blockSet - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_blockSet_in_topdown126); - blockSet5=blockSet(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) - - if ( _first_0==null ) _first_0 = (GrammarAST)blockSet5.getTree(); - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "topdown" - - - public static class setAlt_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "setAlt" - // org/antlr/v4/parse/BlockSetTransformer.g:70:1: setAlt :{...}? ALT ; - public final BlockSetTransformer.setAlt_return setAlt() throws RecognitionException { - BlockSetTransformer.setAlt_return retval = new BlockSetTransformer.setAlt_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - GrammarAST ALT6=null; - - GrammarAST ALT6_tree=null; - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:71:2: ({...}? ALT ) - // org/antlr/v4/parse/BlockSetTransformer.g:71:4: {...}? ALT - { - if ( !((inContext("RULE BLOCK"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setAlt", "inContext(\"RULE BLOCK\")"); - } - _last = (GrammarAST)input.LT(1); - ALT6=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_setAlt141); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = ALT6; - - if ( state.backtracking==1 ) {currentAlt = ((GrammarAST)retval.start);} - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "setAlt" - - - public static class ebnfBlockSet_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "ebnfBlockSet" - // org/antlr/v4/parse/BlockSetTransformer.g:76:1: ebnfBlockSet : ^( ebnfSuffix blockSet ) -> ^( ebnfSuffix ^( BLOCK ^( ALT blockSet ) ) ) ; - public final BlockSetTransformer.ebnfBlockSet_return ebnfBlockSet() throws RecognitionException { - BlockSetTransformer.ebnfBlockSet_return retval = new BlockSetTransformer.ebnfBlockSet_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - TreeRuleReturnScope ebnfSuffix7 =null; - TreeRuleReturnScope blockSet8 =null; - - RewriteRuleSubtreeStream stream_blockSet=new RewriteRuleSubtreeStream(adaptor,"rule blockSet"); - RewriteRuleSubtreeStream stream_ebnfSuffix=new RewriteRuleSubtreeStream(adaptor,"rule ebnfSuffix"); - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:80:2: ( ^( ebnfSuffix blockSet ) -> ^( ebnfSuffix ^( BLOCK ^( ALT blockSet ) ) ) ) - // org/antlr/v4/parse/BlockSetTransformer.g:80:4: ^( ebnfSuffix blockSet ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_ebnfSuffix_in_ebnfBlockSet161); - ebnfSuffix7=ebnfSuffix(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_ebnfSuffix.add(ebnfSuffix7.getTree()); - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = (GrammarAST)ebnfSuffix7.getTree(); - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_blockSet_in_ebnfBlockSet163); - blockSet8=blockSet(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_blockSet.add(blockSet8.getTree()); - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==1 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); - - root_0 = (GrammarAST)adaptor.nil(); - // 80:27: -> ^( ebnfSuffix ^( BLOCK ^( ALT blockSet ) ) ) - { - // org/antlr/v4/parse/BlockSetTransformer.g:80:30: ^( ebnfSuffix ^( BLOCK ^( ALT blockSet ) ) ) - { - GrammarAST root_1 = (GrammarAST)adaptor.nil(); - root_1 = (GrammarAST)adaptor.becomeRoot(stream_ebnfSuffix.nextNode(), root_1); - // org/antlr/v4/parse/BlockSetTransformer.g:80:43: ^( BLOCK ^( ALT blockSet ) ) - { - GrammarAST root_2 = (GrammarAST)adaptor.nil(); - root_2 = (GrammarAST)adaptor.becomeRoot(new BlockAST(BLOCK), root_2); - // org/antlr/v4/parse/BlockSetTransformer.g:80:61: ^( ALT blockSet ) - { - GrammarAST root_3 = (GrammarAST)adaptor.nil(); - root_3 = (GrammarAST)adaptor.becomeRoot(new AltAST(ALT), root_3); - adaptor.addChild(root_3, stream_blockSet.nextTree()); - adaptor.addChild(root_2, root_3); - } - - adaptor.addChild(root_1, root_2); - } - - adaptor.addChild(root_0, root_1); - } - - } - - - retval.tree = (GrammarAST)adaptor.rulePostProcessing(root_0); - input.replaceChildren(adaptor.getParent(retval.start), - adaptor.getChildIndex(retval.start), - adaptor.getChildIndex(_last), - retval.tree); - } - - } - - if ( state.backtracking==1 ) { - GrammarTransformPipeline.setGrammarPtr(g, retval.tree); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ebnfBlockSet" - - - public static class ebnfSuffix_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "ebnfSuffix" - // org/antlr/v4/parse/BlockSetTransformer.g:83:1: ebnfSuffix : ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ); - public final BlockSetTransformer.ebnfSuffix_return ebnfSuffix() throws RecognitionException { - BlockSetTransformer.ebnfSuffix_return retval = new BlockSetTransformer.ebnfSuffix_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - GrammarAST set9=null; - - GrammarAST set9_tree=null; - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:85:2: ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ) - // org/antlr/v4/parse/BlockSetTransformer.g: - { - _last = (GrammarAST)input.LT(1); - set9=(GrammarAST)input.LT(1); - if ( input.LA(1)==CLOSURE||(input.LA(1) >= OPTIONAL && input.LA(1) <= POSITIVE_CLOSURE) ) { - input.consume(); - state.errorRecovery=false; - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - - } - - if ( state.backtracking==1 ) {retval.tree = (GrammarAST)adaptor.dupNode(((GrammarAST)retval.start));} - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ebnfSuffix" - - - public static class blockSet_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "blockSet" - // org/antlr/v4/parse/BlockSetTransformer.g:90:1: blockSet : ({...}? ^( BLOCK ^(alt= ALT ( elementOptions )? {...}? setElement[inLexer] ) ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ ) -> ^( BLOCK[$BLOCK.token] ^( ALT[$BLOCK.token,\"ALT\"] ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ) ) |{...}? ^( BLOCK ^( ALT ( elementOptions )? setElement[inLexer] ) ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ ) -> ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ); - public final BlockSetTransformer.blockSet_return blockSet() throws RecognitionException { - BlockSetTransformer.blockSet_return retval = new BlockSetTransformer.blockSet_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - GrammarAST alt=null; - GrammarAST BLOCK10=null; - GrammarAST ALT13=null; - GrammarAST BLOCK16=null; - GrammarAST ALT17=null; - GrammarAST ALT20=null; - TreeRuleReturnScope elementOptions11 =null; - TreeRuleReturnScope setElement12 =null; - TreeRuleReturnScope elementOptions14 =null; - TreeRuleReturnScope setElement15 =null; - TreeRuleReturnScope elementOptions18 =null; - TreeRuleReturnScope setElement19 =null; - TreeRuleReturnScope elementOptions21 =null; - TreeRuleReturnScope setElement22 =null; - - GrammarAST alt_tree=null; - GrammarAST BLOCK10_tree=null; - GrammarAST ALT13_tree=null; - GrammarAST BLOCK16_tree=null; - GrammarAST ALT17_tree=null; - GrammarAST ALT20_tree=null; - RewriteRuleNodeStream stream_BLOCK=new RewriteRuleNodeStream(adaptor,"token BLOCK"); - RewriteRuleNodeStream stream_ALT=new RewriteRuleNodeStream(adaptor,"token ALT"); - RewriteRuleSubtreeStream stream_elementOptions=new RewriteRuleSubtreeStream(adaptor,"rule elementOptions"); - RewriteRuleSubtreeStream stream_setElement=new RewriteRuleSubtreeStream(adaptor,"rule setElement"); - - - boolean inLexer = Grammar.isTokenName(currentRuleName); - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:97:2: ({...}? ^( BLOCK ^(alt= ALT ( elementOptions )? {...}? setElement[inLexer] ) ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ ) -> ^( BLOCK[$BLOCK.token] ^( ALT[$BLOCK.token,\"ALT\"] ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ) ) |{...}? ^( BLOCK ^( ALT ( elementOptions )? setElement[inLexer] ) ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ ) -> ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ) - int alt10=2; - alt10 = dfa10.predict(input); - switch (alt10) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:97:4: {...}? ^( BLOCK ^(alt= ALT ( elementOptions )? {...}? setElement[inLexer] ) ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ ) - { - if ( !((inContext("RULE"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "blockSet", "inContext(\"RULE\")"); - } - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - BLOCK10=(GrammarAST)match(input,BLOCK,FOLLOW_BLOCK_in_blockSet244); if (state.failed) return retval; - - if ( state.backtracking==1 ) stream_BLOCK.add(BLOCK10); - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = BLOCK10; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_2 = _last; - GrammarAST _first_2 = null; - _last = (GrammarAST)input.LT(1); - alt=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_blockSet249); if (state.failed) return retval; - - if ( state.backtracking==1 ) stream_ALT.add(alt); - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = alt; - match(input, Token.DOWN, null); if (state.failed) return retval; - // org/antlr/v4/parse/BlockSetTransformer.g:98:21: ( elementOptions )? - int alt4=2; - int LA4_0 = input.LA(1); - if ( (LA4_0==ELEMENT_OPTIONS) ) { - alt4=1; - } - switch (alt4) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:98:21: elementOptions - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_elementOptions_in_blockSet251); - elementOptions11=elementOptions(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_elementOptions.add(elementOptions11.getTree()); - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - - if ( !((((AltAST)alt).altLabel==null)) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "blockSet", "((AltAST)$alt).altLabel==null"); - } - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_setElement_in_blockSet256); - setElement12=setElement(inLexer); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_setElement.add(setElement12.getTree()); - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_2; - } - - - // org/antlr/v4/parse/BlockSetTransformer.g:98:91: ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ - int cnt6=0; - loop6: - while (true) { - int alt6=2; - int LA6_0 = input.LA(1); - if ( (LA6_0==ALT) ) { - alt6=1; - } - - switch (alt6) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:98:93: ^( ALT ( elementOptions )? setElement[inLexer] ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_2 = _last; - GrammarAST _first_2 = null; - _last = (GrammarAST)input.LT(1); - ALT13=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_blockSet263); if (state.failed) return retval; - - if ( state.backtracking==1 ) stream_ALT.add(ALT13); - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = ALT13; - match(input, Token.DOWN, null); if (state.failed) return retval; - // org/antlr/v4/parse/BlockSetTransformer.g:98:99: ( elementOptions )? - int alt5=2; - int LA5_0 = input.LA(1); - if ( (LA5_0==ELEMENT_OPTIONS) ) { - alt5=1; - } - switch (alt5) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:98:99: elementOptions - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_elementOptions_in_blockSet265); - elementOptions14=elementOptions(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_elementOptions.add(elementOptions14.getTree()); - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_setElement_in_blockSet268); - setElement15=setElement(inLexer); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_setElement.add(setElement15.getTree()); - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_2; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - default : - if ( cnt6 >= 1 ) break loop6; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = new EarlyExitException(6, input); - throw eee; - } - cnt6++; - } - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==1 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); - - root_0 = (GrammarAST)adaptor.nil(); - // 99:3: -> ^( BLOCK[$BLOCK.token] ^( ALT[$BLOCK.token,\"ALT\"] ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ) ) - { - // org/antlr/v4/parse/BlockSetTransformer.g:99:6: ^( BLOCK[$BLOCK.token] ^( ALT[$BLOCK.token,\"ALT\"] ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ) ) - { - GrammarAST root_1 = (GrammarAST)adaptor.nil(); - root_1 = (GrammarAST)adaptor.becomeRoot(new BlockAST(BLOCK, BLOCK10.token), root_1); - // org/antlr/v4/parse/BlockSetTransformer.g:99:38: ^( ALT[$BLOCK.token,\"ALT\"] ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ) - { - GrammarAST root_2 = (GrammarAST)adaptor.nil(); - root_2 = (GrammarAST)adaptor.becomeRoot(new AltAST(ALT, BLOCK10.token, "ALT"), root_2); - // org/antlr/v4/parse/BlockSetTransformer.g:99:72: ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) - { - GrammarAST root_3 = (GrammarAST)adaptor.nil(); - root_3 = (GrammarAST)adaptor.becomeRoot((GrammarAST)adaptor.create(SET, BLOCK10.token, "SET"), root_3); - if ( !(stream_setElement.hasNext()) ) { - throw new RewriteEarlyExitException(); - } - while ( stream_setElement.hasNext() ) { - adaptor.addChild(root_3, stream_setElement.nextTree()); - } - stream_setElement.reset(); - - adaptor.addChild(root_2, root_3); - } - - adaptor.addChild(root_1, root_2); - } - - adaptor.addChild(root_0, root_1); - } - - } - - - retval.tree = (GrammarAST)adaptor.rulePostProcessing(root_0); - input.replaceChildren(adaptor.getParent(retval.start), - adaptor.getChildIndex(retval.start), - adaptor.getChildIndex(_last), - retval.tree); - } - - } - break; - case 2 : - // org/antlr/v4/parse/BlockSetTransformer.g:100:4: {...}? ^( BLOCK ^( ALT ( elementOptions )? setElement[inLexer] ) ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ ) - { - if ( !((!inContext("RULE"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "blockSet", "!inContext(\"RULE\")"); - } - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - BLOCK16=(GrammarAST)match(input,BLOCK,FOLLOW_BLOCK_in_blockSet313); if (state.failed) return retval; - - if ( state.backtracking==1 ) stream_BLOCK.add(BLOCK16); - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = BLOCK16; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_2 = _last; - GrammarAST _first_2 = null; - _last = (GrammarAST)input.LT(1); - ALT17=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_blockSet316); if (state.failed) return retval; - - if ( state.backtracking==1 ) stream_ALT.add(ALT17); - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = ALT17; - match(input, Token.DOWN, null); if (state.failed) return retval; - // org/antlr/v4/parse/BlockSetTransformer.g:101:17: ( elementOptions )? - int alt7=2; - int LA7_0 = input.LA(1); - if ( (LA7_0==ELEMENT_OPTIONS) ) { - alt7=1; - } - switch (alt7) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:101:17: elementOptions - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_elementOptions_in_blockSet318); - elementOptions18=elementOptions(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_elementOptions.add(elementOptions18.getTree()); - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_setElement_in_blockSet321); - setElement19=setElement(inLexer); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_setElement.add(setElement19.getTree()); - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_2; - } - - - // org/antlr/v4/parse/BlockSetTransformer.g:101:54: ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ - int cnt9=0; - loop9: - while (true) { - int alt9=2; - int LA9_0 = input.LA(1); - if ( (LA9_0==ALT) ) { - alt9=1; - } - - switch (alt9) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:101:56: ^( ALT ( elementOptions )? setElement[inLexer] ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_2 = _last; - GrammarAST _first_2 = null; - _last = (GrammarAST)input.LT(1); - ALT20=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_blockSet328); if (state.failed) return retval; - - if ( state.backtracking==1 ) stream_ALT.add(ALT20); - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = ALT20; - match(input, Token.DOWN, null); if (state.failed) return retval; - // org/antlr/v4/parse/BlockSetTransformer.g:101:62: ( elementOptions )? - int alt8=2; - int LA8_0 = input.LA(1); - if ( (LA8_0==ELEMENT_OPTIONS) ) { - alt8=1; - } - switch (alt8) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:101:62: elementOptions - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_elementOptions_in_blockSet330); - elementOptions21=elementOptions(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_elementOptions.add(elementOptions21.getTree()); - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_setElement_in_blockSet333); - setElement22=setElement(inLexer); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) stream_setElement.add(setElement22.getTree()); - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_2; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - default : - if ( cnt9 >= 1 ) break loop9; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = new EarlyExitException(9, input); - throw eee; - } - cnt9++; - } - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==1 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); - - root_0 = (GrammarAST)adaptor.nil(); - // 102:3: -> ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) - { - // org/antlr/v4/parse/BlockSetTransformer.g:102:6: ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) - { - GrammarAST root_1 = (GrammarAST)adaptor.nil(); - root_1 = (GrammarAST)adaptor.becomeRoot((GrammarAST)adaptor.create(SET, BLOCK16.token, "SET"), root_1); - if ( !(stream_setElement.hasNext()) ) { - throw new RewriteEarlyExitException(); - } - while ( stream_setElement.hasNext() ) { - adaptor.addChild(root_1, stream_setElement.nextTree()); - } - stream_setElement.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - - retval.tree = (GrammarAST)adaptor.rulePostProcessing(root_0); - input.replaceChildren(adaptor.getParent(retval.start), - adaptor.getChildIndex(retval.start), - adaptor.getChildIndex(_last), - retval.tree); - } - - } - break; - - } - if ( state.backtracking==1 ) { - GrammarTransformPipeline.setGrammarPtr(g, retval.tree); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "blockSet" - - - public static class setElement_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "setElement" - // org/antlr/v4/parse/BlockSetTransformer.g:105:1: setElement[boolean inLexer] : ( ^(a= STRING_LITERAL elementOptions ) {...}?|a= STRING_LITERAL {...}?|{...}? => ^( TOKEN_REF elementOptions ) |{...}? => TOKEN_REF |{...}? => ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) {...}?) ; - public final BlockSetTransformer.setElement_return setElement(boolean inLexer) throws RecognitionException { - BlockSetTransformer.setElement_return retval = new BlockSetTransformer.setElement_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - GrammarAST a=null; - GrammarAST b=null; - GrammarAST TOKEN_REF24=null; - GrammarAST TOKEN_REF26=null; - GrammarAST RANGE27=null; - TreeRuleReturnScope elementOptions23 =null; - TreeRuleReturnScope elementOptions25 =null; - - GrammarAST a_tree=null; - GrammarAST b_tree=null; - GrammarAST TOKEN_REF24_tree=null; - GrammarAST TOKEN_REF26_tree=null; - GrammarAST RANGE27_tree=null; - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:109:2: ( ( ^(a= STRING_LITERAL elementOptions ) {...}?|a= STRING_LITERAL {...}?|{...}? => ^( TOKEN_REF elementOptions ) |{...}? => TOKEN_REF |{...}? => ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) {...}?) ) - // org/antlr/v4/parse/BlockSetTransformer.g:109:4: ( ^(a= STRING_LITERAL elementOptions ) {...}?|a= STRING_LITERAL {...}?|{...}? => ^( TOKEN_REF elementOptions ) |{...}? => TOKEN_REF |{...}? => ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) {...}?) - { - // org/antlr/v4/parse/BlockSetTransformer.g:109:4: ( ^(a= STRING_LITERAL elementOptions ) {...}?|a= STRING_LITERAL {...}?|{...}? => ^( TOKEN_REF elementOptions ) |{...}? => TOKEN_REF |{...}? => ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) {...}?) - int alt11=5; - int LA11_0 = input.LA(1); - if ( (LA11_0==STRING_LITERAL) ) { - int LA11_1 = input.LA(2); - if ( (LA11_1==DOWN) ) { - alt11=1; - } - else if ( (LA11_1==UP) ) { - alt11=2; - } - - else { - if (state.backtracking>0) {state.failed=true; return retval;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 11, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA11_0==TOKEN_REF) && ((!inLexer))) { - int LA11_2 = input.LA(2); - if ( (LA11_2==DOWN) && ((!inLexer))) { - alt11=3; - } - else if ( (LA11_2==UP) && ((!inLexer))) { - alt11=4; - } - - } - else if ( (LA11_0==RANGE) && ((inLexer))) { - alt11=5; - } - - switch (alt11) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:109:6: ^(a= STRING_LITERAL elementOptions ) {...}? - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - a=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement373); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = a; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_elementOptions_in_setElement375); - elementOptions23=elementOptions(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) - - if ( _first_1==null ) _first_1 = (GrammarAST)elementOptions23.getTree(); - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( !((!inLexer || CharSupport.getCharValueFromGrammarCharLiteral(a.getText())!=-1)) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setElement", "!inLexer || CharSupport.getCharValueFromGrammarCharLiteral($a.getText())!=-1"); - } - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 2 : - // org/antlr/v4/parse/BlockSetTransformer.g:110:7: a= STRING_LITERAL {...}? - { - _last = (GrammarAST)input.LT(1); - a=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement388); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = a; - - if ( !((!inLexer || CharSupport.getCharValueFromGrammarCharLiteral(a.getText())!=-1)) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setElement", "!inLexer || CharSupport.getCharValueFromGrammarCharLiteral($a.getText())!=-1"); - } - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 3 : - // org/antlr/v4/parse/BlockSetTransformer.g:111:5: {...}? => ^( TOKEN_REF elementOptions ) - { - if ( !((!inLexer)) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setElement", "!inLexer"); - } - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - TOKEN_REF24=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement400); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = TOKEN_REF24; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_elementOptions_in_setElement402); - elementOptions25=elementOptions(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) - - if ( _first_1==null ) _first_1 = (GrammarAST)elementOptions25.getTree(); - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 4 : - // org/antlr/v4/parse/BlockSetTransformer.g:112:5: {...}? => TOKEN_REF - { - if ( !((!inLexer)) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setElement", "!inLexer"); - } - _last = (GrammarAST)input.LT(1); - TOKEN_REF26=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement414); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = TOKEN_REF26; - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 5 : - // org/antlr/v4/parse/BlockSetTransformer.g:113:5: {...}? => ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) {...}? - { - if ( !((inLexer)) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setElement", "inLexer"); - } - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - RANGE27=(GrammarAST)match(input,RANGE,FOLLOW_RANGE_in_setElement425); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = RANGE27; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - a=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement429); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = a; - - _last = (GrammarAST)input.LT(1); - b=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement433); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = b; - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( !((CharSupport.getCharValueFromGrammarCharLiteral(a.getText())!=-1 && - CharSupport.getCharValueFromGrammarCharLiteral(b.getText())!=-1)) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setElement", "CharSupport.getCharValueFromGrammarCharLiteral($a.getText())!=-1 &&\n\t\t\t CharSupport.getCharValueFromGrammarCharLiteral($b.getText())!=-1"); - } - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - - if ( state.backtracking==1 ) { - GrammarTransformPipeline.setGrammarPtr(g, retval.tree); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "setElement" - - - public static class elementOptions_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "elementOptions" - // org/antlr/v4/parse/BlockSetTransformer.g:119:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption )* ) ; - public final BlockSetTransformer.elementOptions_return elementOptions() throws RecognitionException { - BlockSetTransformer.elementOptions_return retval = new BlockSetTransformer.elementOptions_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - GrammarAST ELEMENT_OPTIONS28=null; - TreeRuleReturnScope elementOption29 =null; - - GrammarAST ELEMENT_OPTIONS28_tree=null; - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:120:2: ( ^( ELEMENT_OPTIONS ( elementOption )* ) ) - // org/antlr/v4/parse/BlockSetTransformer.g:120:4: ^( ELEMENT_OPTIONS ( elementOption )* ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - ELEMENT_OPTIONS28=(GrammarAST)match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOptions455); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = ELEMENT_OPTIONS28; - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); if (state.failed) return retval; - // org/antlr/v4/parse/BlockSetTransformer.g:120:22: ( elementOption )* - loop12: - while (true) { - int alt12=2; - int LA12_0 = input.LA(1); - if ( (LA12_0==ASSIGN||LA12_0==ID) ) { - alt12=1; - } - - switch (alt12) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:120:22: elementOption - { - _last = (GrammarAST)input.LT(1); - pushFollow(FOLLOW_elementOption_in_elementOptions457); - elementOption29=elementOption(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==1 ) - - if ( _first_1==null ) _first_1 = (GrammarAST)elementOption29.getTree(); - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - default : - break loop12; - } - } - - match(input, Token.UP, null); if (state.failed) return retval; - } - _last = _save_last_1; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "elementOptions" - - - public static class elementOption_return extends TreeRuleReturnScope { - GrammarAST tree; - @Override - public GrammarAST getTree() { return tree; } - }; - - - // $ANTLR start "elementOption" - // org/antlr/v4/parse/BlockSetTransformer.g:123:1: elementOption : ( ID | ^( ASSIGN id= ID v= ID ) | ^( ASSIGN ID v= STRING_LITERAL ) | ^( ASSIGN ID v= ACTION ) | ^( ASSIGN ID v= INT ) ); - public final BlockSetTransformer.elementOption_return elementOption() throws RecognitionException { - BlockSetTransformer.elementOption_return retval = new BlockSetTransformer.elementOption_return(); - retval.start = input.LT(1); - - GrammarAST root_0 = null; - - GrammarAST _first_0 = null; - GrammarAST _last = null; - - - GrammarAST id=null; - GrammarAST v=null; - GrammarAST ID30=null; - GrammarAST ASSIGN31=null; - GrammarAST ASSIGN32=null; - GrammarAST ID33=null; - GrammarAST ASSIGN34=null; - GrammarAST ID35=null; - GrammarAST ASSIGN36=null; - GrammarAST ID37=null; - - GrammarAST id_tree=null; - GrammarAST v_tree=null; - GrammarAST ID30_tree=null; - GrammarAST ASSIGN31_tree=null; - GrammarAST ASSIGN32_tree=null; - GrammarAST ID33_tree=null; - GrammarAST ASSIGN34_tree=null; - GrammarAST ID35_tree=null; - GrammarAST ASSIGN36_tree=null; - GrammarAST ID37_tree=null; - - try { - // org/antlr/v4/parse/BlockSetTransformer.g:124:2: ( ID | ^( ASSIGN id= ID v= ID ) | ^( ASSIGN ID v= STRING_LITERAL ) | ^( ASSIGN ID v= ACTION ) | ^( ASSIGN ID v= INT ) ) - int alt13=5; - int LA13_0 = input.LA(1); - if ( (LA13_0==ID) ) { - alt13=1; - } - else if ( (LA13_0==ASSIGN) ) { - int LA13_2 = input.LA(2); - if ( (LA13_2==DOWN) ) { - int LA13_3 = input.LA(3); - if ( (LA13_3==ID) ) { - switch ( input.LA(4) ) { - case ID: - { - alt13=2; - } - break; - case STRING_LITERAL: - { - alt13=3; - } - break; - case ACTION: - { - alt13=4; - } - break; - case INT: - { - alt13=5; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 13, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - } - - else { - if (state.backtracking>0) {state.failed=true; return retval;} - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 13, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - if (state.backtracking>0) {state.failed=true; return retval;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 13, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 13, 0, input); - throw nvae; - } - - switch (alt13) { - case 1 : - // org/antlr/v4/parse/BlockSetTransformer.g:124:4: ID - { - _last = (GrammarAST)input.LT(1); - ID30=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption470); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = ID30; - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 2 : - // org/antlr/v4/parse/BlockSetTransformer.g:125:4: ^( ASSIGN id= ID v= ID ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - ASSIGN31=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption476); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = ASSIGN31; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption480); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = id; - - _last = (GrammarAST)input.LT(1); - v=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption484); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = v; - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 3 : - // org/antlr/v4/parse/BlockSetTransformer.g:126:4: ^( ASSIGN ID v= STRING_LITERAL ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - ASSIGN32=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption491); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = ASSIGN32; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - ID33=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption493); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = ID33; - - _last = (GrammarAST)input.LT(1); - v=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption497); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = v; - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 4 : - // org/antlr/v4/parse/BlockSetTransformer.g:127:4: ^( ASSIGN ID v= ACTION ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - ASSIGN34=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption504); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = ASSIGN34; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - ID35=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption506); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = ID35; - - _last = (GrammarAST)input.LT(1); - v=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_elementOption510); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = v; - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - case 5 : - // org/antlr/v4/parse/BlockSetTransformer.g:128:4: ^( ASSIGN ID v= INT ) - { - _last = (GrammarAST)input.LT(1); - { - GrammarAST _save_last_1 = _last; - GrammarAST _first_1 = null; - _last = (GrammarAST)input.LT(1); - ASSIGN36=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption517); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_0==null ) _first_0 = ASSIGN36; - match(input, Token.DOWN, null); if (state.failed) return retval; - _last = (GrammarAST)input.LT(1); - ID37=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption519); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = ID37; - - _last = (GrammarAST)input.LT(1); - v=(GrammarAST)match(input,INT,FOLLOW_INT_in_elementOption523); if (state.failed) return retval; - - if ( state.backtracking==1 ) - if ( _first_1==null ) _first_1 = v; - - match(input, Token.UP, null); if (state.failed) return retval; - _last = _save_last_1; - } - - - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (GrammarAST)adaptor.getParent(retval.tree); - } - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "elementOption" - - // Delegated rules - - - protected DFA10 dfa10 = new DFA10(this); - static final String DFA10_eotS = - "\174\uffff"; - static final String DFA10_eofS = - "\174\uffff"; - static final String DFA10_minS = - "\1\106\1\2\1\105\1\2\1\61\4\2\1\3\1\111\1\105\1\111\1\73\1\3\1\2\1\61"+ - "\3\2\1\73\1\34\1\3\1\61\2\3\1\4\1\3\1\2\1\3\4\2\1\3\1\2\6\3\1\34\2\3\1"+ - "\111\1\3\1\111\1\73\1\34\5\3\1\4\1\3\1\2\1\61\1\2\1\0\1\2\1\73\1\4\4\3"+ - "\1\34\1\3\2\uffff\12\3\1\4\1\3\1\2\2\3\1\2\12\3\1\34\1\3\1\34\5\3\2\4"+ - "\20\3"; - static final String DFA10_maxS = - "\1\106\1\2\1\105\1\2\1\111\1\2\2\3\1\2\1\34\1\111\1\105\1\111\1\73\1\34"+ - "\1\2\1\76\3\2\1\73\2\34\1\111\1\34\1\3\1\73\1\34\1\2\1\3\1\2\2\3\1\2\1"+ - "\34\1\2\6\3\1\34\1\3\1\34\1\111\1\105\1\111\1\73\1\34\1\3\4\34\1\73\1"+ - "\34\1\2\1\76\1\2\1\0\1\2\2\73\4\3\2\34\2\uffff\1\34\5\3\4\34\1\73\1\34"+ - "\1\2\1\3\1\34\1\2\2\3\4\34\4\3\1\34\1\3\1\34\1\3\4\34\2\73\10\3\10\34"; - static final String DFA10_acceptS = - "\106\uffff\1\1\1\2\64\uffff"; - static final String DFA10_specialS = - "\74\uffff\1\0\77\uffff}>"; - static final String[] DFA10_transitionS = { - "\1\1", - "\1\2", - "\1\3", - "\1\4", - "\1\10\11\uffff\1\6\2\uffff\1\7\12\uffff\1\5", - "\1\11", - "\1\12\1\13", - "\1\14\1\13", - "\1\15", - "\1\20\6\uffff\1\17\21\uffff\1\16", - "\1\21", - "\1\22", - "\1\23", - "\1\24", - "\1\20\6\uffff\1\17\21\uffff\1\16", - "\1\25", - "\1\10\11\uffff\1\6\2\uffff\1\7", - "\1\26", - "\1\27", - "\1\30", - "\1\31", - "\1\32", - "\1\35\6\uffff\1\34\21\uffff\1\33", - "\1\41\11\uffff\1\37\2\uffff\1\40\12\uffff\1\36", - "\1\44\6\uffff\1\43\21\uffff\1\42", - "\1\45", - "\1\50\27\uffff\1\46\1\uffff\1\51\34\uffff\1\47", - "\1\35\6\uffff\1\34\21\uffff\1\33", - "\1\52", - "\1\53", - "\1\54", - "\1\55\1\56", - "\1\57\1\56", - "\1\60", - "\1\44\6\uffff\1\43\21\uffff\1\42", - "\1\61", - "\1\62", - "\1\13", - "\1\63", - "\1\64", - "\1\65", - "\1\66", - "\1\67", - "\1\13", - "\1\72\6\uffff\1\71\21\uffff\1\70", - "\1\73", - "\1\74\101\uffff\1\22", - "\1\75", - "\1\76", - "\1\77", - "\1\13", - "\1\20\6\uffff\1\17\21\uffff\1\16", - "\1\20\6\uffff\1\17\21\uffff\1\16", - "\1\20\6\uffff\1\17\21\uffff\1\16", - "\1\20\6\uffff\1\17\21\uffff\1\16", - "\1\102\27\uffff\1\100\1\uffff\1\103\34\uffff\1\101", - "\1\72\6\uffff\1\71\21\uffff\1\70", - "\1\104", - "\1\41\11\uffff\1\37\2\uffff\1\40", - "\1\105", - "\1\uffff", - "\1\110", - "\1\111", - "\1\114\27\uffff\1\112\1\uffff\1\115\34\uffff\1\113", - "\1\116", - "\1\117", - "\1\120", - "\1\121", - "\1\122", - "\1\125\6\uffff\1\124\21\uffff\1\123", - "", - "", - "\1\130\6\uffff\1\127\21\uffff\1\126", - "\1\131", - "\1\132", - "\1\133", - "\1\134", - "\1\135", - "\1\35\6\uffff\1\34\21\uffff\1\33", - "\1\35\6\uffff\1\34\21\uffff\1\33", - "\1\35\6\uffff\1\34\21\uffff\1\33", - "\1\35\6\uffff\1\34\21\uffff\1\33", - "\1\140\27\uffff\1\136\1\uffff\1\141\34\uffff\1\137", - "\1\125\6\uffff\1\124\21\uffff\1\123", - "\1\142", - "\1\143", - "\1\130\6\uffff\1\127\21\uffff\1\126", - "\1\144", - "\1\145", - "\1\56", - "\1\44\6\uffff\1\43\21\uffff\1\42", - "\1\44\6\uffff\1\43\21\uffff\1\42", - "\1\44\6\uffff\1\43\21\uffff\1\42", - "\1\44\6\uffff\1\43\21\uffff\1\42", - "\1\146", - "\1\147", - "\1\150", - "\1\151", - "\1\152", - "\1\56", - "\1\153", - "\1\56", - "\1\72\6\uffff\1\71\21\uffff\1\70", - "\1\72\6\uffff\1\71\21\uffff\1\70", - "\1\72\6\uffff\1\71\21\uffff\1\70", - "\1\72\6\uffff\1\71\21\uffff\1\70", - "\1\156\27\uffff\1\154\1\uffff\1\157\34\uffff\1\155", - "\1\162\27\uffff\1\160\1\uffff\1\163\34\uffff\1\161", - "\1\164", - "\1\165", - "\1\166", - "\1\167", - "\1\170", - "\1\171", - "\1\172", - "\1\173", - "\1\125\6\uffff\1\124\21\uffff\1\123", - "\1\125\6\uffff\1\124\21\uffff\1\123", - "\1\125\6\uffff\1\124\21\uffff\1\123", - "\1\125\6\uffff\1\124\21\uffff\1\123", - "\1\130\6\uffff\1\127\21\uffff\1\126", - "\1\130\6\uffff\1\127\21\uffff\1\126", - "\1\130\6\uffff\1\127\21\uffff\1\126", - "\1\130\6\uffff\1\127\21\uffff\1\126" - }; - - static final short[] DFA10_eot = DFA.unpackEncodedString(DFA10_eotS); - static final short[] DFA10_eof = DFA.unpackEncodedString(DFA10_eofS); - static final char[] DFA10_min = DFA.unpackEncodedStringToUnsignedChars(DFA10_minS); - static final char[] DFA10_max = DFA.unpackEncodedStringToUnsignedChars(DFA10_maxS); - static final short[] DFA10_accept = DFA.unpackEncodedString(DFA10_acceptS); - static final short[] DFA10_special = DFA.unpackEncodedString(DFA10_specialS); - static final short[][] DFA10_transition; - - static { - int numStates = DFA10_transitionS.length; - DFA10_transition = new short[numStates][]; - for (int i=0; i ^( BLOCK[$BLOCK.token] ^( ALT[$BLOCK.token,\"ALT\"] ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) ) ) |{...}? ^( BLOCK ^( ALT ( elementOptions )? setElement[inLexer] ) ( ^( ALT ( elementOptions )? setElement[inLexer] ) )+ ) -> ^( SET[$BLOCK.token, \"SET\"] ( setElement )+ ) );"; - } - @Override - public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { - TreeNodeStream input = (TreeNodeStream)_input; - int _s = s; - switch ( s ) { - case 0 : - int LA10_60 = input.LA(1); - - int index10_60 = input.index(); - input.rewind(); - s = -1; - if ( ((inContext("RULE"))) ) {s = 70;} - else if ( ((!inContext("RULE"))) ) {s = 71;} - - input.seek(index10_60); - if ( s>=0 ) return s; - break; - } - if (state.backtracking>0) {state.failed=true; return -1;} - NoViableAltException nvae = - new NoViableAltException(getDescription(), 10, _s, input); - error(nvae); - throw nvae; - } - } - - public static final BitSet FOLLOW_RULE_in_topdown86 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_TOKEN_REF_in_topdown91 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x00000000000FFFFFL}); - public static final BitSet FOLLOW_RULE_REF_in_topdown95 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x00000000000FFFFFL}); - public static final BitSet FOLLOW_setAlt_in_topdown110 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ebnfBlockSet_in_topdown118 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_blockSet_in_topdown126 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ALT_in_setAlt141 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ebnfSuffix_in_ebnfBlockSet161 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_blockSet_in_ebnfBlockSet163 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_BLOCK_in_blockSet244 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ALT_in_blockSet249 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_blockSet251 = new BitSet(new long[]{0x4802000000000000L}); - public static final BitSet FOLLOW_setElement_in_blockSet256 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ALT_in_blockSet263 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_blockSet265 = new BitSet(new long[]{0x4802000000000000L}); - public static final BitSet FOLLOW_setElement_in_blockSet268 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_BLOCK_in_blockSet313 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ALT_in_blockSet316 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_blockSet318 = new BitSet(new long[]{0x4802000000000000L}); - public static final BitSet FOLLOW_setElement_in_blockSet321 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ALT_in_blockSet328 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_blockSet330 = new BitSet(new long[]{0x4802000000000000L}); - public static final BitSet FOLLOW_setElement_in_blockSet333 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_setElement373 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_setElement375 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_setElement388 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_TOKEN_REF_in_setElement400 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_setElement402 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TOKEN_REF_in_setElement414 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RANGE_in_setElement425 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_setElement429 = new BitSet(new long[]{0x0800000000000000L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_setElement433 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ELEMENT_OPTIONS_in_elementOptions455 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOption_in_elementOptions457 = new BitSet(new long[]{0x0000000010000408L}); - public static final BitSet FOLLOW_ID_in_elementOption470 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption476 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption480 = new BitSet(new long[]{0x0000000010000000L}); - public static final BitSet FOLLOW_ID_in_elementOption484 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption491 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption493 = new BitSet(new long[]{0x0800000000000000L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_elementOption497 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption504 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption506 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_ACTION_in_elementOption510 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption517 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption519 = new BitSet(new long[]{0x0000000040000000L}); - public static final BitSet FOLLOW_INT_in_elementOption523 = new BitSet(new long[]{0x0000000000000008L}); -} diff --git a/src/tree-walkers/BlockSetTransformer.ts b/src/tree-walkers/BlockSetTransformer.ts index 94bb3c7..79d98cd 100644 --- a/src/tree-walkers/BlockSetTransformer.ts +++ b/src/tree-walkers/BlockSetTransformer.ts @@ -51,7 +51,6 @@ export class BlockSetTransformer extends TreeRewriter { ]; private currentRuleName?: string; - private currentAlt: GrammarAST; private g: Grammar; private adaptor = new CommonTreeAdaptor(); @@ -457,9 +456,6 @@ export class BlockSetTransformer extends TreeRewriter { _first_0 = ALT6; } - if (this.state.backtracking === 1) { - this.currentAlt = (retval.start as GrammarAST); - } if (this.state.backtracking === 1) { retval.tree = _first_0 ?? undefined; if (retval.tree?.getParent()?.isNil()) { diff --git a/src/tree-walkers/GrammarTreeVisitor.java b/src/tree-walkers/GrammarTreeVisitor.java deleted file mode 100644 index 5ce9b94..0000000 --- a/src/tree-walkers/GrammarTreeVisitor.java +++ /dev/null @@ -1,5434 +0,0 @@ -// $ANTLR 3.5.3 org/antlr/v4/parse/GrammarTreeVisitor.g - -/* - [The "BSD license"] - Copyright (c) 2011 Terence Parr - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package org.antlr.v4.parse; -import org.antlr.v4.Tool; -import org.antlr.v4.tool.*; -import org.antlr.v4.tool.ast.*; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - - -import org.antlr.runtime.*; -import org.antlr.runtime.tree.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -/** The definitive ANTLR v3 tree grammar to walk/visit ANTLR v4 grammars. - * Parses trees created by ANTLRParser.g. - * - * Rather than have multiple tree grammars, one for each visit, I'm - * creating this generic visitor that knows about context. All of the - * boilerplate pattern recognition is done here. Then, subclasses can - * override the methods they care about. This prevents a lot of the same - * context tracking stuff like "set current alternative for current - * rule node" that is repeated in lots of tree filters. - */ -@SuppressWarnings("all") -public class GrammarTreeVisitor extends TreeParser { - public static final String[] tokenNames = new String[] { - "", "", "", "", "ACTION", "ACTION_CHAR_LITERAL", - "ACTION_ESC", "ACTION_STRING_LITERAL", "ARG_ACTION", "ARG_OR_CHARSET", - "ASSIGN", "AT", "CATCH", "CHANNELS", "COLON", "COLONCOLON", "COMMA", "COMMENT", - "DOC_COMMENT", "DOLLAR", "DOT", "ERRCHAR", "ESC_SEQ", "FINALLY", "FRAGMENT", - "GRAMMAR", "GT", "HEX_DIGIT", "ID", "IMPORT", "INT", "LEXER", "LEXER_CHAR_SET", - "LOCALS", "LPAREN", "LT", "MODE", "NESTED_ACTION", "NLCHARS", "NOT", "NameChar", - "NameStartChar", "OPTIONS", "OR", "PARSER", "PLUS", "PLUS_ASSIGN", "POUND", - "QUESTION", "RANGE", "RARROW", "RBRACE", "RETURNS", "RPAREN", "RULE_REF", - "SEMI", "SEMPRED", "SRC", "STAR", "STRING_LITERAL", "THROWS", "TOKENS_SPEC", - "TOKEN_REF", "UNICODE_ESC", "UNICODE_EXTENDED_ESC", "UnicodeBOM", "WS", - "WSCHARS", "WSNLCHARS", "ALT", "BLOCK", "CLOSURE", "COMBINED", "ELEMENT_OPTIONS", - "EPSILON", "LEXER_ACTION_CALL", "LEXER_ALT_ACTION", "OPTIONAL", "POSITIVE_CLOSURE", - "RULE", "RULEMODIFIERS", "RULES", "SET", "WILDCARD", "PRIVATE", "PROTECTED", - "PUBLIC" - }; - public static final int EOF=-1; - public static final int ACTION=4; - public static final int ACTION_CHAR_LITERAL=5; - public static final int ACTION_ESC=6; - public static final int ACTION_STRING_LITERAL=7; - public static final int ARG_ACTION=8; - public static final int ARG_OR_CHARSET=9; - public static final int ASSIGN=10; - public static final int AT=11; - public static final int CATCH=12; - public static final int CHANNELS=13; - public static final int COLON=14; - public static final int COLONCOLON=15; - public static final int COMMA=16; - public static final int COMMENT=17; - public static final int DOC_COMMENT=18; - public static final int DOLLAR=19; - public static final int DOT=20; - public static final int ERRCHAR=21; - public static final int ESC_SEQ=22; - public static final int FINALLY=23; - public static final int FRAGMENT=24; - public static final int GRAMMAR=25; - public static final int GT=26; - public static final int HEX_DIGIT=27; - public static final int ID=28; - public static final int IMPORT=29; - public static final int INT=30; - public static final int LEXER=31; - public static final int LEXER_CHAR_SET=32; - public static final int LOCALS=33; - public static final int LPAREN=34; - public static final int LT=35; - public static final int MODE=36; - public static final int NESTED_ACTION=37; - public static final int NLCHARS=38; - public static final int NOT=39; - public static final int NameChar=40; - public static final int NameStartChar=41; - public static final int OPTIONS=42; - public static final int OR=43; - public static final int PARSER=44; - public static final int PLUS=45; - public static final int PLUS_ASSIGN=46; - public static final int POUND=47; - public static final int QUESTION=48; - public static final int RANGE=49; - public static final int RARROW=50; - public static final int RBRACE=51; - public static final int RETURNS=52; - public static final int RPAREN=53; - public static final int RULE_REF=54; - public static final int SEMI=55; - public static final int SEMPRED=56; - public static final int SRC=57; - public static final int STAR=58; - public static final int STRING_LITERAL=59; - public static final int THROWS=60; - public static final int TOKENS_SPEC=61; - public static final int TOKEN_REF=62; - public static final int UNICODE_ESC=63; - public static final int UNICODE_EXTENDED_ESC=64; - public static final int UnicodeBOM=65; - public static final int WS=66; - public static final int WSCHARS=67; - public static final int WSNLCHARS=68; - public static final int ALT=69; - public static final int BLOCK=70; - public static final int CLOSURE=71; - public static final int COMBINED=72; - public static final int ELEMENT_OPTIONS=73; - public static final int EPSILON=74; - public static final int LEXER_ACTION_CALL=75; - public static final int LEXER_ALT_ACTION=76; - public static final int OPTIONAL=77; - public static final int POSITIVE_CLOSURE=78; - public static final int RULE=79; - public static final int RULEMODIFIERS=80; - public static final int RULES=81; - public static final int SET=82; - public static final int WILDCARD=83; - public static final int PRIVATE=84; - public static final int PROTECTED=85; - public static final int PUBLIC=86; - - // delegates - public TreeParser[] getDelegates() { - return new TreeParser[] {}; - } - - // delegators - - - public GrammarTreeVisitor(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public GrammarTreeVisitor(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - @Override public String[] getTokenNames() { return GrammarTreeVisitor.tokenNames; } - @Override public String getGrammarFileName() { return "org/antlr/v4/parse/GrammarTreeVisitor.g"; } - - - public String grammarName; - public GrammarAST currentRuleAST; - public String currentModeName = LexerGrammar.DEFAULT_MODE_NAME; - public String currentRuleName; - public GrammarAST currentOuterAltRoot; - public int currentOuterAltNumber = 1; // 1..n - public int rewriteEBNFLevel = 0; - - public GrammarTreeVisitor() { this(null); } - - // Should be abstract but can't make gen'd parser abstract; - // subclasses should implement else everything goes to stderr! - public ErrorManager getErrorManager() { return null; } - - public void visitGrammar(GrammarAST t) { visit(t, "grammarSpec"); } - public void visit(GrammarAST t, String ruleName) { - CommonTreeNodeStream nodes = new CommonTreeNodeStream(new GrammarASTAdaptor(), t); - setTreeNodeStream(nodes); - try { - Method m = getClass().getMethod(ruleName); - m.invoke(this); - } - catch (Throwable e) { - ErrorManager errMgr = getErrorManager(); - if ( e instanceof InvocationTargetException ) { - e = e.getCause(); - } - //e.printStackTrace(System.err); - if ( errMgr==null ) { - System.err.println("can't find rule "+ruleName+ - " or tree structure error: "+t.toStringTree() - ); - e.printStackTrace(System.err); - } - else errMgr.toolError(ErrorType.INTERNAL_ERROR, e); - } - } - - public void discoverGrammar(GrammarRootAST root, GrammarAST ID) { } - public void finishPrequels(GrammarAST firstPrequel) { } - public void finishGrammar(GrammarRootAST root, GrammarAST ID) { } - - public void grammarOption(GrammarAST ID, GrammarAST valueAST) { } - public void ruleOption(GrammarAST ID, GrammarAST valueAST) { } - public void blockOption(GrammarAST ID, GrammarAST valueAST) { } - public void defineToken(GrammarAST ID) { } - public void defineChannel(GrammarAST ID) { } - public void globalNamedAction(GrammarAST scope, GrammarAST ID, ActionAST action) { } - public void importGrammar(GrammarAST label, GrammarAST ID) { } - - public void modeDef(GrammarAST m, GrammarAST ID) { } - - public void discoverRules(GrammarAST rules) { } - public void finishRules(GrammarAST rule) { } - public void discoverRule(RuleAST rule, GrammarAST ID, List modifiers, - ActionAST arg, ActionAST returns, GrammarAST thrws, - GrammarAST options, ActionAST locals, - List actions, - GrammarAST block) { } - public void finishRule(RuleAST rule, GrammarAST ID, GrammarAST block) { } - public void discoverLexerRule(RuleAST rule, GrammarAST ID, List modifiers, GrammarAST options, - GrammarAST block) { } - public void finishLexerRule(RuleAST rule, GrammarAST ID, GrammarAST block) { } - public void ruleCatch(GrammarAST arg, ActionAST action) { } - public void finallyAction(ActionAST action) { } - public void discoverOuterAlt(AltAST alt) { } - public void finishOuterAlt(AltAST alt) { } - public void discoverAlt(AltAST alt) { } - public void finishAlt(AltAST alt) { } - - public void ruleRef(GrammarAST ref, ActionAST arg) { } - public void tokenRef(TerminalAST ref) { } - public void elementOption(GrammarASTWithOptions t, GrammarAST ID, GrammarAST valueAST) { } - public void stringRef(TerminalAST ref) { } - public void wildcardRef(GrammarAST ref) { } - public void actionInAlt(ActionAST action) { } - public void sempredInAlt(PredAST pred) { } - public void label(GrammarAST op, GrammarAST ID, GrammarAST element) { } - public void lexerCallCommand(int outerAltNumber, GrammarAST ID, GrammarAST arg) { } - public void lexerCommand(int outerAltNumber, GrammarAST ID) { } - - protected void enterGrammarSpec(GrammarAST tree) { } - protected void exitGrammarSpec(GrammarAST tree) { } - - protected void enterPrequelConstructs(GrammarAST tree) { } - protected void exitPrequelConstructs(GrammarAST tree) { } - - protected void enterPrequelConstruct(GrammarAST tree) { } - protected void exitPrequelConstruct(GrammarAST tree) { } - - protected void enterOptionsSpec(GrammarAST tree) { } - protected void exitOptionsSpec(GrammarAST tree) { } - - protected void enterOption(GrammarAST tree) { } - protected void exitOption(GrammarAST tree) { } - - protected void enterOptionValue(GrammarAST tree) { } - protected void exitOptionValue(GrammarAST tree) { } - - protected void enterDelegateGrammars(GrammarAST tree) { } - protected void exitDelegateGrammars(GrammarAST tree) { } - - protected void enterDelegateGrammar(GrammarAST tree) { } - protected void exitDelegateGrammar(GrammarAST tree) { } - - protected void enterTokensSpec(GrammarAST tree) { } - protected void exitTokensSpec(GrammarAST tree) { } - - protected void enterTokenSpec(GrammarAST tree) { } - protected void exitTokenSpec(GrammarAST tree) { } - - protected void enterChannelsSpec(GrammarAST tree) { } - protected void exitChannelsSpec(GrammarAST tree) { } - - protected void enterChannelSpec(GrammarAST tree) { } - protected void exitChannelSpec(GrammarAST tree) { } - - protected void enterAction(GrammarAST tree) { } - protected void exitAction(GrammarAST tree) { } - - protected void enterRules(GrammarAST tree) { } - protected void exitRules(GrammarAST tree) { } - - protected void enterMode(GrammarAST tree) { } - protected void exitMode(GrammarAST tree) { } - - protected void enterLexerRule(GrammarAST tree) { } - protected void exitLexerRule(GrammarAST tree) { } - - protected void enterRule(GrammarAST tree) { } - protected void exitRule(GrammarAST tree) { } - - protected void enterExceptionGroup(GrammarAST tree) { } - protected void exitExceptionGroup(GrammarAST tree) { } - - protected void enterExceptionHandler(GrammarAST tree) { } - protected void exitExceptionHandler(GrammarAST tree) { } - - protected void enterFinallyClause(GrammarAST tree) { } - protected void exitFinallyClause(GrammarAST tree) { } - - protected void enterLocals(GrammarAST tree) { } - protected void exitLocals(GrammarAST tree) { } - - protected void enterRuleReturns(GrammarAST tree) { } - protected void exitRuleReturns(GrammarAST tree) { } - - protected void enterThrowsSpec(GrammarAST tree) { } - protected void exitThrowsSpec(GrammarAST tree) { } - - protected void enterRuleAction(GrammarAST tree) { } - protected void exitRuleAction(GrammarAST tree) { } - - protected void enterRuleModifier(GrammarAST tree) { } - protected void exitRuleModifier(GrammarAST tree) { } - - protected void enterLexerRuleBlock(GrammarAST tree) { } - protected void exitLexerRuleBlock(GrammarAST tree) { } - - protected void enterRuleBlock(GrammarAST tree) { } - protected void exitRuleBlock(GrammarAST tree) { } - - protected void enterLexerOuterAlternative(AltAST tree) { } - protected void exitLexerOuterAlternative(AltAST tree) { } - - protected void enterOuterAlternative(AltAST tree) { } - protected void exitOuterAlternative(AltAST tree) { } - - protected void enterLexerAlternative(GrammarAST tree) { } - protected void exitLexerAlternative(GrammarAST tree) { } - - protected void enterLexerElements(GrammarAST tree) { } - protected void exitLexerElements(GrammarAST tree) { } - - protected void enterLexerElement(GrammarAST tree) { } - protected void exitLexerElement(GrammarAST tree) { } - - protected void enterLexerBlock(GrammarAST tree) { } - protected void exitLexerBlock(GrammarAST tree) { } - - protected void enterLexerAtom(GrammarAST tree) { } - protected void exitLexerAtom(GrammarAST tree) { } - - protected void enterActionElement(GrammarAST tree) { } - protected void exitActionElement(GrammarAST tree) { } - - protected void enterAlternative(AltAST tree) { } - protected void exitAlternative(AltAST tree) { } - - protected void enterLexerCommand(GrammarAST tree) { } - protected void exitLexerCommand(GrammarAST tree) { } - - protected void enterLexerCommandExpr(GrammarAST tree) { } - protected void exitLexerCommandExpr(GrammarAST tree) { } - - protected void enterElement(GrammarAST tree) { } - protected void exitElement(GrammarAST tree) { } - - protected void enterAstOperand(GrammarAST tree) { } - protected void exitAstOperand(GrammarAST tree) { } - - protected void enterLabeledElement(GrammarAST tree) { } - protected void exitLabeledElement(GrammarAST tree) { } - - protected void enterSubrule(GrammarAST tree) { } - protected void exitSubrule(GrammarAST tree) { } - - protected void enterLexerSubrule(GrammarAST tree) { } - protected void exitLexerSubrule(GrammarAST tree) { } - - protected void enterBlockSuffix(GrammarAST tree) { } - protected void exitBlockSuffix(GrammarAST tree) { } - - protected void enterEbnfSuffix(GrammarAST tree) { } - protected void exitEbnfSuffix(GrammarAST tree) { } - - protected void enterAtom(GrammarAST tree) { } - protected void exitAtom(GrammarAST tree) { } - - protected void enterBlockSet(GrammarAST tree) { } - protected void exitBlockSet(GrammarAST tree) { } - - protected void enterSetElement(GrammarAST tree) { } - protected void exitSetElement(GrammarAST tree) { } - - protected void enterBlock(GrammarAST tree) { } - protected void exitBlock(GrammarAST tree) { } - - protected void enterRuleref(GrammarAST tree) { } - protected void exitRuleref(GrammarAST tree) { } - - protected void enterRange(GrammarAST tree) { } - protected void exitRange(GrammarAST tree) { } - - protected void enterTerminal(GrammarAST tree) { } - protected void exitTerminal(GrammarAST tree) { } - - protected void enterElementOptions(GrammarAST tree) { } - protected void exitElementOptions(GrammarAST tree) { } - - protected void enterElementOption(GrammarAST tree) { } - protected void exitElementOption(GrammarAST tree) { } - - @Override - public void traceIn(String ruleName, int ruleIndex) { - System.err.println("enter "+ruleName+": "+input.LT(1)); - } - - @Override - public void traceOut(String ruleName, int ruleIndex) { - System.err.println("exit "+ruleName+": "+input.LT(1)); - } - - - public static class grammarSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "grammarSpec" - // org/antlr/v4/parse/GrammarTreeVisitor.g:341:1: grammarSpec : ^( GRAMMAR ID prequelConstructs rules ( mode )* ) ; - public final GrammarTreeVisitor.grammarSpec_return grammarSpec() throws RecognitionException { - GrammarTreeVisitor.grammarSpec_return retval = new GrammarTreeVisitor.grammarSpec_return(); - retval.start = input.LT(1); - - GrammarAST ID1=null; - GrammarAST GRAMMAR2=null; - TreeRuleReturnScope prequelConstructs3 =null; - - - enterGrammarSpec(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:348:5: ( ^( GRAMMAR ID prequelConstructs rules ( mode )* ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:348:9: ^( GRAMMAR ID prequelConstructs rules ( mode )* ) - { - GRAMMAR2=(GrammarAST)match(input,GRAMMAR,FOLLOW_GRAMMAR_in_grammarSpec85); - match(input, Token.DOWN, null); - ID1=(GrammarAST)match(input,ID,FOLLOW_ID_in_grammarSpec87); - grammarName=(ID1!=null?ID1.getText():null); - discoverGrammar((GrammarRootAST)GRAMMAR2, ID1); - pushFollow(FOLLOW_prequelConstructs_in_grammarSpec106); - prequelConstructs3=prequelConstructs(); - state._fsp--; - - finishPrequels((prequelConstructs3!=null?((GrammarTreeVisitor.prequelConstructs_return)prequelConstructs3).firstOne:null)); - pushFollow(FOLLOW_rules_in_grammarSpec123); - rules(); - state._fsp--; - - // org/antlr/v4/parse/GrammarTreeVisitor.g:352:14: ( mode )* - loop1: - while (true) { - int alt1=2; - int LA1_0 = input.LA(1); - if ( (LA1_0==MODE) ) { - alt1=1; - } - - switch (alt1) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:352:14: mode - { - pushFollow(FOLLOW_mode_in_grammarSpec125); - mode(); - state._fsp--; - - } - break; - - default : - break loop1; - } - } - - finishGrammar((GrammarRootAST)GRAMMAR2, ID1); - match(input, Token.UP, null); - - } - - - exitGrammarSpec(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "grammarSpec" - - - public static class prequelConstructs_return extends TreeRuleReturnScope { - public GrammarAST firstOne=null; - }; - - - // $ANTLR start "prequelConstructs" - // org/antlr/v4/parse/GrammarTreeVisitor.g:357:1: prequelConstructs returns [GrammarAST firstOne=null] : ( ( prequelConstruct )+ |); - public final GrammarTreeVisitor.prequelConstructs_return prequelConstructs() throws RecognitionException { - GrammarTreeVisitor.prequelConstructs_return retval = new GrammarTreeVisitor.prequelConstructs_return(); - retval.start = input.LT(1); - - - enterPrequelConstructs(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:364:2: ( ( prequelConstruct )+ |) - int alt3=2; - int LA3_0 = input.LA(1); - if ( (LA3_0==AT||LA3_0==CHANNELS||LA3_0==IMPORT||LA3_0==OPTIONS||LA3_0==TOKENS_SPEC) ) { - alt3=1; - } - else if ( (LA3_0==RULES) ) { - alt3=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 3, 0, input); - throw nvae; - } - - switch (alt3) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:364:4: ( prequelConstruct )+ - { - retval.firstOne =((GrammarAST)retval.start); - // org/antlr/v4/parse/GrammarTreeVisitor.g:364:24: ( prequelConstruct )+ - int cnt2=0; - loop2: - while (true) { - int alt2=2; - int LA2_0 = input.LA(1); - if ( (LA2_0==AT||LA2_0==CHANNELS||LA2_0==IMPORT||LA2_0==OPTIONS||LA2_0==TOKENS_SPEC) ) { - alt2=1; - } - - switch (alt2) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:364:24: prequelConstruct - { - pushFollow(FOLLOW_prequelConstruct_in_prequelConstructs167); - prequelConstruct(); - state._fsp--; - - } - break; - - default : - if ( cnt2 >= 1 ) break loop2; - EarlyExitException eee = new EarlyExitException(2, input); - throw eee; - } - cnt2++; - } - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:366:2: - { - } - break; - - } - - exitPrequelConstructs(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "prequelConstructs" - - - public static class prequelConstruct_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "prequelConstruct" - // org/antlr/v4/parse/GrammarTreeVisitor.g:368:1: prequelConstruct : ( optionsSpec | delegateGrammars | tokensSpec | channelsSpec | action ); - public final GrammarTreeVisitor.prequelConstruct_return prequelConstruct() throws RecognitionException { - GrammarTreeVisitor.prequelConstruct_return retval = new GrammarTreeVisitor.prequelConstruct_return(); - retval.start = input.LT(1); - - - enterPrequelConstructs(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:375:2: ( optionsSpec | delegateGrammars | tokensSpec | channelsSpec | action ) - int alt4=5; - switch ( input.LA(1) ) { - case OPTIONS: - { - alt4=1; - } - break; - case IMPORT: - { - alt4=2; - } - break; - case TOKENS_SPEC: - { - alt4=3; - } - break; - case CHANNELS: - { - alt4=4; - } - break; - case AT: - { - alt4=5; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 4, 0, input); - throw nvae; - } - switch (alt4) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:375:6: optionsSpec - { - pushFollow(FOLLOW_optionsSpec_in_prequelConstruct194); - optionsSpec(); - state._fsp--; - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:376:9: delegateGrammars - { - pushFollow(FOLLOW_delegateGrammars_in_prequelConstruct204); - delegateGrammars(); - state._fsp--; - - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:377:9: tokensSpec - { - pushFollow(FOLLOW_tokensSpec_in_prequelConstruct214); - tokensSpec(); - state._fsp--; - - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:378:9: channelsSpec - { - pushFollow(FOLLOW_channelsSpec_in_prequelConstruct224); - channelsSpec(); - state._fsp--; - - } - break; - case 5 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:379:9: action - { - pushFollow(FOLLOW_action_in_prequelConstruct234); - action(); - state._fsp--; - - } - break; - - } - - exitPrequelConstructs(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "prequelConstruct" - - - public static class optionsSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "optionsSpec" - // org/antlr/v4/parse/GrammarTreeVisitor.g:382:1: optionsSpec : ^( OPTIONS ( option )* ) ; - public final GrammarTreeVisitor.optionsSpec_return optionsSpec() throws RecognitionException { - GrammarTreeVisitor.optionsSpec_return retval = new GrammarTreeVisitor.optionsSpec_return(); - retval.start = input.LT(1); - - - enterOptionsSpec(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:389:2: ( ^( OPTIONS ( option )* ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:389:4: ^( OPTIONS ( option )* ) - { - match(input,OPTIONS,FOLLOW_OPTIONS_in_optionsSpec259); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:389:14: ( option )* - loop5: - while (true) { - int alt5=2; - int LA5_0 = input.LA(1); - if ( (LA5_0==ASSIGN) ) { - alt5=1; - } - - switch (alt5) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:389:14: option - { - pushFollow(FOLLOW_option_in_optionsSpec261); - option(); - state._fsp--; - - } - break; - - default : - break loop5; - } - } - - match(input, Token.UP, null); - } - - } - - - exitOptionsSpec(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "optionsSpec" - - - public static class option_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "option" - // org/antlr/v4/parse/GrammarTreeVisitor.g:392:1: option : ^(a= ASSIGN ID v= optionValue ) ; - public final GrammarTreeVisitor.option_return option() throws RecognitionException { - GrammarTreeVisitor.option_return retval = new GrammarTreeVisitor.option_return(); - retval.start = input.LT(1); - - GrammarAST a=null; - GrammarAST ID4=null; - TreeRuleReturnScope v =null; - - - enterOption(((GrammarAST)retval.start)); - boolean rule = inContext("RULE ..."); - boolean block = inContext("BLOCK ..."); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:401:5: ( ^(a= ASSIGN ID v= optionValue ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:401:9: ^(a= ASSIGN ID v= optionValue ) - { - a=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_option295); - match(input, Token.DOWN, null); - ID4=(GrammarAST)match(input,ID,FOLLOW_ID_in_option297); - pushFollow(FOLLOW_optionValue_in_option301); - v=optionValue(); - state._fsp--; - - match(input, Token.UP, null); - - - if ( block ) blockOption(ID4, (v!=null?((GrammarAST)v.start):null)); // most specific first - else if ( rule ) ruleOption(ID4, (v!=null?((GrammarAST)v.start):null)); - else grammarOption(ID4, (v!=null?((GrammarAST)v.start):null)); - - } - - - exitOption(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "option" - - - public static class optionValue_return extends TreeRuleReturnScope { - public String v; - }; - - - // $ANTLR start "optionValue" - // org/antlr/v4/parse/GrammarTreeVisitor.g:409:1: optionValue returns [String v] : ( ID | STRING_LITERAL | INT ); - public final GrammarTreeVisitor.optionValue_return optionValue() throws RecognitionException { - GrammarTreeVisitor.optionValue_return retval = new GrammarTreeVisitor.optionValue_return(); - retval.start = input.LT(1); - - - enterOptionValue(((GrammarAST)retval.start)); - retval.v = ((GrammarAST)retval.start).token.getText(); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:417:5: ( ID | STRING_LITERAL | INT ) - // org/antlr/v4/parse/GrammarTreeVisitor.g: - { - if ( input.LA(1)==ID||input.LA(1)==INT||input.LA(1)==STRING_LITERAL ) { - input.consume(); - state.errorRecovery=false; - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - } - - - exitOptionValue(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "optionValue" - - - public static class delegateGrammars_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "delegateGrammars" - // org/antlr/v4/parse/GrammarTreeVisitor.g:422:1: delegateGrammars : ^( IMPORT ( delegateGrammar )+ ) ; - public final GrammarTreeVisitor.delegateGrammars_return delegateGrammars() throws RecognitionException { - GrammarTreeVisitor.delegateGrammars_return retval = new GrammarTreeVisitor.delegateGrammars_return(); - retval.start = input.LT(1); - - - enterDelegateGrammars(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:429:2: ( ^( IMPORT ( delegateGrammar )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:429:6: ^( IMPORT ( delegateGrammar )+ ) - { - match(input,IMPORT,FOLLOW_IMPORT_in_delegateGrammars389); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:429:15: ( delegateGrammar )+ - int cnt6=0; - loop6: - while (true) { - int alt6=2; - int LA6_0 = input.LA(1); - if ( (LA6_0==ASSIGN||LA6_0==ID) ) { - alt6=1; - } - - switch (alt6) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:429:15: delegateGrammar - { - pushFollow(FOLLOW_delegateGrammar_in_delegateGrammars391); - delegateGrammar(); - state._fsp--; - - } - break; - - default : - if ( cnt6 >= 1 ) break loop6; - EarlyExitException eee = new EarlyExitException(6, input); - throw eee; - } - cnt6++; - } - - match(input, Token.UP, null); - - } - - - exitDelegateGrammars(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "delegateGrammars" - - - public static class delegateGrammar_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "delegateGrammar" - // org/antlr/v4/parse/GrammarTreeVisitor.g:432:1: delegateGrammar : ( ^( ASSIGN label= ID id= ID ) |id= ID ); - public final GrammarTreeVisitor.delegateGrammar_return delegateGrammar() throws RecognitionException { - GrammarTreeVisitor.delegateGrammar_return retval = new GrammarTreeVisitor.delegateGrammar_return(); - retval.start = input.LT(1); - - GrammarAST label=null; - GrammarAST id=null; - - - enterDelegateGrammar(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:439:5: ( ^( ASSIGN label= ID id= ID ) |id= ID ) - int alt7=2; - int LA7_0 = input.LA(1); - if ( (LA7_0==ASSIGN) ) { - alt7=1; - } - else if ( (LA7_0==ID) ) { - alt7=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 7, 0, input); - throw nvae; - } - - switch (alt7) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:439:9: ^( ASSIGN label= ID id= ID ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_delegateGrammar420); - match(input, Token.DOWN, null); - label=(GrammarAST)match(input,ID,FOLLOW_ID_in_delegateGrammar424); - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_delegateGrammar428); - match(input, Token.UP, null); - - importGrammar(label, id); - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:440:9: id= ID - { - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_delegateGrammar443); - importGrammar(null, id); - } - break; - - } - - exitDelegateGrammar(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "delegateGrammar" - - - public static class tokensSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "tokensSpec" - // org/antlr/v4/parse/GrammarTreeVisitor.g:443:1: tokensSpec : ^( TOKENS_SPEC ( tokenSpec )+ ) ; - public final GrammarTreeVisitor.tokensSpec_return tokensSpec() throws RecognitionException { - GrammarTreeVisitor.tokensSpec_return retval = new GrammarTreeVisitor.tokensSpec_return(); - retval.start = input.LT(1); - - - enterTokensSpec(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:450:2: ( ^( TOKENS_SPEC ( tokenSpec )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:450:6: ^( TOKENS_SPEC ( tokenSpec )+ ) - { - match(input,TOKENS_SPEC,FOLLOW_TOKENS_SPEC_in_tokensSpec477); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:450:20: ( tokenSpec )+ - int cnt8=0; - loop8: - while (true) { - int alt8=2; - int LA8_0 = input.LA(1); - if ( (LA8_0==ID) ) { - alt8=1; - } - - switch (alt8) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:450:20: tokenSpec - { - pushFollow(FOLLOW_tokenSpec_in_tokensSpec479); - tokenSpec(); - state._fsp--; - - } - break; - - default : - if ( cnt8 >= 1 ) break loop8; - EarlyExitException eee = new EarlyExitException(8, input); - throw eee; - } - cnt8++; - } - - match(input, Token.UP, null); - - } - - - exitTokensSpec(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "tokensSpec" - - - public static class tokenSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "tokenSpec" - // org/antlr/v4/parse/GrammarTreeVisitor.g:453:1: tokenSpec : ID ; - public final GrammarTreeVisitor.tokenSpec_return tokenSpec() throws RecognitionException { - GrammarTreeVisitor.tokenSpec_return retval = new GrammarTreeVisitor.tokenSpec_return(); - retval.start = input.LT(1); - - GrammarAST ID5=null; - - - enterTokenSpec(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:460:2: ( ID ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:460:4: ID - { - ID5=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokenSpec502); - defineToken(ID5); - } - - - exitTokenSpec(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "tokenSpec" - - - public static class channelsSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "channelsSpec" - // org/antlr/v4/parse/GrammarTreeVisitor.g:463:1: channelsSpec : ^( CHANNELS ( channelSpec )+ ) ; - public final GrammarTreeVisitor.channelsSpec_return channelsSpec() throws RecognitionException { - GrammarTreeVisitor.channelsSpec_return retval = new GrammarTreeVisitor.channelsSpec_return(); - retval.start = input.LT(1); - - - enterChannelsSpec(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:470:2: ( ^( CHANNELS ( channelSpec )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:470:6: ^( CHANNELS ( channelSpec )+ ) - { - match(input,CHANNELS,FOLLOW_CHANNELS_in_channelsSpec532); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:470:17: ( channelSpec )+ - int cnt9=0; - loop9: - while (true) { - int alt9=2; - int LA9_0 = input.LA(1); - if ( (LA9_0==ID) ) { - alt9=1; - } - - switch (alt9) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:470:17: channelSpec - { - pushFollow(FOLLOW_channelSpec_in_channelsSpec534); - channelSpec(); - state._fsp--; - - } - break; - - default : - if ( cnt9 >= 1 ) break loop9; - EarlyExitException eee = new EarlyExitException(9, input); - throw eee; - } - cnt9++; - } - - match(input, Token.UP, null); - - } - - - exitChannelsSpec(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "channelsSpec" - - - public static class channelSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "channelSpec" - // org/antlr/v4/parse/GrammarTreeVisitor.g:473:1: channelSpec : ID ; - public final GrammarTreeVisitor.channelSpec_return channelSpec() throws RecognitionException { - GrammarTreeVisitor.channelSpec_return retval = new GrammarTreeVisitor.channelSpec_return(); - retval.start = input.LT(1); - - GrammarAST ID6=null; - - - enterChannelSpec(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:480:2: ( ID ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:480:4: ID - { - ID6=(GrammarAST)match(input,ID,FOLLOW_ID_in_channelSpec557); - defineChannel(ID6); - } - - - exitChannelSpec(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "channelSpec" - - - public static class action_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "action" - // org/antlr/v4/parse/GrammarTreeVisitor.g:483:1: action : ^( AT (sc= ID )? name= ID ACTION ) ; - public final GrammarTreeVisitor.action_return action() throws RecognitionException { - GrammarTreeVisitor.action_return retval = new GrammarTreeVisitor.action_return(); - retval.start = input.LT(1); - - GrammarAST sc=null; - GrammarAST name=null; - GrammarAST ACTION7=null; - - - enterAction(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:490:2: ( ^( AT (sc= ID )? name= ID ACTION ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:490:4: ^( AT (sc= ID )? name= ID ACTION ) - { - match(input,AT,FOLLOW_AT_in_action585); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:490:11: (sc= ID )? - int alt10=2; - int LA10_0 = input.LA(1); - if ( (LA10_0==ID) ) { - int LA10_1 = input.LA(2); - if ( (LA10_1==ID) ) { - alt10=1; - } - } - switch (alt10) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:490:11: sc= ID - { - sc=(GrammarAST)match(input,ID,FOLLOW_ID_in_action589); - } - break; - - } - - name=(GrammarAST)match(input,ID,FOLLOW_ID_in_action594); - ACTION7=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_action596); - match(input, Token.UP, null); - - globalNamedAction(sc, name, (ActionAST)ACTION7); - } - - - exitAction(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "action" - - - public static class rules_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "rules" - // org/antlr/v4/parse/GrammarTreeVisitor.g:493:1: rules : ^( RULES ( rule | lexerRule )* ) ; - public final GrammarTreeVisitor.rules_return rules() throws RecognitionException { - GrammarTreeVisitor.rules_return retval = new GrammarTreeVisitor.rules_return(); - retval.start = input.LT(1); - - GrammarAST RULES8=null; - - - enterRules(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:500:5: ( ^( RULES ( rule | lexerRule )* ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:500:7: ^( RULES ( rule | lexerRule )* ) - { - RULES8=(GrammarAST)match(input,RULES,FOLLOW_RULES_in_rules624); - discoverRules(RULES8); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:500:40: ( rule | lexerRule )* - loop11: - while (true) { - int alt11=3; - int LA11_0 = input.LA(1); - if ( (LA11_0==RULE) ) { - int LA11_2 = input.LA(2); - if ( (LA11_2==DOWN) ) { - int LA11_3 = input.LA(3); - if ( (LA11_3==RULE_REF) ) { - alt11=1; - } - else if ( (LA11_3==TOKEN_REF) ) { - alt11=2; - } - - } - - } - - switch (alt11) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:500:41: rule - { - pushFollow(FOLLOW_rule_in_rules629); - rule(); - state._fsp--; - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:500:46: lexerRule - { - pushFollow(FOLLOW_lexerRule_in_rules631); - lexerRule(); - state._fsp--; - - } - break; - - default : - break loop11; - } - } - - finishRules(RULES8); - match(input, Token.UP, null); - } - - } - - - exitRules(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "rules" - - - public static class mode_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "mode" - // org/antlr/v4/parse/GrammarTreeVisitor.g:503:1: mode : ^( MODE ID ( lexerRule )* ) ; - public final GrammarTreeVisitor.mode_return mode() throws RecognitionException { - GrammarTreeVisitor.mode_return retval = new GrammarTreeVisitor.mode_return(); - retval.start = input.LT(1); - - GrammarAST ID9=null; - GrammarAST MODE10=null; - - - enterMode(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:510:2: ( ^( MODE ID ( lexerRule )* ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:510:4: ^( MODE ID ( lexerRule )* ) - { - MODE10=(GrammarAST)match(input,MODE,FOLLOW_MODE_in_mode662); - match(input, Token.DOWN, null); - ID9=(GrammarAST)match(input,ID,FOLLOW_ID_in_mode664); - currentModeName=(ID9!=null?ID9.getText():null); modeDef(MODE10, ID9); - // org/antlr/v4/parse/GrammarTreeVisitor.g:510:64: ( lexerRule )* - loop12: - while (true) { - int alt12=2; - int LA12_0 = input.LA(1); - if ( (LA12_0==RULE) ) { - alt12=1; - } - - switch (alt12) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:510:64: lexerRule - { - pushFollow(FOLLOW_lexerRule_in_mode668); - lexerRule(); - state._fsp--; - - } - break; - - default : - break loop12; - } - } - - match(input, Token.UP, null); - - } - - - exitMode(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "mode" - - - public static class lexerRule_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerRule" - // org/antlr/v4/parse/GrammarTreeVisitor.g:513:1: lexerRule : ^( RULE TOKEN_REF ( ^( RULEMODIFIERS m= FRAGMENT ) )? (opts= optionsSpec )* lexerRuleBlock ) ; - public final GrammarTreeVisitor.lexerRule_return lexerRule() throws RecognitionException { - GrammarTreeVisitor.lexerRule_return retval = new GrammarTreeVisitor.lexerRule_return(); - retval.start = input.LT(1); - - GrammarAST m=null; - GrammarAST TOKEN_REF11=null; - GrammarAST RULE12=null; - TreeRuleReturnScope opts =null; - TreeRuleReturnScope lexerRuleBlock13 =null; - - - enterLexerRule(((GrammarAST)retval.start)); - List mods = new ArrayList(); - currentOuterAltNumber=0; - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:522:2: ( ^( RULE TOKEN_REF ( ^( RULEMODIFIERS m= FRAGMENT ) )? (opts= optionsSpec )* lexerRuleBlock ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:522:4: ^( RULE TOKEN_REF ( ^( RULEMODIFIERS m= FRAGMENT ) )? (opts= optionsSpec )* lexerRuleBlock ) - { - RULE12=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_lexerRule694); - match(input, Token.DOWN, null); - TOKEN_REF11=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_lexerRule696); - currentRuleName=(TOKEN_REF11!=null?TOKEN_REF11.getText():null); currentRuleAST=RULE12; - // org/antlr/v4/parse/GrammarTreeVisitor.g:524:4: ( ^( RULEMODIFIERS m= FRAGMENT ) )? - int alt13=2; - int LA13_0 = input.LA(1); - if ( (LA13_0==RULEMODIFIERS) ) { - alt13=1; - } - switch (alt13) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:524:5: ^( RULEMODIFIERS m= FRAGMENT ) - { - match(input,RULEMODIFIERS,FOLLOW_RULEMODIFIERS_in_lexerRule708); - match(input, Token.DOWN, null); - m=(GrammarAST)match(input,FRAGMENT,FOLLOW_FRAGMENT_in_lexerRule712); - mods.add(m); - match(input, Token.UP, null); - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:525:8: (opts= optionsSpec )* - loop14: - while (true) { - int alt14=2; - int LA14_0 = input.LA(1); - if ( (LA14_0==OPTIONS) ) { - alt14=1; - } - - switch (alt14) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:525:8: opts= optionsSpec - { - pushFollow(FOLLOW_optionsSpec_in_lexerRule724); - opts=optionsSpec(); - state._fsp--; - - } - break; - - default : - break loop14; - } - } - - discoverLexerRule((RuleAST)RULE12, TOKEN_REF11, mods, (opts!=null?((GrammarAST)opts.start):null), (GrammarAST)input.LT(1)); - pushFollow(FOLLOW_lexerRuleBlock_in_lexerRule745); - lexerRuleBlock13=lexerRuleBlock(); - state._fsp--; - - - finishLexerRule((RuleAST)RULE12, TOKEN_REF11, (lexerRuleBlock13!=null?((GrammarAST)lexerRuleBlock13.start):null)); - currentRuleName=null; currentRuleAST=null; - - match(input, Token.UP, null); - - } - - - exitLexerRule(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerRule" - - - public static class rule_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "rule" - // org/antlr/v4/parse/GrammarTreeVisitor.g:535:1: rule : ^( RULE RULE_REF ( ^( RULEMODIFIERS (m= ruleModifier )+ ) )? ( ARG_ACTION )? (ret= ruleReturns )? (thr= throwsSpec )? (loc= locals )? (opts= optionsSpec |a= ruleAction )* ruleBlock exceptionGroup ) ; - public final GrammarTreeVisitor.rule_return rule() throws RecognitionException { - GrammarTreeVisitor.rule_return retval = new GrammarTreeVisitor.rule_return(); - retval.start = input.LT(1); - - GrammarAST RULE_REF14=null; - GrammarAST RULE15=null; - GrammarAST ARG_ACTION16=null; - TreeRuleReturnScope m =null; - TreeRuleReturnScope ret =null; - TreeRuleReturnScope thr =null; - TreeRuleReturnScope loc =null; - TreeRuleReturnScope opts =null; - TreeRuleReturnScope a =null; - TreeRuleReturnScope ruleBlock17 =null; - - - enterRule(((GrammarAST)retval.start)); - List mods = new ArrayList(); - List actions = new ArrayList(); // track roots - currentOuterAltNumber=0; - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:545:2: ( ^( RULE RULE_REF ( ^( RULEMODIFIERS (m= ruleModifier )+ ) )? ( ARG_ACTION )? (ret= ruleReturns )? (thr= throwsSpec )? (loc= locals )? (opts= optionsSpec |a= ruleAction )* ruleBlock exceptionGroup ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:545:6: ^( RULE RULE_REF ( ^( RULEMODIFIERS (m= ruleModifier )+ ) )? ( ARG_ACTION )? (ret= ruleReturns )? (thr= throwsSpec )? (loc= locals )? (opts= optionsSpec |a= ruleAction )* ruleBlock exceptionGroup ) - { - RULE15=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_rule790); - match(input, Token.DOWN, null); - RULE_REF14=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_rule792); - currentRuleName=(RULE_REF14!=null?RULE_REF14.getText():null); currentRuleAST=RULE15; - // org/antlr/v4/parse/GrammarTreeVisitor.g:546:4: ( ^( RULEMODIFIERS (m= ruleModifier )+ ) )? - int alt16=2; - int LA16_0 = input.LA(1); - if ( (LA16_0==RULEMODIFIERS) ) { - alt16=1; - } - switch (alt16) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:546:5: ^( RULEMODIFIERS (m= ruleModifier )+ ) - { - match(input,RULEMODIFIERS,FOLLOW_RULEMODIFIERS_in_rule801); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:546:21: (m= ruleModifier )+ - int cnt15=0; - loop15: - while (true) { - int alt15=2; - int LA15_0 = input.LA(1); - if ( (LA15_0==FRAGMENT||(LA15_0 >= PRIVATE && LA15_0 <= PUBLIC)) ) { - alt15=1; - } - - switch (alt15) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:546:22: m= ruleModifier - { - pushFollow(FOLLOW_ruleModifier_in_rule806); - m=ruleModifier(); - state._fsp--; - - mods.add((m!=null?((GrammarAST)m.start):null)); - } - break; - - default : - if ( cnt15 >= 1 ) break loop15; - EarlyExitException eee = new EarlyExitException(15, input); - throw eee; - } - cnt15++; - } - - match(input, Token.UP, null); - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:547:4: ( ARG_ACTION )? - int alt17=2; - int LA17_0 = input.LA(1); - if ( (LA17_0==ARG_ACTION) ) { - alt17=1; - } - switch (alt17) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:547:4: ARG_ACTION - { - ARG_ACTION16=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rule817); - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:548:12: (ret= ruleReturns )? - int alt18=2; - int LA18_0 = input.LA(1); - if ( (LA18_0==RETURNS) ) { - alt18=1; - } - switch (alt18) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:548:12: ret= ruleReturns - { - pushFollow(FOLLOW_ruleReturns_in_rule830); - ret=ruleReturns(); - state._fsp--; - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:549:12: (thr= throwsSpec )? - int alt19=2; - int LA19_0 = input.LA(1); - if ( (LA19_0==THROWS) ) { - alt19=1; - } - switch (alt19) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:549:12: thr= throwsSpec - { - pushFollow(FOLLOW_throwsSpec_in_rule843); - thr=throwsSpec(); - state._fsp--; - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:550:12: (loc= locals )? - int alt20=2; - int LA20_0 = input.LA(1); - if ( (LA20_0==LOCALS) ) { - alt20=1; - } - switch (alt20) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:550:12: loc= locals - { - pushFollow(FOLLOW_locals_in_rule856); - loc=locals(); - state._fsp--; - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:551:9: (opts= optionsSpec |a= ruleAction )* - loop21: - while (true) { - int alt21=3; - int LA21_0 = input.LA(1); - if ( (LA21_0==OPTIONS) ) { - alt21=1; - } - else if ( (LA21_0==AT) ) { - alt21=2; - } - - switch (alt21) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:551:11: opts= optionsSpec - { - pushFollow(FOLLOW_optionsSpec_in_rule871); - opts=optionsSpec(); - state._fsp--; - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:552:11: a= ruleAction - { - pushFollow(FOLLOW_ruleAction_in_rule885); - a=ruleAction(); - state._fsp--; - - actions.add((a!=null?((GrammarAST)a.start):null)); - } - break; - - default : - break loop21; - } - } - - discoverRule((RuleAST)RULE15, RULE_REF14, mods, (ActionAST)ARG_ACTION16, - (ret!=null?((GrammarAST)ret.start):null)!=null?(ActionAST)(ret!=null?((GrammarAST)ret.start):null).getChild(0):null, - (thr!=null?((GrammarAST)thr.start):null), (opts!=null?((GrammarAST)opts.start):null), - (loc!=null?((GrammarAST)loc.start):null)!=null?(ActionAST)(loc!=null?((GrammarAST)loc.start):null).getChild(0):null, - actions, (GrammarAST)input.LT(1)); - pushFollow(FOLLOW_ruleBlock_in_rule916); - ruleBlock17=ruleBlock(); - state._fsp--; - - pushFollow(FOLLOW_exceptionGroup_in_rule918); - exceptionGroup(); - state._fsp--; - - finishRule((RuleAST)RULE15, RULE_REF14, (ruleBlock17!=null?((GrammarAST)ruleBlock17.start):null)); currentRuleName=null; currentRuleAST=null; - match(input, Token.UP, null); - - } - - - exitRule(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "rule" - - - public static class exceptionGroup_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "exceptionGroup" - // org/antlr/v4/parse/GrammarTreeVisitor.g:564:1: exceptionGroup : ( exceptionHandler )* ( finallyClause )? ; - public final GrammarTreeVisitor.exceptionGroup_return exceptionGroup() throws RecognitionException { - GrammarTreeVisitor.exceptionGroup_return retval = new GrammarTreeVisitor.exceptionGroup_return(); - retval.start = input.LT(1); - - - enterExceptionGroup(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:571:5: ( ( exceptionHandler )* ( finallyClause )? ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:571:7: ( exceptionHandler )* ( finallyClause )? - { - // org/antlr/v4/parse/GrammarTreeVisitor.g:571:7: ( exceptionHandler )* - loop22: - while (true) { - int alt22=2; - int LA22_0 = input.LA(1); - if ( (LA22_0==CATCH) ) { - alt22=1; - } - - switch (alt22) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:571:7: exceptionHandler - { - pushFollow(FOLLOW_exceptionHandler_in_exceptionGroup965); - exceptionHandler(); - state._fsp--; - - } - break; - - default : - break loop22; - } - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:571:25: ( finallyClause )? - int alt23=2; - int LA23_0 = input.LA(1); - if ( (LA23_0==FINALLY) ) { - alt23=1; - } - switch (alt23) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:571:25: finallyClause - { - pushFollow(FOLLOW_finallyClause_in_exceptionGroup968); - finallyClause(); - state._fsp--; - - } - break; - - } - - } - - - exitExceptionGroup(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "exceptionGroup" - - - public static class exceptionHandler_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "exceptionHandler" - // org/antlr/v4/parse/GrammarTreeVisitor.g:574:1: exceptionHandler : ^( CATCH ARG_ACTION ACTION ) ; - public final GrammarTreeVisitor.exceptionHandler_return exceptionHandler() throws RecognitionException { - GrammarTreeVisitor.exceptionHandler_return retval = new GrammarTreeVisitor.exceptionHandler_return(); - retval.start = input.LT(1); - - GrammarAST ARG_ACTION18=null; - GrammarAST ACTION19=null; - - - enterExceptionHandler(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:581:2: ( ^( CATCH ARG_ACTION ACTION ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:581:4: ^( CATCH ARG_ACTION ACTION ) - { - match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler994); - match(input, Token.DOWN, null); - ARG_ACTION18=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_exceptionHandler996); - ACTION19=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_exceptionHandler998); - match(input, Token.UP, null); - - ruleCatch(ARG_ACTION18, (ActionAST)ACTION19); - } - - - exitExceptionHandler(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "exceptionHandler" - - - public static class finallyClause_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "finallyClause" - // org/antlr/v4/parse/GrammarTreeVisitor.g:584:1: finallyClause : ^( FINALLY ACTION ) ; - public final GrammarTreeVisitor.finallyClause_return finallyClause() throws RecognitionException { - GrammarTreeVisitor.finallyClause_return retval = new GrammarTreeVisitor.finallyClause_return(); - retval.start = input.LT(1); - - GrammarAST ACTION20=null; - - - enterFinallyClause(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:591:2: ( ^( FINALLY ACTION ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:591:4: ^( FINALLY ACTION ) - { - match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause1023); - match(input, Token.DOWN, null); - ACTION20=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_finallyClause1025); - match(input, Token.UP, null); - - finallyAction((ActionAST)ACTION20); - } - - - exitFinallyClause(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "finallyClause" - - - public static class locals_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "locals" - // org/antlr/v4/parse/GrammarTreeVisitor.g:594:1: locals : ^( LOCALS ARG_ACTION ) ; - public final GrammarTreeVisitor.locals_return locals() throws RecognitionException { - GrammarTreeVisitor.locals_return retval = new GrammarTreeVisitor.locals_return(); - retval.start = input.LT(1); - - - enterLocals(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:601:2: ( ^( LOCALS ARG_ACTION ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:601:4: ^( LOCALS ARG_ACTION ) - { - match(input,LOCALS,FOLLOW_LOCALS_in_locals1053); - match(input, Token.DOWN, null); - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_locals1055); - match(input, Token.UP, null); - - } - - - exitLocals(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "locals" - - - public static class ruleReturns_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "ruleReturns" - // org/antlr/v4/parse/GrammarTreeVisitor.g:604:1: ruleReturns : ^( RETURNS ARG_ACTION ) ; - public final GrammarTreeVisitor.ruleReturns_return ruleReturns() throws RecognitionException { - GrammarTreeVisitor.ruleReturns_return retval = new GrammarTreeVisitor.ruleReturns_return(); - retval.start = input.LT(1); - - - enterRuleReturns(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:611:2: ( ^( RETURNS ARG_ACTION ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:611:4: ^( RETURNS ARG_ACTION ) - { - match(input,RETURNS,FOLLOW_RETURNS_in_ruleReturns1078); - match(input, Token.DOWN, null); - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleReturns1080); - match(input, Token.UP, null); - - } - - - exitRuleReturns(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ruleReturns" - - - public static class throwsSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "throwsSpec" - // org/antlr/v4/parse/GrammarTreeVisitor.g:614:1: throwsSpec : ^( THROWS ( ID )+ ) ; - public final GrammarTreeVisitor.throwsSpec_return throwsSpec() throws RecognitionException { - GrammarTreeVisitor.throwsSpec_return retval = new GrammarTreeVisitor.throwsSpec_return(); - retval.start = input.LT(1); - - - enterThrowsSpec(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:621:5: ( ^( THROWS ( ID )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:621:7: ^( THROWS ( ID )+ ) - { - match(input,THROWS,FOLLOW_THROWS_in_throwsSpec1106); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:621:16: ( ID )+ - int cnt24=0; - loop24: - while (true) { - int alt24=2; - int LA24_0 = input.LA(1); - if ( (LA24_0==ID) ) { - alt24=1; - } - - switch (alt24) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:621:16: ID - { - match(input,ID,FOLLOW_ID_in_throwsSpec1108); - } - break; - - default : - if ( cnt24 >= 1 ) break loop24; - EarlyExitException eee = new EarlyExitException(24, input); - throw eee; - } - cnt24++; - } - - match(input, Token.UP, null); - - } - - - exitThrowsSpec(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "throwsSpec" - - - public static class ruleAction_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "ruleAction" - // org/antlr/v4/parse/GrammarTreeVisitor.g:624:1: ruleAction : ^( AT ID ACTION ) ; - public final GrammarTreeVisitor.ruleAction_return ruleAction() throws RecognitionException { - GrammarTreeVisitor.ruleAction_return retval = new GrammarTreeVisitor.ruleAction_return(); - retval.start = input.LT(1); - - - enterRuleAction(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:631:2: ( ^( AT ID ACTION ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:631:4: ^( AT ID ACTION ) - { - match(input,AT,FOLLOW_AT_in_ruleAction1135); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_ruleAction1137); - match(input,ACTION,FOLLOW_ACTION_in_ruleAction1139); - match(input, Token.UP, null); - - } - - - exitRuleAction(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ruleAction" - - - public static class ruleModifier_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "ruleModifier" - // org/antlr/v4/parse/GrammarTreeVisitor.g:634:1: ruleModifier : ( PUBLIC | PRIVATE | PROTECTED | FRAGMENT ); - public final GrammarTreeVisitor.ruleModifier_return ruleModifier() throws RecognitionException { - GrammarTreeVisitor.ruleModifier_return retval = new GrammarTreeVisitor.ruleModifier_return(); - retval.start = input.LT(1); - - - enterRuleModifier(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:641:5: ( PUBLIC | PRIVATE | PROTECTED | FRAGMENT ) - // org/antlr/v4/parse/GrammarTreeVisitor.g: - { - if ( input.LA(1)==FRAGMENT||(input.LA(1) >= PRIVATE && input.LA(1) <= PUBLIC) ) { - input.consume(); - state.errorRecovery=false; - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - } - - - exitRuleModifier(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ruleModifier" - - - public static class lexerRuleBlock_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerRuleBlock" - // org/antlr/v4/parse/GrammarTreeVisitor.g:647:1: lexerRuleBlock : ^( BLOCK ( lexerOuterAlternative )+ ) ; - public final GrammarTreeVisitor.lexerRuleBlock_return lexerRuleBlock() throws RecognitionException { - GrammarTreeVisitor.lexerRuleBlock_return retval = new GrammarTreeVisitor.lexerRuleBlock_return(); - retval.start = input.LT(1); - - - enterLexerRuleBlock(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:654:5: ( ^( BLOCK ( lexerOuterAlternative )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:654:7: ^( BLOCK ( lexerOuterAlternative )+ ) - { - match(input,BLOCK,FOLLOW_BLOCK_in_lexerRuleBlock1217); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:655:7: ( lexerOuterAlternative )+ - int cnt25=0; - loop25: - while (true) { - int alt25=2; - int LA25_0 = input.LA(1); - if ( (LA25_0==ALT||LA25_0==LEXER_ALT_ACTION) ) { - alt25=1; - } - - switch (alt25) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:655:9: lexerOuterAlternative - { - - currentOuterAltRoot = (GrammarAST)input.LT(1); - currentOuterAltNumber++; - - pushFollow(FOLLOW_lexerOuterAlternative_in_lexerRuleBlock1236); - lexerOuterAlternative(); - state._fsp--; - - } - break; - - default : - if ( cnt25 >= 1 ) break loop25; - EarlyExitException eee = new EarlyExitException(25, input); - throw eee; - } - cnt25++; - } - - match(input, Token.UP, null); - - } - - - exitLexerRuleBlock(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerRuleBlock" - - - public static class ruleBlock_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "ruleBlock" - // org/antlr/v4/parse/GrammarTreeVisitor.g:664:1: ruleBlock : ^( BLOCK ( outerAlternative )+ ) ; - public final GrammarTreeVisitor.ruleBlock_return ruleBlock() throws RecognitionException { - GrammarTreeVisitor.ruleBlock_return retval = new GrammarTreeVisitor.ruleBlock_return(); - retval.start = input.LT(1); - - - enterRuleBlock(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:671:5: ( ^( BLOCK ( outerAlternative )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:671:7: ^( BLOCK ( outerAlternative )+ ) - { - match(input,BLOCK,FOLLOW_BLOCK_in_ruleBlock1281); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:672:7: ( outerAlternative )+ - int cnt26=0; - loop26: - while (true) { - int alt26=2; - int LA26_0 = input.LA(1); - if ( (LA26_0==ALT) ) { - alt26=1; - } - - switch (alt26) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:672:9: outerAlternative - { - - currentOuterAltRoot = (GrammarAST)input.LT(1); - currentOuterAltNumber++; - - pushFollow(FOLLOW_outerAlternative_in_ruleBlock1300); - outerAlternative(); - state._fsp--; - - } - break; - - default : - if ( cnt26 >= 1 ) break loop26; - EarlyExitException eee = new EarlyExitException(26, input); - throw eee; - } - cnt26++; - } - - match(input, Token.UP, null); - - } - - - exitRuleBlock(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ruleBlock" - - - public static class lexerOuterAlternative_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerOuterAlternative" - // org/antlr/v4/parse/GrammarTreeVisitor.g:681:1: lexerOuterAlternative : lexerAlternative ; - public final GrammarTreeVisitor.lexerOuterAlternative_return lexerOuterAlternative() throws RecognitionException { - GrammarTreeVisitor.lexerOuterAlternative_return retval = new GrammarTreeVisitor.lexerOuterAlternative_return(); - retval.start = input.LT(1); - - - enterLexerOuterAlternative((AltAST)((GrammarAST)retval.start)); - discoverOuterAlt((AltAST)((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:690:2: ( lexerAlternative ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:690:4: lexerAlternative - { - pushFollow(FOLLOW_lexerAlternative_in_lexerOuterAlternative1340); - lexerAlternative(); - state._fsp--; - - } - - - finishOuterAlt((AltAST)((GrammarAST)retval.start)); - exitLexerOuterAlternative((AltAST)((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerOuterAlternative" - - - public static class outerAlternative_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "outerAlternative" - // org/antlr/v4/parse/GrammarTreeVisitor.g:694:1: outerAlternative : alternative ; - public final GrammarTreeVisitor.outerAlternative_return outerAlternative() throws RecognitionException { - GrammarTreeVisitor.outerAlternative_return retval = new GrammarTreeVisitor.outerAlternative_return(); - retval.start = input.LT(1); - - - enterOuterAlternative((AltAST)((GrammarAST)retval.start)); - discoverOuterAlt((AltAST)((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:703:2: ( alternative ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:703:4: alternative - { - pushFollow(FOLLOW_alternative_in_outerAlternative1362); - alternative(); - state._fsp--; - - } - - - finishOuterAlt((AltAST)((GrammarAST)retval.start)); - exitOuterAlternative((AltAST)((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "outerAlternative" - - - public static class lexerAlternative_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerAlternative" - // org/antlr/v4/parse/GrammarTreeVisitor.g:706:1: lexerAlternative : ( ^( LEXER_ALT_ACTION lexerElements ( lexerCommand )+ ) | lexerElements ); - public final GrammarTreeVisitor.lexerAlternative_return lexerAlternative() throws RecognitionException { - GrammarTreeVisitor.lexerAlternative_return retval = new GrammarTreeVisitor.lexerAlternative_return(); - retval.start = input.LT(1); - - - enterLexerAlternative(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:713:2: ( ^( LEXER_ALT_ACTION lexerElements ( lexerCommand )+ ) | lexerElements ) - int alt28=2; - int LA28_0 = input.LA(1); - if ( (LA28_0==LEXER_ALT_ACTION) ) { - alt28=1; - } - else if ( (LA28_0==ALT) ) { - alt28=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 28, 0, input); - throw nvae; - } - - switch (alt28) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:713:4: ^( LEXER_ALT_ACTION lexerElements ( lexerCommand )+ ) - { - match(input,LEXER_ALT_ACTION,FOLLOW_LEXER_ALT_ACTION_in_lexerAlternative1384); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_lexerElements_in_lexerAlternative1386); - lexerElements(); - state._fsp--; - - // org/antlr/v4/parse/GrammarTreeVisitor.g:713:37: ( lexerCommand )+ - int cnt27=0; - loop27: - while (true) { - int alt27=2; - int LA27_0 = input.LA(1); - if ( (LA27_0==ID||LA27_0==LEXER_ACTION_CALL) ) { - alt27=1; - } - - switch (alt27) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:713:37: lexerCommand - { - pushFollow(FOLLOW_lexerCommand_in_lexerAlternative1388); - lexerCommand(); - state._fsp--; - - } - break; - - default : - if ( cnt27 >= 1 ) break loop27; - EarlyExitException eee = new EarlyExitException(27, input); - throw eee; - } - cnt27++; - } - - match(input, Token.UP, null); - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:714:9: lexerElements - { - pushFollow(FOLLOW_lexerElements_in_lexerAlternative1400); - lexerElements(); - state._fsp--; - - } - break; - - } - - exitLexerAlternative(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerAlternative" - - - public static class lexerElements_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerElements" - // org/antlr/v4/parse/GrammarTreeVisitor.g:717:1: lexerElements : ^( ALT ( lexerElement )+ ) ; - public final GrammarTreeVisitor.lexerElements_return lexerElements() throws RecognitionException { - GrammarTreeVisitor.lexerElements_return retval = new GrammarTreeVisitor.lexerElements_return(); - retval.start = input.LT(1); - - - enterLexerElements(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:724:5: ( ^( ALT ( lexerElement )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:724:7: ^( ALT ( lexerElement )+ ) - { - match(input,ALT,FOLLOW_ALT_in_lexerElements1428); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:724:13: ( lexerElement )+ - int cnt29=0; - loop29: - while (true) { - int alt29=2; - int LA29_0 = input.LA(1); - if ( (LA29_0==ACTION||LA29_0==LEXER_CHAR_SET||LA29_0==NOT||LA29_0==RANGE||LA29_0==RULE_REF||LA29_0==SEMPRED||LA29_0==STRING_LITERAL||LA29_0==TOKEN_REF||(LA29_0 >= BLOCK && LA29_0 <= CLOSURE)||LA29_0==EPSILON||(LA29_0 >= OPTIONAL && LA29_0 <= POSITIVE_CLOSURE)||(LA29_0 >= SET && LA29_0 <= WILDCARD)) ) { - alt29=1; - } - - switch (alt29) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:724:13: lexerElement - { - pushFollow(FOLLOW_lexerElement_in_lexerElements1430); - lexerElement(); - state._fsp--; - - } - break; - - default : - if ( cnt29 >= 1 ) break loop29; - EarlyExitException eee = new EarlyExitException(29, input); - throw eee; - } - cnt29++; - } - - match(input, Token.UP, null); - - } - - - exitLexerElements(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerElements" - - - public static class lexerElement_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerElement" - // org/antlr/v4/parse/GrammarTreeVisitor.g:727:1: lexerElement : ( lexerAtom | lexerSubrule | ACTION | SEMPRED | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) | EPSILON ); - public final GrammarTreeVisitor.lexerElement_return lexerElement() throws RecognitionException { - GrammarTreeVisitor.lexerElement_return retval = new GrammarTreeVisitor.lexerElement_return(); - retval.start = input.LT(1); - - GrammarAST ACTION21=null; - GrammarAST SEMPRED22=null; - GrammarAST ACTION23=null; - GrammarAST SEMPRED24=null; - - - enterLexerElement(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:734:2: ( lexerAtom | lexerSubrule | ACTION | SEMPRED | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) | EPSILON ) - int alt30=7; - switch ( input.LA(1) ) { - case LEXER_CHAR_SET: - case NOT: - case RANGE: - case RULE_REF: - case STRING_LITERAL: - case TOKEN_REF: - case SET: - case WILDCARD: - { - alt30=1; - } - break; - case BLOCK: - case CLOSURE: - case OPTIONAL: - case POSITIVE_CLOSURE: - { - alt30=2; - } - break; - case ACTION: - { - int LA30_3 = input.LA(2); - if ( (LA30_3==DOWN) ) { - alt30=5; - } - else if ( ((LA30_3 >= UP && LA30_3 <= ACTION)||LA30_3==LEXER_CHAR_SET||LA30_3==NOT||LA30_3==RANGE||LA30_3==RULE_REF||LA30_3==SEMPRED||LA30_3==STRING_LITERAL||LA30_3==TOKEN_REF||(LA30_3 >= BLOCK && LA30_3 <= CLOSURE)||LA30_3==EPSILON||(LA30_3 >= OPTIONAL && LA30_3 <= POSITIVE_CLOSURE)||(LA30_3 >= SET && LA30_3 <= WILDCARD)) ) { - alt30=3; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 30, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case SEMPRED: - { - int LA30_4 = input.LA(2); - if ( (LA30_4==DOWN) ) { - alt30=6; - } - else if ( ((LA30_4 >= UP && LA30_4 <= ACTION)||LA30_4==LEXER_CHAR_SET||LA30_4==NOT||LA30_4==RANGE||LA30_4==RULE_REF||LA30_4==SEMPRED||LA30_4==STRING_LITERAL||LA30_4==TOKEN_REF||(LA30_4 >= BLOCK && LA30_4 <= CLOSURE)||LA30_4==EPSILON||(LA30_4 >= OPTIONAL && LA30_4 <= POSITIVE_CLOSURE)||(LA30_4 >= SET && LA30_4 <= WILDCARD)) ) { - alt30=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 30, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case EPSILON: - { - alt30=7; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 30, 0, input); - throw nvae; - } - switch (alt30) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:734:4: lexerAtom - { - pushFollow(FOLLOW_lexerAtom_in_lexerElement1456); - lexerAtom(); - state._fsp--; - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:735:4: lexerSubrule - { - pushFollow(FOLLOW_lexerSubrule_in_lexerElement1461); - lexerSubrule(); - state._fsp--; - - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:736:6: ACTION - { - ACTION21=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_lexerElement1468); - actionInAlt((ActionAST)ACTION21); - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:737:6: SEMPRED - { - SEMPRED22=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_lexerElement1482); - sempredInAlt((PredAST)SEMPRED22); - } - break; - case 5 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:738:6: ^( ACTION elementOptions ) - { - ACTION23=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_lexerElement1497); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_lexerElement1499); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - actionInAlt((ActionAST)ACTION23); - } - break; - case 6 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:739:6: ^( SEMPRED elementOptions ) - { - SEMPRED24=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_lexerElement1510); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_lexerElement1512); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - sempredInAlt((PredAST)SEMPRED24); - } - break; - case 7 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:740:4: EPSILON - { - match(input,EPSILON,FOLLOW_EPSILON_in_lexerElement1520); - } - break; - - } - - exitLexerElement(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerElement" - - - public static class lexerBlock_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerBlock" - // org/antlr/v4/parse/GrammarTreeVisitor.g:743:1: lexerBlock : ^( BLOCK ( optionsSpec )? ( lexerAlternative )+ ) ; - public final GrammarTreeVisitor.lexerBlock_return lexerBlock() throws RecognitionException { - GrammarTreeVisitor.lexerBlock_return retval = new GrammarTreeVisitor.lexerBlock_return(); - retval.start = input.LT(1); - - - enterLexerBlock(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:750:3: ( ^( BLOCK ( optionsSpec )? ( lexerAlternative )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:750:5: ^( BLOCK ( optionsSpec )? ( lexerAlternative )+ ) - { - match(input,BLOCK,FOLLOW_BLOCK_in_lexerBlock1543); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:750:13: ( optionsSpec )? - int alt31=2; - int LA31_0 = input.LA(1); - if ( (LA31_0==OPTIONS) ) { - alt31=1; - } - switch (alt31) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:750:13: optionsSpec - { - pushFollow(FOLLOW_optionsSpec_in_lexerBlock1545); - optionsSpec(); - state._fsp--; - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:750:26: ( lexerAlternative )+ - int cnt32=0; - loop32: - while (true) { - int alt32=2; - int LA32_0 = input.LA(1); - if ( (LA32_0==ALT||LA32_0==LEXER_ALT_ACTION) ) { - alt32=1; - } - - switch (alt32) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:750:26: lexerAlternative - { - pushFollow(FOLLOW_lexerAlternative_in_lexerBlock1548); - lexerAlternative(); - state._fsp--; - - } - break; - - default : - if ( cnt32 >= 1 ) break loop32; - EarlyExitException eee = new EarlyExitException(32, input); - throw eee; - } - cnt32++; - } - - match(input, Token.UP, null); - - } - - - exitLexerBlock(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerBlock" - - - public static class lexerAtom_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerAtom" - // org/antlr/v4/parse/GrammarTreeVisitor.g:753:1: lexerAtom : ( terminal | ^( NOT blockSet ) | blockSet | ^( WILDCARD elementOptions ) | WILDCARD | LEXER_CHAR_SET | range | ruleref ); - public final GrammarTreeVisitor.lexerAtom_return lexerAtom() throws RecognitionException { - GrammarTreeVisitor.lexerAtom_return retval = new GrammarTreeVisitor.lexerAtom_return(); - retval.start = input.LT(1); - - - enterLexerAtom(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:760:5: ( terminal | ^( NOT blockSet ) | blockSet | ^( WILDCARD elementOptions ) | WILDCARD | LEXER_CHAR_SET | range | ruleref ) - int alt33=8; - switch ( input.LA(1) ) { - case STRING_LITERAL: - case TOKEN_REF: - { - alt33=1; - } - break; - case NOT: - { - alt33=2; - } - break; - case SET: - { - alt33=3; - } - break; - case WILDCARD: - { - int LA33_4 = input.LA(2); - if ( (LA33_4==DOWN) ) { - alt33=4; - } - else if ( ((LA33_4 >= UP && LA33_4 <= ACTION)||LA33_4==LEXER_CHAR_SET||LA33_4==NOT||LA33_4==RANGE||LA33_4==RULE_REF||LA33_4==SEMPRED||LA33_4==STRING_LITERAL||LA33_4==TOKEN_REF||(LA33_4 >= BLOCK && LA33_4 <= CLOSURE)||LA33_4==EPSILON||(LA33_4 >= OPTIONAL && LA33_4 <= POSITIVE_CLOSURE)||(LA33_4 >= SET && LA33_4 <= WILDCARD)) ) { - alt33=5; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 33, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case LEXER_CHAR_SET: - { - alt33=6; - } - break; - case RANGE: - { - alt33=7; - } - break; - case RULE_REF: - { - alt33=8; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 33, 0, input); - throw nvae; - } - switch (alt33) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:760:9: terminal - { - pushFollow(FOLLOW_terminal_in_lexerAtom1579); - terminal(); - state._fsp--; - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:761:9: ^( NOT blockSet ) - { - match(input,NOT,FOLLOW_NOT_in_lexerAtom1590); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_blockSet_in_lexerAtom1592); - blockSet(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:762:9: blockSet - { - pushFollow(FOLLOW_blockSet_in_lexerAtom1603); - blockSet(); - state._fsp--; - - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:763:9: ^( WILDCARD elementOptions ) - { - match(input,WILDCARD,FOLLOW_WILDCARD_in_lexerAtom1614); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_lexerAtom1616); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 5 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:764:9: WILDCARD - { - match(input,WILDCARD,FOLLOW_WILDCARD_in_lexerAtom1627); - } - break; - case 6 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:765:7: LEXER_CHAR_SET - { - match(input,LEXER_CHAR_SET,FOLLOW_LEXER_CHAR_SET_in_lexerAtom1635); - } - break; - case 7 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:766:9: range - { - pushFollow(FOLLOW_range_in_lexerAtom1645); - range(); - state._fsp--; - - } - break; - case 8 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:767:9: ruleref - { - pushFollow(FOLLOW_ruleref_in_lexerAtom1655); - ruleref(); - state._fsp--; - - } - break; - - } - - exitLexerAtom(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerAtom" - - - public static class actionElement_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "actionElement" - // org/antlr/v4/parse/GrammarTreeVisitor.g:770:1: actionElement : ( ACTION | ^( ACTION elementOptions ) | SEMPRED | ^( SEMPRED elementOptions ) ); - public final GrammarTreeVisitor.actionElement_return actionElement() throws RecognitionException { - GrammarTreeVisitor.actionElement_return retval = new GrammarTreeVisitor.actionElement_return(); - retval.start = input.LT(1); - - - enterActionElement(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:777:2: ( ACTION | ^( ACTION elementOptions ) | SEMPRED | ^( SEMPRED elementOptions ) ) - int alt34=4; - int LA34_0 = input.LA(1); - if ( (LA34_0==ACTION) ) { - int LA34_1 = input.LA(2); - if ( (LA34_1==DOWN) ) { - alt34=2; - } - else if ( (LA34_1==EOF) ) { - alt34=1; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 34, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA34_0==SEMPRED) ) { - int LA34_2 = input.LA(2); - if ( (LA34_2==DOWN) ) { - alt34=4; - } - else if ( (LA34_2==EOF) ) { - alt34=3; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 34, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 34, 0, input); - throw nvae; - } - - switch (alt34) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:777:4: ACTION - { - match(input,ACTION,FOLLOW_ACTION_in_actionElement1679); - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:778:6: ^( ACTION elementOptions ) - { - match(input,ACTION,FOLLOW_ACTION_in_actionElement1687); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_actionElement1689); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:779:6: SEMPRED - { - match(input,SEMPRED,FOLLOW_SEMPRED_in_actionElement1697); - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:780:6: ^( SEMPRED elementOptions ) - { - match(input,SEMPRED,FOLLOW_SEMPRED_in_actionElement1705); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_actionElement1707); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - - } - - exitActionElement(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "actionElement" - - - public static class alternative_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "alternative" - // org/antlr/v4/parse/GrammarTreeVisitor.g:783:1: alternative : ( ^( ALT ( elementOptions )? ( element )+ ) | ^( ALT ( elementOptions )? EPSILON ) ); - public final GrammarTreeVisitor.alternative_return alternative() throws RecognitionException { - GrammarTreeVisitor.alternative_return retval = new GrammarTreeVisitor.alternative_return(); - retval.start = input.LT(1); - - - enterAlternative((AltAST)((GrammarAST)retval.start)); - discoverAlt((AltAST)((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:792:2: ( ^( ALT ( elementOptions )? ( element )+ ) | ^( ALT ( elementOptions )? EPSILON ) ) - int alt38=2; - alt38 = dfa38.predict(input); - switch (alt38) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:792:4: ^( ALT ( elementOptions )? ( element )+ ) - { - match(input,ALT,FOLLOW_ALT_in_alternative1730); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:792:10: ( elementOptions )? - int alt35=2; - int LA35_0 = input.LA(1); - if ( (LA35_0==ELEMENT_OPTIONS) ) { - alt35=1; - } - switch (alt35) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:792:10: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_alternative1732); - elementOptions(); - state._fsp--; - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:792:26: ( element )+ - int cnt36=0; - loop36: - while (true) { - int alt36=2; - int LA36_0 = input.LA(1); - if ( (LA36_0==ACTION||LA36_0==ASSIGN||LA36_0==DOT||LA36_0==NOT||LA36_0==PLUS_ASSIGN||LA36_0==RANGE||LA36_0==RULE_REF||LA36_0==SEMPRED||LA36_0==STRING_LITERAL||LA36_0==TOKEN_REF||(LA36_0 >= BLOCK && LA36_0 <= CLOSURE)||(LA36_0 >= OPTIONAL && LA36_0 <= POSITIVE_CLOSURE)||(LA36_0 >= SET && LA36_0 <= WILDCARD)) ) { - alt36=1; - } - - switch (alt36) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:792:26: element - { - pushFollow(FOLLOW_element_in_alternative1735); - element(); - state._fsp--; - - } - break; - - default : - if ( cnt36 >= 1 ) break loop36; - EarlyExitException eee = new EarlyExitException(36, input); - throw eee; - } - cnt36++; - } - - match(input, Token.UP, null); - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:793:4: ^( ALT ( elementOptions )? EPSILON ) - { - match(input,ALT,FOLLOW_ALT_in_alternative1743); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:793:10: ( elementOptions )? - int alt37=2; - int LA37_0 = input.LA(1); - if ( (LA37_0==ELEMENT_OPTIONS) ) { - alt37=1; - } - switch (alt37) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:793:10: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_alternative1745); - elementOptions(); - state._fsp--; - - } - break; - - } - - match(input,EPSILON,FOLLOW_EPSILON_in_alternative1748); - match(input, Token.UP, null); - - } - break; - - } - - finishAlt((AltAST)((GrammarAST)retval.start)); - exitAlternative((AltAST)((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "alternative" - - - public static class lexerCommand_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerCommand" - // org/antlr/v4/parse/GrammarTreeVisitor.g:796:1: lexerCommand : ( ^( LEXER_ACTION_CALL ID lexerCommandExpr ) | ID ); - public final GrammarTreeVisitor.lexerCommand_return lexerCommand() throws RecognitionException { - GrammarTreeVisitor.lexerCommand_return retval = new GrammarTreeVisitor.lexerCommand_return(); - retval.start = input.LT(1); - - GrammarAST ID25=null; - GrammarAST ID27=null; - TreeRuleReturnScope lexerCommandExpr26 =null; - - - enterLexerCommand(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:803:2: ( ^( LEXER_ACTION_CALL ID lexerCommandExpr ) | ID ) - int alt39=2; - int LA39_0 = input.LA(1); - if ( (LA39_0==LEXER_ACTION_CALL) ) { - alt39=1; - } - else if ( (LA39_0==ID) ) { - alt39=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 39, 0, input); - throw nvae; - } - - switch (alt39) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:803:4: ^( LEXER_ACTION_CALL ID lexerCommandExpr ) - { - match(input,LEXER_ACTION_CALL,FOLLOW_LEXER_ACTION_CALL_in_lexerCommand1774); - match(input, Token.DOWN, null); - ID25=(GrammarAST)match(input,ID,FOLLOW_ID_in_lexerCommand1776); - pushFollow(FOLLOW_lexerCommandExpr_in_lexerCommand1778); - lexerCommandExpr26=lexerCommandExpr(); - state._fsp--; - - match(input, Token.UP, null); - - lexerCallCommand(currentOuterAltNumber, ID25, (lexerCommandExpr26!=null?((GrammarAST)lexerCommandExpr26.start):null)); - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:805:4: ID - { - ID27=(GrammarAST)match(input,ID,FOLLOW_ID_in_lexerCommand1794); - lexerCommand(currentOuterAltNumber, ID27); - } - break; - - } - - exitLexerCommand(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerCommand" - - - public static class lexerCommandExpr_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerCommandExpr" - // org/antlr/v4/parse/GrammarTreeVisitor.g:809:1: lexerCommandExpr : ( ID | INT ); - public final GrammarTreeVisitor.lexerCommandExpr_return lexerCommandExpr() throws RecognitionException { - GrammarTreeVisitor.lexerCommandExpr_return retval = new GrammarTreeVisitor.lexerCommandExpr_return(); - retval.start = input.LT(1); - - - enterLexerCommandExpr(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:816:2: ( ID | INT ) - // org/antlr/v4/parse/GrammarTreeVisitor.g: - { - if ( input.LA(1)==ID||input.LA(1)==INT ) { - input.consume(); - state.errorRecovery=false; - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - } - - - exitLexerCommandExpr(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerCommandExpr" - - - public static class element_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "element" - // org/antlr/v4/parse/GrammarTreeVisitor.g:820:1: element : ( labeledElement | atom | subrule | ACTION | SEMPRED | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) | range | ^( NOT blockSet ) | ^( NOT block ) ); - public final GrammarTreeVisitor.element_return element() throws RecognitionException { - GrammarTreeVisitor.element_return retval = new GrammarTreeVisitor.element_return(); - retval.start = input.LT(1); - - GrammarAST ACTION28=null; - GrammarAST SEMPRED29=null; - GrammarAST ACTION30=null; - GrammarAST SEMPRED31=null; - - - enterElement(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:827:2: ( labeledElement | atom | subrule | ACTION | SEMPRED | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) | range | ^( NOT blockSet ) | ^( NOT block ) ) - int alt40=10; - switch ( input.LA(1) ) { - case ASSIGN: - case PLUS_ASSIGN: - { - alt40=1; - } - break; - case DOT: - case RULE_REF: - case STRING_LITERAL: - case TOKEN_REF: - case SET: - case WILDCARD: - { - alt40=2; - } - break; - case BLOCK: - case CLOSURE: - case OPTIONAL: - case POSITIVE_CLOSURE: - { - alt40=3; - } - break; - case ACTION: - { - int LA40_4 = input.LA(2); - if ( (LA40_4==DOWN) ) { - alt40=6; - } - else if ( ((LA40_4 >= UP && LA40_4 <= ACTION)||LA40_4==ASSIGN||LA40_4==DOT||LA40_4==NOT||LA40_4==PLUS_ASSIGN||LA40_4==RANGE||LA40_4==RULE_REF||LA40_4==SEMPRED||LA40_4==STRING_LITERAL||LA40_4==TOKEN_REF||(LA40_4 >= BLOCK && LA40_4 <= CLOSURE)||(LA40_4 >= OPTIONAL && LA40_4 <= POSITIVE_CLOSURE)||(LA40_4 >= SET && LA40_4 <= WILDCARD)) ) { - alt40=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 40, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case SEMPRED: - { - int LA40_5 = input.LA(2); - if ( (LA40_5==DOWN) ) { - alt40=7; - } - else if ( ((LA40_5 >= UP && LA40_5 <= ACTION)||LA40_5==ASSIGN||LA40_5==DOT||LA40_5==NOT||LA40_5==PLUS_ASSIGN||LA40_5==RANGE||LA40_5==RULE_REF||LA40_5==SEMPRED||LA40_5==STRING_LITERAL||LA40_5==TOKEN_REF||(LA40_5 >= BLOCK && LA40_5 <= CLOSURE)||(LA40_5 >= OPTIONAL && LA40_5 <= POSITIVE_CLOSURE)||(LA40_5 >= SET && LA40_5 <= WILDCARD)) ) { - alt40=5; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 40, 5, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case RANGE: - { - alt40=8; - } - break; - case NOT: - { - int LA40_7 = input.LA(2); - if ( (LA40_7==DOWN) ) { - int LA40_12 = input.LA(3); - if ( (LA40_12==SET) ) { - alt40=9; - } - else if ( (LA40_12==BLOCK) ) { - alt40=10; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 40, 12, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 40, 7, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 40, 0, input); - throw nvae; - } - switch (alt40) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:827:4: labeledElement - { - pushFollow(FOLLOW_labeledElement_in_element1851); - labeledElement(); - state._fsp--; - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:828:4: atom - { - pushFollow(FOLLOW_atom_in_element1856); - atom(); - state._fsp--; - - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:829:4: subrule - { - pushFollow(FOLLOW_subrule_in_element1861); - subrule(); - state._fsp--; - - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:830:6: ACTION - { - ACTION28=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_element1868); - actionInAlt((ActionAST)ACTION28); - } - break; - case 5 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:831:6: SEMPRED - { - SEMPRED29=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_element1882); - sempredInAlt((PredAST)SEMPRED29); - } - break; - case 6 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:832:6: ^( ACTION elementOptions ) - { - ACTION30=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_element1897); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_element1899); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - actionInAlt((ActionAST)ACTION30); - } - break; - case 7 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:833:6: ^( SEMPRED elementOptions ) - { - SEMPRED31=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_element1910); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_element1912); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - sempredInAlt((PredAST)SEMPRED31); - } - break; - case 8 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:834:4: range - { - pushFollow(FOLLOW_range_in_element1920); - range(); - state._fsp--; - - } - break; - case 9 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:835:4: ^( NOT blockSet ) - { - match(input,NOT,FOLLOW_NOT_in_element1926); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_blockSet_in_element1928); - blockSet(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 10 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:836:4: ^( NOT block ) - { - match(input,NOT,FOLLOW_NOT_in_element1935); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_element1937); - block(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - - } - - exitElement(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "element" - - - public static class astOperand_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "astOperand" - // org/antlr/v4/parse/GrammarTreeVisitor.g:839:1: astOperand : ( atom | ^( NOT blockSet ) | ^( NOT block ) ); - public final GrammarTreeVisitor.astOperand_return astOperand() throws RecognitionException { - GrammarTreeVisitor.astOperand_return retval = new GrammarTreeVisitor.astOperand_return(); - retval.start = input.LT(1); - - - enterAstOperand(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:846:2: ( atom | ^( NOT blockSet ) | ^( NOT block ) ) - int alt41=3; - int LA41_0 = input.LA(1); - if ( (LA41_0==DOT||LA41_0==RULE_REF||LA41_0==STRING_LITERAL||LA41_0==TOKEN_REF||(LA41_0 >= SET && LA41_0 <= WILDCARD)) ) { - alt41=1; - } - else if ( (LA41_0==NOT) ) { - int LA41_2 = input.LA(2); - if ( (LA41_2==DOWN) ) { - int LA41_3 = input.LA(3); - if ( (LA41_3==SET) ) { - alt41=2; - } - else if ( (LA41_3==BLOCK) ) { - alt41=3; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 41, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 41, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 41, 0, input); - throw nvae; - } - - switch (alt41) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:846:4: atom - { - pushFollow(FOLLOW_atom_in_astOperand1959); - atom(); - state._fsp--; - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:847:4: ^( NOT blockSet ) - { - match(input,NOT,FOLLOW_NOT_in_astOperand1965); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_blockSet_in_astOperand1967); - blockSet(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:848:4: ^( NOT block ) - { - match(input,NOT,FOLLOW_NOT_in_astOperand1974); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_astOperand1976); - block(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - - } - - exitAstOperand(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "astOperand" - - - public static class labeledElement_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "labeledElement" - // org/antlr/v4/parse/GrammarTreeVisitor.g:851:1: labeledElement : ^( ( ASSIGN | PLUS_ASSIGN ) ID element ) ; - public final GrammarTreeVisitor.labeledElement_return labeledElement() throws RecognitionException { - GrammarTreeVisitor.labeledElement_return retval = new GrammarTreeVisitor.labeledElement_return(); - retval.start = input.LT(1); - - GrammarAST ID32=null; - TreeRuleReturnScope element33 =null; - - - enterLabeledElement(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:858:2: ( ^( ( ASSIGN | PLUS_ASSIGN ) ID element ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:858:4: ^( ( ASSIGN | PLUS_ASSIGN ) ID element ) - { - if ( input.LA(1)==ASSIGN||input.LA(1)==PLUS_ASSIGN ) { - input.consume(); - state.errorRecovery=false; - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - match(input, Token.DOWN, null); - ID32=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement2005); - pushFollow(FOLLOW_element_in_labeledElement2007); - element33=element(); - state._fsp--; - - match(input, Token.UP, null); - - label(((GrammarAST)retval.start), ID32, (element33!=null?((GrammarAST)element33.start):null)); - } - - - exitLabeledElement(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "labeledElement" - - - public static class subrule_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "subrule" - // org/antlr/v4/parse/GrammarTreeVisitor.g:861:1: subrule : ( ^( blockSuffix block ) | block ); - public final GrammarTreeVisitor.subrule_return subrule() throws RecognitionException { - GrammarTreeVisitor.subrule_return retval = new GrammarTreeVisitor.subrule_return(); - retval.start = input.LT(1); - - - enterSubrule(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:868:2: ( ^( blockSuffix block ) | block ) - int alt42=2; - int LA42_0 = input.LA(1); - if ( (LA42_0==CLOSURE||(LA42_0 >= OPTIONAL && LA42_0 <= POSITIVE_CLOSURE)) ) { - alt42=1; - } - else if ( (LA42_0==BLOCK) ) { - alt42=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 42, 0, input); - throw nvae; - } - - switch (alt42) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:868:4: ^( blockSuffix block ) - { - pushFollow(FOLLOW_blockSuffix_in_subrule2032); - blockSuffix(); - state._fsp--; - - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_subrule2034); - block(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:869:5: block - { - pushFollow(FOLLOW_block_in_subrule2041); - block(); - state._fsp--; - - } - break; - - } - - exitSubrule(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "subrule" - - - public static class lexerSubrule_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "lexerSubrule" - // org/antlr/v4/parse/GrammarTreeVisitor.g:872:1: lexerSubrule : ( ^( blockSuffix lexerBlock ) | lexerBlock ); - public final GrammarTreeVisitor.lexerSubrule_return lexerSubrule() throws RecognitionException { - GrammarTreeVisitor.lexerSubrule_return retval = new GrammarTreeVisitor.lexerSubrule_return(); - retval.start = input.LT(1); - - - enterLexerSubrule(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:879:2: ( ^( blockSuffix lexerBlock ) | lexerBlock ) - int alt43=2; - int LA43_0 = input.LA(1); - if ( (LA43_0==CLOSURE||(LA43_0 >= OPTIONAL && LA43_0 <= POSITIVE_CLOSURE)) ) { - alt43=1; - } - else if ( (LA43_0==BLOCK) ) { - alt43=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 43, 0, input); - throw nvae; - } - - switch (alt43) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:879:4: ^( blockSuffix lexerBlock ) - { - pushFollow(FOLLOW_blockSuffix_in_lexerSubrule2066); - blockSuffix(); - state._fsp--; - - match(input, Token.DOWN, null); - pushFollow(FOLLOW_lexerBlock_in_lexerSubrule2068); - lexerBlock(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:880:5: lexerBlock - { - pushFollow(FOLLOW_lexerBlock_in_lexerSubrule2075); - lexerBlock(); - state._fsp--; - - } - break; - - } - - exitLexerSubrule(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "lexerSubrule" - - - public static class blockSuffix_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "blockSuffix" - // org/antlr/v4/parse/GrammarTreeVisitor.g:883:1: blockSuffix : ebnfSuffix ; - public final GrammarTreeVisitor.blockSuffix_return blockSuffix() throws RecognitionException { - GrammarTreeVisitor.blockSuffix_return retval = new GrammarTreeVisitor.blockSuffix_return(); - retval.start = input.LT(1); - - - enterBlockSuffix(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:890:5: ( ebnfSuffix ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:890:7: ebnfSuffix - { - pushFollow(FOLLOW_ebnfSuffix_in_blockSuffix2102); - ebnfSuffix(); - state._fsp--; - - } - - - exitBlockSuffix(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "blockSuffix" - - - public static class ebnfSuffix_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "ebnfSuffix" - // org/antlr/v4/parse/GrammarTreeVisitor.g:893:1: ebnfSuffix : ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ); - public final GrammarTreeVisitor.ebnfSuffix_return ebnfSuffix() throws RecognitionException { - GrammarTreeVisitor.ebnfSuffix_return retval = new GrammarTreeVisitor.ebnfSuffix_return(); - retval.start = input.LT(1); - - - enterEbnfSuffix(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:900:2: ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ) - // org/antlr/v4/parse/GrammarTreeVisitor.g: - { - if ( input.LA(1)==CLOSURE||(input.LA(1) >= OPTIONAL && input.LA(1) <= POSITIVE_CLOSURE) ) { - input.consume(); - state.errorRecovery=false; - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - } - - - exitEbnfSuffix(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ebnfSuffix" - - - public static class atom_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "atom" - // org/antlr/v4/parse/GrammarTreeVisitor.g:905:1: atom : ( ^( DOT ID terminal ) | ^( DOT ID ruleref ) | ^( WILDCARD elementOptions ) | WILDCARD | terminal | blockSet | ruleref ); - public final GrammarTreeVisitor.atom_return atom() throws RecognitionException { - GrammarTreeVisitor.atom_return retval = new GrammarTreeVisitor.atom_return(); - retval.start = input.LT(1); - - GrammarAST WILDCARD34=null; - GrammarAST WILDCARD35=null; - - - enterAtom(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:912:2: ( ^( DOT ID terminal ) | ^( DOT ID ruleref ) | ^( WILDCARD elementOptions ) | WILDCARD | terminal | blockSet | ruleref ) - int alt44=7; - switch ( input.LA(1) ) { - case DOT: - { - int LA44_1 = input.LA(2); - if ( (LA44_1==DOWN) ) { - int LA44_6 = input.LA(3); - if ( (LA44_6==ID) ) { - int LA44_9 = input.LA(4); - if ( (LA44_9==STRING_LITERAL||LA44_9==TOKEN_REF) ) { - alt44=1; - } - else if ( (LA44_9==RULE_REF) ) { - alt44=2; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 44, 9, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 44, 6, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 44, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case WILDCARD: - { - int LA44_2 = input.LA(2); - if ( (LA44_2==DOWN) ) { - alt44=3; - } - else if ( (LA44_2==EOF||(LA44_2 >= UP && LA44_2 <= ACTION)||LA44_2==ASSIGN||LA44_2==DOT||LA44_2==NOT||LA44_2==PLUS_ASSIGN||LA44_2==RANGE||LA44_2==RULE_REF||LA44_2==SEMPRED||LA44_2==STRING_LITERAL||LA44_2==TOKEN_REF||(LA44_2 >= BLOCK && LA44_2 <= CLOSURE)||(LA44_2 >= OPTIONAL && LA44_2 <= POSITIVE_CLOSURE)||(LA44_2 >= SET && LA44_2 <= WILDCARD)) ) { - alt44=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 44, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case STRING_LITERAL: - case TOKEN_REF: - { - alt44=5; - } - break; - case SET: - { - alt44=6; - } - break; - case RULE_REF: - { - alt44=7; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 44, 0, input); - throw nvae; - } - switch (alt44) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:912:4: ^( DOT ID terminal ) - { - match(input,DOT,FOLLOW_DOT_in_atom2163); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom2165); - pushFollow(FOLLOW_terminal_in_atom2167); - terminal(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:913:4: ^( DOT ID ruleref ) - { - match(input,DOT,FOLLOW_DOT_in_atom2174); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom2176); - pushFollow(FOLLOW_ruleref_in_atom2178); - ruleref(); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:914:7: ^( WILDCARD elementOptions ) - { - WILDCARD34=(GrammarAST)match(input,WILDCARD,FOLLOW_WILDCARD_in_atom2188); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_atom2190); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - wildcardRef(WILDCARD34); - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:915:7: WILDCARD - { - WILDCARD35=(GrammarAST)match(input,WILDCARD,FOLLOW_WILDCARD_in_atom2201); - wildcardRef(WILDCARD35); - } - break; - case 5 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:916:9: terminal - { - pushFollow(FOLLOW_terminal_in_atom2217); - terminal(); - state._fsp--; - - } - break; - case 6 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:917:7: blockSet - { - pushFollow(FOLLOW_blockSet_in_atom2225); - blockSet(); - state._fsp--; - - } - break; - case 7 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:918:9: ruleref - { - pushFollow(FOLLOW_ruleref_in_atom2235); - ruleref(); - state._fsp--; - - } - break; - - } - - exitAtom(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "atom" - - - public static class blockSet_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "blockSet" - // org/antlr/v4/parse/GrammarTreeVisitor.g:921:1: blockSet : ^( SET ( setElement )+ ) ; - public final GrammarTreeVisitor.blockSet_return blockSet() throws RecognitionException { - GrammarTreeVisitor.blockSet_return retval = new GrammarTreeVisitor.blockSet_return(); - retval.start = input.LT(1); - - - enterBlockSet(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:928:2: ( ^( SET ( setElement )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:928:4: ^( SET ( setElement )+ ) - { - match(input,SET,FOLLOW_SET_in_blockSet2260); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:928:10: ( setElement )+ - int cnt45=0; - loop45: - while (true) { - int alt45=2; - int LA45_0 = input.LA(1); - if ( (LA45_0==LEXER_CHAR_SET||LA45_0==RANGE||LA45_0==STRING_LITERAL||LA45_0==TOKEN_REF) ) { - alt45=1; - } - - switch (alt45) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:928:10: setElement - { - pushFollow(FOLLOW_setElement_in_blockSet2262); - setElement(); - state._fsp--; - - } - break; - - default : - if ( cnt45 >= 1 ) break loop45; - EarlyExitException eee = new EarlyExitException(45, input); - throw eee; - } - cnt45++; - } - - match(input, Token.UP, null); - - } - - - exitBlockSet(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "blockSet" - - - public static class setElement_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "setElement" - // org/antlr/v4/parse/GrammarTreeVisitor.g:931:1: setElement : ( ^( STRING_LITERAL elementOptions ) | ^( TOKEN_REF elementOptions ) | STRING_LITERAL | TOKEN_REF | ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) | LEXER_CHAR_SET ); - public final GrammarTreeVisitor.setElement_return setElement() throws RecognitionException { - GrammarTreeVisitor.setElement_return retval = new GrammarTreeVisitor.setElement_return(); - retval.start = input.LT(1); - - GrammarAST a=null; - GrammarAST b=null; - GrammarAST STRING_LITERAL36=null; - GrammarAST TOKEN_REF37=null; - GrammarAST STRING_LITERAL38=null; - GrammarAST TOKEN_REF39=null; - - - enterSetElement(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:938:2: ( ^( STRING_LITERAL elementOptions ) | ^( TOKEN_REF elementOptions ) | STRING_LITERAL | TOKEN_REF | ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) | LEXER_CHAR_SET ) - int alt46=6; - switch ( input.LA(1) ) { - case STRING_LITERAL: - { - int LA46_1 = input.LA(2); - if ( (LA46_1==DOWN) ) { - alt46=1; - } - else if ( (LA46_1==UP||LA46_1==LEXER_CHAR_SET||LA46_1==RANGE||LA46_1==STRING_LITERAL||LA46_1==TOKEN_REF) ) { - alt46=3; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 46, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case TOKEN_REF: - { - int LA46_2 = input.LA(2); - if ( (LA46_2==DOWN) ) { - alt46=2; - } - else if ( (LA46_2==UP||LA46_2==LEXER_CHAR_SET||LA46_2==RANGE||LA46_2==STRING_LITERAL||LA46_2==TOKEN_REF) ) { - alt46=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 46, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case RANGE: - { - alt46=5; - } - break; - case LEXER_CHAR_SET: - { - alt46=6; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 46, 0, input); - throw nvae; - } - switch (alt46) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:938:4: ^( STRING_LITERAL elementOptions ) - { - STRING_LITERAL36=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement2286); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_setElement2288); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - stringRef((TerminalAST)STRING_LITERAL36); - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:939:4: ^( TOKEN_REF elementOptions ) - { - TOKEN_REF37=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement2300); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_setElement2302); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - tokenRef((TerminalAST)TOKEN_REF37); - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:940:4: STRING_LITERAL - { - STRING_LITERAL38=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement2312); - stringRef((TerminalAST)STRING_LITERAL38); - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:941:4: TOKEN_REF - { - TOKEN_REF39=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement2337); - tokenRef((TerminalAST)TOKEN_REF39); - } - break; - case 5 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:942:4: ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) - { - match(input,RANGE,FOLLOW_RANGE_in_setElement2366); - match(input, Token.DOWN, null); - a=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement2370); - b=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement2374); - match(input, Token.UP, null); - - - stringRef((TerminalAST)a); - stringRef((TerminalAST)b); - - } - break; - case 6 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:947:17: LEXER_CHAR_SET - { - match(input,LEXER_CHAR_SET,FOLLOW_LEXER_CHAR_SET_in_setElement2397); - } - break; - - } - - exitSetElement(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "setElement" - - - public static class block_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "block" - // org/antlr/v4/parse/GrammarTreeVisitor.g:950:1: block : ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? ( alternative )+ ) ; - public final GrammarTreeVisitor.block_return block() throws RecognitionException { - GrammarTreeVisitor.block_return retval = new GrammarTreeVisitor.block_return(); - retval.start = input.LT(1); - - - enterBlock(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:5: ( ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? ( alternative )+ ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:7: ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? ( alternative )+ ) - { - match(input,BLOCK,FOLLOW_BLOCK_in_block2422); - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:15: ( optionsSpec )? - int alt47=2; - int LA47_0 = input.LA(1); - if ( (LA47_0==OPTIONS) ) { - alt47=1; - } - switch (alt47) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:15: optionsSpec - { - pushFollow(FOLLOW_optionsSpec_in_block2424); - optionsSpec(); - state._fsp--; - - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:28: ( ruleAction )* - loop48: - while (true) { - int alt48=2; - int LA48_0 = input.LA(1); - if ( (LA48_0==AT) ) { - alt48=1; - } - - switch (alt48) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:28: ruleAction - { - pushFollow(FOLLOW_ruleAction_in_block2427); - ruleAction(); - state._fsp--; - - } - break; - - default : - break loop48; - } - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:40: ( ACTION )? - int alt49=2; - int LA49_0 = input.LA(1); - if ( (LA49_0==ACTION) ) { - alt49=1; - } - switch (alt49) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:40: ACTION - { - match(input,ACTION,FOLLOW_ACTION_in_block2430); - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:48: ( alternative )+ - int cnt50=0; - loop50: - while (true) { - int alt50=2; - int LA50_0 = input.LA(1); - if ( (LA50_0==ALT) ) { - alt50=1; - } - - switch (alt50) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:957:48: alternative - { - pushFollow(FOLLOW_alternative_in_block2433); - alternative(); - state._fsp--; - - } - break; - - default : - if ( cnt50 >= 1 ) break loop50; - EarlyExitException eee = new EarlyExitException(50, input); - throw eee; - } - cnt50++; - } - - match(input, Token.UP, null); - - } - - - exitBlock(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "block" - - - public static class ruleref_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "ruleref" - // org/antlr/v4/parse/GrammarTreeVisitor.g:960:1: ruleref : ^( RULE_REF (arg= ARG_ACTION )? ( elementOptions )? ) ; - public final GrammarTreeVisitor.ruleref_return ruleref() throws RecognitionException { - GrammarTreeVisitor.ruleref_return retval = new GrammarTreeVisitor.ruleref_return(); - retval.start = input.LT(1); - - GrammarAST arg=null; - GrammarAST RULE_REF40=null; - - - enterRuleref(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:967:5: ( ^( RULE_REF (arg= ARG_ACTION )? ( elementOptions )? ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:967:7: ^( RULE_REF (arg= ARG_ACTION )? ( elementOptions )? ) - { - RULE_REF40=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref2463); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:967:21: (arg= ARG_ACTION )? - int alt51=2; - int LA51_0 = input.LA(1); - if ( (LA51_0==ARG_ACTION) ) { - alt51=1; - } - switch (alt51) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:967:21: arg= ARG_ACTION - { - arg=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref2467); - } - break; - - } - - // org/antlr/v4/parse/GrammarTreeVisitor.g:967:34: ( elementOptions )? - int alt52=2; - int LA52_0 = input.LA(1); - if ( (LA52_0==ELEMENT_OPTIONS) ) { - alt52=1; - } - switch (alt52) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:967:34: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_ruleref2470); - elementOptions(); - state._fsp--; - - } - break; - - } - - match(input, Token.UP, null); - } - - - ruleRef(RULE_REF40, (ActionAST)arg); - if ( arg!=null ) actionInAlt((ActionAST)arg); - - } - - - exitRuleref(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ruleref" - - - public static class range_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "range" - // org/antlr/v4/parse/GrammarTreeVisitor.g:974:1: range : ^( RANGE STRING_LITERAL STRING_LITERAL ) ; - public final GrammarTreeVisitor.range_return range() throws RecognitionException { - GrammarTreeVisitor.range_return retval = new GrammarTreeVisitor.range_return(); - retval.start = input.LT(1); - - - enterRange(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:981:5: ( ^( RANGE STRING_LITERAL STRING_LITERAL ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:981:7: ^( RANGE STRING_LITERAL STRING_LITERAL ) - { - match(input,RANGE,FOLLOW_RANGE_in_range2507); - match(input, Token.DOWN, null); - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_range2509); - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_range2511); - match(input, Token.UP, null); - - } - - - exitRange(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "range" - - - public static class terminal_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "terminal" - // org/antlr/v4/parse/GrammarTreeVisitor.g:984:1: terminal : ( ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF ); - public final GrammarTreeVisitor.terminal_return terminal() throws RecognitionException { - GrammarTreeVisitor.terminal_return retval = new GrammarTreeVisitor.terminal_return(); - retval.start = input.LT(1); - - GrammarAST STRING_LITERAL41=null; - GrammarAST STRING_LITERAL42=null; - GrammarAST TOKEN_REF43=null; - GrammarAST TOKEN_REF44=null; - - - enterTerminal(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:991:5: ( ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF ) - int alt53=4; - int LA53_0 = input.LA(1); - if ( (LA53_0==STRING_LITERAL) ) { - int LA53_1 = input.LA(2); - if ( (LA53_1==DOWN) ) { - alt53=1; - } - else if ( (LA53_1==EOF||(LA53_1 >= UP && LA53_1 <= ACTION)||LA53_1==ASSIGN||LA53_1==DOT||LA53_1==LEXER_CHAR_SET||LA53_1==NOT||LA53_1==PLUS_ASSIGN||LA53_1==RANGE||LA53_1==RULE_REF||LA53_1==SEMPRED||LA53_1==STRING_LITERAL||LA53_1==TOKEN_REF||(LA53_1 >= BLOCK && LA53_1 <= CLOSURE)||LA53_1==EPSILON||(LA53_1 >= OPTIONAL && LA53_1 <= POSITIVE_CLOSURE)||(LA53_1 >= SET && LA53_1 <= WILDCARD)) ) { - alt53=2; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 53, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA53_0==TOKEN_REF) ) { - int LA53_2 = input.LA(2); - if ( (LA53_2==DOWN) ) { - alt53=3; - } - else if ( (LA53_2==EOF||(LA53_2 >= UP && LA53_2 <= ACTION)||LA53_2==ASSIGN||LA53_2==DOT||LA53_2==LEXER_CHAR_SET||LA53_2==NOT||LA53_2==PLUS_ASSIGN||LA53_2==RANGE||LA53_2==RULE_REF||LA53_2==SEMPRED||LA53_2==STRING_LITERAL||LA53_2==TOKEN_REF||(LA53_2 >= BLOCK && LA53_2 <= CLOSURE)||LA53_2==EPSILON||(LA53_2 >= OPTIONAL && LA53_2 <= POSITIVE_CLOSURE)||(LA53_2 >= SET && LA53_2 <= WILDCARD)) ) { - alt53=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 53, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 53, 0, input); - throw nvae; - } - - switch (alt53) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:991:8: ^( STRING_LITERAL elementOptions ) - { - STRING_LITERAL41=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal2541); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_terminal2543); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - stringRef((TerminalAST)STRING_LITERAL41); - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:993:7: STRING_LITERAL - { - STRING_LITERAL42=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal2566); - stringRef((TerminalAST)STRING_LITERAL42); - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:994:7: ^( TOKEN_REF elementOptions ) - { - TOKEN_REF43=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal2580); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_terminal2582); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - tokenRef((TerminalAST)TOKEN_REF43); - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:995:7: TOKEN_REF - { - TOKEN_REF44=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal2593); - tokenRef((TerminalAST)TOKEN_REF44); - } - break; - - } - - exitTerminal(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "terminal" - - - public static class elementOptions_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "elementOptions" - // org/antlr/v4/parse/GrammarTreeVisitor.g:998:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption[(GrammarASTWithOptions)$start.getParent()] )* ) ; - public final GrammarTreeVisitor.elementOptions_return elementOptions() throws RecognitionException { - GrammarTreeVisitor.elementOptions_return retval = new GrammarTreeVisitor.elementOptions_return(); - retval.start = input.LT(1); - - - enterElementOptions(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:1005:5: ( ^( ELEMENT_OPTIONS ( elementOption[(GrammarASTWithOptions)$start.getParent()] )* ) ) - // org/antlr/v4/parse/GrammarTreeVisitor.g:1005:7: ^( ELEMENT_OPTIONS ( elementOption[(GrammarASTWithOptions)$start.getParent()] )* ) - { - match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOptions2630); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // org/antlr/v4/parse/GrammarTreeVisitor.g:1005:25: ( elementOption[(GrammarASTWithOptions)$start.getParent()] )* - loop54: - while (true) { - int alt54=2; - int LA54_0 = input.LA(1); - if ( (LA54_0==ASSIGN||LA54_0==ID) ) { - alt54=1; - } - - switch (alt54) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:1005:25: elementOption[(GrammarASTWithOptions)$start.getParent()] - { - pushFollow(FOLLOW_elementOption_in_elementOptions2632); - elementOption((GrammarASTWithOptions)((GrammarAST)retval.start).getParent()); - state._fsp--; - - } - break; - - default : - break loop54; - } - } - - match(input, Token.UP, null); - } - - } - - - exitElementOptions(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "elementOptions" - - - public static class elementOption_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "elementOption" - // org/antlr/v4/parse/GrammarTreeVisitor.g:1008:1: elementOption[GrammarASTWithOptions t] : ( ID | ^( ASSIGN id= ID v= ID ) | ^( ASSIGN ID v= STRING_LITERAL ) | ^( ASSIGN ID v= ACTION ) | ^( ASSIGN ID v= INT ) ); - public final GrammarTreeVisitor.elementOption_return elementOption(GrammarASTWithOptions t) throws RecognitionException { - GrammarTreeVisitor.elementOption_return retval = new GrammarTreeVisitor.elementOption_return(); - retval.start = input.LT(1); - - GrammarAST id=null; - GrammarAST v=null; - GrammarAST ID45=null; - GrammarAST ID46=null; - GrammarAST ID47=null; - GrammarAST ID48=null; - - - enterElementOption(((GrammarAST)retval.start)); - - try { - // org/antlr/v4/parse/GrammarTreeVisitor.g:1015:5: ( ID | ^( ASSIGN id= ID v= ID ) | ^( ASSIGN ID v= STRING_LITERAL ) | ^( ASSIGN ID v= ACTION ) | ^( ASSIGN ID v= INT ) ) - int alt55=5; - int LA55_0 = input.LA(1); - if ( (LA55_0==ID) ) { - alt55=1; - } - else if ( (LA55_0==ASSIGN) ) { - int LA55_2 = input.LA(2); - if ( (LA55_2==DOWN) ) { - int LA55_3 = input.LA(3); - if ( (LA55_3==ID) ) { - switch ( input.LA(4) ) { - case ID: - { - alt55=2; - } - break; - case STRING_LITERAL: - { - alt55=3; - } - break; - case ACTION: - { - alt55=4; - } - break; - case INT: - { - alt55=5; - } - break; - default: - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 55, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 55, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 55, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 55, 0, input); - throw nvae; - } - - switch (alt55) { - case 1 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:1015:7: ID - { - ID45=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption2663); - elementOption(t, ID45, null); - } - break; - case 2 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:1016:9: ^( ASSIGN id= ID v= ID ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption2683); - match(input, Token.DOWN, null); - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption2687); - v=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption2691); - match(input, Token.UP, null); - - elementOption(t, id, v); - } - break; - case 3 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:1017:9: ^( ASSIGN ID v= STRING_LITERAL ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption2707); - match(input, Token.DOWN, null); - ID46=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption2709); - v=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption2713); - match(input, Token.UP, null); - - elementOption(t, ID46, v); - } - break; - case 4 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:1018:9: ^( ASSIGN ID v= ACTION ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption2727); - match(input, Token.DOWN, null); - ID47=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption2729); - v=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_elementOption2733); - match(input, Token.UP, null); - - elementOption(t, ID47, v); - } - break; - case 5 : - // org/antlr/v4/parse/GrammarTreeVisitor.g:1019:9: ^( ASSIGN ID v= INT ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption2749); - match(input, Token.DOWN, null); - ID48=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption2751); - v=(GrammarAST)match(input,INT,FOLLOW_INT_in_elementOption2755); - match(input, Token.UP, null); - - elementOption(t, ID48, v); - } - break; - - } - - exitElementOption(((GrammarAST)retval.start)); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "elementOption" - - // Delegated rules - - - protected DFA38 dfa38 = new DFA38(this); - static final String DFA38_eotS = - "\24\uffff"; - static final String DFA38_eofS = - "\24\uffff"; - static final String DFA38_minS = - "\1\105\1\2\1\4\1\2\2\uffff\2\3\1\2\1\4\1\34\1\4\10\3"; - static final String DFA38_maxS = - "\1\105\1\2\1\123\1\2\2\uffff\2\34\1\2\1\123\1\34\1\73\4\3\4\34"; - static final String DFA38_acceptS = - "\4\uffff\1\1\1\2\16\uffff"; - static final String DFA38_specialS = - "\24\uffff}>"; - static final String[] DFA38_transitionS = { - "\1\1", - "\1\2", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\4\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\1\uffff\1"+ - "\3\1\5\2\uffff\2\4\3\uffff\2\4", - "\1\6", - "", - "", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\12", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\4\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\5\2\uffff\2\4\3\uffff\2\4", - "\1\13", - "\1\16\27\uffff\1\14\1\uffff\1\17\34\uffff\1\15", - "\1\20", - "\1\21", - "\1\22", - "\1\23", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7" - }; - - static final short[] DFA38_eot = DFA.unpackEncodedString(DFA38_eotS); - static final short[] DFA38_eof = DFA.unpackEncodedString(DFA38_eofS); - static final char[] DFA38_min = DFA.unpackEncodedStringToUnsignedChars(DFA38_minS); - static final char[] DFA38_max = DFA.unpackEncodedStringToUnsignedChars(DFA38_maxS); - static final short[] DFA38_accept = DFA.unpackEncodedString(DFA38_acceptS); - static final short[] DFA38_special = DFA.unpackEncodedString(DFA38_specialS); - static final short[][] DFA38_transition; - - static { - int numStates = DFA38_transitionS.length; - DFA38_transition = new short[numStates][]; - for (int i=0; i", "", "", "", "ACTION", "ACTION_CHAR_LITERAL", - "ACTION_ESC", "ACTION_STRING_LITERAL", "ARG_ACTION", "ARG_OR_CHARSET", - "ASSIGN", "AT", "CATCH", "CHANNELS", "COLON", "COLONCOLON", "COMMA", "COMMENT", - "DOC_COMMENT", "DOLLAR", "DOT", "ERRCHAR", "ESC_SEQ", "FINALLY", "FRAGMENT", - "GRAMMAR", "GT", "HEX_DIGIT", "ID", "IMPORT", "INT", "LEXER", "LEXER_CHAR_SET", - "LOCALS", "LPAREN", "LT", "MODE", "NESTED_ACTION", "NLCHARS", "NOT", "NameChar", - "NameStartChar", "OPTIONS", "OR", "PARSER", "PLUS", "PLUS_ASSIGN", "POUND", - "QUESTION", "RANGE", "RARROW", "RBRACE", "RETURNS", "RPAREN", "RULE_REF", - "SEMI", "SEMPRED", "SRC", "STAR", "STRING_LITERAL", "THROWS", "TOKENS_SPEC", - "TOKEN_REF", "UNICODE_ESC", "UNICODE_EXTENDED_ESC", "UnicodeBOM", "WS", - "WSCHARS", "WSNLCHARS", "ALT", "BLOCK", "CLOSURE", "COMBINED", "ELEMENT_OPTIONS", - "EPSILON", "LEXER_ACTION_CALL", "LEXER_ALT_ACTION", "OPTIONAL", "POSITIVE_CLOSURE", - "RULE", "RULEMODIFIERS", "RULES", "SET", "WILDCARD", "PRIVATE", "PROTECTED", - "PUBLIC" - }; - public static final int EOF=-1; - public static final int ACTION=4; - public static final int ACTION_CHAR_LITERAL=5; - public static final int ACTION_ESC=6; - public static final int ACTION_STRING_LITERAL=7; - public static final int ARG_ACTION=8; - public static final int ARG_OR_CHARSET=9; - public static final int ASSIGN=10; - public static final int AT=11; - public static final int CATCH=12; - public static final int CHANNELS=13; - public static final int COLON=14; - public static final int COLONCOLON=15; - public static final int COMMA=16; - public static final int COMMENT=17; - public static final int DOC_COMMENT=18; - public static final int DOLLAR=19; - public static final int DOT=20; - public static final int ERRCHAR=21; - public static final int ESC_SEQ=22; - public static final int FINALLY=23; - public static final int FRAGMENT=24; - public static final int GRAMMAR=25; - public static final int GT=26; - public static final int HEX_DIGIT=27; - public static final int ID=28; - public static final int IMPORT=29; - public static final int INT=30; - public static final int LEXER=31; - public static final int LEXER_CHAR_SET=32; - public static final int LOCALS=33; - public static final int LPAREN=34; - public static final int LT=35; - public static final int MODE=36; - public static final int NESTED_ACTION=37; - public static final int NLCHARS=38; - public static final int NOT=39; - public static final int NameChar=40; - public static final int NameStartChar=41; - public static final int OPTIONS=42; - public static final int OR=43; - public static final int PARSER=44; - public static final int PLUS=45; - public static final int PLUS_ASSIGN=46; - public static final int POUND=47; - public static final int QUESTION=48; - public static final int RANGE=49; - public static final int RARROW=50; - public static final int RBRACE=51; - public static final int RETURNS=52; - public static final int RPAREN=53; - public static final int RULE_REF=54; - public static final int SEMI=55; - public static final int SEMPRED=56; - public static final int SRC=57; - public static final int STAR=58; - public static final int STRING_LITERAL=59; - public static final int THROWS=60; - public static final int TOKENS_SPEC=61; - public static final int TOKEN_REF=62; - public static final int UNICODE_ESC=63; - public static final int UNICODE_EXTENDED_ESC=64; - public static final int UnicodeBOM=65; - public static final int WS=66; - public static final int WSCHARS=67; - public static final int WSNLCHARS=68; - public static final int ALT=69; - public static final int BLOCK=70; - public static final int CLOSURE=71; - public static final int COMBINED=72; - public static final int ELEMENT_OPTIONS=73; - public static final int EPSILON=74; - public static final int LEXER_ACTION_CALL=75; - public static final int LEXER_ALT_ACTION=76; - public static final int OPTIONAL=77; - public static final int POSITIVE_CLOSURE=78; - public static final int RULE=79; - public static final int RULEMODIFIERS=80; - public static final int RULES=81; - public static final int SET=82; - public static final int WILDCARD=83; - public static final int PRIVATE=84; - public static final int PROTECTED=85; - public static final int PUBLIC=86; - - // delegates - public TreeParser[] getDelegates() { - return new TreeParser[] {}; - } - - // delegators - - - public LeftRecursiveRuleWalker(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public LeftRecursiveRuleWalker(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - @Override public String[] getTokenNames() { return LeftRecursiveRuleWalker.tokenNames; } - @Override public String getGrammarFileName() { return "org/antlr/v4/parse/LeftRecursiveRuleWalker.g"; } - - - private String ruleName; - private int currentOuterAltNumber; // which outer alt of rule? - public int numAlts; // how many alts for this rule total? - - public void setAltAssoc(AltAST altTree, int alt) {} - public void binaryAlt(AltAST altTree, int alt) {} - public void prefixAlt(AltAST altTree, int alt) {} - public void suffixAlt(AltAST altTree, int alt) {} - public void otherAlt(AltAST altTree, int alt) {} - public void setReturnValues(GrammarAST t) {} - - - - // $ANTLR start "rec_rule" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:64:1: public rec_rule returns [boolean isLeftRec] : ^(r= RULE id= RULE_REF ( ruleModifier )? ( ^( RETURNS a= ARG_ACTION ) )? ( ^( LOCALS ARG_ACTION ) )? ( ^( OPTIONS ( . )* ) | ^( AT ID ACTION ) )* ruleBlock exceptionGroup ) ; - public final boolean rec_rule() throws RecognitionException { - boolean isLeftRec = false; - - - GrammarAST r=null; - GrammarAST id=null; - GrammarAST a=null; - TreeRuleReturnScope ruleBlock1 =null; - - - currentOuterAltNumber = 1; - - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:69:2: ( ^(r= RULE id= RULE_REF ( ruleModifier )? ( ^( RETURNS a= ARG_ACTION ) )? ( ^( LOCALS ARG_ACTION ) )? ( ^( OPTIONS ( . )* ) | ^( AT ID ACTION ) )* ruleBlock exceptionGroup ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:69:4: ^(r= RULE id= RULE_REF ( ruleModifier )? ( ^( RETURNS a= ARG_ACTION ) )? ( ^( LOCALS ARG_ACTION ) )? ( ^( OPTIONS ( . )* ) | ^( AT ID ACTION ) )* ruleBlock exceptionGroup ) - { - r=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_rec_rule72); if (state.failed) return isLeftRec; - match(input, Token.DOWN, null); if (state.failed) return isLeftRec; - id=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_rec_rule76); if (state.failed) return isLeftRec; - if ( state.backtracking==0 ) {ruleName=id.getText();} - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:70:4: ( ruleModifier )? - int alt1=2; - int LA1_0 = input.LA(1); - if ( ((LA1_0 >= PRIVATE && LA1_0 <= PUBLIC)) ) { - alt1=1; - } - switch (alt1) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:70:4: ruleModifier - { - pushFollow(FOLLOW_ruleModifier_in_rec_rule83); - ruleModifier(); - state._fsp--; - if (state.failed) return isLeftRec; - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:72:4: ( ^( RETURNS a= ARG_ACTION ) )? - int alt2=2; - int LA2_0 = input.LA(1); - if ( (LA2_0==RETURNS) ) { - alt2=1; - } - switch (alt2) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:72:5: ^( RETURNS a= ARG_ACTION ) - { - match(input,RETURNS,FOLLOW_RETURNS_in_rec_rule92); if (state.failed) return isLeftRec; - match(input, Token.DOWN, null); if (state.failed) return isLeftRec; - a=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rec_rule96); if (state.failed) return isLeftRec; - if ( state.backtracking==0 ) {setReturnValues(a);} - match(input, Token.UP, null); if (state.failed) return isLeftRec; - - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:74:9: ( ^( LOCALS ARG_ACTION ) )? - int alt3=2; - int LA3_0 = input.LA(1); - if ( (LA3_0==LOCALS) ) { - alt3=1; - } - switch (alt3) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:74:11: ^( LOCALS ARG_ACTION ) - { - match(input,LOCALS,FOLLOW_LOCALS_in_rec_rule115); if (state.failed) return isLeftRec; - match(input, Token.DOWN, null); if (state.failed) return isLeftRec; - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rec_rule117); if (state.failed) return isLeftRec; - match(input, Token.UP, null); if (state.failed) return isLeftRec; - - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:75:9: ( ^( OPTIONS ( . )* ) | ^( AT ID ACTION ) )* - loop5: - while (true) { - int alt5=3; - int LA5_0 = input.LA(1); - if ( (LA5_0==OPTIONS) ) { - alt5=1; - } - else if ( (LA5_0==AT) ) { - alt5=2; - } - - switch (alt5) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:75:11: ^( OPTIONS ( . )* ) - { - match(input,OPTIONS,FOLLOW_OPTIONS_in_rec_rule135); if (state.failed) return isLeftRec; - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); if (state.failed) return isLeftRec; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:75:21: ( . )* - loop4: - while (true) { - int alt4=2; - int LA4_0 = input.LA(1); - if ( ((LA4_0 >= ACTION && LA4_0 <= PUBLIC)) ) { - alt4=1; - } - else if ( (LA4_0==UP) ) { - alt4=2; - } - - switch (alt4) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:75:21: . - { - matchAny(input); if (state.failed) return isLeftRec; - } - break; - - default : - break loop4; - } - } - - match(input, Token.UP, null); if (state.failed) return isLeftRec; - } - - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:76:11: ^( AT ID ACTION ) - { - match(input,AT,FOLLOW_AT_in_rec_rule152); if (state.failed) return isLeftRec; - match(input, Token.DOWN, null); if (state.failed) return isLeftRec; - match(input,ID,FOLLOW_ID_in_rec_rule154); if (state.failed) return isLeftRec; - match(input,ACTION,FOLLOW_ACTION_in_rec_rule156); if (state.failed) return isLeftRec; - match(input, Token.UP, null); if (state.failed) return isLeftRec; - - } - break; - - default : - break loop5; - } - } - - pushFollow(FOLLOW_ruleBlock_in_rec_rule172); - ruleBlock1=ruleBlock(); - state._fsp--; - if (state.failed) return isLeftRec; - if ( state.backtracking==0 ) {isLeftRec = (ruleBlock1!=null?((LeftRecursiveRuleWalker.ruleBlock_return)ruleBlock1).isLeftRec:false);} - pushFollow(FOLLOW_exceptionGroup_in_rec_rule179); - exceptionGroup(); - state._fsp--; - if (state.failed) return isLeftRec; - match(input, Token.UP, null); if (state.failed) return isLeftRec; - - } - - } - - finally { - // do for sure before leaving - } - return isLeftRec; - } - // $ANTLR end "rec_rule" - - - - // $ANTLR start "exceptionGroup" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:83:1: exceptionGroup : ( exceptionHandler )* ( finallyClause )? ; - public final void exceptionGroup() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:84:5: ( ( exceptionHandler )* ( finallyClause )? ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:84:7: ( exceptionHandler )* ( finallyClause )? - { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:84:7: ( exceptionHandler )* - loop6: - while (true) { - int alt6=2; - int LA6_0 = input.LA(1); - if ( (LA6_0==CATCH) ) { - alt6=1; - } - - switch (alt6) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:84:7: exceptionHandler - { - pushFollow(FOLLOW_exceptionHandler_in_exceptionGroup197); - exceptionHandler(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - break loop6; - } - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:84:25: ( finallyClause )? - int alt7=2; - int LA7_0 = input.LA(1); - if ( (LA7_0==FINALLY) ) { - alt7=1; - } - switch (alt7) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:84:25: finallyClause - { - pushFollow(FOLLOW_finallyClause_in_exceptionGroup200); - finallyClause(); - state._fsp--; - if (state.failed) return; - } - break; - - } - - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "exceptionGroup" - - - - // $ANTLR start "exceptionHandler" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:87:1: exceptionHandler : ^( CATCH ARG_ACTION ACTION ) ; - public final void exceptionHandler() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:88:2: ( ^( CATCH ARG_ACTION ACTION ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:88:4: ^( CATCH ARG_ACTION ACTION ) - { - match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler216); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_exceptionHandler218); if (state.failed) return; - match(input,ACTION,FOLLOW_ACTION_in_exceptionHandler220); if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "exceptionHandler" - - - - // $ANTLR start "finallyClause" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:91:1: finallyClause : ^( FINALLY ACTION ) ; - public final void finallyClause() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:92:2: ( ^( FINALLY ACTION ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:92:4: ^( FINALLY ACTION ) - { - match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause233); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ACTION,FOLLOW_ACTION_in_finallyClause235); if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "finallyClause" - - - - // $ANTLR start "ruleModifier" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:95:1: ruleModifier : ( PUBLIC | PRIVATE | PROTECTED ); - public final void ruleModifier() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:96:5: ( PUBLIC | PRIVATE | PROTECTED ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g: - { - if ( (input.LA(1) >= PRIVATE && input.LA(1) <= PUBLIC) ) { - input.consume(); - state.errorRecovery=false; - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return;} - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "ruleModifier" - - - public static class ruleBlock_return extends TreeRuleReturnScope { - public boolean isLeftRec; - }; - - - // $ANTLR start "ruleBlock" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:101:1: ruleBlock returns [boolean isLeftRec] : ^( BLOCK (o= outerAlternative )+ ) ; - public final LeftRecursiveRuleWalker.ruleBlock_return ruleBlock() throws RecognitionException { - LeftRecursiveRuleWalker.ruleBlock_return retval = new LeftRecursiveRuleWalker.ruleBlock_return(); - retval.start = input.LT(1); - - TreeRuleReturnScope o =null; - - boolean lr=false; this.numAlts = ((GrammarAST)retval.start).getChildCount(); - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:103:2: ( ^( BLOCK (o= outerAlternative )+ ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:103:4: ^( BLOCK (o= outerAlternative )+ ) - { - match(input,BLOCK,FOLLOW_BLOCK_in_ruleBlock290); if (state.failed) return retval; - match(input, Token.DOWN, null); if (state.failed) return retval; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:104:4: (o= outerAlternative )+ - int cnt8=0; - loop8: - while (true) { - int alt8=2; - int LA8_0 = input.LA(1); - if ( (LA8_0==ALT) ) { - alt8=1; - } - - switch (alt8) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:105:5: o= outerAlternative - { - pushFollow(FOLLOW_outerAlternative_in_ruleBlock303); - o=outerAlternative(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) {if ((o!=null?((LeftRecursiveRuleWalker.outerAlternative_return)o).isLeftRec:false)) retval.isLeftRec = true;} - if ( state.backtracking==0 ) {currentOuterAltNumber++;} - } - break; - - default : - if ( cnt8 >= 1 ) break loop8; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = new EarlyExitException(8, input); - throw eee; - } - cnt8++; - } - - match(input, Token.UP, null); if (state.failed) return retval; - - } - - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "ruleBlock" - - - public static class outerAlternative_return extends TreeRuleReturnScope { - public boolean isLeftRec; - }; - - - // $ANTLR start "outerAlternative" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:113:1: outerAlternative returns [boolean isLeftRec] : ( ( binary )=> binary | ( prefix )=> prefix | ( suffix )=> suffix | nonLeftRecur ); - public final LeftRecursiveRuleWalker.outerAlternative_return outerAlternative() throws RecognitionException { - LeftRecursiveRuleWalker.outerAlternative_return retval = new LeftRecursiveRuleWalker.outerAlternative_return(); - retval.start = input.LT(1); - - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:114:5: ( ( binary )=> binary | ( prefix )=> prefix | ( suffix )=> suffix | nonLeftRecur ) - int alt9=4; - int LA9_0 = input.LA(1); - if ( (LA9_0==ALT) ) { - int LA9_1 = input.LA(2); - if ( (synpred1_LeftRecursiveRuleWalker()) ) { - alt9=1; - } - else if ( (synpred2_LeftRecursiveRuleWalker()) ) { - alt9=2; - } - else if ( (synpred3_LeftRecursiveRuleWalker()) ) { - alt9=3; - } - else if ( (true) ) { - alt9=4; - } - - } - - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 9, 0, input); - throw nvae; - } - - switch (alt9) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:114:9: ( binary )=> binary - { - pushFollow(FOLLOW_binary_in_outerAlternative362); - binary(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) {binaryAlt((AltAST)((GrammarAST)retval.start), currentOuterAltNumber); retval.isLeftRec =true;} - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:116:9: ( prefix )=> prefix - { - pushFollow(FOLLOW_prefix_in_outerAlternative418); - prefix(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) {prefixAlt((AltAST)((GrammarAST)retval.start), currentOuterAltNumber);} - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:118:9: ( suffix )=> suffix - { - pushFollow(FOLLOW_suffix_in_outerAlternative474); - suffix(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) {suffixAlt((AltAST)((GrammarAST)retval.start), currentOuterAltNumber); retval.isLeftRec =true;} - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:120:9: nonLeftRecur - { - pushFollow(FOLLOW_nonLeftRecur_in_outerAlternative515); - nonLeftRecur(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) {otherAlt((AltAST)((GrammarAST)retval.start), currentOuterAltNumber);} - } - break; - - } - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "outerAlternative" - - - - // $ANTLR start "binary" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:123:1: binary : ^( ALT ( elementOptions )? recurse ( element )* recurse ( epsilonElement )* ) ; - public final void binary() throws RecognitionException { - GrammarAST ALT2=null; - - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:2: ( ^( ALT ( elementOptions )? recurse ( element )* recurse ( epsilonElement )* ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:4: ^( ALT ( elementOptions )? recurse ( element )* recurse ( epsilonElement )* ) - { - ALT2=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_binary541); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:11: ( elementOptions )? - int alt10=2; - int LA10_0 = input.LA(1); - if ( (LA10_0==ELEMENT_OPTIONS) ) { - alt10=1; - } - switch (alt10) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:11: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_binary543); - elementOptions(); - state._fsp--; - if (state.failed) return; - } - break; - - } - - pushFollow(FOLLOW_recurse_in_binary546); - recurse(); - state._fsp--; - if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:35: ( element )* - loop11: - while (true) { - int alt11=2; - alt11 = dfa11.predict(input); - switch (alt11) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:35: element - { - pushFollow(FOLLOW_element_in_binary548); - element(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - break loop11; - } - } - - pushFollow(FOLLOW_recurse_in_binary551); - recurse(); - state._fsp--; - if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:52: ( epsilonElement )* - loop12: - while (true) { - int alt12=2; - int LA12_0 = input.LA(1); - if ( (LA12_0==ACTION||LA12_0==SEMPRED||LA12_0==EPSILON) ) { - alt12=1; - } - - switch (alt12) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:124:52: epsilonElement - { - pushFollow(FOLLOW_epsilonElement_in_binary553); - epsilonElement(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - break loop12; - } - } - - match(input, Token.UP, null); if (state.failed) return; - - if ( state.backtracking==0 ) {setAltAssoc((AltAST)ALT2,currentOuterAltNumber);} - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "binary" - - - - // $ANTLR start "prefix" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:128:1: prefix : ^( ALT ( elementOptions )? ( element )+ recurse ( epsilonElement )* ) ; - public final void prefix() throws RecognitionException { - GrammarAST ALT3=null; - - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:129:2: ( ^( ALT ( elementOptions )? ( element )+ recurse ( epsilonElement )* ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:129:4: ^( ALT ( elementOptions )? ( element )+ recurse ( epsilonElement )* ) - { - ALT3=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_prefix579); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:129:11: ( elementOptions )? - int alt13=2; - int LA13_0 = input.LA(1); - if ( (LA13_0==ELEMENT_OPTIONS) ) { - alt13=1; - } - switch (alt13) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:129:11: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_prefix581); - elementOptions(); - state._fsp--; - if (state.failed) return; - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:130:4: ( element )+ - int cnt14=0; - loop14: - while (true) { - int alt14=2; - alt14 = dfa14.predict(input); - switch (alt14) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:130:4: element - { - pushFollow(FOLLOW_element_in_prefix587); - element(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - if ( cnt14 >= 1 ) break loop14; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(14, input); - throw eee; - } - cnt14++; - } - - pushFollow(FOLLOW_recurse_in_prefix593); - recurse(); - state._fsp--; - if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:131:12: ( epsilonElement )* - loop15: - while (true) { - int alt15=2; - int LA15_0 = input.LA(1); - if ( (LA15_0==ACTION||LA15_0==SEMPRED||LA15_0==EPSILON) ) { - alt15=1; - } - - switch (alt15) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:131:12: epsilonElement - { - pushFollow(FOLLOW_epsilonElement_in_prefix595); - epsilonElement(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - break loop15; - } - } - - match(input, Token.UP, null); if (state.failed) return; - - if ( state.backtracking==0 ) {setAltAssoc((AltAST)ALT3,currentOuterAltNumber);} - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "prefix" - - - - // $ANTLR start "suffix" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:136:1: suffix : ^( ALT ( elementOptions )? recurse ( element )+ ) ; - public final void suffix() throws RecognitionException { - GrammarAST ALT4=null; - - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:137:5: ( ^( ALT ( elementOptions )? recurse ( element )+ ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:137:9: ^( ALT ( elementOptions )? recurse ( element )+ ) - { - ALT4=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_suffix630); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:137:16: ( elementOptions )? - int alt16=2; - int LA16_0 = input.LA(1); - if ( (LA16_0==ELEMENT_OPTIONS) ) { - alt16=1; - } - switch (alt16) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:137:16: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_suffix632); - elementOptions(); - state._fsp--; - if (state.failed) return; - } - break; - - } - - pushFollow(FOLLOW_recurse_in_suffix635); - recurse(); - state._fsp--; - if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:137:40: ( element )+ - int cnt17=0; - loop17: - while (true) { - int alt17=2; - int LA17_0 = input.LA(1); - if ( (LA17_0==ACTION||LA17_0==ASSIGN||LA17_0==DOT||LA17_0==NOT||LA17_0==PLUS_ASSIGN||LA17_0==RANGE||LA17_0==RULE_REF||LA17_0==SEMPRED||LA17_0==STRING_LITERAL||LA17_0==TOKEN_REF||(LA17_0 >= BLOCK && LA17_0 <= CLOSURE)||LA17_0==EPSILON||(LA17_0 >= OPTIONAL && LA17_0 <= POSITIVE_CLOSURE)||(LA17_0 >= SET && LA17_0 <= WILDCARD)) ) { - alt17=1; - } - - switch (alt17) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:137:40: element - { - pushFollow(FOLLOW_element_in_suffix637); - element(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - if ( cnt17 >= 1 ) break loop17; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(17, input); - throw eee; - } - cnt17++; - } - - match(input, Token.UP, null); if (state.failed) return; - - if ( state.backtracking==0 ) {setAltAssoc((AltAST)ALT4,currentOuterAltNumber);} - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "suffix" - - - - // $ANTLR start "nonLeftRecur" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:141:1: nonLeftRecur : ^( ALT ( elementOptions )? ( element )+ ) ; - public final void nonLeftRecur() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:142:5: ( ^( ALT ( elementOptions )? ( element )+ ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:142:9: ^( ALT ( elementOptions )? ( element )+ ) - { - match(input,ALT,FOLLOW_ALT_in_nonLeftRecur671); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:142:15: ( elementOptions )? - int alt18=2; - int LA18_0 = input.LA(1); - if ( (LA18_0==ELEMENT_OPTIONS) ) { - alt18=1; - } - switch (alt18) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:142:15: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_nonLeftRecur673); - elementOptions(); - state._fsp--; - if (state.failed) return; - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:142:31: ( element )+ - int cnt19=0; - loop19: - while (true) { - int alt19=2; - int LA19_0 = input.LA(1); - if ( (LA19_0==ACTION||LA19_0==ASSIGN||LA19_0==DOT||LA19_0==NOT||LA19_0==PLUS_ASSIGN||LA19_0==RANGE||LA19_0==RULE_REF||LA19_0==SEMPRED||LA19_0==STRING_LITERAL||LA19_0==TOKEN_REF||(LA19_0 >= BLOCK && LA19_0 <= CLOSURE)||LA19_0==EPSILON||(LA19_0 >= OPTIONAL && LA19_0 <= POSITIVE_CLOSURE)||(LA19_0 >= SET && LA19_0 <= WILDCARD)) ) { - alt19=1; - } - - switch (alt19) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:142:31: element - { - pushFollow(FOLLOW_element_in_nonLeftRecur676); - element(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - if ( cnt19 >= 1 ) break loop19; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(19, input); - throw eee; - } - cnt19++; - } - - match(input, Token.UP, null); if (state.failed) return; - - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "nonLeftRecur" - - - - // $ANTLR start "recurse" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:145:1: recurse : ( ^( ASSIGN ID recurseNoLabel ) | ^( PLUS_ASSIGN ID recurseNoLabel ) | recurseNoLabel ); - public final void recurse() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:146:2: ( ^( ASSIGN ID recurseNoLabel ) | ^( PLUS_ASSIGN ID recurseNoLabel ) | recurseNoLabel ) - int alt20=3; - switch ( input.LA(1) ) { - case ASSIGN: - { - alt20=1; - } - break; - case PLUS_ASSIGN: - { - alt20=2; - } - break; - case RULE_REF: - { - alt20=3; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 20, 0, input); - throw nvae; - } - switch (alt20) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:146:4: ^( ASSIGN ID recurseNoLabel ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_recurse693); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_recurse695); if (state.failed) return; - pushFollow(FOLLOW_recurseNoLabel_in_recurse697); - recurseNoLabel(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:147:4: ^( PLUS_ASSIGN ID recurseNoLabel ) - { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_recurse704); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_recurse706); if (state.failed) return; - pushFollow(FOLLOW_recurseNoLabel_in_recurse708); - recurseNoLabel(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:148:4: recurseNoLabel - { - pushFollow(FOLLOW_recurseNoLabel_in_recurse714); - recurseNoLabel(); - state._fsp--; - if (state.failed) return; - } - break; - - } - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "recurse" - - - - // $ANTLR start "recurseNoLabel" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:151:1: recurseNoLabel :{...}? RULE_REF ; - public final void recurseNoLabel() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:151:16: ({...}? RULE_REF ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:151:18: {...}? RULE_REF - { - if ( !((((CommonTree)input.LT(1)).getText().equals(ruleName))) ) { - if (state.backtracking>0) {state.failed=true; return;} - throw new FailedPredicateException(input, "recurseNoLabel", "((CommonTree)input.LT(1)).getText().equals(ruleName)"); - } - match(input,RULE_REF,FOLLOW_RULE_REF_in_recurseNoLabel726); if (state.failed) return; - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "recurseNoLabel" - - - - // $ANTLR start "token" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:153:1: token returns [GrammarAST t=null] : ( ^( ASSIGN ID s= token ) | ^( PLUS_ASSIGN ID s= token ) |b= STRING_LITERAL | ^(b= STRING_LITERAL elementOptions ) | ^(c= TOKEN_REF elementOptions ) |c= TOKEN_REF ); - public final GrammarAST token() throws RecognitionException { - GrammarAST t = null; - - - GrammarAST b=null; - GrammarAST c=null; - GrammarAST s =null; - - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:154:2: ( ^( ASSIGN ID s= token ) | ^( PLUS_ASSIGN ID s= token ) |b= STRING_LITERAL | ^(b= STRING_LITERAL elementOptions ) | ^(c= TOKEN_REF elementOptions ) |c= TOKEN_REF ) - int alt21=6; - switch ( input.LA(1) ) { - case ASSIGN: - { - alt21=1; - } - break; - case PLUS_ASSIGN: - { - alt21=2; - } - break; - case STRING_LITERAL: - { - int LA21_3 = input.LA(2); - if ( (LA21_3==DOWN) ) { - alt21=4; - } - else if ( (LA21_3==UP) ) { - alt21=3; - } - - else { - if (state.backtracking>0) {state.failed=true; return t;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 21, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case TOKEN_REF: - { - int LA21_4 = input.LA(2); - if ( (LA21_4==DOWN) ) { - alt21=5; - } - else if ( (LA21_4==UP) ) { - alt21=6; - } - - else { - if (state.backtracking>0) {state.failed=true; return t;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 21, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - default: - if (state.backtracking>0) {state.failed=true; return t;} - NoViableAltException nvae = - new NoViableAltException("", 21, 0, input); - throw nvae; - } - switch (alt21) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:154:4: ^( ASSIGN ID s= token ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_token740); if (state.failed) return t; - match(input, Token.DOWN, null); if (state.failed) return t; - match(input,ID,FOLLOW_ID_in_token742); if (state.failed) return t; - pushFollow(FOLLOW_token_in_token746); - s=token(); - state._fsp--; - if (state.failed) return t; - if ( state.backtracking==0 ) {t = s;} - match(input, Token.UP, null); if (state.failed) return t; - - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:155:4: ^( PLUS_ASSIGN ID s= token ) - { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_token755); if (state.failed) return t; - match(input, Token.DOWN, null); if (state.failed) return t; - match(input,ID,FOLLOW_ID_in_token757); if (state.failed) return t; - pushFollow(FOLLOW_token_in_token761); - s=token(); - state._fsp--; - if (state.failed) return t; - if ( state.backtracking==0 ) {t = s;} - match(input, Token.UP, null); if (state.failed) return t; - - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:156:4: b= STRING_LITERAL - { - b=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_token771); if (state.failed) return t; - if ( state.backtracking==0 ) {t = b;} - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:157:7: ^(b= STRING_LITERAL elementOptions ) - { - b=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_token792); if (state.failed) return t; - match(input, Token.DOWN, null); if (state.failed) return t; - pushFollow(FOLLOW_elementOptions_in_token794); - elementOptions(); - state._fsp--; - if (state.failed) return t; - match(input, Token.UP, null); if (state.failed) return t; - - if ( state.backtracking==0 ) {t = b;} - } - break; - case 5 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:158:7: ^(c= TOKEN_REF elementOptions ) - { - c=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_token809); if (state.failed) return t; - match(input, Token.DOWN, null); if (state.failed) return t; - pushFollow(FOLLOW_elementOptions_in_token811); - elementOptions(); - state._fsp--; - if (state.failed) return t; - match(input, Token.UP, null); if (state.failed) return t; - - if ( state.backtracking==0 ) {t = c;} - } - break; - case 6 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:159:4: c= TOKEN_REF - { - c=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_token823); if (state.failed) return t; - if ( state.backtracking==0 ) {t = c;} - } - break; - - } - } - - finally { - // do for sure before leaving - } - return t; - } - // $ANTLR end "token" - - - - // $ANTLR start "elementOptions" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:162:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption )* ) ; - public final void elementOptions() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:163:5: ( ^( ELEMENT_OPTIONS ( elementOption )* ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:163:7: ^( ELEMENT_OPTIONS ( elementOption )* ) - { - match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOptions853); if (state.failed) return; - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:163:25: ( elementOption )* - loop22: - while (true) { - int alt22=2; - int LA22_0 = input.LA(1); - if ( (LA22_0==ASSIGN||LA22_0==ID) ) { - alt22=1; - } - - switch (alt22) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:163:25: elementOption - { - pushFollow(FOLLOW_elementOption_in_elementOptions855); - elementOption(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - break loop22; - } - } - - match(input, Token.UP, null); if (state.failed) return; - } - - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "elementOptions" - - - - // $ANTLR start "elementOption" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:166:1: elementOption : ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ); - public final void elementOption() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:167:5: ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ) - int alt23=5; - int LA23_0 = input.LA(1); - if ( (LA23_0==ID) ) { - alt23=1; - } - else if ( (LA23_0==ASSIGN) ) { - int LA23_2 = input.LA(2); - if ( (LA23_2==DOWN) ) { - int LA23_3 = input.LA(3); - if ( (LA23_3==ID) ) { - switch ( input.LA(4) ) { - case ID: - { - alt23=2; - } - break; - case STRING_LITERAL: - { - alt23=3; - } - break; - case ACTION: - { - alt23=4; - } - break; - case INT: - { - alt23=5; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 23, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 23, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 23, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 23, 0, input); - throw nvae; - } - - switch (alt23) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:167:7: ID - { - match(input,ID,FOLLOW_ID_in_elementOption874); if (state.failed) return; - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:168:9: ^( ASSIGN ID ID ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption885); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_elementOption887); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_elementOption889); if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:169:9: ^( ASSIGN ID STRING_LITERAL ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption901); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_elementOption903); if (state.failed) return; - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption905); if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:170:9: ^( ASSIGN ID ACTION ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption917); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_elementOption919); if (state.failed) return; - match(input,ACTION,FOLLOW_ACTION_in_elementOption921); if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 5 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:171:9: ^( ASSIGN ID INT ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption933); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_elementOption935); if (state.failed) return; - match(input,INT,FOLLOW_INT_in_elementOption937); if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - - } - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "elementOption" - - - - // $ANTLR start "element" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:174:1: element : ( atom | ^( NOT element ) | ^( RANGE atom atom ) | ^( ASSIGN ID element ) | ^( PLUS_ASSIGN ID element ) | ^( SET ( setElement )+ ) | RULE_REF | ebnf | epsilonElement ); - public final void element() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:175:2: ( atom | ^( NOT element ) | ^( RANGE atom atom ) | ^( ASSIGN ID element ) | ^( PLUS_ASSIGN ID element ) | ^( SET ( setElement )+ ) | RULE_REF | ebnf | epsilonElement ) - int alt25=9; - switch ( input.LA(1) ) { - case RULE_REF: - { - int LA25_1 = input.LA(2); - if ( (LA25_1==DOWN) ) { - alt25=1; - } - else if ( ((LA25_1 >= UP && LA25_1 <= ACTION)||LA25_1==ASSIGN||LA25_1==DOT||LA25_1==NOT||LA25_1==PLUS_ASSIGN||LA25_1==RANGE||LA25_1==RULE_REF||LA25_1==SEMPRED||LA25_1==STRING_LITERAL||LA25_1==TOKEN_REF||(LA25_1 >= BLOCK && LA25_1 <= CLOSURE)||LA25_1==EPSILON||(LA25_1 >= OPTIONAL && LA25_1 <= POSITIVE_CLOSURE)||(LA25_1 >= SET && LA25_1 <= WILDCARD)) ) { - alt25=7; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 25, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case DOT: - case STRING_LITERAL: - case TOKEN_REF: - case WILDCARD: - { - alt25=1; - } - break; - case NOT: - { - alt25=2; - } - break; - case RANGE: - { - alt25=3; - } - break; - case ASSIGN: - { - alt25=4; - } - break; - case PLUS_ASSIGN: - { - alt25=5; - } - break; - case SET: - { - alt25=6; - } - break; - case BLOCK: - case CLOSURE: - case OPTIONAL: - case POSITIVE_CLOSURE: - { - alt25=8; - } - break; - case ACTION: - case SEMPRED: - case EPSILON: - { - alt25=9; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 25, 0, input); - throw nvae; - } - switch (alt25) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:175:4: atom - { - pushFollow(FOLLOW_atom_in_element952); - atom(); - state._fsp--; - if (state.failed) return; - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:176:4: ^( NOT element ) - { - match(input,NOT,FOLLOW_NOT_in_element958); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_element_in_element960); - element(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:177:4: ^( RANGE atom atom ) - { - match(input,RANGE,FOLLOW_RANGE_in_element967); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_atom_in_element969); - atom(); - state._fsp--; - if (state.failed) return; - pushFollow(FOLLOW_atom_in_element971); - atom(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:178:4: ^( ASSIGN ID element ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_element978); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_element980); if (state.failed) return; - pushFollow(FOLLOW_element_in_element982); - element(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 5 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:179:4: ^( PLUS_ASSIGN ID element ) - { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_element989); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_element991); if (state.failed) return; - pushFollow(FOLLOW_element_in_element993); - element(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 6 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:180:7: ^( SET ( setElement )+ ) - { - match(input,SET,FOLLOW_SET_in_element1003); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:180:13: ( setElement )+ - int cnt24=0; - loop24: - while (true) { - int alt24=2; - int LA24_0 = input.LA(1); - if ( (LA24_0==STRING_LITERAL||LA24_0==TOKEN_REF) ) { - alt24=1; - } - - switch (alt24) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:180:13: setElement - { - pushFollow(FOLLOW_setElement_in_element1005); - setElement(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - if ( cnt24 >= 1 ) break loop24; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(24, input); - throw eee; - } - cnt24++; - } - - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 7 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:181:9: RULE_REF - { - match(input,RULE_REF,FOLLOW_RULE_REF_in_element1017); if (state.failed) return; - } - break; - case 8 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:182:4: ebnf - { - pushFollow(FOLLOW_ebnf_in_element1022); - ebnf(); - state._fsp--; - if (state.failed) return; - } - break; - case 9 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:183:4: epsilonElement - { - pushFollow(FOLLOW_epsilonElement_in_element1027); - epsilonElement(); - state._fsp--; - if (state.failed) return; - } - break; - - } - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "element" - - - - // $ANTLR start "epsilonElement" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:186:1: epsilonElement : ( ACTION | SEMPRED | EPSILON | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) ); - public final void epsilonElement() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:187:2: ( ACTION | SEMPRED | EPSILON | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) ) - int alt26=5; - switch ( input.LA(1) ) { - case ACTION: - { - int LA26_1 = input.LA(2); - if ( (LA26_1==DOWN) ) { - alt26=4; - } - else if ( ((LA26_1 >= UP && LA26_1 <= ACTION)||LA26_1==ASSIGN||LA26_1==DOT||LA26_1==NOT||LA26_1==PLUS_ASSIGN||LA26_1==RANGE||LA26_1==RULE_REF||LA26_1==SEMPRED||LA26_1==STRING_LITERAL||LA26_1==TOKEN_REF||(LA26_1 >= BLOCK && LA26_1 <= CLOSURE)||LA26_1==EPSILON||(LA26_1 >= OPTIONAL && LA26_1 <= POSITIVE_CLOSURE)||(LA26_1 >= SET && LA26_1 <= WILDCARD)) ) { - alt26=1; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 26, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case SEMPRED: - { - int LA26_2 = input.LA(2); - if ( (LA26_2==DOWN) ) { - alt26=5; - } - else if ( ((LA26_2 >= UP && LA26_2 <= ACTION)||LA26_2==ASSIGN||LA26_2==DOT||LA26_2==NOT||LA26_2==PLUS_ASSIGN||LA26_2==RANGE||LA26_2==RULE_REF||LA26_2==SEMPRED||LA26_2==STRING_LITERAL||LA26_2==TOKEN_REF||(LA26_2 >= BLOCK && LA26_2 <= CLOSURE)||LA26_2==EPSILON||(LA26_2 >= OPTIONAL && LA26_2 <= POSITIVE_CLOSURE)||(LA26_2 >= SET && LA26_2 <= WILDCARD)) ) { - alt26=2; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 26, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case EPSILON: - { - alt26=3; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 26, 0, input); - throw nvae; - } - switch (alt26) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:187:4: ACTION - { - match(input,ACTION,FOLLOW_ACTION_in_epsilonElement1038); if (state.failed) return; - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:188:4: SEMPRED - { - match(input,SEMPRED,FOLLOW_SEMPRED_in_epsilonElement1043); if (state.failed) return; - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:189:4: EPSILON - { - match(input,EPSILON,FOLLOW_EPSILON_in_epsilonElement1048); if (state.failed) return; - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:190:4: ^( ACTION elementOptions ) - { - match(input,ACTION,FOLLOW_ACTION_in_epsilonElement1054); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_elementOptions_in_epsilonElement1056); - elementOptions(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 5 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:191:4: ^( SEMPRED elementOptions ) - { - match(input,SEMPRED,FOLLOW_SEMPRED_in_epsilonElement1063); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_elementOptions_in_epsilonElement1065); - elementOptions(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - - } - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "epsilonElement" - - - - // $ANTLR start "setElement" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:194:1: setElement : ( ^( STRING_LITERAL elementOptions ) | ^( TOKEN_REF elementOptions ) | STRING_LITERAL | TOKEN_REF ); - public final void setElement() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:195:2: ( ^( STRING_LITERAL elementOptions ) | ^( TOKEN_REF elementOptions ) | STRING_LITERAL | TOKEN_REF ) - int alt27=4; - int LA27_0 = input.LA(1); - if ( (LA27_0==STRING_LITERAL) ) { - int LA27_1 = input.LA(2); - if ( (LA27_1==DOWN) ) { - alt27=1; - } - else if ( (LA27_1==UP||LA27_1==STRING_LITERAL||LA27_1==TOKEN_REF) ) { - alt27=3; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 27, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA27_0==TOKEN_REF) ) { - int LA27_2 = input.LA(2); - if ( (LA27_2==DOWN) ) { - alt27=2; - } - else if ( (LA27_2==UP||LA27_2==STRING_LITERAL||LA27_2==TOKEN_REF) ) { - alt27=4; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 27, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 27, 0, input); - throw nvae; - } - - switch (alt27) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:195:4: ^( STRING_LITERAL elementOptions ) - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement1078); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_elementOptions_in_setElement1080); - elementOptions(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:196:4: ^( TOKEN_REF elementOptions ) - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement1087); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_elementOptions_in_setElement1089); - elementOptions(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:197:4: STRING_LITERAL - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_setElement1095); if (state.failed) return; - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:198:4: TOKEN_REF - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_setElement1100); if (state.failed) return; - } - break; - - } - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "setElement" - - - - // $ANTLR start "ebnf" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:201:1: ebnf : ( block | ^( OPTIONAL block ) | ^( CLOSURE block ) | ^( POSITIVE_CLOSURE block ) ); - public final void ebnf() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:201:5: ( block | ^( OPTIONAL block ) | ^( CLOSURE block ) | ^( POSITIVE_CLOSURE block ) ) - int alt28=4; - switch ( input.LA(1) ) { - case BLOCK: - { - alt28=1; - } - break; - case OPTIONAL: - { - alt28=2; - } - break; - case CLOSURE: - { - alt28=3; - } - break; - case POSITIVE_CLOSURE: - { - alt28=4; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 28, 0, input); - throw nvae; - } - switch (alt28) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:201:9: block - { - pushFollow(FOLLOW_block_in_ebnf1111); - block(); - state._fsp--; - if (state.failed) return; - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:202:9: ^( OPTIONAL block ) - { - match(input,OPTIONAL,FOLLOW_OPTIONAL_in_ebnf1123); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_block_in_ebnf1125); - block(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:203:9: ^( CLOSURE block ) - { - match(input,CLOSURE,FOLLOW_CLOSURE_in_ebnf1139); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_block_in_ebnf1141); - block(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:204:9: ^( POSITIVE_CLOSURE block ) - { - match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_ebnf1155); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_block_in_ebnf1157); - block(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - - } - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "ebnf" - - - - // $ANTLR start "block" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:207:1: block : ^( BLOCK ( ACTION )? ( alternative )+ ) ; - public final void block() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:208:5: ( ^( BLOCK ( ACTION )? ( alternative )+ ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:208:7: ^( BLOCK ( ACTION )? ( alternative )+ ) - { - match(input,BLOCK,FOLLOW_BLOCK_in_block1177); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:208:15: ( ACTION )? - int alt29=2; - int LA29_0 = input.LA(1); - if ( (LA29_0==ACTION) ) { - alt29=1; - } - switch (alt29) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:208:15: ACTION - { - match(input,ACTION,FOLLOW_ACTION_in_block1179); if (state.failed) return; - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:208:23: ( alternative )+ - int cnt30=0; - loop30: - while (true) { - int alt30=2; - int LA30_0 = input.LA(1); - if ( (LA30_0==ALT) ) { - alt30=1; - } - - switch (alt30) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:208:23: alternative - { - pushFollow(FOLLOW_alternative_in_block1182); - alternative(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - if ( cnt30 >= 1 ) break loop30; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(30, input); - throw eee; - } - cnt30++; - } - - match(input, Token.UP, null); if (state.failed) return; - - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "block" - - - - // $ANTLR start "alternative" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:211:1: alternative : ^( ALT ( elementOptions )? ( element )+ ) ; - public final void alternative() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:212:2: ( ^( ALT ( elementOptions )? ( element )+ ) ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:212:4: ^( ALT ( elementOptions )? ( element )+ ) - { - match(input,ALT,FOLLOW_ALT_in_alternative1199); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:212:10: ( elementOptions )? - int alt31=2; - int LA31_0 = input.LA(1); - if ( (LA31_0==ELEMENT_OPTIONS) ) { - alt31=1; - } - switch (alt31) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:212:10: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_alternative1201); - elementOptions(); - state._fsp--; - if (state.failed) return; - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:212:26: ( element )+ - int cnt32=0; - loop32: - while (true) { - int alt32=2; - int LA32_0 = input.LA(1); - if ( (LA32_0==ACTION||LA32_0==ASSIGN||LA32_0==DOT||LA32_0==NOT||LA32_0==PLUS_ASSIGN||LA32_0==RANGE||LA32_0==RULE_REF||LA32_0==SEMPRED||LA32_0==STRING_LITERAL||LA32_0==TOKEN_REF||(LA32_0 >= BLOCK && LA32_0 <= CLOSURE)||LA32_0==EPSILON||(LA32_0 >= OPTIONAL && LA32_0 <= POSITIVE_CLOSURE)||(LA32_0 >= SET && LA32_0 <= WILDCARD)) ) { - alt32=1; - } - - switch (alt32) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:212:26: element - { - pushFollow(FOLLOW_element_in_alternative1204); - element(); - state._fsp--; - if (state.failed) return; - } - break; - - default : - if ( cnt32 >= 1 ) break loop32; - if (state.backtracking>0) {state.failed=true; return;} - EarlyExitException eee = new EarlyExitException(32, input); - throw eee; - } - cnt32++; - } - - match(input, Token.UP, null); if (state.failed) return; - - } - - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "alternative" - - - - // $ANTLR start "atom" - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:215:1: atom : ( ^( RULE_REF ( ARG_ACTION )? ( elementOptions )? ) | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( DOT ID element ) ); - public final void atom() throws RecognitionException { - try { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:216:2: ( ^( RULE_REF ( ARG_ACTION )? ( elementOptions )? ) | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( DOT ID element ) ) - int alt35=8; - switch ( input.LA(1) ) { - case RULE_REF: - { - alt35=1; - } - break; - case STRING_LITERAL: - { - int LA35_2 = input.LA(2); - if ( (LA35_2==DOWN) ) { - alt35=2; - } - else if ( ((LA35_2 >= UP && LA35_2 <= ACTION)||LA35_2==ASSIGN||LA35_2==DOT||LA35_2==NOT||LA35_2==PLUS_ASSIGN||LA35_2==RANGE||LA35_2==RULE_REF||LA35_2==SEMPRED||LA35_2==STRING_LITERAL||LA35_2==TOKEN_REF||(LA35_2 >= BLOCK && LA35_2 <= CLOSURE)||LA35_2==EPSILON||(LA35_2 >= OPTIONAL && LA35_2 <= POSITIVE_CLOSURE)||(LA35_2 >= SET && LA35_2 <= WILDCARD)) ) { - alt35=3; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 35, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case TOKEN_REF: - { - int LA35_3 = input.LA(2); - if ( (LA35_3==DOWN) ) { - alt35=4; - } - else if ( ((LA35_3 >= UP && LA35_3 <= ACTION)||LA35_3==ASSIGN||LA35_3==DOT||LA35_3==NOT||LA35_3==PLUS_ASSIGN||LA35_3==RANGE||LA35_3==RULE_REF||LA35_3==SEMPRED||LA35_3==STRING_LITERAL||LA35_3==TOKEN_REF||(LA35_3 >= BLOCK && LA35_3 <= CLOSURE)||LA35_3==EPSILON||(LA35_3 >= OPTIONAL && LA35_3 <= POSITIVE_CLOSURE)||(LA35_3 >= SET && LA35_3 <= WILDCARD)) ) { - alt35=5; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 35, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case WILDCARD: - { - int LA35_4 = input.LA(2); - if ( (LA35_4==DOWN) ) { - alt35=6; - } - else if ( ((LA35_4 >= UP && LA35_4 <= ACTION)||LA35_4==ASSIGN||LA35_4==DOT||LA35_4==NOT||LA35_4==PLUS_ASSIGN||LA35_4==RANGE||LA35_4==RULE_REF||LA35_4==SEMPRED||LA35_4==STRING_LITERAL||LA35_4==TOKEN_REF||(LA35_4 >= BLOCK && LA35_4 <= CLOSURE)||LA35_4==EPSILON||(LA35_4 >= OPTIONAL && LA35_4 <= POSITIVE_CLOSURE)||(LA35_4 >= SET && LA35_4 <= WILDCARD)) ) { - alt35=7; - } - - else { - if (state.backtracking>0) {state.failed=true; return;} - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 35, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case DOT: - { - alt35=8; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return;} - NoViableAltException nvae = - new NoViableAltException("", 35, 0, input); - throw nvae; - } - switch (alt35) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:216:4: ^( RULE_REF ( ARG_ACTION )? ( elementOptions )? ) - { - match(input,RULE_REF,FOLLOW_RULE_REF_in_atom1221); if (state.failed) return; - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); if (state.failed) return; - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:216:15: ( ARG_ACTION )? - int alt33=2; - int LA33_0 = input.LA(1); - if ( (LA33_0==ARG_ACTION) ) { - alt33=1; - } - switch (alt33) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:216:15: ARG_ACTION - { - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_atom1223); if (state.failed) return; - } - break; - - } - - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:216:27: ( elementOptions )? - int alt34=2; - int LA34_0 = input.LA(1); - if ( (LA34_0==ELEMENT_OPTIONS) ) { - alt34=1; - } - switch (alt34) { - case 1 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:216:27: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_atom1226); - elementOptions(); - state._fsp--; - if (state.failed) return; - } - break; - - } - - match(input, Token.UP, null); if (state.failed) return; - } - - } - break; - case 2 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:217:8: ^( STRING_LITERAL elementOptions ) - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_atom1238); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_elementOptions_in_atom1240); - elementOptions(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 3 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:218:4: STRING_LITERAL - { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_atom1246); if (state.failed) return; - } - break; - case 4 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:219:7: ^( TOKEN_REF elementOptions ) - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_atom1255); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_elementOptions_in_atom1257); - elementOptions(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 5 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:220:4: TOKEN_REF - { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_atom1263); if (state.failed) return; - } - break; - case 6 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:221:7: ^( WILDCARD elementOptions ) - { - match(input,WILDCARD,FOLLOW_WILDCARD_in_atom1272); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - pushFollow(FOLLOW_elementOptions_in_atom1274); - elementOptions(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - case 7 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:222:4: WILDCARD - { - match(input,WILDCARD,FOLLOW_WILDCARD_in_atom1280); if (state.failed) return; - } - break; - case 8 : - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:223:4: ^( DOT ID element ) - { - match(input,DOT,FOLLOW_DOT_in_atom1286); if (state.failed) return; - match(input, Token.DOWN, null); if (state.failed) return; - match(input,ID,FOLLOW_ID_in_atom1288); if (state.failed) return; - pushFollow(FOLLOW_element_in_atom1290); - element(); - state._fsp--; - if (state.failed) return; - match(input, Token.UP, null); if (state.failed) return; - - } - break; - - } - } - - finally { - // do for sure before leaving - } - } - // $ANTLR end "atom" - - // $ANTLR start synpred1_LeftRecursiveRuleWalker - public final void synpred1_LeftRecursiveRuleWalker_fragment() throws RecognitionException { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:114:9: ( binary ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:114:10: binary - { - pushFollow(FOLLOW_binary_in_synpred1_LeftRecursiveRuleWalker348); - binary(); - state._fsp--; - if (state.failed) return; - } - - } - // $ANTLR end synpred1_LeftRecursiveRuleWalker - - // $ANTLR start synpred2_LeftRecursiveRuleWalker - public final void synpred2_LeftRecursiveRuleWalker_fragment() throws RecognitionException { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:116:9: ( prefix ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:116:10: prefix - { - pushFollow(FOLLOW_prefix_in_synpred2_LeftRecursiveRuleWalker404); - prefix(); - state._fsp--; - if (state.failed) return; - } - - } - // $ANTLR end synpred2_LeftRecursiveRuleWalker - - // $ANTLR start synpred3_LeftRecursiveRuleWalker - public final void synpred3_LeftRecursiveRuleWalker_fragment() throws RecognitionException { - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:118:9: ( suffix ) - // org/antlr/v4/parse/LeftRecursiveRuleWalker.g:118:10: suffix - { - pushFollow(FOLLOW_suffix_in_synpred3_LeftRecursiveRuleWalker460); - suffix(); - state._fsp--; - if (state.failed) return; - } - - } - // $ANTLR end synpred3_LeftRecursiveRuleWalker - - // Delegated rules - - public final boolean synpred1_LeftRecursiveRuleWalker() { - state.backtracking++; - int start = input.mark(); - try { - synpred1_LeftRecursiveRuleWalker_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred2_LeftRecursiveRuleWalker() { - state.backtracking++; - int start = input.mark(); - try { - synpred2_LeftRecursiveRuleWalker_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred3_LeftRecursiveRuleWalker() { - state.backtracking++; - int start = input.mark(); - try { - synpred3_LeftRecursiveRuleWalker_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - - - protected DFA11 dfa11 = new DFA11(this); - protected DFA14 dfa14 = new DFA14(this); - static final String DFA11_eotS = - "\130\uffff"; - static final String DFA11_eofS = - "\130\uffff"; - static final String DFA11_minS = - "\1\4\3\2\1\uffff\2\34\2\2\1\3\1\uffff\2\4\2\111\4\2\4\3\2\2\2\3\1\2\2"+ - "\3\1\2\1\3\2\111\1\34\1\3\1\34\1\3\2\2\2\4\13\3\1\2\2\3\1\2\11\3\1\34"+ - "\1\3\1\34\1\3\2\4\20\3"; - static final String DFA11_maxS = - "\1\123\2\2\1\123\1\uffff\2\34\3\123\1\uffff\2\123\2\111\2\3\2\2\2\123"+ - "\2\34\3\123\1\34\1\2\1\3\1\34\1\2\1\3\2\111\1\34\1\123\1\34\1\123\2\2"+ - "\2\73\2\34\10\3\1\34\1\2\1\3\1\34\1\2\1\3\11\34\1\123\1\34\1\123\2\73"+ - "\10\3\10\34"; - static final String DFA11_acceptS = - "\4\uffff\1\1\5\uffff\1\2\115\uffff"; - static final String DFA11_specialS = - "\130\uffff}>"; - static final String[] DFA11_transitionS = { - "\1\4\5\uffff\1\1\11\uffff\1\4\22\uffff\1\4\6\uffff\1\2\2\uffff\1\4\4"+ - "\uffff\1\3\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\4\2\uffff\2\4\3\uffff\2\4", - "\1\5", - "\1\6", - "\1\4\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "", - "\1\13", - "\1\14", - "\1\15\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\16\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\17\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\4\2\uffff\2\4\3\uffff\2\4", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\20\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\4\2\uffff\2\4\3\uffff\2\4", - "\1\21", - "\1\22", - "\1\4\1\23", - "\1\4\1\24", - "\1\25", - "\1\26", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\40\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2"+ - "\uffff\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2"+ - "\4\2\uffff\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\41\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2"+ - "\uffff\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2"+ - "\4\2\uffff\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\42", - "\1\43", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\44", - "\1\45", - "\1\46", - "\1\47", - "\1\50", - "\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\51", - "\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\52", - "\1\53", - "\1\56\27\uffff\1\54\1\uffff\1\57\34\uffff\1\55", - "\1\62\27\uffff\1\60\1\uffff\1\63\34\uffff\1\61", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\72", - "\1\73", - "\1\74", - "\1\75", - "\1\76", - "\1\77", - "\1\100", - "\1\101", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\102", - "\1\103", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\104", - "\1\105", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\106", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\107", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\112\27\uffff\1\110\1\uffff\1\113\34\uffff\1\111", - "\1\116\27\uffff\1\114\1\uffff\1\117\34\uffff\1\115", - "\1\120", - "\1\121", - "\1\122", - "\1\123", - "\1\124", - "\1\125", - "\1\126", - "\1\127", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\71\6\uffff\1\70\21\uffff\1\67" - }; - - static final short[] DFA11_eot = DFA.unpackEncodedString(DFA11_eotS); - static final short[] DFA11_eof = DFA.unpackEncodedString(DFA11_eofS); - static final char[] DFA11_min = DFA.unpackEncodedStringToUnsignedChars(DFA11_minS); - static final char[] DFA11_max = DFA.unpackEncodedStringToUnsignedChars(DFA11_maxS); - static final short[] DFA11_accept = DFA.unpackEncodedString(DFA11_acceptS); - static final short[] DFA11_special = DFA.unpackEncodedString(DFA11_specialS); - static final short[][] DFA11_transition; - - static { - int numStates = DFA11_transitionS.length; - DFA11_transition = new short[numStates][]; - for (int i=0; i"; - static final String[] DFA14_transitionS = { - "\1\4\5\uffff\1\1\11\uffff\1\4\22\uffff\1\4\6\uffff\1\2\2\uffff\1\4\4"+ - "\uffff\1\3\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\4\2\uffff\2\4\3\uffff\2\4", - "\1\5", - "\1\6", - "\1\4\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "", - "\1\13", - "\1\14", - "\1\15\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\16\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\17\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\4\2\uffff\2\4\3\uffff\2\4", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\20\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\4\2\uffff\2\4\3\uffff\2\4", - "\1\21", - "\1\22", - "\1\4\1\23", - "\1\4\1\24", - "\1\25", - "\1\26", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\40\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2"+ - "\uffff\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2"+ - "\4\2\uffff\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\41\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2"+ - "\uffff\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2"+ - "\4\2\uffff\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\42", - "\1\43", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\44", - "\1\45", - "\1\46", - "\1\47", - "\1\50", - "\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\51", - "\1\12\1\7\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\10\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\11\2\uffff\2\4\3\uffff\2\4", - "\1\52", - "\1\53", - "\1\56\27\uffff\1\54\1\uffff\1\57\34\uffff\1\55", - "\1\62\27\uffff\1\60\1\uffff\1\63\34\uffff\1\61", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\72", - "\1\73", - "\1\74", - "\1\75", - "\1\76", - "\1\77", - "\1\100", - "\1\101", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\102", - "\1\103", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\104", - "\1\105", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\34\6\uffff\1\33\21\uffff\1\32", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\37\6\uffff\1\36\21\uffff\1\35", - "\1\106", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\107", - "\1\12\1\27\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff"+ - "\1\4\4\uffff\1\4\1\uffff\1\30\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff"+ - "\1\31\2\uffff\2\4\3\uffff\2\4", - "\1\112\27\uffff\1\110\1\uffff\1\113\34\uffff\1\111", - "\1\116\27\uffff\1\114\1\uffff\1\117\34\uffff\1\115", - "\1\120", - "\1\121", - "\1\122", - "\1\123", - "\1\124", - "\1\125", - "\1\126", - "\1\127", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\66\6\uffff\1\65\21\uffff\1\64", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\71\6\uffff\1\70\21\uffff\1\67", - "\1\71\6\uffff\1\70\21\uffff\1\67" - }; - - static final short[] DFA14_eot = DFA.unpackEncodedString(DFA14_eotS); - static final short[] DFA14_eof = DFA.unpackEncodedString(DFA14_eofS); - static final char[] DFA14_min = DFA.unpackEncodedStringToUnsignedChars(DFA14_minS); - static final char[] DFA14_max = DFA.unpackEncodedStringToUnsignedChars(DFA14_maxS); - static final short[] DFA14_accept = DFA.unpackEncodedString(DFA14_acceptS); - static final short[] DFA14_special = DFA.unpackEncodedString(DFA14_specialS); - static final short[][] DFA14_transition; - - static { - int numStates = DFA14_transitionS.length; - DFA14_transition = new short[numStates][]; - for (int i=0; i", "", "", "", "ACTION", "ACTION_CHAR_LITERAL", - "ACTION_ESC", "ACTION_STRING_LITERAL", "ARG_ACTION", "ARG_OR_CHARSET", - "ASSIGN", "AT", "CATCH", "CHANNELS", "COLON", "COLONCOLON", "COMMA", "COMMENT", - "DOC_COMMENT", "DOLLAR", "DOT", "ERRCHAR", "ESC_SEQ", "FINALLY", "FRAGMENT", - "GRAMMAR", "GT", "HEX_DIGIT", "ID", "IMPORT", "INT", "LEXER", "LEXER_CHAR_SET", - "LOCALS", "LPAREN", "LT", "MODE", "NESTED_ACTION", "NLCHARS", "NOT", "NameChar", - "NameStartChar", "OPTIONS", "OR", "PARSER", "PLUS", "PLUS_ASSIGN", "POUND", - "QUESTION", "RANGE", "RARROW", "RBRACE", "RETURNS", "RPAREN", "RULE_REF", - "SEMI", "SEMPRED", "SRC", "STAR", "STRING_LITERAL", "THROWS", "TOKENS_SPEC", - "TOKEN_REF", "UNICODE_ESC", "UNICODE_EXTENDED_ESC", "UnicodeBOM", "WS", - "WSCHARS", "WSNLCHARS", "ALT", "BLOCK", "CLOSURE", "COMBINED", "ELEMENT_OPTIONS", - "EPSILON", "LEXER_ACTION_CALL", "LEXER_ALT_ACTION", "OPTIONAL", "POSITIVE_CLOSURE", - "RULE", "RULEMODIFIERS", "RULES", "SET", "WILDCARD" - }; - public static final int EOF=-1; - public static final int ACTION=4; - public static final int ACTION_CHAR_LITERAL=5; - public static final int ACTION_ESC=6; - public static final int ACTION_STRING_LITERAL=7; - public static final int ARG_ACTION=8; - public static final int ARG_OR_CHARSET=9; - public static final int ASSIGN=10; - public static final int AT=11; - public static final int CATCH=12; - public static final int CHANNELS=13; - public static final int COLON=14; - public static final int COLONCOLON=15; - public static final int COMMA=16; - public static final int COMMENT=17; - public static final int DOC_COMMENT=18; - public static final int DOLLAR=19; - public static final int DOT=20; - public static final int ERRCHAR=21; - public static final int ESC_SEQ=22; - public static final int FINALLY=23; - public static final int FRAGMENT=24; - public static final int GRAMMAR=25; - public static final int GT=26; - public static final int HEX_DIGIT=27; - public static final int ID=28; - public static final int IMPORT=29; - public static final int INT=30; - public static final int LEXER=31; - public static final int LEXER_CHAR_SET=32; - public static final int LOCALS=33; - public static final int LPAREN=34; - public static final int LT=35; - public static final int MODE=36; - public static final int NESTED_ACTION=37; - public static final int NLCHARS=38; - public static final int NOT=39; - public static final int NameChar=40; - public static final int NameStartChar=41; - public static final int OPTIONS=42; - public static final int OR=43; - public static final int PARSER=44; - public static final int PLUS=45; - public static final int PLUS_ASSIGN=46; - public static final int POUND=47; - public static final int QUESTION=48; - public static final int RANGE=49; - public static final int RARROW=50; - public static final int RBRACE=51; - public static final int RETURNS=52; - public static final int RPAREN=53; - public static final int RULE_REF=54; - public static final int SEMI=55; - public static final int SEMPRED=56; - public static final int SRC=57; - public static final int STAR=58; - public static final int STRING_LITERAL=59; - public static final int THROWS=60; - public static final int TOKENS_SPEC=61; - public static final int TOKEN_REF=62; - public static final int UNICODE_ESC=63; - public static final int UNICODE_EXTENDED_ESC=64; - public static final int UnicodeBOM=65; - public static final int WS=66; - public static final int WSCHARS=67; - public static final int WSNLCHARS=68; - public static final int ALT=69; - public static final int BLOCK=70; - public static final int CLOSURE=71; - public static final int COMBINED=72; - public static final int ELEMENT_OPTIONS=73; - public static final int EPSILON=74; - public static final int LEXER_ACTION_CALL=75; - public static final int LEXER_ALT_ACTION=76; - public static final int OPTIONAL=77; - public static final int POSITIVE_CLOSURE=78; - public static final int RULE=79; - public static final int RULEMODIFIERS=80; - public static final int RULES=81; - public static final int SET=82; - public static final int WILDCARD=83; - - // delegates - public TreeParser[] getDelegates() { - return new TreeParser[] {}; - } - - // delegators - - - public SourceGenTriggers(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public SourceGenTriggers(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - @Override public String[] getTokenNames() { return SourceGenTriggers.tokenNames; } - @Override public String getGrammarFileName() { return "./SourceGenTriggers.g"; } - - - public OutputModelController controller; - public boolean hasLookaheadBlock; - public SourceGenTriggers(TreeNodeStream input, OutputModelController controller) { - this(input); - this.controller = controller; - } - - - - // $ANTLR start "dummy" - // ./SourceGenTriggers.g:59:1: dummy : block[null, null] ; - public final void dummy() throws RecognitionException { - try { - // ./SourceGenTriggers.g:59:7: ( block[null, null] ) - // ./SourceGenTriggers.g:59:9: block[null, null] - { - pushFollow(FOLLOW_block_in_dummy61); - block(null, null); - state._fsp--; - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "dummy" - - - - // $ANTLR start "block" - // ./SourceGenTriggers.g:61:1: block[GrammarAST label, GrammarAST ebnfRoot] returns [List omos] : ^(blk= BLOCK ( ^( OPTIONS ( . )+ ) )? ( alternative )+ ) ; - public final List block(GrammarAST label, GrammarAST ebnfRoot) throws RecognitionException { - List omos = null; - - - GrammarAST blk=null; - TreeRuleReturnScope alternative1 =null; - - try { - // ./SourceGenTriggers.g:62:5: ( ^(blk= BLOCK ( ^( OPTIONS ( . )+ ) )? ( alternative )+ ) ) - // ./SourceGenTriggers.g:62:7: ^(blk= BLOCK ( ^( OPTIONS ( . )+ ) )? ( alternative )+ ) - { - blk=(GrammarAST)match(input,BLOCK,FOLLOW_BLOCK_in_block84); - match(input, Token.DOWN, null); - // ./SourceGenTriggers.g:62:20: ( ^( OPTIONS ( . )+ ) )? - int alt2=2; - int LA2_0 = input.LA(1); - if ( (LA2_0==OPTIONS) ) { - alt2=1; - } - switch (alt2) { - case 1 : - // ./SourceGenTriggers.g:62:21: ^( OPTIONS ( . )+ ) - { - match(input,OPTIONS,FOLLOW_OPTIONS_in_block88); - match(input, Token.DOWN, null); - // ./SourceGenTriggers.g:62:31: ( . )+ - int cnt1=0; - loop1: - while (true) { - int alt1=2; - int LA1_0 = input.LA(1); - if ( ((LA1_0 >= ACTION && LA1_0 <= WILDCARD)) ) { - alt1=1; - } - else if ( (LA1_0==UP) ) { - alt1=2; - } - - switch (alt1) { - case 1 : - // ./SourceGenTriggers.g:62:31: . - { - matchAny(input); - } - break; - - default : - if ( cnt1 >= 1 ) break loop1; - EarlyExitException eee = new EarlyExitException(1, input); - throw eee; - } - cnt1++; - } - - match(input, Token.UP, null); - - } - break; - - } - - List alts = new ArrayList(); - // ./SourceGenTriggers.g:64:7: ( alternative )+ - int cnt3=0; - loop3: - while (true) { - int alt3=2; - int LA3_0 = input.LA(1); - if ( (LA3_0==ALT) ) { - alt3=1; - } - - switch (alt3) { - case 1 : - // ./SourceGenTriggers.g:64:9: alternative - { - pushFollow(FOLLOW_alternative_in_block109); - alternative1=alternative(); - state._fsp--; - - alts.add((alternative1!=null?((SourceGenTriggers.alternative_return)alternative1).altCodeBlock:null)); - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } - - match(input, Token.UP, null); - - - if ( alts.size()==1 && ebnfRoot==null) return alts; - if ( ebnfRoot==null ) { - omos = DefaultOutputModelFactory.list(controller.getChoiceBlock((BlockAST)blk, alts, label)); - } - else { - Choice choice = controller.getEBNFBlock(ebnfRoot, alts); - hasLookaheadBlock |= choice instanceof PlusBlock || choice instanceof StarBlock; - omos = DefaultOutputModelFactory.list(choice); - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "block" - - - public static class alternative_return extends TreeRuleReturnScope { - public CodeBlockForAlt altCodeBlock; - public List ops; - }; - - - // $ANTLR start "alternative" - // ./SourceGenTriggers.g:79:1: alternative returns [CodeBlockForAlt altCodeBlock, List ops] : a= alt[outerMost] ; - public final SourceGenTriggers.alternative_return alternative() throws RecognitionException { - SourceGenTriggers.alternative_return retval = new SourceGenTriggers.alternative_return(); - retval.start = input.LT(1); - - TreeRuleReturnScope a =null; - - - boolean outerMost = inContext("RULE BLOCK"); - - try { - // ./SourceGenTriggers.g:86:5: (a= alt[outerMost] ) - // ./SourceGenTriggers.g:86:7: a= alt[outerMost] - { - pushFollow(FOLLOW_alt_in_alternative161); - a=alt(outerMost); - state._fsp--; - - retval.altCodeBlock =(a!=null?((SourceGenTriggers.alt_return)a).altCodeBlock:null); retval.ops =(a!=null?((SourceGenTriggers.alt_return)a).ops:null); - } - - - controller.finishAlternative(retval.altCodeBlock, retval.ops, outerMost); - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "alternative" - - - public static class alt_return extends TreeRuleReturnScope { - public CodeBlockForAlt altCodeBlock; - public List ops; - }; - - - // $ANTLR start "alt" - // ./SourceGenTriggers.g:89:1: alt[boolean outerMost] returns [CodeBlockForAlt altCodeBlock, List ops] : ( ^( ALT ( elementOptions )? ( element )+ ) | ^( ALT ( elementOptions )? EPSILON ) ); - public final SourceGenTriggers.alt_return alt(boolean outerMost) throws RecognitionException { - SourceGenTriggers.alt_return retval = new SourceGenTriggers.alt_return(); - retval.start = input.LT(1); - - List element2 =null; - - - // set alt if outer ALT only (the only ones with alt field set to Alternative object) - AltAST altAST = (AltAST)retval.start; - if ( outerMost ) controller.setCurrentOuterMostAlt(altAST.alt); - - try { - // ./SourceGenTriggers.g:95:2: ( ^( ALT ( elementOptions )? ( element )+ ) | ^( ALT ( elementOptions )? EPSILON ) ) - int alt7=2; - alt7 = dfa7.predict(input); - switch (alt7) { - case 1 : - // ./SourceGenTriggers.g:95:4: ^( ALT ( elementOptions )? ( element )+ ) - { - - List elems = new ArrayList(); - // TODO: shouldn't we pass ((GrammarAST)retval.start) to controller.alternative()? - retval.altCodeBlock = controller.alternative(controller.getCurrentOuterMostAlt(), outerMost); - retval.altCodeBlock.ops = retval.ops = elems; - controller.setCurrentBlock(retval.altCodeBlock); - - match(input,ALT,FOLLOW_ALT_in_alt191); - match(input, Token.DOWN, null); - // ./SourceGenTriggers.g:102:10: ( elementOptions )? - int alt4=2; - int LA4_0 = input.LA(1); - if ( (LA4_0==ELEMENT_OPTIONS) ) { - alt4=1; - } - switch (alt4) { - case 1 : - // ./SourceGenTriggers.g:102:10: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_alt193); - elementOptions(); - state._fsp--; - - } - break; - - } - - // ./SourceGenTriggers.g:102:26: ( element )+ - int cnt5=0; - loop5: - while (true) { - int alt5=2; - int LA5_0 = input.LA(1); - if ( (LA5_0==ACTION||LA5_0==ASSIGN||LA5_0==DOT||LA5_0==NOT||LA5_0==PLUS_ASSIGN||LA5_0==RANGE||LA5_0==RULE_REF||LA5_0==SEMPRED||LA5_0==STRING_LITERAL||LA5_0==TOKEN_REF||(LA5_0 >= BLOCK && LA5_0 <= CLOSURE)||(LA5_0 >= OPTIONAL && LA5_0 <= POSITIVE_CLOSURE)||(LA5_0 >= SET && LA5_0 <= WILDCARD)) ) { - alt5=1; - } - - switch (alt5) { - case 1 : - // ./SourceGenTriggers.g:102:28: element - { - pushFollow(FOLLOW_element_in_alt198); - element2=element(); - state._fsp--; - - if (element2!=null) elems.addAll(element2); - } - break; - - default : - if ( cnt5 >= 1 ) break loop5; - EarlyExitException eee = new EarlyExitException(5, input); - throw eee; - } - cnt5++; - } - - match(input, Token.UP, null); - - } - break; - case 2 : - // ./SourceGenTriggers.g:104:4: ^( ALT ( elementOptions )? EPSILON ) - { - match(input,ALT,FOLLOW_ALT_in_alt212); - match(input, Token.DOWN, null); - // ./SourceGenTriggers.g:104:10: ( elementOptions )? - int alt6=2; - int LA6_0 = input.LA(1); - if ( (LA6_0==ELEMENT_OPTIONS) ) { - alt6=1; - } - switch (alt6) { - case 1 : - // ./SourceGenTriggers.g:104:10: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_alt214); - elementOptions(); - state._fsp--; - - } - break; - - } - - match(input,EPSILON,FOLLOW_EPSILON_in_alt217); - match(input, Token.UP, null); - - retval.altCodeBlock = controller.epsilon(controller.getCurrentOuterMostAlt(), outerMost); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "alt" - - - - // $ANTLR start "element" - // ./SourceGenTriggers.g:108:1: element returns [List omos] : ( labeledElement | atom[null,false] | subrule | ACTION | SEMPRED | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) ); - public final List element() throws RecognitionException { - List omos = null; - - - GrammarAST ACTION6=null; - GrammarAST SEMPRED7=null; - GrammarAST ACTION8=null; - GrammarAST SEMPRED9=null; - List labeledElement3 =null; - List atom4 =null; - List subrule5 =null; - - try { - // ./SourceGenTriggers.g:109:2: ( labeledElement | atom[null,false] | subrule | ACTION | SEMPRED | ^( ACTION elementOptions ) | ^( SEMPRED elementOptions ) ) - int alt8=7; - switch ( input.LA(1) ) { - case ASSIGN: - case PLUS_ASSIGN: - { - alt8=1; - } - break; - case DOT: - case NOT: - case RANGE: - case RULE_REF: - case STRING_LITERAL: - case TOKEN_REF: - case SET: - case WILDCARD: - { - alt8=2; - } - break; - case BLOCK: - case CLOSURE: - case OPTIONAL: - case POSITIVE_CLOSURE: - { - alt8=3; - } - break; - case ACTION: - { - int LA8_4 = input.LA(2); - if ( (LA8_4==DOWN) ) { - alt8=6; - } - else if ( ((LA8_4 >= UP && LA8_4 <= ACTION)||LA8_4==ASSIGN||LA8_4==DOT||LA8_4==NOT||LA8_4==PLUS_ASSIGN||LA8_4==RANGE||LA8_4==RULE_REF||LA8_4==SEMPRED||LA8_4==STRING_LITERAL||LA8_4==TOKEN_REF||(LA8_4 >= BLOCK && LA8_4 <= CLOSURE)||(LA8_4 >= OPTIONAL && LA8_4 <= POSITIVE_CLOSURE)||(LA8_4 >= SET && LA8_4 <= WILDCARD)) ) { - alt8=4; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 8, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case SEMPRED: - { - int LA8_5 = input.LA(2); - if ( (LA8_5==DOWN) ) { - alt8=7; - } - else if ( ((LA8_5 >= UP && LA8_5 <= ACTION)||LA8_5==ASSIGN||LA8_5==DOT||LA8_5==NOT||LA8_5==PLUS_ASSIGN||LA8_5==RANGE||LA8_5==RULE_REF||LA8_5==SEMPRED||LA8_5==STRING_LITERAL||LA8_5==TOKEN_REF||(LA8_5 >= BLOCK && LA8_5 <= CLOSURE)||(LA8_5 >= OPTIONAL && LA8_5 <= POSITIVE_CLOSURE)||(LA8_5 >= SET && LA8_5 <= WILDCARD)) ) { - alt8=5; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 8, 5, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 8, 0, input); - throw nvae; - } - switch (alt8) { - case 1 : - // ./SourceGenTriggers.g:109:4: labeledElement - { - pushFollow(FOLLOW_labeledElement_in_element246); - labeledElement3=labeledElement(); - state._fsp--; - - omos = labeledElement3; - } - break; - case 2 : - // ./SourceGenTriggers.g:110:4: atom[null,false] - { - pushFollow(FOLLOW_atom_in_element257); - atom4=atom(null, false); - state._fsp--; - - omos = atom4; - } - break; - case 3 : - // ./SourceGenTriggers.g:111:4: subrule - { - pushFollow(FOLLOW_subrule_in_element267); - subrule5=subrule(); - state._fsp--; - - omos = subrule5; - } - break; - case 4 : - // ./SourceGenTriggers.g:112:6: ACTION - { - ACTION6=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_element282); - omos = controller.action((ActionAST)ACTION6); - } - break; - case 5 : - // ./SourceGenTriggers.g:113:6: SEMPRED - { - SEMPRED7=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_element297); - omos = controller.sempred((ActionAST)SEMPRED7); - } - break; - case 6 : - // ./SourceGenTriggers.g:114:4: ^( ACTION elementOptions ) - { - ACTION8=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_element311); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_element313); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - omos = controller.action((ActionAST)ACTION8); - } - break; - case 7 : - // ./SourceGenTriggers.g:115:6: ^( SEMPRED elementOptions ) - { - SEMPRED9=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_element325); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_element327); - elementOptions(); - state._fsp--; - - match(input, Token.UP, null); - - omos = controller.sempred((ActionAST)SEMPRED9); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "element" - - - - // $ANTLR start "labeledElement" - // ./SourceGenTriggers.g:118:1: labeledElement returns [List omos] : ( ^( ASSIGN ID atom[$ID,false] ) | ^( PLUS_ASSIGN ID atom[$ID,false] ) | ^( ASSIGN ID block[$ID,null] ) | ^( PLUS_ASSIGN ID block[$ID,null] ) ); - public final List labeledElement() throws RecognitionException { - List omos = null; - - - GrammarAST ID10=null; - GrammarAST ID12=null; - GrammarAST ID14=null; - GrammarAST ID16=null; - List atom11 =null; - List atom13 =null; - List block15 =null; - List block17 =null; - - try { - // ./SourceGenTriggers.g:119:2: ( ^( ASSIGN ID atom[$ID,false] ) | ^( PLUS_ASSIGN ID atom[$ID,false] ) | ^( ASSIGN ID block[$ID,null] ) | ^( PLUS_ASSIGN ID block[$ID,null] ) ) - int alt9=4; - int LA9_0 = input.LA(1); - if ( (LA9_0==ASSIGN) ) { - int LA9_1 = input.LA(2); - if ( (LA9_1==DOWN) ) { - int LA9_3 = input.LA(3); - if ( (LA9_3==ID) ) { - int LA9_5 = input.LA(4); - if ( (LA9_5==DOT||LA9_5==NOT||LA9_5==RANGE||LA9_5==RULE_REF||LA9_5==STRING_LITERAL||LA9_5==TOKEN_REF||(LA9_5 >= SET && LA9_5 <= WILDCARD)) ) { - alt9=1; - } - else if ( (LA9_5==BLOCK) ) { - alt9=3; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 9, 5, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 9, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 9, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA9_0==PLUS_ASSIGN) ) { - int LA9_2 = input.LA(2); - if ( (LA9_2==DOWN) ) { - int LA9_4 = input.LA(3); - if ( (LA9_4==ID) ) { - int LA9_6 = input.LA(4); - if ( (LA9_6==DOT||LA9_6==NOT||LA9_6==RANGE||LA9_6==RULE_REF||LA9_6==STRING_LITERAL||LA9_6==TOKEN_REF||(LA9_6 >= SET && LA9_6 <= WILDCARD)) ) { - alt9=2; - } - else if ( (LA9_6==BLOCK) ) { - alt9=4; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 9, 6, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 9, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 9, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 9, 0, input); - throw nvae; - } - - switch (alt9) { - case 1 : - // ./SourceGenTriggers.g:119:4: ^( ASSIGN ID atom[$ID,false] ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement347); - match(input, Token.DOWN, null); - ID10=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement349); - pushFollow(FOLLOW_atom_in_labeledElement351); - atom11=atom(ID10, false); - state._fsp--; - - match(input, Token.UP, null); - - omos = atom11; - } - break; - case 2 : - // ./SourceGenTriggers.g:120:4: ^( PLUS_ASSIGN ID atom[$ID,false] ) - { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement364); - match(input, Token.DOWN, null); - ID12=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement366); - pushFollow(FOLLOW_atom_in_labeledElement368); - atom13=atom(ID12, false); - state._fsp--; - - match(input, Token.UP, null); - - omos = atom13; - } - break; - case 3 : - // ./SourceGenTriggers.g:121:4: ^( ASSIGN ID block[$ID,null] ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement379); - match(input, Token.DOWN, null); - ID14=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement381); - pushFollow(FOLLOW_block_in_labeledElement383); - block15=block(ID14, null); - state._fsp--; - - match(input, Token.UP, null); - - omos = block15; - } - break; - case 4 : - // ./SourceGenTriggers.g:122:4: ^( PLUS_ASSIGN ID block[$ID,null] ) - { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement396); - match(input, Token.DOWN, null); - ID16=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement398); - pushFollow(FOLLOW_block_in_labeledElement400); - block17=block(ID16, null); - state._fsp--; - - match(input, Token.UP, null); - - omos = block17; - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "labeledElement" - - - - // $ANTLR start "subrule" - // ./SourceGenTriggers.g:125:1: subrule returns [List omos] : ( ^( OPTIONAL b= block[null,$OPTIONAL] ) | ( ^(op= CLOSURE b= block[null,null] ) | ^(op= POSITIVE_CLOSURE b= block[null,null] ) ) | block[null, null] ); - public final List subrule() throws RecognitionException { - List omos = null; - - - GrammarAST op=null; - GrammarAST OPTIONAL18=null; - List b =null; - List block19 =null; - - try { - // ./SourceGenTriggers.g:126:2: ( ^( OPTIONAL b= block[null,$OPTIONAL] ) | ( ^(op= CLOSURE b= block[null,null] ) | ^(op= POSITIVE_CLOSURE b= block[null,null] ) ) | block[null, null] ) - int alt11=3; - switch ( input.LA(1) ) { - case OPTIONAL: - { - alt11=1; - } - break; - case CLOSURE: - case POSITIVE_CLOSURE: - { - alt11=2; - } - break; - case BLOCK: - { - alt11=3; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 11, 0, input); - throw nvae; - } - switch (alt11) { - case 1 : - // ./SourceGenTriggers.g:126:4: ^( OPTIONAL b= block[null,$OPTIONAL] ) - { - OPTIONAL18=(GrammarAST)match(input,OPTIONAL,FOLLOW_OPTIONAL_in_subrule421); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_subrule425); - b=block(null, OPTIONAL18); - state._fsp--; - - match(input, Token.UP, null); - - - omos = b; - - } - break; - case 2 : - // ./SourceGenTriggers.g:130:4: ( ^(op= CLOSURE b= block[null,null] ) | ^(op= POSITIVE_CLOSURE b= block[null,null] ) ) - { - // ./SourceGenTriggers.g:130:4: ( ^(op= CLOSURE b= block[null,null] ) | ^(op= POSITIVE_CLOSURE b= block[null,null] ) ) - int alt10=2; - int LA10_0 = input.LA(1); - if ( (LA10_0==CLOSURE) ) { - alt10=1; - } - else if ( (LA10_0==POSITIVE_CLOSURE) ) { - alt10=2; - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 10, 0, input); - throw nvae; - } - - switch (alt10) { - case 1 : - // ./SourceGenTriggers.g:130:6: ^(op= CLOSURE b= block[null,null] ) - { - op=(GrammarAST)match(input,CLOSURE,FOLLOW_CLOSURE_in_subrule441); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_subrule445); - b=block(null, null); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 2 : - // ./SourceGenTriggers.g:131:5: ^(op= POSITIVE_CLOSURE b= block[null,null] ) - { - op=(GrammarAST)match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_subrule456); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_subrule460); - b=block(null, null); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - - } - - - List alts = new ArrayList(); - SrcOp blk = b.get(0); - CodeBlockForAlt alt = new CodeBlockForAlt(controller.delegate); - alt.addOp(blk); - alts.add(alt); - SrcOp loop = controller.getEBNFBlock(op, alts); // "star it" - hasLookaheadBlock |= loop instanceof PlusBlock || loop instanceof StarBlock; - omos = DefaultOutputModelFactory.list(loop); - - } - break; - case 3 : - // ./SourceGenTriggers.g:143:5: block[null, null] - { - pushFollow(FOLLOW_block_in_subrule476); - block19=block(null, null); - state._fsp--; - - omos = block19; - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "subrule" - - - - // $ANTLR start "blockSet" - // ./SourceGenTriggers.g:146:1: blockSet[GrammarAST label, boolean invert] returns [List omos] : ^( SET ( atom[label,invert] )+ ) ; - public final List blockSet(GrammarAST label, boolean invert) throws RecognitionException { - List omos = null; - - - GrammarAST SET20=null; - - try { - // ./SourceGenTriggers.g:147:5: ( ^( SET ( atom[label,invert] )+ ) ) - // ./SourceGenTriggers.g:147:7: ^( SET ( atom[label,invert] )+ ) - { - SET20=(GrammarAST)match(input,SET,FOLLOW_SET_in_blockSet506); - match(input, Token.DOWN, null); - // ./SourceGenTriggers.g:147:13: ( atom[label,invert] )+ - int cnt12=0; - loop12: - while (true) { - int alt12=2; - int LA12_0 = input.LA(1); - if ( (LA12_0==DOT||LA12_0==NOT||LA12_0==RANGE||LA12_0==RULE_REF||LA12_0==STRING_LITERAL||LA12_0==TOKEN_REF||(LA12_0 >= SET && LA12_0 <= WILDCARD)) ) { - alt12=1; - } - - switch (alt12) { - case 1 : - // ./SourceGenTriggers.g:147:13: atom[label,invert] - { - pushFollow(FOLLOW_atom_in_blockSet508); - atom(label, invert); - state._fsp--; - - } - break; - - default : - if ( cnt12 >= 1 ) break loop12; - EarlyExitException eee = new EarlyExitException(12, input); - throw eee; - } - cnt12++; - } - - match(input, Token.UP, null); - - omos = controller.set(SET20, label, invert); - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "blockSet" - - - - // $ANTLR start "atom" - // ./SourceGenTriggers.g:160:1: atom[GrammarAST label, boolean invert] returns [List omos] : ( ^( NOT a= atom[$label, true] ) | range[label] | ^( DOT ID terminal[$label] ) | ^( DOT ID ruleref[$label] ) | ^( WILDCARD . ) | WILDCARD | terminal[label] | ruleref[label] | blockSet[$label, invert] ); - public final List atom(GrammarAST label, boolean invert) throws RecognitionException { - List omos = null; - - - GrammarAST WILDCARD22=null; - GrammarAST WILDCARD23=null; - List a =null; - List range21 =null; - List terminal24 =null; - List ruleref25 =null; - List blockSet26 =null; - - try { - // ./SourceGenTriggers.g:161:2: ( ^( NOT a= atom[$label, true] ) | range[label] | ^( DOT ID terminal[$label] ) | ^( DOT ID ruleref[$label] ) | ^( WILDCARD . ) | WILDCARD | terminal[label] | ruleref[label] | blockSet[$label, invert] ) - int alt13=9; - switch ( input.LA(1) ) { - case NOT: - { - alt13=1; - } - break; - case RANGE: - { - alt13=2; - } - break; - case DOT: - { - int LA13_3 = input.LA(2); - if ( (LA13_3==DOWN) ) { - int LA13_8 = input.LA(3); - if ( (LA13_8==ID) ) { - int LA13_11 = input.LA(4); - if ( (LA13_11==STRING_LITERAL||LA13_11==TOKEN_REF) ) { - alt13=3; - } - else if ( (LA13_11==RULE_REF) ) { - alt13=4; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 13, 11, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 13, 8, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 13, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case WILDCARD: - { - int LA13_4 = input.LA(2); - if ( (LA13_4==DOWN) ) { - alt13=5; - } - else if ( ((LA13_4 >= UP && LA13_4 <= ACTION)||LA13_4==ASSIGN||LA13_4==DOT||LA13_4==NOT||LA13_4==PLUS_ASSIGN||LA13_4==RANGE||LA13_4==RULE_REF||LA13_4==SEMPRED||LA13_4==STRING_LITERAL||LA13_4==TOKEN_REF||(LA13_4 >= BLOCK && LA13_4 <= CLOSURE)||(LA13_4 >= OPTIONAL && LA13_4 <= POSITIVE_CLOSURE)||(LA13_4 >= SET && LA13_4 <= WILDCARD)) ) { - alt13=6; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 13, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - break; - case STRING_LITERAL: - case TOKEN_REF: - { - alt13=7; - } - break; - case RULE_REF: - { - alt13=8; - } - break; - case SET: - { - alt13=9; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 13, 0, input); - throw nvae; - } - switch (alt13) { - case 1 : - // ./SourceGenTriggers.g:161:4: ^( NOT a= atom[$label, true] ) - { - match(input,NOT,FOLLOW_NOT_in_atom538); - match(input, Token.DOWN, null); - pushFollow(FOLLOW_atom_in_atom542); - a=atom(label, true); - state._fsp--; - - match(input, Token.UP, null); - - omos = a; - } - break; - case 2 : - // ./SourceGenTriggers.g:162:4: range[label] - { - pushFollow(FOLLOW_range_in_atom552); - range21=range(label); - state._fsp--; - - omos = range21; - } - break; - case 3 : - // ./SourceGenTriggers.g:163:4: ^( DOT ID terminal[$label] ) - { - match(input,DOT,FOLLOW_DOT_in_atom567); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom569); - pushFollow(FOLLOW_terminal_in_atom571); - terminal(label); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 4 : - // ./SourceGenTriggers.g:164:4: ^( DOT ID ruleref[$label] ) - { - match(input,DOT,FOLLOW_DOT_in_atom579); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom581); - pushFollow(FOLLOW_ruleref_in_atom583); - ruleref(label); - state._fsp--; - - match(input, Token.UP, null); - - } - break; - case 5 : - // ./SourceGenTriggers.g:165:7: ^( WILDCARD . ) - { - WILDCARD22=(GrammarAST)match(input,WILDCARD,FOLLOW_WILDCARD_in_atom594); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - omos = controller.wildcard(WILDCARD22, label); - } - break; - case 6 : - // ./SourceGenTriggers.g:166:7: WILDCARD - { - WILDCARD23=(GrammarAST)match(input,WILDCARD,FOLLOW_WILDCARD_in_atom613); - omos = controller.wildcard(WILDCARD23, label); - } - break; - case 7 : - // ./SourceGenTriggers.g:167:9: terminal[label] - { - pushFollow(FOLLOW_terminal_in_atom632); - terminal24=terminal(label); - state._fsp--; - - omos = terminal24; - } - break; - case 8 : - // ./SourceGenTriggers.g:168:9: ruleref[label] - { - pushFollow(FOLLOW_ruleref_in_atom649); - ruleref25=ruleref(label); - state._fsp--; - - omos = ruleref25; - } - break; - case 9 : - // ./SourceGenTriggers.g:169:4: blockSet[$label, invert] - { - pushFollow(FOLLOW_blockSet_in_atom661); - blockSet26=blockSet(label, invert); - state._fsp--; - - omos = blockSet26; - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "atom" - - - - // $ANTLR start "ruleref" - // ./SourceGenTriggers.g:172:1: ruleref[GrammarAST label] returns [List omos] : ^( RULE_REF ( ARG_ACTION )? ( elementOptions )? ) ; - public final List ruleref(GrammarAST label) throws RecognitionException { - List omos = null; - - - GrammarAST RULE_REF27=null; - GrammarAST ARG_ACTION28=null; - - try { - // ./SourceGenTriggers.g:173:5: ( ^( RULE_REF ( ARG_ACTION )? ( elementOptions )? ) ) - // ./SourceGenTriggers.g:173:7: ^( RULE_REF ( ARG_ACTION )? ( elementOptions )? ) - { - RULE_REF27=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref685); - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); - // ./SourceGenTriggers.g:173:18: ( ARG_ACTION )? - int alt14=2; - int LA14_0 = input.LA(1); - if ( (LA14_0==ARG_ACTION) ) { - alt14=1; - } - switch (alt14) { - case 1 : - // ./SourceGenTriggers.g:173:18: ARG_ACTION - { - ARG_ACTION28=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref687); - } - break; - - } - - // ./SourceGenTriggers.g:173:30: ( elementOptions )? - int alt15=2; - int LA15_0 = input.LA(1); - if ( (LA15_0==ELEMENT_OPTIONS) ) { - alt15=1; - } - switch (alt15) { - case 1 : - // ./SourceGenTriggers.g:173:30: elementOptions - { - pushFollow(FOLLOW_elementOptions_in_ruleref690); - elementOptions(); - state._fsp--; - - } - break; - - } - - match(input, Token.UP, null); - } - - omos = controller.ruleRef(RULE_REF27, label, ARG_ACTION28); - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "ruleref" - - - - // $ANTLR start "range" - // ./SourceGenTriggers.g:176:1: range[GrammarAST label] returns [List omos] : ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) ; - public final List range(GrammarAST label) throws RecognitionException { - List omos = null; - - - GrammarAST a=null; - GrammarAST b=null; - - try { - // ./SourceGenTriggers.g:177:5: ( ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) ) - // ./SourceGenTriggers.g:177:7: ^( RANGE a= STRING_LITERAL b= STRING_LITERAL ) - { - match(input,RANGE,FOLLOW_RANGE_in_range718); - match(input, Token.DOWN, null); - a=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_range722); - b=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_range726); - match(input, Token.UP, null); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "range" - - - - // $ANTLR start "terminal" - // ./SourceGenTriggers.g:180:1: terminal[GrammarAST label] returns [List omos] : ( ^( STRING_LITERAL . ) | STRING_LITERAL | ^( TOKEN_REF ARG_ACTION . ) | ^( TOKEN_REF . ) | TOKEN_REF ); - public final List terminal(GrammarAST label) throws RecognitionException { - List omos = null; - - - GrammarAST STRING_LITERAL29=null; - GrammarAST STRING_LITERAL30=null; - GrammarAST TOKEN_REF31=null; - GrammarAST ARG_ACTION32=null; - GrammarAST TOKEN_REF33=null; - GrammarAST TOKEN_REF34=null; - - try { - // ./SourceGenTriggers.g:181:5: ( ^( STRING_LITERAL . ) | STRING_LITERAL | ^( TOKEN_REF ARG_ACTION . ) | ^( TOKEN_REF . ) | TOKEN_REF ) - int alt16=5; - int LA16_0 = input.LA(1); - if ( (LA16_0==STRING_LITERAL) ) { - int LA16_1 = input.LA(2); - if ( (LA16_1==DOWN) ) { - alt16=1; - } - else if ( ((LA16_1 >= UP && LA16_1 <= ACTION)||LA16_1==ASSIGN||LA16_1==DOT||LA16_1==NOT||LA16_1==PLUS_ASSIGN||LA16_1==RANGE||LA16_1==RULE_REF||LA16_1==SEMPRED||LA16_1==STRING_LITERAL||LA16_1==TOKEN_REF||(LA16_1 >= BLOCK && LA16_1 <= CLOSURE)||(LA16_1 >= OPTIONAL && LA16_1 <= POSITIVE_CLOSURE)||(LA16_1 >= SET && LA16_1 <= WILDCARD)) ) { - alt16=2; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 16, 1, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( (LA16_0==TOKEN_REF) ) { - int LA16_2 = input.LA(2); - if ( (LA16_2==DOWN) ) { - int LA16_5 = input.LA(3); - if ( (LA16_5==ARG_ACTION) ) { - int LA16_7 = input.LA(4); - if ( ((LA16_7 >= ACTION && LA16_7 <= WILDCARD)) ) { - alt16=3; - } - else if ( ((LA16_7 >= DOWN && LA16_7 <= UP)) ) { - alt16=4; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 16, 7, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( ((LA16_5 >= ACTION && LA16_5 <= ACTION_STRING_LITERAL)||(LA16_5 >= ARG_OR_CHARSET && LA16_5 <= WILDCARD)) ) { - alt16=4; - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 16, 5, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - else if ( ((LA16_2 >= UP && LA16_2 <= ACTION)||LA16_2==ASSIGN||LA16_2==DOT||LA16_2==NOT||LA16_2==PLUS_ASSIGN||LA16_2==RANGE||LA16_2==RULE_REF||LA16_2==SEMPRED||LA16_2==STRING_LITERAL||LA16_2==TOKEN_REF||(LA16_2 >= BLOCK && LA16_2 <= CLOSURE)||(LA16_2 >= OPTIONAL && LA16_2 <= POSITIVE_CLOSURE)||(LA16_2 >= SET && LA16_2 <= WILDCARD)) ) { - alt16=5; - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 16, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 16, 0, input); - throw nvae; - } - - switch (alt16) { - case 1 : - // ./SourceGenTriggers.g:181:8: ^( STRING_LITERAL . ) - { - STRING_LITERAL29=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal751); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - omos = controller.stringRef(STRING_LITERAL29, label); - } - break; - case 2 : - // ./SourceGenTriggers.g:182:7: STRING_LITERAL - { - STRING_LITERAL30=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal766); - omos = controller.stringRef(STRING_LITERAL30, label); - } - break; - case 3 : - // ./SourceGenTriggers.g:183:7: ^( TOKEN_REF ARG_ACTION . ) - { - TOKEN_REF31=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal780); - match(input, Token.DOWN, null); - ARG_ACTION32=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_terminal782); - matchAny(input); - match(input, Token.UP, null); - - omos = controller.tokenRef(TOKEN_REF31, label, ARG_ACTION32); - } - break; - case 4 : - // ./SourceGenTriggers.g:184:7: ^( TOKEN_REF . ) - { - TOKEN_REF33=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal796); - match(input, Token.DOWN, null); - matchAny(input); - match(input, Token.UP, null); - - omos = controller.tokenRef(TOKEN_REF33, label, null); - } - break; - case 5 : - // ./SourceGenTriggers.g:185:7: TOKEN_REF - { - TOKEN_REF34=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal812); - omos = controller.tokenRef(TOKEN_REF34, label, null); - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - return omos; - } - // $ANTLR end "terminal" - - - - // $ANTLR start "elementOptions" - // ./SourceGenTriggers.g:188:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption )+ ) ; - public final void elementOptions() throws RecognitionException { - try { - // ./SourceGenTriggers.g:189:5: ( ^( ELEMENT_OPTIONS ( elementOption )+ ) ) - // ./SourceGenTriggers.g:189:7: ^( ELEMENT_OPTIONS ( elementOption )+ ) - { - match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOptions836); - match(input, Token.DOWN, null); - // ./SourceGenTriggers.g:189:25: ( elementOption )+ - int cnt17=0; - loop17: - while (true) { - int alt17=2; - int LA17_0 = input.LA(1); - if ( (LA17_0==ASSIGN||LA17_0==ID) ) { - alt17=1; - } - - switch (alt17) { - case 1 : - // ./SourceGenTriggers.g:189:25: elementOption - { - pushFollow(FOLLOW_elementOption_in_elementOptions838); - elementOption(); - state._fsp--; - - } - break; - - default : - if ( cnt17 >= 1 ) break loop17; - EarlyExitException eee = new EarlyExitException(17, input); - throw eee; - } - cnt17++; - } - - match(input, Token.UP, null); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "elementOptions" - - - - // $ANTLR start "elementOption" - // ./SourceGenTriggers.g:192:1: elementOption : ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ); - public final void elementOption() throws RecognitionException { - try { - // ./SourceGenTriggers.g:193:5: ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) | ^( ASSIGN ID ACTION ) | ^( ASSIGN ID INT ) ) - int alt18=5; - int LA18_0 = input.LA(1); - if ( (LA18_0==ID) ) { - alt18=1; - } - else if ( (LA18_0==ASSIGN) ) { - int LA18_2 = input.LA(2); - if ( (LA18_2==DOWN) ) { - int LA18_3 = input.LA(3); - if ( (LA18_3==ID) ) { - switch ( input.LA(4) ) { - case ID: - { - alt18=2; - } - break; - case STRING_LITERAL: - { - alt18=3; - } - break; - case ACTION: - { - alt18=4; - } - break; - case INT: - { - alt18=5; - } - break; - default: - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 18, 4, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - } - - else { - int nvaeMark = input.mark(); - try { - for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { - input.consume(); - } - NoViableAltException nvae = - new NoViableAltException("", 18, 3, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - int nvaeMark = input.mark(); - try { - input.consume(); - NoViableAltException nvae = - new NoViableAltException("", 18, 2, input); - throw nvae; - } finally { - input.rewind(nvaeMark); - } - } - - } - - else { - NoViableAltException nvae = - new NoViableAltException("", 18, 0, input); - throw nvae; - } - - switch (alt18) { - case 1 : - // ./SourceGenTriggers.g:193:7: ID - { - match(input,ID,FOLLOW_ID_in_elementOption857); - } - break; - case 2 : - // ./SourceGenTriggers.g:194:9: ^( ASSIGN ID ID ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption868); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption870); - match(input,ID,FOLLOW_ID_in_elementOption872); - match(input, Token.UP, null); - - } - break; - case 3 : - // ./SourceGenTriggers.g:195:9: ^( ASSIGN ID STRING_LITERAL ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption884); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption886); - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption888); - match(input, Token.UP, null); - - } - break; - case 4 : - // ./SourceGenTriggers.g:196:9: ^( ASSIGN ID ACTION ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption900); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption902); - match(input,ACTION,FOLLOW_ACTION_in_elementOption904); - match(input, Token.UP, null); - - } - break; - case 5 : - // ./SourceGenTriggers.g:197:9: ^( ASSIGN ID INT ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption916); - match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption918); - match(input,INT,FOLLOW_INT_in_elementOption920); - match(input, Token.UP, null); - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - // do for sure before leaving - } - } - // $ANTLR end "elementOption" - - // Delegated rules - - - protected DFA7 dfa7 = new DFA7(this); - static final String DFA7_eotS = - "\24\uffff"; - static final String DFA7_eofS = - "\24\uffff"; - static final String DFA7_minS = - "\1\105\1\2\1\4\1\2\2\uffff\1\12\1\3\1\2\1\4\1\34\1\4\10\3"; - static final String DFA7_maxS = - "\1\105\1\2\1\123\1\2\2\uffff\2\34\1\2\1\123\1\34\1\73\4\3\4\34"; - static final String DFA7_acceptS = - "\4\uffff\1\1\1\2\16\uffff"; - static final String DFA7_specialS = - "\24\uffff}>"; - static final String[] DFA7_transitionS = { - "\1\1", - "\1\2", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\4\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\1\uffff\1"+ - "\3\1\5\2\uffff\2\4\3\uffff\2\4", - "\1\6", - "", - "", - "\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\12", - "\1\4\5\uffff\1\4\11\uffff\1\4\22\uffff\1\4\6\uffff\1\4\2\uffff\1\4\4"+ - "\uffff\1\4\1\uffff\1\4\2\uffff\1\4\2\uffff\1\4\7\uffff\2\4\2\uffff\1"+ - "\5\2\uffff\2\4\3\uffff\2\4", - "\1\13", - "\1\16\27\uffff\1\14\1\uffff\1\17\34\uffff\1\15", - "\1\20", - "\1\21", - "\1\22", - "\1\23", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7", - "\1\11\6\uffff\1\10\21\uffff\1\7" - }; - - static final short[] DFA7_eot = DFA.unpackEncodedString(DFA7_eotS); - static final short[] DFA7_eof = DFA.unpackEncodedString(DFA7_eofS); - static final char[] DFA7_min = DFA.unpackEncodedStringToUnsignedChars(DFA7_minS); - static final char[] DFA7_max = DFA.unpackEncodedStringToUnsignedChars(DFA7_maxS); - static final short[] DFA7_accept = DFA.unpackEncodedString(DFA7_acceptS); - static final short[] DFA7_special = DFA.unpackEncodedString(DFA7_specialS); - static final short[][] DFA7_transition; - - static { - int numStates = DFA7_transitionS.length; - DFA7_transition = new short[numStates][]; - for (int i=0; i ops] : ( ^( ALT ( elementOptions )? ( element )+ ) | ^( ALT ( elementOptions )? EPSILON ) );"; - } - } - - public static final BitSet FOLLOW_block_in_dummy61 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_BLOCK_in_block84 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_OPTIONS_in_block88 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_alternative_in_block109 = new BitSet(new long[]{0x0000000000000008L,0x0000000000000020L}); - public static final BitSet FOLLOW_alt_in_alternative161 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ALT_in_alt191 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_alt193 = new BitSet(new long[]{0x4942408000100410L,0x00000000000C60C0L}); - public static final BitSet FOLLOW_element_in_alt198 = new BitSet(new long[]{0x4942408000100418L,0x00000000000C60C0L}); - public static final BitSet FOLLOW_ALT_in_alt212 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_alt214 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); - public static final BitSet FOLLOW_EPSILON_in_alt217 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_labeledElement_in_element246 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_atom_in_element257 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_subrule_in_element267 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ACTION_in_element282 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_SEMPRED_in_element297 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ACTION_in_element311 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_element313 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_SEMPRED_in_element325 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_element327 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_labeledElement347 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_labeledElement349 = new BitSet(new long[]{0x4842008000100000L,0x00000000000C0000L}); - public static final BitSet FOLLOW_atom_in_labeledElement351 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_PLUS_ASSIGN_in_labeledElement364 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_labeledElement366 = new BitSet(new long[]{0x4842008000100000L,0x00000000000C0000L}); - public static final BitSet FOLLOW_atom_in_labeledElement368 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_labeledElement379 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_labeledElement381 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000040L}); - public static final BitSet FOLLOW_block_in_labeledElement383 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_PLUS_ASSIGN_in_labeledElement396 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_labeledElement398 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000040L}); - public static final BitSet FOLLOW_block_in_labeledElement400 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_OPTIONAL_in_subrule421 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_block_in_subrule425 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_CLOSURE_in_subrule441 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_block_in_subrule445 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_POSITIVE_CLOSURE_in_subrule456 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_block_in_subrule460 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_block_in_subrule476 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_SET_in_blockSet506 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_atom_in_blockSet508 = new BitSet(new long[]{0x4842008000100008L,0x00000000000C0000L}); - public static final BitSet FOLLOW_NOT_in_atom538 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_atom_in_atom542 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_range_in_atom552 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_DOT_in_atom567 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_atom569 = new BitSet(new long[]{0x4800000000000000L}); - public static final BitSet FOLLOW_terminal_in_atom571 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_DOT_in_atom579 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_atom581 = new BitSet(new long[]{0x0040000000000000L}); - public static final BitSet FOLLOW_ruleref_in_atom583 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_WILDCARD_in_atom594 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_WILDCARD_in_atom613 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_terminal_in_atom632 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleref_in_atom649 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_blockSet_in_atom661 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_REF_in_ruleref685 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ARG_ACTION_in_ruleref687 = new BitSet(new long[]{0x0000000000000008L,0x0000000000000200L}); - public static final BitSet FOLLOW_elementOptions_in_ruleref690 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RANGE_in_range718 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_range722 = new BitSet(new long[]{0x0800000000000000L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_range726 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_terminal751 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_terminal766 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_TOKEN_REF_in_terminal780 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ARG_ACTION_in_terminal782 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x00000000000FFFFFL}); - public static final BitSet FOLLOW_TOKEN_REF_in_terminal796 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_TOKEN_REF_in_terminal812 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ELEMENT_OPTIONS_in_elementOptions836 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOption_in_elementOptions838 = new BitSet(new long[]{0x0000000010000408L}); - public static final BitSet FOLLOW_ID_in_elementOption857 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption868 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption870 = new BitSet(new long[]{0x0000000010000000L}); - public static final BitSet FOLLOW_ID_in_elementOption872 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption884 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption886 = new BitSet(new long[]{0x0800000000000000L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_elementOption888 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption900 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption902 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_ACTION_in_elementOption904 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption916 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption918 = new BitSet(new long[]{0x0000000040000000L}); - public static final BitSet FOLLOW_INT_in_elementOption920 = new BitSet(new long[]{0x0000000000000008L}); -} diff --git a/src/types.ts b/src/types.ts index 75050fb..9500c2d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -15,6 +15,7 @@ import type { Grammar } from "./tool/Grammar.js"; import type { GrammarParserInterpreter } from "./tool/GrammarParserInterpreter.js"; import type { LexerGrammar } from "./tool/LexerGrammar.js"; import type { Rule } from "./tool/Rule.js"; +import type { CommonTree } from "./tree/CommonTree.js"; export interface IAlternative extends Alternative { } @@ -37,3 +38,10 @@ export interface IParserATNFactory extends ParserATNFactory { } export interface IGrammarParserInterpreter extends GrammarParserInterpreter { } export interface ICodeBlockForOuterMostAlt extends CodeBlockForOuterMostAlt { } + +/** The result from tree walker rules. */ +export interface ITreeRuleReturnScope { + /** First node or root node of tree matched for this rule. */ + start?: CommonTree; + tree?: T; +}