From 981aff4132acf5bd0fa473de827b1cba6b163936 Mon Sep 17 00:00:00 2001 From: parrt Date: Tue, 21 Jun 2011 12:03:24 -0800 Subject: [PATCH] kill [git-p4: depot-paths = "//depot/code/antlr4/main/": change = 8694] --- .../v4/semantics/BasicSemanticTriggers.java | 1866 -------------- .../antlr/v4/semantics/CollectSymbols.java | 2296 ----------------- 2 files changed, 4162 deletions(-) delete mode 100644 tool/src/org/antlr/v4/semantics/BasicSemanticTriggers.java delete mode 100644 tool/src/org/antlr/v4/semantics/CollectSymbols.java diff --git a/tool/src/org/antlr/v4/semantics/BasicSemanticTriggers.java b/tool/src/org/antlr/v4/semantics/BasicSemanticTriggers.java deleted file mode 100644 index e2a06d967..000000000 --- a/tool/src/org/antlr/v4/semantics/BasicSemanticTriggers.java +++ /dev/null @@ -1,1866 +0,0 @@ -// $ANTLR 3.4 BasicSemanticTriggers.g 2011-06-20 18:47:15 - -/* - [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.semantics; -import org.antlr.v4.tool.*; - - -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; - -/** Triggers for the basic semantics of the input. Side-effects: - * Set token, block, rule options in the tree. Load field option - * with grammar options. Only legal options are set. - */ -@SuppressWarnings({"all", "warnings", "unchecked"}) -public class BasicSemanticTriggers extends TreeFilter { - public static final String[] tokenNames = new String[] { - "", "", "", "", "ACTION", "ACTION_CHAR_LITERAL", "ACTION_ESC", "ACTION_STRING_LITERAL", "ARG_ACTION", "ASSIGN", "AT", "BANG", "CATCH", "COLON", "COLONCOLON", "COMMA", "COMMENT", "DOC_COMMENT", "DOLLAR", "DOT", "DOUBLE_ANGLE_STRING_LITERAL", "DOUBLE_QUOTE_STRING_LITERAL", "ERRCHAR", "ESC_SEQ", "ETC", "FINALLY", "FORCED_ACTION", "FRAGMENT", "GRAMMAR", "GT", "HEX_DIGIT", "IMPLIES", "IMPORT", "INT", "LEXER", "LPAREN", "LT", "MODE", "NESTED_ACTION", "NLCHARS", "NOT", "OPTIONS", "OR", "PARSER", "PLUS", "PLUS_ASSIGN", "PRIVATE", "PROTECTED", "PUBLIC", "QUESTION", "RANGE", "RARROW", "RBRACE", "RETURNS", "ROOT", "RPAREN", "RULE_REF", "SCOPE", "SEMI", "SEMPRED", "SRC", "STAR", "STRING_LITERAL", "TEMPLATE", "THROWS", "TOKENS", "TOKEN_REF", "TREE", "TREE_BEGIN", "UNICODE_ESC", "WS", "WSCHARS", "WSNLCHARS", "ALT", "ALTLIST", "ALT_REWRITE", "ARG", "ARGLIST", "BACKTRACK_SEMPRED", "BLOCK", "CHAR_RANGE", "CLOSURE", "COMBINED", "ELEMENT_OPTIONS", "EPSILON", "GATED_SEMPRED", "ID", "INITACTION", "LABEL", "LIST", "OPTIONAL", "POSITIVE_CLOSURE", "RESULT", "RET", "REWRITE_BLOCK", "RULE", "RULEACTIONS", "RULEMODIFIERS", "RULES", "ST_RESULT", "SYNPRED", "SYN_SEMPRED", "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 ASSIGN=9; - public static final int AT=10; - public static final int BANG=11; - public static final int CATCH=12; - public static final int COLON=13; - public static final int COLONCOLON=14; - public static final int COMMA=15; - public static final int COMMENT=16; - public static final int DOC_COMMENT=17; - public static final int DOLLAR=18; - public static final int DOT=19; - public static final int DOUBLE_ANGLE_STRING_LITERAL=20; - public static final int DOUBLE_QUOTE_STRING_LITERAL=21; - public static final int ERRCHAR=22; - public static final int ESC_SEQ=23; - public static final int ETC=24; - public static final int FINALLY=25; - public static final int FORCED_ACTION=26; - public static final int FRAGMENT=27; - public static final int GRAMMAR=28; - public static final int GT=29; - public static final int HEX_DIGIT=30; - public static final int IMPLIES=31; - public static final int IMPORT=32; - public static final int INT=33; - public static final int LEXER=34; - public static final int LPAREN=35; - public static final int LT=36; - public static final int MODE=37; - public static final int NESTED_ACTION=38; - public static final int NLCHARS=39; - public static final int NOT=40; - public static final int OPTIONS=41; - public static final int OR=42; - public static final int PARSER=43; - public static final int PLUS=44; - public static final int PLUS_ASSIGN=45; - public static final int PRIVATE=46; - public static final int PROTECTED=47; - public static final int PUBLIC=48; - public static final int QUESTION=49; - public static final int RANGE=50; - public static final int RARROW=51; - public static final int RBRACE=52; - public static final int RETURNS=53; - public static final int ROOT=54; - public static final int RPAREN=55; - public static final int RULE_REF=56; - public static final int SCOPE=57; - public static final int SEMI=58; - public static final int SEMPRED=59; - public static final int SRC=60; - public static final int STAR=61; - public static final int STRING_LITERAL=62; - public static final int TEMPLATE=63; - public static final int THROWS=64; - public static final int TOKENS=65; - public static final int TOKEN_REF=66; - public static final int TREE=67; - public static final int TREE_BEGIN=68; - public static final int UNICODE_ESC=69; - public static final int WS=70; - public static final int WSCHARS=71; - public static final int WSNLCHARS=72; - public static final int ALT=73; - public static final int ALTLIST=74; - public static final int ALT_REWRITE=75; - public static final int ARG=76; - public static final int ARGLIST=77; - public static final int BACKTRACK_SEMPRED=78; - public static final int BLOCK=79; - public static final int CHAR_RANGE=80; - public static final int CLOSURE=81; - public static final int COMBINED=82; - public static final int ELEMENT_OPTIONS=83; - public static final int EPSILON=84; - public static final int GATED_SEMPRED=85; - public static final int ID=86; - public static final int INITACTION=87; - public static final int LABEL=88; - public static final int LIST=89; - public static final int OPTIONAL=90; - public static final int POSITIVE_CLOSURE=91; - public static final int RESULT=92; - public static final int RET=93; - public static final int REWRITE_BLOCK=94; - public static final int RULE=95; - public static final int RULEACTIONS=96; - public static final int RULEMODIFIERS=97; - public static final int RULES=98; - public static final int ST_RESULT=99; - public static final int SYNPRED=100; - public static final int SYN_SEMPRED=101; - public static final int WILDCARD=102; - - // delegates - public TreeFilter[] getDelegates() { - return new TreeFilter[] {}; - } - - // delegators - - - public BasicSemanticTriggers(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public BasicSemanticTriggers(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - public String[] getTokenNames() { return BasicSemanticTriggers.tokenNames; } - public String getGrammarFileName() { return "BasicSemanticTriggers.g"; } - - - // TODO: SHOULD we fix up grammar AST to remove errors? Like kill refs to bad rules? - // that is, rewrite tree? maybe all passes are filters until code gen, which needs - // tree grammar. 'course we won't try codegen if errors. - public String name; - GrammarASTWithOptions root; - Grammar g; // which grammar are we checking - BasicSemanticChecks checker; - public BasicSemanticTriggers(TreeNodeStream input, Grammar g) { - this(input); - this.g = g; - checker = new BasicSemanticChecks(g); - } - - - - // $ANTLR start "topdown" - // BasicSemanticTriggers.g:86:1: topdown : ( grammarSpec | rules | mode | option | rule | tokenAlias | rewrite ); - public final void topdown() throws RecognitionException { - try { - // BasicSemanticTriggers.g:87:2: ( grammarSpec | rules | mode | option | rule | tokenAlias | rewrite ) - int alt1=7; - switch ( input.LA(1) ) { - case GRAMMAR: - { - alt1=1; - } - break; - case RULES: - { - alt1=2; - } - break; - case MODE: - { - alt1=3; - } - break; - case ASSIGN: - { - int LA1_4 = input.LA(2); - - if ( (LA1_4==DOWN) ) { - int LA1_7 = input.LA(3); - - if ( (LA1_7==ID) ) { - int LA1_8 = input.LA(4); - - if ( (LA1_8==STRING_LITERAL) ) { - int LA1_9 = input.LA(5); - - if ( (LA1_9==UP) ) { - int LA1_11 = input.LA(6); - - if ( ((inContext("OPTIONS"))) ) { - alt1=4; - } - else if ( ((inContext("TOKENS"))) ) { - alt1=6; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 11, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 9, input); - - throw nvae; - - } - } - else if ( (LA1_8==INT||LA1_8==STAR||LA1_8==ID) ) { - alt1=4; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 8, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 7, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 4, input); - - throw nvae; - - } - } - break; - case RULE: - { - alt1=5; - } - break; - case RESULT: - case ST_RESULT: - { - alt1=7; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 0, input); - - throw nvae; - - } - - switch (alt1) { - case 1 : - // BasicSemanticTriggers.g:87:4: grammarSpec - { - pushFollow(FOLLOW_grammarSpec_in_topdown87); - grammarSpec(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 2 : - // BasicSemanticTriggers.g:88:4: rules - { - pushFollow(FOLLOW_rules_in_topdown92); - rules(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 3 : - // BasicSemanticTriggers.g:89:4: mode - { - pushFollow(FOLLOW_mode_in_topdown97); - mode(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 4 : - // BasicSemanticTriggers.g:90:4: option - { - pushFollow(FOLLOW_option_in_topdown102); - option(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 5 : - // BasicSemanticTriggers.g:91:4: rule - { - pushFollow(FOLLOW_rule_in_topdown107); - rule(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 6 : - // BasicSemanticTriggers.g:92:4: tokenAlias - { - pushFollow(FOLLOW_tokenAlias_in_topdown112); - tokenAlias(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 7 : - // BasicSemanticTriggers.g:93:4: rewrite - { - pushFollow(FOLLOW_rewrite_in_topdown117); - rewrite(); - - state._fsp--; - if (state.failed) return ; - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "topdown" - - - - // $ANTLR start "bottomup" - // BasicSemanticTriggers.g:96:1: bottomup : ( multiElementAltInTreeGrammar | astOps | ruleref | tokenRefWithArgs | elementOption | checkGrammarOptions | wildcardRoot ); - public final void bottomup() throws RecognitionException { - try { - // BasicSemanticTriggers.g:97:2: ( multiElementAltInTreeGrammar | astOps | ruleref | tokenRefWithArgs | elementOption | checkGrammarOptions | wildcardRoot ) - int alt2=7; - switch ( input.LA(1) ) { - case ALT: - { - alt2=1; - } - break; - case BANG: - case ROOT: - { - alt2=2; - } - break; - case RULE_REF: - { - alt2=3; - } - break; - case TOKEN_REF: - { - alt2=4; - } - break; - case ELEMENT_OPTIONS: - { - alt2=5; - } - break; - case GRAMMAR: - { - alt2=6; - } - break; - case TREE_BEGIN: - { - alt2=7; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 2, 0, input); - - throw nvae; - - } - - switch (alt2) { - case 1 : - // BasicSemanticTriggers.g:97:4: multiElementAltInTreeGrammar - { - pushFollow(FOLLOW_multiElementAltInTreeGrammar_in_bottomup129); - multiElementAltInTreeGrammar(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 2 : - // BasicSemanticTriggers.g:98:4: astOps - { - pushFollow(FOLLOW_astOps_in_bottomup134); - astOps(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 3 : - // BasicSemanticTriggers.g:99:4: ruleref - { - pushFollow(FOLLOW_ruleref_in_bottomup139); - ruleref(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 4 : - // BasicSemanticTriggers.g:100:4: tokenRefWithArgs - { - pushFollow(FOLLOW_tokenRefWithArgs_in_bottomup144); - tokenRefWithArgs(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 5 : - // BasicSemanticTriggers.g:101:4: elementOption - { - pushFollow(FOLLOW_elementOption_in_bottomup149); - elementOption(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 6 : - // BasicSemanticTriggers.g:102:4: checkGrammarOptions - { - pushFollow(FOLLOW_checkGrammarOptions_in_bottomup154); - checkGrammarOptions(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 7 : - // BasicSemanticTriggers.g:103:4: wildcardRoot - { - pushFollow(FOLLOW_wildcardRoot_in_bottomup160); - wildcardRoot(); - - state._fsp--; - if (state.failed) return ; - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "bottomup" - - - public static class grammarSpec_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "grammarSpec" - // BasicSemanticTriggers.g:106:1: grammarSpec : ^( GRAMMAR ID ( DOC_COMMENT )? prequelConstructs ^( RULES ( . )* ) ) ; - public final BasicSemanticTriggers.grammarSpec_return grammarSpec() throws RecognitionException { - BasicSemanticTriggers.grammarSpec_return retval = new BasicSemanticTriggers.grammarSpec_return(); - retval.start = input.LT(1); - - - GrammarAST ID1=null; - - try { - // BasicSemanticTriggers.g:107:5: ( ^( GRAMMAR ID ( DOC_COMMENT )? prequelConstructs ^( RULES ( . )* ) ) ) - // BasicSemanticTriggers.g:107:9: ^( GRAMMAR ID ( DOC_COMMENT )? prequelConstructs ^( RULES ( . )* ) ) - { - match(input,GRAMMAR,FOLLOW_GRAMMAR_in_grammarSpec178); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - ID1=(GrammarAST)match(input,ID,FOLLOW_ID_in_grammarSpec180); if (state.failed) return retval; - - // BasicSemanticTriggers.g:107:23: ( DOC_COMMENT )? - int alt3=2; - int LA3_0 = input.LA(1); - - if ( (LA3_0==DOC_COMMENT) ) { - alt3=1; - } - switch (alt3) { - case 1 : - // BasicSemanticTriggers.g:107:23: DOC_COMMENT - { - match(input,DOC_COMMENT,FOLLOW_DOC_COMMENT_in_grammarSpec182); if (state.failed) return retval; - - } - break; - - } - - - if ( state.backtracking==1 ) { - name = (ID1!=null?ID1.getText():null); - checker.checkGrammarName(ID1.token); - root = (GrammarRootAST)((GrammarAST)retval.start); - } - - pushFollow(FOLLOW_prequelConstructs_in_grammarSpec199); - prequelConstructs(); - - state._fsp--; - if (state.failed) return retval; - - match(input,RULES,FOLLOW_RULES_in_grammarSpec202); if (state.failed) return retval; - - if ( input.LA(1)==Token.DOWN ) { - match(input, Token.DOWN, null); if (state.failed) return retval; - // BasicSemanticTriggers.g:113:33: ( . )* - loop4: - do { - 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 : - // BasicSemanticTriggers.g:113:33: . - { - matchAny(input); if (state.failed) return retval; - - } - break; - - default : - break loop4; - } - } while (true); - - - match(input, Token.UP, null); if (state.failed) return retval; - } - - - match(input, Token.UP, null); if (state.failed) return retval; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "grammarSpec" - - - - // $ANTLR start "checkGrammarOptions" - // BasicSemanticTriggers.g:117:1: checkGrammarOptions : GRAMMAR ; - public final void checkGrammarOptions() throws RecognitionException { - GrammarAST GRAMMAR2=null; - - try { - // BasicSemanticTriggers.g:118:2: ( GRAMMAR ) - // BasicSemanticTriggers.g:118:4: GRAMMAR - { - GRAMMAR2=(GrammarAST)match(input,GRAMMAR,FOLLOW_GRAMMAR_in_checkGrammarOptions225); if (state.failed) return ; - - if ( state.backtracking==1 ) {checker.checkTreeFilterOptions((GrammarRootAST)GRAMMAR2, - root.getOptions());} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "checkGrammarOptions" - - - - // $ANTLR start "prequelConstructs" - // BasicSemanticTriggers.g:130:1: prequelConstructs : ( ^(o+= OPTIONS ( . )+ ) | ^(i+= IMPORT ( delegateGrammar )+ ) | ^(t+= TOKENS ( . )+ ) )* ; - public final void prequelConstructs() throws RecognitionException { - GrammarAST o=null; - GrammarAST i=null; - GrammarAST t=null; - List list_o=null; - List list_i=null; - List list_t=null; - - try { - // BasicSemanticTriggers.g:131:2: ( ( ^(o+= OPTIONS ( . )+ ) | ^(i+= IMPORT ( delegateGrammar )+ ) | ^(t+= TOKENS ( . )+ ) )* ) - // BasicSemanticTriggers.g:131:4: ( ^(o+= OPTIONS ( . )+ ) | ^(i+= IMPORT ( delegateGrammar )+ ) | ^(t+= TOKENS ( . )+ ) )* - { - // BasicSemanticTriggers.g:131:4: ( ^(o+= OPTIONS ( . )+ ) | ^(i+= IMPORT ( delegateGrammar )+ ) | ^(t+= TOKENS ( . )+ ) )* - loop8: - do { - int alt8=4; - switch ( input.LA(1) ) { - case OPTIONS: - { - alt8=1; - } - break; - case IMPORT: - { - alt8=2; - } - break; - case TOKENS: - { - alt8=3; - } - break; - - } - - switch (alt8) { - case 1 : - // BasicSemanticTriggers.g:131:6: ^(o+= OPTIONS ( . )+ ) - { - o=(GrammarAST)match(input,OPTIONS,FOLLOW_OPTIONS_in_prequelConstructs248); if (state.failed) return ; - if (list_o==null) list_o=new ArrayList(); - list_o.add(o); - - - match(input, Token.DOWN, null); if (state.failed) return ; - // BasicSemanticTriggers.g:131:19: ( . )+ - int cnt5=0; - loop5: - do { - int alt5=2; - int LA5_0 = input.LA(1); - - if ( ((LA5_0 >= ACTION && LA5_0 <= WILDCARD)) ) { - alt5=1; - } - else if ( (LA5_0==UP) ) { - alt5=2; - } - - - switch (alt5) { - case 1 : - // BasicSemanticTriggers.g:131:19: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - if ( cnt5 >= 1 ) break loop5; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(5, input); - throw eee; - } - cnt5++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - } - break; - case 2 : - // BasicSemanticTriggers.g:132:5: ^(i+= IMPORT ( delegateGrammar )+ ) - { - i=(GrammarAST)match(input,IMPORT,FOLLOW_IMPORT_in_prequelConstructs261); if (state.failed) return ; - if (list_i==null) list_i=new ArrayList(); - list_i.add(i); - - - match(input, Token.DOWN, null); if (state.failed) return ; - // BasicSemanticTriggers.g:132:17: ( delegateGrammar )+ - int cnt6=0; - loop6: - do { - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0==ASSIGN||LA6_0==ID) ) { - alt6=1; - } - - - switch (alt6) { - case 1 : - // BasicSemanticTriggers.g:132:17: delegateGrammar - { - pushFollow(FOLLOW_delegateGrammar_in_prequelConstructs263); - delegateGrammar(); - - state._fsp--; - if (state.failed) return ; - - } - break; - - default : - if ( cnt6 >= 1 ) break loop6; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(6, input); - throw eee; - } - cnt6++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - } - break; - case 3 : - // BasicSemanticTriggers.g:133:5: ^(t+= TOKENS ( . )+ ) - { - t=(GrammarAST)match(input,TOKENS,FOLLOW_TOKENS_in_prequelConstructs274); if (state.failed) return ; - if (list_t==null) list_t=new ArrayList(); - list_t.add(t); - - - match(input, Token.DOWN, null); if (state.failed) return ; - // BasicSemanticTriggers.g:133:17: ( . )+ - int cnt7=0; - loop7: - do { - int alt7=2; - int LA7_0 = input.LA(1); - - if ( ((LA7_0 >= ACTION && LA7_0 <= WILDCARD)) ) { - alt7=1; - } - else if ( (LA7_0==UP) ) { - alt7=2; - } - - - switch (alt7) { - case 1 : - // BasicSemanticTriggers.g:133:17: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - if ( cnt7 >= 1 ) break loop7; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(7, input); - throw eee; - } - cnt7++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - } - break; - - default : - break loop8; - } - } while (true); - - - if ( state.backtracking==1 ) {checker.checkNumPrequels(list_o, list_i, list_t);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "prequelConstructs" - - - - // $ANTLR start "delegateGrammar" - // BasicSemanticTriggers.g:138:1: delegateGrammar : ( ^( ASSIGN ID id= ID ) |id= ID ) ; - public final void delegateGrammar() throws RecognitionException { - GrammarAST id=null; - - try { - // BasicSemanticTriggers.g:139:5: ( ( ^( ASSIGN ID id= ID ) |id= ID ) ) - // BasicSemanticTriggers.g:139:9: ( ^( ASSIGN ID id= ID ) |id= ID ) - { - // BasicSemanticTriggers.g:139:9: ( ^( ASSIGN ID id= ID ) |id= ID ) - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0==ASSIGN) ) { - alt9=1; - } - else if ( (LA9_0==ID) ) { - alt9=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 9, 0, input); - - throw nvae; - - } - switch (alt9) { - case 1 : - // BasicSemanticTriggers.g:139:11: ^( ASSIGN ID id= ID ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_delegateGrammar306); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - match(input,ID,FOLLOW_ID_in_delegateGrammar308); if (state.failed) return ; - - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_delegateGrammar312); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - } - break; - case 2 : - // BasicSemanticTriggers.g:140:10: id= ID - { - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_delegateGrammar326); if (state.failed) return ; - - } - break; - - } - - - if ( state.backtracking==1 ) {checker.checkImport(id.token);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "delegateGrammar" - - - - // $ANTLR start "rules" - // BasicSemanticTriggers.g:145:1: rules : RULES ; - public final void rules() throws RecognitionException { - GrammarAST RULES3=null; - - try { - // BasicSemanticTriggers.g:145:7: ( RULES ) - // BasicSemanticTriggers.g:145:9: RULES - { - RULES3=(GrammarAST)match(input,RULES,FOLLOW_RULES_in_rules353); if (state.failed) return ; - - if ( state.backtracking==1 ) {checker.checkNumRules(RULES3);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "rules" - - - - // $ANTLR start "mode" - // BasicSemanticTriggers.g:147:1: mode : ^( MODE ID ( . )* ) ; - public final void mode() throws RecognitionException { - GrammarAST ID4=null; - - try { - // BasicSemanticTriggers.g:147:6: ( ^( MODE ID ( . )* ) ) - // BasicSemanticTriggers.g:147:8: ^( MODE ID ( . )* ) - { - match(input,MODE,FOLLOW_MODE_in_mode365); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ID4=(GrammarAST)match(input,ID,FOLLOW_ID_in_mode367); if (state.failed) return ; - - // BasicSemanticTriggers.g:147:18: ( . )* - loop10: - do { - int alt10=2; - int LA10_0 = input.LA(1); - - if ( ((LA10_0 >= ACTION && LA10_0 <= WILDCARD)) ) { - alt10=1; - } - else if ( (LA10_0==UP) ) { - alt10=2; - } - - - switch (alt10) { - case 1 : - // BasicSemanticTriggers.g:147:18: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - break loop10; - } - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {checker.checkMode(ID4.token);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "mode" - - - public static class option_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "option" - // BasicSemanticTriggers.g:149:1: option :{...}? ^( ASSIGN o= ID optionValue ) ; - public final BasicSemanticTriggers.option_return option() throws RecognitionException { - BasicSemanticTriggers.option_return retval = new BasicSemanticTriggers.option_return(); - retval.start = input.LT(1); - - - GrammarAST o=null; - BasicSemanticTriggers.optionValue_return optionValue5 =null; - - - try { - // BasicSemanticTriggers.g:150:5: ({...}? ^( ASSIGN o= ID optionValue ) ) - // BasicSemanticTriggers.g:150:9: {...}? ^( ASSIGN o= ID optionValue ) - { - if ( !((inContext("OPTIONS"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "option", "inContext(\"OPTIONS\")"); - } - - match(input,ASSIGN,FOLLOW_ASSIGN_in_option392); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - o=(GrammarAST)match(input,ID,FOLLOW_ID_in_option396); if (state.failed) return retval; - - pushFollow(FOLLOW_optionValue_in_option398); - optionValue5=optionValue(); - - state._fsp--; - if (state.failed) return retval; - - match(input, Token.UP, null); if (state.failed) return retval; - - - if ( state.backtracking==1 ) { - GrammarAST parent = (GrammarAST)((GrammarAST)retval.start).getParent(); // OPTION - GrammarAST parentWithOptionKind = (GrammarAST)parent.getParent(); - boolean ok = checker.checkOptions(parentWithOptionKind, - o.token, (optionValue5!=null?optionValue5.v:null)); - // store options into XXX_GRAMMAR, RULE, BLOCK nodes - if ( ok ) { - ((GrammarASTWithOptions)parentWithOptionKind).setOption((o!=null?o.getText():null), (optionValue5!=null?optionValue5.v:null)); - } - } - - } - - } - 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" - // BasicSemanticTriggers.g:163:1: optionValue returns [String v] : ( ID | STRING_LITERAL | INT | STAR ); - public final BasicSemanticTriggers.optionValue_return optionValue() throws RecognitionException { - BasicSemanticTriggers.optionValue_return retval = new BasicSemanticTriggers.optionValue_return(); - retval.start = input.LT(1); - - - retval.v = ((GrammarAST)retval.start).token.getText(); - try { - // BasicSemanticTriggers.g:165:5: ( ID | STRING_LITERAL | INT | STAR ) - // BasicSemanticTriggers.g: - { - if ( input.LA(1)==INT||(input.LA(1) >= STAR && input.LA(1) <= STRING_LITERAL)||input.LA(1)==ID ) { - 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; - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "optionValue" - - - - // $ANTLR start "rule" - // BasicSemanticTriggers.g:171:1: rule : ^( RULE r= ID ( . )* ) ; - public final void rule() throws RecognitionException { - GrammarAST r=null; - - try { - // BasicSemanticTriggers.g:171:5: ( ^( RULE r= ID ( . )* ) ) - // BasicSemanticTriggers.g:171:9: ^( RULE r= ID ( . )* ) - { - match(input,RULE,FOLLOW_RULE_in_rule480); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - r=(GrammarAST)match(input,ID,FOLLOW_ID_in_rule484); if (state.failed) return ; - - // BasicSemanticTriggers.g:171:22: ( . )* - loop11: - do { - int alt11=2; - int LA11_0 = input.LA(1); - - if ( ((LA11_0 >= ACTION && LA11_0 <= WILDCARD)) ) { - alt11=1; - } - else if ( (LA11_0==UP) ) { - alt11=2; - } - - - switch (alt11) { - case 1 : - // BasicSemanticTriggers.g:171:22: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - break loop11; - } - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {checker.checkInvalidRuleDef(r.token);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "rule" - - - - // $ANTLR start "ruleref" - // BasicSemanticTriggers.g:174:1: ruleref : RULE_REF ; - public final void ruleref() throws RecognitionException { - GrammarAST RULE_REF6=null; - - try { - // BasicSemanticTriggers.g:175:5: ( RULE_REF ) - // BasicSemanticTriggers.g:175:7: RULE_REF - { - RULE_REF6=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref507); if (state.failed) return ; - - if ( state.backtracking==1 ) {checker.checkInvalidRuleRef(RULE_REF6.token);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "ruleref" - - - - // $ANTLR start "tokenAlias" - // BasicSemanticTriggers.g:178:1: tokenAlias :{...}? ^( ASSIGN ID STRING_LITERAL ) ; - public final void tokenAlias() throws RecognitionException { - GrammarAST ID7=null; - - try { - // BasicSemanticTriggers.g:179:2: ({...}? ^( ASSIGN ID STRING_LITERAL ) ) - // BasicSemanticTriggers.g:179:4: {...}? ^( ASSIGN ID STRING_LITERAL ) - { - if ( !((inContext("TOKENS"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "tokenAlias", "inContext(\"TOKENS\")"); - } - - match(input,ASSIGN,FOLLOW_ASSIGN_in_tokenAlias526); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ID7=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokenAlias528); if (state.failed) return ; - - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_tokenAlias530); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {checker.checkTokenAlias(ID7.token);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "tokenAlias" - - - - // $ANTLR start "tokenRefWithArgs" - // BasicSemanticTriggers.g:183:1: tokenRefWithArgs :{...}? ^( TOKEN_REF ARG_ACTION ) ; - public final void tokenRefWithArgs() throws RecognitionException { - GrammarAST TOKEN_REF8=null; - - try { - // BasicSemanticTriggers.g:184:2: ({...}? ^( TOKEN_REF ARG_ACTION ) ) - // BasicSemanticTriggers.g:184:4: {...}? ^( TOKEN_REF ARG_ACTION ) - { - if ( !((!inContext("RESULT ..."))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "tokenRefWithArgs", "!inContext(\"RESULT ...\")"); - } - - TOKEN_REF8=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenRefWithArgs555); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_tokenRefWithArgs557); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {checker.checkTokenArgs(TOKEN_REF8.token);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "tokenRefWithArgs" - - - public static class elementOption_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "elementOption" - // BasicSemanticTriggers.g:189:1: elementOption :{...}? ^( ELEMENT_OPTIONS ( ^( ASSIGN o= ID value= ID ) | ^( ASSIGN o= ID value= STRING_LITERAL ) |o= ID ) ) ; - public final BasicSemanticTriggers.elementOption_return elementOption() throws RecognitionException { - BasicSemanticTriggers.elementOption_return retval = new BasicSemanticTriggers.elementOption_return(); - retval.start = input.LT(1); - - - GrammarAST o=null; - GrammarAST value=null; - - try { - // BasicSemanticTriggers.g:190:5: ({...}? ^( ELEMENT_OPTIONS ( ^( ASSIGN o= ID value= ID ) | ^( ASSIGN o= ID value= STRING_LITERAL ) |o= ID ) ) ) - // BasicSemanticTriggers.g:190:7: {...}? ^( ELEMENT_OPTIONS ( ^( ASSIGN o= ID value= ID ) | ^( ASSIGN o= ID value= STRING_LITERAL ) |o= ID ) ) - { - if ( !((!inContext("RESULT ..."))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "elementOption", "!inContext(\"RESULT ...\")"); - } - - match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOption586); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - // BasicSemanticTriggers.g:192:7: ( ^( ASSIGN o= ID value= ID ) | ^( ASSIGN o= ID value= STRING_LITERAL ) |o= ID ) - int alt12=3; - int LA12_0 = input.LA(1); - - if ( (LA12_0==ASSIGN) ) { - int LA12_1 = input.LA(2); - - if ( (LA12_1==DOWN) ) { - int LA12_3 = input.LA(3); - - if ( (LA12_3==ID) ) { - int LA12_4 = input.LA(4); - - if ( (LA12_4==ID) ) { - alt12=1; - } - else if ( (LA12_4==STRING_LITERAL) ) { - alt12=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 12, 4, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 12, 3, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 12, 1, input); - - throw nvae; - - } - } - else if ( (LA12_0==ID) ) { - alt12=3; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 12, 0, input); - - throw nvae; - - } - switch (alt12) { - case 1 : - // BasicSemanticTriggers.g:192:9: ^( ASSIGN o= ID value= ID ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption597); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - o=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption601); if (state.failed) return retval; - - value=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption605); if (state.failed) return retval; - - match(input, Token.UP, null); if (state.failed) return retval; - - - } - break; - case 2 : - // BasicSemanticTriggers.g:193:11: ^( ASSIGN o= ID value= STRING_LITERAL ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption619); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - o=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption623); if (state.failed) return retval; - - value=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption627); if (state.failed) return retval; - - match(input, Token.UP, null); if (state.failed) return retval; - - - } - break; - case 3 : - // BasicSemanticTriggers.g:194:10: o= ID - { - o=(GrammarAST)match(input,ID,FOLLOW_ID_in_elementOption641); if (state.failed) return retval; - - } - break; - - } - - - match(input, Token.UP, null); if (state.failed) return retval; - - - if ( state.backtracking==1 ) { - boolean ok = checker.checkTokenOptions((GrammarAST)o.getParent(), - o.token, (value!=null?value.getText():null)); - if ( ok ) { - if ( value!=null ) { - TerminalAST terminal = (TerminalAST)((GrammarAST)retval.start).getParent(); - terminal.setOption((o!=null?o.getText():null), (value!=null?value.getText():null)); - } - else { - TerminalAST terminal = (TerminalAST)((GrammarAST)retval.start).getParent(); - terminal.setOption(TerminalAST.defaultTokenOption, (o!=null?o.getText():null)); - } - } - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "elementOption" - - - public static class multiElementAltInTreeGrammar_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "multiElementAltInTreeGrammar" - // BasicSemanticTriggers.g:214:1: multiElementAltInTreeGrammar :{...}? ^( ALT ~ ( SEMPRED | ACTION ) (~ ( SEMPRED | ACTION ) )+ ) ; - public final BasicSemanticTriggers.multiElementAltInTreeGrammar_return multiElementAltInTreeGrammar() throws RecognitionException { - BasicSemanticTriggers.multiElementAltInTreeGrammar_return retval = new BasicSemanticTriggers.multiElementAltInTreeGrammar_return(); - retval.start = input.LT(1); - - - try { - // BasicSemanticTriggers.g:215:2: ({...}? ^( ALT ~ ( SEMPRED | ACTION ) (~ ( SEMPRED | ACTION ) )+ ) ) - // BasicSemanticTriggers.g:215:4: {...}? ^( ALT ~ ( SEMPRED | ACTION ) (~ ( SEMPRED | ACTION ) )+ ) - { - if ( !((inContext("ALT_REWRITE"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "multiElementAltInTreeGrammar", "inContext(\"ALT_REWRITE\")"); - } - - match(input,ALT,FOLLOW_ALT_in_multiElementAltInTreeGrammar681); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - if ( (input.LA(1) >= ACTION_CHAR_LITERAL && input.LA(1) <= SEMI)||(input.LA(1) >= SRC && input.LA(1) <= WILDCARD) ) { - 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; - } - - - // BasicSemanticTriggers.g:216:28: (~ ( SEMPRED | ACTION ) )+ - int cnt13=0; - loop13: - do { - int alt13=2; - int LA13_0 = input.LA(1); - - if ( ((LA13_0 >= ACTION_CHAR_LITERAL && LA13_0 <= SEMI)||(LA13_0 >= SRC && LA13_0 <= WILDCARD)) ) { - alt13=1; - } - - - switch (alt13) { - case 1 : - // BasicSemanticTriggers.g: - { - if ( (input.LA(1) >= ACTION_CHAR_LITERAL && input.LA(1) <= SEMI)||(input.LA(1) >= SRC && input.LA(1) <= WILDCARD) ) { - 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; - } - - - } - break; - - default : - if ( cnt13 >= 1 ) break loop13; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = - new EarlyExitException(13, input); - throw eee; - } - cnt13++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return retval; - - - if ( state.backtracking==1 ) { - int altNum = ((GrammarAST)retval.start).getParent().getChildIndex() + 1; // alts are 1..n - GrammarAST firstNode = (GrammarAST)((GrammarAST)retval.start).getChild(0); - checker.checkRewriteForMultiRootAltInTreeGrammar(root.getOptions(), - firstNode.token, - altNum); - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "multiElementAltInTreeGrammar" - - - public static class astOps_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "astOps" - // BasicSemanticTriggers.g:227:1: astOps : ( ^( ROOT el= . ) | ^( BANG el= . ) ); - public final BasicSemanticTriggers.astOps_return astOps() throws RecognitionException { - BasicSemanticTriggers.astOps_return retval = new BasicSemanticTriggers.astOps_return(); - retval.start = input.LT(1); - - - GrammarAST el=null; - - try { - // BasicSemanticTriggers.g:228:2: ( ^( ROOT el= . ) | ^( BANG el= . ) ) - int alt14=2; - int LA14_0 = input.LA(1); - - if ( (LA14_0==ROOT) ) { - alt14=1; - } - else if ( (LA14_0==BANG) ) { - alt14=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 14, 0, input); - - throw nvae; - - } - switch (alt14) { - case 1 : - // BasicSemanticTriggers.g:228:4: ^( ROOT el= . ) - { - match(input,ROOT,FOLLOW_ROOT_in_astOps716); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - el=(GrammarAST)input.LT(1); - - matchAny(input); if (state.failed) return retval; - - match(input, Token.UP, null); if (state.failed) return retval; - - - if ( state.backtracking==1 ) {checker.checkASTOps(root.getOptions(), ((GrammarAST)retval.start), el);} - - } - break; - case 2 : - // BasicSemanticTriggers.g:229:4: ^( BANG el= . ) - { - match(input,BANG,FOLLOW_BANG_in_astOps729); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - el=(GrammarAST)input.LT(1); - - matchAny(input); if (state.failed) return retval; - - match(input, Token.UP, null); if (state.failed) return retval; - - - if ( state.backtracking==1 ) {checker.checkASTOps(root.getOptions(), ((GrammarAST)retval.start), el);} - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "astOps" - - - public static class rewrite_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "rewrite" - // BasicSemanticTriggers.g:232:1: rewrite : ( RESULT | ST_RESULT ) ; - public final BasicSemanticTriggers.rewrite_return rewrite() throws RecognitionException { - BasicSemanticTriggers.rewrite_return retval = new BasicSemanticTriggers.rewrite_return(); - retval.start = input.LT(1); - - - try { - // BasicSemanticTriggers.g:233:2: ( ( RESULT | ST_RESULT ) ) - // BasicSemanticTriggers.g:233:4: ( RESULT | ST_RESULT ) - { - if ( input.LA(1)==RESULT||input.LA(1)==ST_RESULT ) { - 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 ) {checker.checkRewriteOk(root.getOptions(),((GrammarAST)retval.start));} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "rewrite" - - - - // $ANTLR start "wildcardRoot" - // BasicSemanticTriggers.g:237:1: wildcardRoot : ^( TREE_BEGIN WILDCARD ( . )* ) ; - public final void wildcardRoot() throws RecognitionException { - GrammarAST WILDCARD9=null; - - try { - // BasicSemanticTriggers.g:238:5: ( ^( TREE_BEGIN WILDCARD ( . )* ) ) - // BasicSemanticTriggers.g:238:7: ^( TREE_BEGIN WILDCARD ( . )* ) - { - match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_wildcardRoot770); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - WILDCARD9=(GrammarAST)match(input,WILDCARD,FOLLOW_WILDCARD_in_wildcardRoot772); if (state.failed) return ; - - // BasicSemanticTriggers.g:238:29: ( . )* - loop15: - do { - int alt15=2; - int LA15_0 = input.LA(1); - - if ( ((LA15_0 >= ACTION && LA15_0 <= WILDCARD)) ) { - alt15=1; - } - else if ( (LA15_0==UP) ) { - alt15=2; - } - - - switch (alt15) { - case 1 : - // BasicSemanticTriggers.g:238:29: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - break loop15; - } - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {checker.checkWildcardRoot(WILDCARD9.token);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "wildcardRoot" - - // Delegated rules - - - - - public static final BitSet FOLLOW_grammarSpec_in_topdown87 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rules_in_topdown92 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_mode_in_topdown97 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_option_in_topdown102 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule_in_topdown107 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_tokenAlias_in_topdown112 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rewrite_in_topdown117 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_multiElementAltInTreeGrammar_in_bottomup129 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_astOps_in_bottomup134 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleref_in_bottomup139 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_tokenRefWithArgs_in_bottomup144 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_elementOption_in_bottomup149 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_checkGrammarOptions_in_bottomup154 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_wildcardRoot_in_bottomup160 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_GRAMMAR_in_grammarSpec178 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_grammarSpec180 = new BitSet(new long[]{0x0000020100020000L,0x0000000400000002L}); - public static final BitSet FOLLOW_DOC_COMMENT_in_grammarSpec182 = new BitSet(new long[]{0x0000020100000000L,0x0000000400000002L}); - public static final BitSet FOLLOW_prequelConstructs_in_grammarSpec199 = new BitSet(new long[]{0x0000000000000000L,0x0000000400000000L}); - public static final BitSet FOLLOW_RULES_in_grammarSpec202 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_GRAMMAR_in_checkGrammarOptions225 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_OPTIONS_in_prequelConstructs248 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_IMPORT_in_prequelConstructs261 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_delegateGrammar_in_prequelConstructs263 = new BitSet(new long[]{0x0000000000000208L,0x0000000000400000L}); - public static final BitSet FOLLOW_TOKENS_in_prequelConstructs274 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ASSIGN_in_delegateGrammar306 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_delegateGrammar308 = new BitSet(new long[]{0x0000000000000000L,0x0000000000400000L}); - public static final BitSet FOLLOW_ID_in_delegateGrammar312 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ID_in_delegateGrammar326 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULES_in_rules353 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_MODE_in_mode365 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_mode367 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF8L,0x0000007FFFFFFFFFL}); - public static final BitSet FOLLOW_ASSIGN_in_option392 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_option396 = new BitSet(new long[]{0x6000000200000000L,0x0000000000400000L}); - public static final BitSet FOLLOW_optionValue_in_option398 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RULE_in_rule480 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_rule484 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF8L,0x0000007FFFFFFFFFL}); - public static final BitSet FOLLOW_RULE_REF_in_ruleref507 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ASSIGN_in_tokenAlias526 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_tokenAlias528 = new BitSet(new long[]{0x4000000000000000L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_tokenAlias530 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TOKEN_REF_in_tokenRefWithArgs555 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ARG_ACTION_in_tokenRefWithArgs557 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ELEMENT_OPTIONS_in_elementOption586 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption597 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption601 = new BitSet(new long[]{0x0000000000000000L,0x0000000000400000L}); - public static final BitSet FOLLOW_ID_in_elementOption605 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption619 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption623 = new BitSet(new long[]{0x4000000000000000L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_elementOption627 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ID_in_elementOption641 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ALT_in_multiElementAltInTreeGrammar681 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_set_in_multiElementAltInTreeGrammar683 = new BitSet(new long[]{0xF7FFFFFFFFFFFFE0L,0x0000007FFFFFFFFFL}); - public static final BitSet FOLLOW_ROOT_in_astOps716 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_BANG_in_astOps729 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_set_in_rewrite747 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_TREE_BEGIN_in_wildcardRoot770 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_WILDCARD_in_wildcardRoot772 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF8L,0x0000007FFFFFFFFFL}); - -} \ No newline at end of file diff --git a/tool/src/org/antlr/v4/semantics/CollectSymbols.java b/tool/src/org/antlr/v4/semantics/CollectSymbols.java deleted file mode 100644 index 195e6b9e7..000000000 --- a/tool/src/org/antlr/v4/semantics/CollectSymbols.java +++ /dev/null @@ -1,2296 +0,0 @@ -// $ANTLR 3.4 CollectSymbols.g 2011-06-20 18:47:15 - -/* - [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.semantics; -import org.antlr.v4.tool.*; -import org.antlr.v4.parse.*; -import java.util.Set; -import java.util.HashSet; -import org.stringtemplate.v4.misc.MultiMap; - - -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; - -/** Collects rules, terminals, strings, actions, scopes etc... from AST - * No side-effects - */ -@SuppressWarnings({"all", "warnings", "unchecked"}) -public class CollectSymbols extends TreeFilter { - public static final String[] tokenNames = new String[] { - "", "", "", "", "ACTION", "ACTION_CHAR_LITERAL", "ACTION_ESC", "ACTION_STRING_LITERAL", "ARG_ACTION", "ASSIGN", "AT", "BANG", "CATCH", "COLON", "COLONCOLON", "COMMA", "COMMENT", "DOC_COMMENT", "DOLLAR", "DOT", "DOUBLE_ANGLE_STRING_LITERAL", "DOUBLE_QUOTE_STRING_LITERAL", "ERRCHAR", "ESC_SEQ", "ETC", "FINALLY", "FORCED_ACTION", "FRAGMENT", "GRAMMAR", "GT", "HEX_DIGIT", "IMPLIES", "IMPORT", "INT", "LEXER", "LPAREN", "LT", "MODE", "NESTED_ACTION", "NLCHARS", "NOT", "OPTIONS", "OR", "PARSER", "PLUS", "PLUS_ASSIGN", "PRIVATE", "PROTECTED", "PUBLIC", "QUESTION", "RANGE", "RARROW", "RBRACE", "RETURNS", "ROOT", "RPAREN", "RULE_REF", "SCOPE", "SEMI", "SEMPRED", "SRC", "STAR", "STRING_LITERAL", "TEMPLATE", "THROWS", "TOKENS", "TOKEN_REF", "TREE", "TREE_BEGIN", "UNICODE_ESC", "WS", "WSCHARS", "WSNLCHARS", "ALT", "ALTLIST", "ALT_REWRITE", "ARG", "ARGLIST", "BACKTRACK_SEMPRED", "BLOCK", "CHAR_RANGE", "CLOSURE", "COMBINED", "ELEMENT_OPTIONS", "EPSILON", "GATED_SEMPRED", "ID", "INITACTION", "LABEL", "LIST", "OPTIONAL", "POSITIVE_CLOSURE", "RESULT", "RET", "REWRITE_BLOCK", "RULE", "RULEACTIONS", "RULEMODIFIERS", "RULES", "ST_RESULT", "SYNPRED", "SYN_SEMPRED", "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 ASSIGN=9; - public static final int AT=10; - public static final int BANG=11; - public static final int CATCH=12; - public static final int COLON=13; - public static final int COLONCOLON=14; - public static final int COMMA=15; - public static final int COMMENT=16; - public static final int DOC_COMMENT=17; - public static final int DOLLAR=18; - public static final int DOT=19; - public static final int DOUBLE_ANGLE_STRING_LITERAL=20; - public static final int DOUBLE_QUOTE_STRING_LITERAL=21; - public static final int ERRCHAR=22; - public static final int ESC_SEQ=23; - public static final int ETC=24; - public static final int FINALLY=25; - public static final int FORCED_ACTION=26; - public static final int FRAGMENT=27; - public static final int GRAMMAR=28; - public static final int GT=29; - public static final int HEX_DIGIT=30; - public static final int IMPLIES=31; - public static final int IMPORT=32; - public static final int INT=33; - public static final int LEXER=34; - public static final int LPAREN=35; - public static final int LT=36; - public static final int MODE=37; - public static final int NESTED_ACTION=38; - public static final int NLCHARS=39; - public static final int NOT=40; - public static final int OPTIONS=41; - public static final int OR=42; - public static final int PARSER=43; - public static final int PLUS=44; - public static final int PLUS_ASSIGN=45; - public static final int PRIVATE=46; - public static final int PROTECTED=47; - public static final int PUBLIC=48; - public static final int QUESTION=49; - public static final int RANGE=50; - public static final int RARROW=51; - public static final int RBRACE=52; - public static final int RETURNS=53; - public static final int ROOT=54; - public static final int RPAREN=55; - public static final int RULE_REF=56; - public static final int SCOPE=57; - public static final int SEMI=58; - public static final int SEMPRED=59; - public static final int SRC=60; - public static final int STAR=61; - public static final int STRING_LITERAL=62; - public static final int TEMPLATE=63; - public static final int THROWS=64; - public static final int TOKENS=65; - public static final int TOKEN_REF=66; - public static final int TREE=67; - public static final int TREE_BEGIN=68; - public static final int UNICODE_ESC=69; - public static final int WS=70; - public static final int WSCHARS=71; - public static final int WSNLCHARS=72; - public static final int ALT=73; - public static final int ALTLIST=74; - public static final int ALT_REWRITE=75; - public static final int ARG=76; - public static final int ARGLIST=77; - public static final int BACKTRACK_SEMPRED=78; - public static final int BLOCK=79; - public static final int CHAR_RANGE=80; - public static final int CLOSURE=81; - public static final int COMBINED=82; - public static final int ELEMENT_OPTIONS=83; - public static final int EPSILON=84; - public static final int GATED_SEMPRED=85; - public static final int ID=86; - public static final int INITACTION=87; - public static final int LABEL=88; - public static final int LIST=89; - public static final int OPTIONAL=90; - public static final int POSITIVE_CLOSURE=91; - public static final int RESULT=92; - public static final int RET=93; - public static final int REWRITE_BLOCK=94; - public static final int RULE=95; - public static final int RULEACTIONS=96; - public static final int RULEMODIFIERS=97; - public static final int RULES=98; - public static final int ST_RESULT=99; - public static final int SYNPRED=100; - public static final int SYN_SEMPRED=101; - public static final int WILDCARD=102; - - // delegates - public TreeFilter[] getDelegates() { - return new TreeFilter[] {}; - } - - // delegators - - - public CollectSymbols(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public CollectSymbols(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - public String[] getTokenNames() { return CollectSymbols.tokenNames; } - public String getGrammarFileName() { return "CollectSymbols.g"; } - - - Rule currentRule; - String currentMode = LexerGrammar.DEFAULT_MODE_NAME; - int currentAlt = 1; // 1..n - public List rules = new ArrayList(); - public List rulerefs = new ArrayList(); - public List qualifiedRulerefs = new ArrayList(); - public List terminals = new ArrayList(); - public List tokenIDRefs = new ArrayList(); - public Set strings = new HashSet(); - public List tokensDefs = new ArrayList(); - public List scopes = new ArrayList(); - public List actions = new ArrayList(); - Grammar g; // which grammar are we checking - public CollectSymbols(TreeNodeStream input, Grammar g) { - this(input); - this.g = g; - } - - - - // $ANTLR start "topdown" - // CollectSymbols.g:94:1: topdown : ( globalScope | globalNamedAction | tokensSection | mode | rule | ruleArg | ruleReturns | ruleNamedAction | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt | ruleAction | sempred | finallyClause | exceptionHandler ); - public final void topdown() throws RecognitionException { - try { - // CollectSymbols.g:96:5: ( globalScope | globalNamedAction | tokensSection | mode | rule | ruleArg | ruleReturns | ruleNamedAction | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt | ruleAction | sempred | finallyClause | exceptionHandler ) - int alt1=18; - switch ( input.LA(1) ) { - case SCOPE: - { - int LA1_1 = input.LA(2); - - if ( (LA1_1==DOWN) ) { - int LA1_19 = input.LA(3); - - if ( (LA1_19==ID) ) { - int LA1_24 = input.LA(4); - - if ( (LA1_24==ACTION) ) { - alt1=1; - } - else if ( (LA1_24==UP||LA1_24==ID) ) { - alt1=9; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 24, input); - - throw nvae; - - } - } - else if ( (LA1_19==ACTION) ) { - alt1=9; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 19, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 1, input); - - throw nvae; - - } - } - break; - case AT: - { - int LA1_2 = input.LA(2); - - if ( (LA1_2==DOWN) ) { - int LA1_20 = input.LA(3); - - if ( (LA1_20==ID) ) { - int LA1_26 = input.LA(4); - - if ( (LA1_26==ACTION) ) { - int LA1_29 = input.LA(5); - - if ( (LA1_29==UP) ) { - int LA1_32 = input.LA(6); - - if ( ((inContext("GRAMMAR"))) ) { - alt1=2; - } - else if ( ((inContext("RULE"))) ) { - alt1=8; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 32, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 29, input); - - throw nvae; - - } - } - else if ( (LA1_26==ID) ) { - alt1=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 26, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 20, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 2, input); - - throw nvae; - - } - } - break; - case ASSIGN: - { - int LA1_3 = input.LA(2); - - if ( (LA1_3==DOWN) ) { - int LA1_21 = input.LA(3); - - if ( (LA1_21==ID) ) { - int LA1_27 = input.LA(4); - - if ( (LA1_27==STRING_LITERAL) ) { - int LA1_31 = input.LA(5); - - if ( (LA1_31==UP) ) { - int LA1_33 = input.LA(6); - - if ( ((inContext("TOKENS"))) ) { - alt1=3; - } - else if ( ((inContext("RULE ..."))) ) { - alt1=13; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 33, input); - - throw nvae; - - } - } - else if ( (LA1_31==DOWN) ) { - alt1=13; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 31, input); - - throw nvae; - - } - } - else if ( ((LA1_27 >= ACTION && LA1_27 <= STAR)||(LA1_27 >= TEMPLATE && LA1_27 <= WILDCARD)) ) { - alt1=13; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 27, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 21, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 3, input); - - throw nvae; - - } - } - break; - case ID: - { - alt1=3; - } - break; - case MODE: - { - alt1=4; - } - break; - case RULE: - { - alt1=5; - } - break; - case ARG_ACTION: - { - alt1=6; - } - break; - case RETURNS: - { - alt1=7; - } - break; - case RULE_REF: - { - int LA1_9 = input.LA(2); - - if ( (!(((inContext("RESULT ..."))))) ) { - alt1=10; - } - else if ( ((inContext("RESULT ..."))) ) { - alt1=11; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 9, input); - - throw nvae; - - } - } - break; - case STRING_LITERAL: - { - int LA1_10 = input.LA(2); - - if ( ((inContext("RESULT ..."))) ) { - alt1=11; - } - else if ( ((!inContext("TOKENS ASSIGN"))) ) { - alt1=12; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 10, input); - - throw nvae; - - } - } - break; - case TOKEN_REF: - { - int LA1_11 = input.LA(2); - - if ( ((inContext("RESULT ..."))) ) { - alt1=11; - } - else if ( (true) ) { - alt1=12; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 11, input); - - throw nvae; - - } - } - break; - case LABEL: - { - alt1=11; - } - break; - case PLUS_ASSIGN: - { - alt1=13; - } - break; - case ALT: - case ALT_REWRITE: - { - alt1=14; - } - break; - case ACTION: - case FORCED_ACTION: - { - alt1=15; - } - break; - case SEMPRED: - { - alt1=16; - } - break; - case FINALLY: - { - alt1=17; - } - break; - case CATCH: - { - alt1=18; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 1, 0, input); - - throw nvae; - - } - - switch (alt1) { - case 1 : - // CollectSymbols.g:96:7: globalScope - { - pushFollow(FOLLOW_globalScope_in_topdown89); - globalScope(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 2 : - // CollectSymbols.g:97:7: globalNamedAction - { - pushFollow(FOLLOW_globalNamedAction_in_topdown97); - globalNamedAction(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 3 : - // CollectSymbols.g:98:7: tokensSection - { - pushFollow(FOLLOW_tokensSection_in_topdown105); - tokensSection(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 4 : - // CollectSymbols.g:99:7: mode - { - pushFollow(FOLLOW_mode_in_topdown113); - mode(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 5 : - // CollectSymbols.g:100:7: rule - { - pushFollow(FOLLOW_rule_in_topdown121); - rule(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 6 : - // CollectSymbols.g:101:7: ruleArg - { - pushFollow(FOLLOW_ruleArg_in_topdown129); - ruleArg(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 7 : - // CollectSymbols.g:102:7: ruleReturns - { - pushFollow(FOLLOW_ruleReturns_in_topdown137); - ruleReturns(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 8 : - // CollectSymbols.g:103:7: ruleNamedAction - { - pushFollow(FOLLOW_ruleNamedAction_in_topdown145); - ruleNamedAction(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 9 : - // CollectSymbols.g:104:7: ruleScopeSpec - { - pushFollow(FOLLOW_ruleScopeSpec_in_topdown153); - ruleScopeSpec(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 10 : - // CollectSymbols.g:105:7: ruleref - { - pushFollow(FOLLOW_ruleref_in_topdown161); - ruleref(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 11 : - // CollectSymbols.g:106:7: rewriteElement - { - pushFollow(FOLLOW_rewriteElement_in_topdown169); - rewriteElement(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 12 : - // CollectSymbols.g:108:7: terminal - { - pushFollow(FOLLOW_terminal_in_topdown190); - terminal(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 13 : - // CollectSymbols.g:109:7: labeledElement - { - pushFollow(FOLLOW_labeledElement_in_topdown198); - labeledElement(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 14 : - // CollectSymbols.g:110:7: setAlt - { - pushFollow(FOLLOW_setAlt_in_topdown206); - setAlt(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 15 : - // CollectSymbols.g:111:7: ruleAction - { - pushFollow(FOLLOW_ruleAction_in_topdown214); - ruleAction(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 16 : - // CollectSymbols.g:112:9: sempred - { - pushFollow(FOLLOW_sempred_in_topdown224); - sempred(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 17 : - // CollectSymbols.g:113:7: finallyClause - { - pushFollow(FOLLOW_finallyClause_in_topdown232); - finallyClause(); - - state._fsp--; - if (state.failed) return ; - - } - break; - case 18 : - // CollectSymbols.g:114:7: exceptionHandler - { - pushFollow(FOLLOW_exceptionHandler_in_topdown240); - exceptionHandler(); - - state._fsp--; - if (state.failed) return ; - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "topdown" - - - - // $ANTLR start "bottomup" - // CollectSymbols.g:117:1: bottomup : finishRule ; - public final void bottomup() throws RecognitionException { - try { - // CollectSymbols.g:118:2: ( finishRule ) - // CollectSymbols.g:118:4: finishRule - { - pushFollow(FOLLOW_finishRule_in_bottomup251); - finishRule(); - - state._fsp--; - if (state.failed) return ; - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "bottomup" - - - - // $ANTLR start "globalScope" - // CollectSymbols.g:121:1: globalScope :{...}? ^( SCOPE ID ACTION ) ; - public final void globalScope() throws RecognitionException { - GrammarAST ACTION1=null; - GrammarAST ID2=null; - - try { - // CollectSymbols.g:122:2: ({...}? ^( SCOPE ID ACTION ) ) - // CollectSymbols.g:122:4: {...}? ^( SCOPE ID ACTION ) - { - if ( !((inContext("GRAMMAR"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "globalScope", "inContext(\"GRAMMAR\")"); - } - - match(input,SCOPE,FOLLOW_SCOPE_in_globalScope265); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ID2=(GrammarAST)match(input,ID,FOLLOW_ID_in_globalScope267); if (state.failed) return ; - - ACTION1=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_globalScope269); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) { - AttributeDict s = ScopeParser.parseDynamicScope((ACTION1!=null?ACTION1.getText():null)); - s.type = AttributeDict.DictType.GLOBAL_SCOPE; - s.name = (ID2!=null?ID2.getText():null); - s.ast = ACTION1; - scopes.add(s); - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "globalScope" - - - - // $ANTLR start "globalNamedAction" - // CollectSymbols.g:132:1: globalNamedAction :{...}? ^( AT ( ID )? ID ACTION ) ; - public final void globalNamedAction() throws RecognitionException { - GrammarAST AT3=null; - GrammarAST ACTION4=null; - - try { - // CollectSymbols.g:133:2: ({...}? ^( AT ( ID )? ID ACTION ) ) - // CollectSymbols.g:133:4: {...}? ^( AT ( ID )? ID ACTION ) - { - if ( !((inContext("GRAMMAR"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "globalNamedAction", "inContext(\"GRAMMAR\")"); - } - - AT3=(GrammarAST)match(input,AT,FOLLOW_AT_in_globalNamedAction288); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - // CollectSymbols.g:133:33: ( ID )? - int alt2=2; - int LA2_0 = input.LA(1); - - if ( (LA2_0==ID) ) { - int LA2_1 = input.LA(2); - - if ( (LA2_1==ID) ) { - alt2=1; - } - } - switch (alt2) { - case 1 : - // CollectSymbols.g:133:33: ID - { - match(input,ID,FOLLOW_ID_in_globalNamedAction290); if (state.failed) return ; - - } - break; - - } - - - match(input,ID,FOLLOW_ID_in_globalNamedAction293); if (state.failed) return ; - - ACTION4=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_globalNamedAction295); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {actions.add(AT3); ((ActionAST)ACTION4).resolver = g;} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "globalNamedAction" - - - - // $ANTLR start "tokensSection" - // CollectSymbols.g:137:1: tokensSection :{...}? ( ^( ASSIGN t= ID STRING_LITERAL ) |t= ID ) ; - public final void tokensSection() throws RecognitionException { - GrammarAST t=null; - GrammarAST ASSIGN5=null; - GrammarAST STRING_LITERAL6=null; - - try { - // CollectSymbols.g:138:2: ({...}? ( ^( ASSIGN t= ID STRING_LITERAL ) |t= ID ) ) - // CollectSymbols.g:138:4: {...}? ( ^( ASSIGN t= ID STRING_LITERAL ) |t= ID ) - { - if ( !((inContext("TOKENS"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "tokensSection", "inContext(\"TOKENS\")"); - } - - // CollectSymbols.g:139:3: ( ^( ASSIGN t= ID STRING_LITERAL ) |t= ID ) - int alt3=2; - int LA3_0 = input.LA(1); - - if ( (LA3_0==ASSIGN) ) { - alt3=1; - } - else if ( (LA3_0==ID) ) { - alt3=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 3, 0, input); - - throw nvae; - - } - switch (alt3) { - case 1 : - // CollectSymbols.g:139:5: ^( ASSIGN t= ID STRING_LITERAL ) - { - ASSIGN5=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_tokensSection318); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - t=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokensSection322); if (state.failed) return ; - - STRING_LITERAL6=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_tokensSection324); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {terminals.add(t); tokenIDRefs.add(t); - tokensDefs.add(ASSIGN5); strings.add((STRING_LITERAL6!=null?STRING_LITERAL6.getText():null));} - - } - break; - case 2 : - // CollectSymbols.g:142:5: t= ID - { - t=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokensSection338); if (state.failed) return ; - - if ( state.backtracking==1 ) {terminals.add(t); tokenIDRefs.add(t); tokensDefs.add(t);} - - } - break; - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "tokensSection" - - - - // $ANTLR start "mode" - // CollectSymbols.g:147:1: mode : ^( MODE ID ( . )+ ) ; - public final void mode() throws RecognitionException { - GrammarAST ID7=null; - - try { - // CollectSymbols.g:147:5: ( ^( MODE ID ( . )+ ) ) - // CollectSymbols.g:147:7: ^( MODE ID ( . )+ ) - { - match(input,MODE,FOLLOW_MODE_in_mode357); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ID7=(GrammarAST)match(input,ID,FOLLOW_ID_in_mode359); if (state.failed) return ; - - // CollectSymbols.g:147:17: ( . )+ - int cnt4=0; - loop4: - do { - 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 : - // CollectSymbols.g:147:17: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - if ( cnt4 >= 1 ) break loop4; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(4, input); - throw eee; - } - cnt4++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {currentMode = (ID7!=null?ID7.getText():null);} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "mode" - - - - // $ANTLR start "rule" - // CollectSymbols.g:149:1: rule : ^( RULE name= ID ( options {greedy=false; } : . )* ( ^( RULEMODIFIERS (m= . )+ ) )? ( ^( AT ID ACTION ) )* ^( BLOCK ( . )+ ) ( . )* ) ; - public final void rule() throws RecognitionException { - GrammarAST name=null; - GrammarAST RULE8=null; - GrammarAST m=null; - - List modifiers = new ArrayList(); - try { - // CollectSymbols.g:151:2: ( ^( RULE name= ID ( options {greedy=false; } : . )* ( ^( RULEMODIFIERS (m= . )+ ) )? ( ^( AT ID ACTION ) )* ^( BLOCK ( . )+ ) ( . )* ) ) - // CollectSymbols.g:151:6: ^( RULE name= ID ( options {greedy=false; } : . )* ( ^( RULEMODIFIERS (m= . )+ ) )? ( ^( AT ID ACTION ) )* ^( BLOCK ( . )+ ) ( . )* ) - { - RULE8=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_rule384); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - name=(GrammarAST)match(input,ID,FOLLOW_ID_in_rule396); if (state.failed) return ; - - // CollectSymbols.g:152:17: ( options {greedy=false; } : . )* - loop5: - do { - int alt5=2; - alt5 = dfa5.predict(input); - switch (alt5) { - case 1 : - // CollectSymbols.g:152:42: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - break loop5; - } - } while (true); - - - // CollectSymbols.g:153:9: ( ^( RULEMODIFIERS (m= . )+ ) )? - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0==RULEMODIFIERS) ) { - alt7=1; - } - switch (alt7) { - case 1 : - // CollectSymbols.g:153:10: ^( RULEMODIFIERS (m= . )+ ) - { - match(input,RULEMODIFIERS,FOLLOW_RULEMODIFIERS_in_rule420); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - // CollectSymbols.g:153:26: (m= . )+ - int cnt6=0; - loop6: - do { - int alt6=2; - int LA6_0 = input.LA(1); - - if ( ((LA6_0 >= ACTION && LA6_0 <= WILDCARD)) ) { - alt6=1; - } - - - switch (alt6) { - case 1 : - // CollectSymbols.g:153:27: m= . - { - m=(GrammarAST)input.LT(1); - - matchAny(input); if (state.failed) return ; - - if ( state.backtracking==1 ) {modifiers.add(m);} - - } - break; - - default : - if ( cnt6 >= 1 ) break loop6; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(6, input); - throw eee; - } - cnt6++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - } - break; - - } - - - // CollectSymbols.g:154:9: ( ^( AT ID ACTION ) )* - loop8: - do { - int alt8=2; - int LA8_0 = input.LA(1); - - if ( (LA8_0==AT) ) { - alt8=1; - } - - - switch (alt8) { - case 1 : - // CollectSymbols.g:154:10: ^( AT ID ACTION ) - { - match(input,AT,FOLLOW_AT_in_rule444); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - match(input,ID,FOLLOW_ID_in_rule446); if (state.failed) return ; - - match(input,ACTION,FOLLOW_ACTION_in_rule448); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - } - break; - - default : - break loop8; - } - } while (true); - - - match(input,BLOCK,FOLLOW_BLOCK_in_rule462); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - // CollectSymbols.g:155:17: ( . )+ - int cnt9=0; - loop9: - do { - int alt9=2; - int LA9_0 = input.LA(1); - - if ( ((LA9_0 >= ACTION && LA9_0 <= WILDCARD)) ) { - alt9=1; - } - else if ( (LA9_0==UP) ) { - alt9=2; - } - - - switch (alt9) { - case 1 : - // CollectSymbols.g:155:17: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - if ( cnt9 >= 1 ) break loop9; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(9, input); - throw eee; - } - cnt9++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - // CollectSymbols.g:156:9: ( . )* - loop10: - do { - int alt10=2; - int LA10_0 = input.LA(1); - - if ( ((LA10_0 >= ACTION && LA10_0 <= WILDCARD)) ) { - alt10=1; - } - else if ( (LA10_0==UP) ) { - alt10=2; - } - - - switch (alt10) { - case 1 : - // CollectSymbols.g:156:9: . - { - matchAny(input); if (state.failed) return ; - - } - break; - - default : - break loop10; - } - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) { - int numAlts = RULE8.getFirstChildWithType(BLOCK).getChildCount(); - Rule r = new Rule(g, (name!=null?name.getText():null), (RuleAST)RULE8, numAlts); - if ( g.isLexer() ) r.mode = currentMode; - if ( modifiers.size()>0 ) r.modifiers = modifiers; - rules.add(r); - currentRule = r; - currentAlt = 1; - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "rule" - - - public static class setAlt_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "setAlt" - // CollectSymbols.g:169:1: setAlt :{...}? ( ALT | ALT_REWRITE ) ; - public final CollectSymbols.setAlt_return setAlt() throws RecognitionException { - CollectSymbols.setAlt_return retval = new CollectSymbols.setAlt_return(); - retval.start = input.LT(1); - - - try { - // CollectSymbols.g:170:2: ({...}? ( ALT | ALT_REWRITE ) ) - // CollectSymbols.g:170:4: {...}? ( ALT | ALT_REWRITE ) - { - if ( !((inContext("RULE BLOCK"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "setAlt", "inContext(\"RULE BLOCK\")"); - } - - if ( input.LA(1)==ALT||input.LA(1)==ALT_REWRITE ) { - 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 ) { - currentAlt = ((GrammarAST)retval.start).getChildIndex()+1; - currentRule.alt[currentAlt].ast = (AltAST)((GrammarAST)retval.start); - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "setAlt" - - - - // $ANTLR start "finishRule" - // CollectSymbols.g:177:1: finishRule : RULE ; - public final void finishRule() throws RecognitionException { - try { - // CollectSymbols.g:178:2: ( RULE ) - // CollectSymbols.g:178:4: RULE - { - match(input,RULE,FOLLOW_RULE_in_finishRule528); if (state.failed) return ; - - if ( state.backtracking==1 ) {currentRule = null;} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "finishRule" - - - - // $ANTLR start "ruleNamedAction" - // CollectSymbols.g:181:1: ruleNamedAction :{...}? ^( AT ID ACTION ) ; - public final void ruleNamedAction() throws RecognitionException { - GrammarAST ID9=null; - GrammarAST ACTION10=null; - - try { - // CollectSymbols.g:182:2: ({...}? ^( AT ID ACTION ) ) - // CollectSymbols.g:182:4: {...}? ^( AT ID ACTION ) - { - if ( !((inContext("RULE"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "ruleNamedAction", "inContext(\"RULE\")"); - } - - match(input,AT,FOLLOW_AT_in_ruleNamedAction544); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ID9=(GrammarAST)match(input,ID,FOLLOW_ID_in_ruleNamedAction546); if (state.failed) return ; - - ACTION10=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_ruleNamedAction548); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) { - currentRule.namedActions.put((ID9!=null?ID9.getText():null),(ActionAST)ACTION10); - ((ActionAST)ACTION10).resolver = currentRule; - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "ruleNamedAction" - - - - // $ANTLR start "ruleAction" - // CollectSymbols.g:189:1: ruleAction : ({...}? ACTION | FORCED_ACTION ); - public final void ruleAction() throws RecognitionException { - GrammarAST ACTION11=null; - GrammarAST FORCED_ACTION12=null; - - try { - // CollectSymbols.g:190:2: ({...}? ACTION | FORCED_ACTION ) - int alt11=2; - int LA11_0 = input.LA(1); - - if ( (LA11_0==ACTION) ) { - alt11=1; - } - else if ( (LA11_0==FORCED_ACTION) ) { - alt11=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 11, 0, input); - - throw nvae; - - } - switch (alt11) { - case 1 : - // CollectSymbols.g:190:4: {...}? ACTION - { - if ( !((inContext("RULE ...")&&!inContext("SCOPE")&& - !inContext("CATCH")&&!inContext("FINALLY")&&!inContext("AT"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "ruleAction", "inContext(\"RULE ...\")&&!inContext(\"SCOPE\")&&\n\t\t !inContext(\"CATCH\")&&!inContext(\"FINALLY\")&&!inContext(\"AT\")"); - } - - ACTION11=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_ruleAction568); if (state.failed) return ; - - if ( state.backtracking==1 ) { - currentRule.defineActionInAlt(currentAlt, (ActionAST)ACTION11); - ((ActionAST)ACTION11).resolver = currentRule.alt[currentAlt]; - } - - } - break; - case 2 : - // CollectSymbols.g:197:9: FORCED_ACTION - { - FORCED_ACTION12=(GrammarAST)match(input,FORCED_ACTION,FOLLOW_FORCED_ACTION_in_ruleAction582); if (state.failed) return ; - - if ( state.backtracking==1 ) { - currentRule.defineActionInAlt(currentAlt, (ActionAST)FORCED_ACTION12); - ((ActionAST)FORCED_ACTION12).resolver = currentRule.alt[currentAlt]; - } - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "ruleAction" - - - - // $ANTLR start "sempred" - // CollectSymbols.g:204:1: sempred :{...}? SEMPRED ; - public final void sempred() throws RecognitionException { - GrammarAST SEMPRED13=null; - - try { - // CollectSymbols.g:205:2: ({...}? SEMPRED ) - // CollectSymbols.g:205:4: {...}? SEMPRED - { - if ( !((inContext("RULE ..."))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "sempred", "inContext(\"RULE ...\")"); - } - - SEMPRED13=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_sempred601); if (state.failed) return ; - - if ( state.backtracking==1 ) { - currentRule.definePredicateInAlt(currentAlt, (PredAST)SEMPRED13); - ((PredAST)SEMPRED13).resolver = currentRule.alt[currentAlt]; - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "sempred" - - - - // $ANTLR start "exceptionHandler" - // CollectSymbols.g:213:1: exceptionHandler : ^( CATCH ARG_ACTION ACTION ) ; - public final void exceptionHandler() throws RecognitionException { - GrammarAST ACTION14=null; - - try { - // CollectSymbols.g:214:2: ( ^( CATCH ARG_ACTION ACTION ) ) - // CollectSymbols.g:214:4: ^( CATCH ARG_ACTION ACTION ) - { - match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler617); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_exceptionHandler619); if (state.failed) return ; - - ACTION14=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_exceptionHandler621); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) { - currentRule.exceptionActions.add((ActionAST)ACTION14); - ((ActionAST)ACTION14).resolver = currentRule; - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "exceptionHandler" - - - - // $ANTLR start "finallyClause" - // CollectSymbols.g:221:1: finallyClause : ^( FINALLY ACTION ) ; - public final void finallyClause() throws RecognitionException { - GrammarAST ACTION15=null; - - try { - // CollectSymbols.g:222:2: ( ^( FINALLY ACTION ) ) - // CollectSymbols.g:222:4: ^( FINALLY ACTION ) - { - match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause638); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ACTION15=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_finallyClause640); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) { - currentRule.finallyAction = (ActionAST)ACTION15; - ((ActionAST)ACTION15).resolver = currentRule; - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "finallyClause" - - - - // $ANTLR start "ruleArg" - // CollectSymbols.g:229:1: ruleArg :{...}? ARG_ACTION ; - public final void ruleArg() throws RecognitionException { - GrammarAST ARG_ACTION16=null; - - try { - // CollectSymbols.g:230:2: ({...}? ARG_ACTION ) - // CollectSymbols.g:230:4: {...}? ARG_ACTION - { - if ( !((inContext("RULE"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "ruleArg", "inContext(\"RULE\")"); - } - - ARG_ACTION16=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleArg658); if (state.failed) return ; - - if ( state.backtracking==1 ) { - currentRule.args = ScopeParser.parseTypeList((ARG_ACTION16!=null?ARG_ACTION16.getText():null)); - currentRule.args.type = AttributeDict.DictType.ARG; - currentRule.args.ast = ARG_ACTION16; - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "ruleArg" - - - - // $ANTLR start "ruleReturns" - // CollectSymbols.g:238:1: ruleReturns : ^( RETURNS ARG_ACTION ) ; - public final void ruleReturns() throws RecognitionException { - GrammarAST ARG_ACTION17=null; - - try { - // CollectSymbols.g:239:2: ( ^( RETURNS ARG_ACTION ) ) - // CollectSymbols.g:239:4: ^( RETURNS ARG_ACTION ) - { - match(input,RETURNS,FOLLOW_RETURNS_in_ruleReturns674); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ARG_ACTION17=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleReturns676); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) { - currentRule.retvals = ScopeParser.parseTypeList((ARG_ACTION17!=null?ARG_ACTION17.getText():null)); - currentRule.retvals.type = AttributeDict.DictType.RET; - currentRule.retvals.ast = ARG_ACTION17; - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "ruleReturns" - - - - // $ANTLR start "ruleScopeSpec" - // CollectSymbols.g:247:1: ruleScopeSpec :{...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) ; - public final void ruleScopeSpec() throws RecognitionException { - GrammarAST ACTION18=null; - GrammarAST ids=null; - List list_ids=null; - - try { - // CollectSymbols.g:248:2: ({...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) ) - // CollectSymbols.g:248:4: {...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) - { - if ( !((inContext("RULE"))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "ruleScopeSpec", "inContext(\"RULE\")"); - } - - // CollectSymbols.g:249:3: ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) - int alt13=2; - int LA13_0 = input.LA(1); - - if ( (LA13_0==SCOPE) ) { - int LA13_1 = input.LA(2); - - if ( (LA13_1==DOWN) ) { - int LA13_2 = input.LA(3); - - if ( (LA13_2==ACTION) ) { - alt13=1; - } - else if ( (LA13_2==ID) ) { - alt13=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 13, 2, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 13, 1, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 13, 0, input); - - throw nvae; - - } - switch (alt13) { - case 1 : - // CollectSymbols.g:249:5: ^( SCOPE ACTION ) - { - match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec699); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - ACTION18=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_ruleScopeSpec701); if (state.failed) return ; - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) { - currentRule.scope = ScopeParser.parseDynamicScope((ACTION18!=null?ACTION18.getText():null)); - currentRule.scope.type = AttributeDict.DictType.RULE_SCOPE; - currentRule.scope.name = currentRule.name; - currentRule.scope.ast = ACTION18; - } - - } - break; - case 2 : - // CollectSymbols.g:256:5: ^( SCOPE (ids+= ID )+ ) - { - match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec714); if (state.failed) return ; - - match(input, Token.DOWN, null); if (state.failed) return ; - // CollectSymbols.g:256:16: (ids+= ID )+ - int cnt12=0; - loop12: - do { - int alt12=2; - int LA12_0 = input.LA(1); - - if ( (LA12_0==ID) ) { - alt12=1; - } - - - switch (alt12) { - case 1 : - // CollectSymbols.g:256:16: ids+= ID - { - ids=(GrammarAST)match(input,ID,FOLLOW_ID_in_ruleScopeSpec718); if (state.failed) return ; - if (list_ids==null) list_ids=new ArrayList(); - list_ids.add(ids); - - - } - break; - - default : - if ( cnt12 >= 1 ) break loop12; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(12, input); - throw eee; - } - cnt12++; - } while (true); - - - match(input, Token.UP, null); if (state.failed) return ; - - - if ( state.backtracking==1 ) {currentRule.useScopes = list_ids;} - - } - break; - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "ruleScopeSpec" - - - public static class rewriteElement_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "rewriteElement" - // CollectSymbols.g:260:1: rewriteElement :{...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL ) ; - public final CollectSymbols.rewriteElement_return rewriteElement() throws RecognitionException { - CollectSymbols.rewriteElement_return retval = new CollectSymbols.rewriteElement_return(); - retval.start = input.LT(1); - - - try { - // CollectSymbols.g:262:2: ({...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL ) ) - // CollectSymbols.g:263:6: {...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL ) - { - if ( !((inContext("RESULT ..."))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "rewriteElement", "inContext(\"RESULT ...\")"); - } - - if ( input.LA(1)==RULE_REF||input.LA(1)==STRING_LITERAL||input.LA(1)==TOKEN_REF||input.LA(1)==LABEL ) { - 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 ) {currentRule.alt[currentAlt].rewriteElements.add(((GrammarAST)retval.start));} - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "rewriteElement" - - - public static class labeledElement_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "labeledElement" - // CollectSymbols.g:267:1: labeledElement :{...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) ; - public final CollectSymbols.labeledElement_return labeledElement() throws RecognitionException { - CollectSymbols.labeledElement_return retval = new CollectSymbols.labeledElement_return(); - retval.start = input.LT(1); - - - GrammarAST id=null; - GrammarAST e=null; - - try { - // CollectSymbols.g:273:2: ({...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) ) - // CollectSymbols.g:273:4: {...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) - { - if ( !((inContext("RULE ..."))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "labeledElement", "inContext(\"RULE ...\")"); - } - - // CollectSymbols.g:274:3: ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) - int alt14=2; - int LA14_0 = input.LA(1); - - if ( (LA14_0==ASSIGN) ) { - alt14=1; - } - else if ( (LA14_0==PLUS_ASSIGN) ) { - alt14=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 14, 0, input); - - throw nvae; - - } - switch (alt14) { - case 1 : - // CollectSymbols.g:274:5: ^( ASSIGN id= ID e= . ) - { - match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement780); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement784); if (state.failed) return retval; - - e=(GrammarAST)input.LT(1); - - matchAny(input); if (state.failed) return retval; - - match(input, Token.UP, null); if (state.failed) return retval; - - - } - break; - case 2 : - // CollectSymbols.g:275:5: ^( PLUS_ASSIGN id= ID e= . ) - { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement796); if (state.failed) return retval; - - match(input, Token.DOWN, null); if (state.failed) return retval; - id=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement800); if (state.failed) return retval; - - e=(GrammarAST)input.LT(1); - - matchAny(input); if (state.failed) return retval; - - match(input, Token.UP, null); if (state.failed) return retval; - - - } - break; - - } - - - } - - if ( state.backtracking==1 ) { - LabelElementPair lp = new LabelElementPair(g, id, e, ((GrammarAST)retval.start).getType()); - //currentRule.labelDefs.map((id!=null?id.getText():null), lp); - currentRule.alt[currentAlt].labelDefs.map((id!=null?id.getText():null), lp); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "labeledElement" - - - public static class terminal_return extends TreeRuleReturnScope { - }; - - - // $ANTLR start "terminal" - // CollectSymbols.g:279:1: terminal : ({...}? STRING_LITERAL | TOKEN_REF ); - public final CollectSymbols.terminal_return terminal() throws RecognitionException { - CollectSymbols.terminal_return retval = new CollectSymbols.terminal_return(); - retval.start = input.LT(1); - - - GrammarAST STRING_LITERAL19=null; - GrammarAST TOKEN_REF20=null; - - try { - // CollectSymbols.g:280:5: ({...}? STRING_LITERAL | TOKEN_REF ) - int alt15=2; - int LA15_0 = input.LA(1); - - if ( (LA15_0==STRING_LITERAL) ) { - alt15=1; - } - else if ( (LA15_0==TOKEN_REF) ) { - alt15=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 15, 0, input); - - throw nvae; - - } - switch (alt15) { - case 1 : - // CollectSymbols.g:280:7: {...}? STRING_LITERAL - { - if ( !((!inContext("TOKENS ASSIGN"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "terminal", "!inContext(\"TOKENS ASSIGN\")"); - } - - STRING_LITERAL19=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal825); if (state.failed) return retval; - - if ( state.backtracking==1 ) { - terminals.add(((GrammarAST)retval.start)); - strings.add((STRING_LITERAL19!=null?STRING_LITERAL19.getText():null)); - if ( currentRule!=null ) { - currentRule.alt[currentAlt].tokenRefs.map((STRING_LITERAL19!=null?STRING_LITERAL19.getText():null), (TerminalAST)STRING_LITERAL19); - } - } - - } - break; - case 2 : - // CollectSymbols.g:288:7: TOKEN_REF - { - TOKEN_REF20=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal840); if (state.failed) return retval; - - if ( state.backtracking==1 ) { - terminals.add(TOKEN_REF20); - tokenIDRefs.add(TOKEN_REF20); - if ( currentRule!=null ) { - currentRule.alt[currentAlt].tokenRefs.map((TOKEN_REF20!=null?TOKEN_REF20.getText():null), (TerminalAST)TOKEN_REF20); - } - } - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "terminal" - - - - // $ANTLR start "ruleref" - // CollectSymbols.g:298:1: ruleref : ({...}?r= RULE_REF |r= RULE_REF ) ; - public final void ruleref() throws RecognitionException { - GrammarAST r=null; - - try { - // CollectSymbols.g:300:5: ( ({...}?r= RULE_REF |r= RULE_REF ) ) - // CollectSymbols.g:300:7: ({...}?r= RULE_REF |r= RULE_REF ) - { - // CollectSymbols.g:300:7: ({...}?r= RULE_REF |r= RULE_REF ) - int alt16=2; - int LA16_0 = input.LA(1); - - if ( (LA16_0==RULE_REF) ) { - int LA16_1 = input.LA(2); - - if ( ((inContext("DOT ..."))) ) { - alt16=1; - } - else if ( (true) ) { - alt16=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 16, 1, input); - - throw nvae; - - } - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 16, 0, input); - - throw nvae; - - } - switch (alt16) { - case 1 : - // CollectSymbols.g:300:9: {...}?r= RULE_REF - { - if ( !((inContext("DOT ..."))) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "ruleref", "inContext(\"DOT ...\")"); - } - - r=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref877); if (state.failed) return ; - - if ( state.backtracking==1 ) {qualifiedRulerefs.add((GrammarAST)r.getParent());} - - } - break; - case 2 : - // CollectSymbols.g:302:8: r= RULE_REF - { - r=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref890); if (state.failed) return ; - - } - break; - - } - - - if ( state.backtracking==1 ) { - rulerefs.add(r); - if ( currentRule!=null ) { - currentRule.alt[currentAlt].ruleRefs.map((r!=null?r.getText():null), r); - } - } - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - - finally { - // do for sure before leaving - } - return ; - } - // $ANTLR end "ruleref" - - // Delegated rules - - - protected DFA5 dfa5 = new DFA5(this); - static final String DFA5_eotS = - "\41\uffff"; - static final String DFA5_eofS = - "\41\uffff"; - static final String DFA5_minS = - "\1\4\3\2\1\uffff\3\4\1\2\1\3\1\2\2\uffff\2\3\1\uffff\4\2\4\4\1\2"+ - "\2\3\1\2\3\3\1\uffff\1\3"; - static final String DFA5_maxS = - "\4\146\1\uffff\6\146\2\uffff\2\146\1\uffff\17\146\1\uffff\1\146"; - static final String DFA5_acceptS = - "\4\uffff\1\1\6\uffff\2\2\2\uffff\1\2\17\uffff\1\2\1\uffff"; - static final String DFA5_specialS = - "\41\uffff}>"; - static final String[] DFA5_transitionS = { - "\6\4\1\2\104\4\1\3\21\4\1\1\5\4", - "\1\5\1\uffff\143\4", - "\1\6\1\uffff\143\4", - "\1\7\1\uffff\143\4", - "", - "\143\10", - "\122\4\1\11\20\4", - "\143\12", - "\1\13\1\14\143\10", - "\1\4\1\15\142\4", - "\1\14\1\16\143\12", - "", - "", - "\1\17\143\4", - "\1\17\6\23\1\21\104\23\1\22\21\23\1\20\5\23", - "", - "\1\24\1\17\6\23\1\21\104\23\1\22\21\23\1\20\5\23", - "\1\25\1\17\6\23\1\21\104\23\1\22\21\23\1\20\5\23", - "\1\26\1\17\6\23\1\21\104\23\1\22\21\23\1\20\5\23", - "\1\27\1\17\6\23\1\21\104\23\1\22\21\23\1\20\5\23", - "\143\30", - "\122\32\1\31\20\32", - "\143\33", - "\143\32", - "\1\4\1\34\143\30", - "\1\36\1\35\142\32", - "\1\36\143\32", - "\1\4\1\37\143\33", - "\1\37\6\23\1\21\104\23\1\22\21\23\1\20\5\23", - "\1\40\143\32", - "\1\37\6\23\1\21\104\23\1\22\21\23\1\20\5\23", - "", - "\1\37\6\23\1\21\104\23\1\22\21\23\1\20\5\23" - }; - - static final short[] DFA5_eot = DFA.unpackEncodedString(DFA5_eotS); - static final short[] DFA5_eof = DFA.unpackEncodedString(DFA5_eofS); - static final char[] DFA5_min = DFA.unpackEncodedStringToUnsignedChars(DFA5_minS); - static final char[] DFA5_max = DFA.unpackEncodedStringToUnsignedChars(DFA5_maxS); - static final short[] DFA5_accept = DFA.unpackEncodedString(DFA5_acceptS); - static final short[] DFA5_special = DFA.unpackEncodedString(DFA5_specialS); - static final short[][] DFA5_transition; - - static { - int numStates = DFA5_transitionS.length; - DFA5_transition = new short[numStates][]; - for (int i=0; i