package org.antlr.grammar.v3;
import java.util.*;
import org.antlr.analysis.*;
import org.antlr.misc.*;
import org.antlr.tool.*;
import org.antlr.runtime.BitSet;
import org.antlr.runtime.*;
import org.antlr.runtime.tree.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class AssignTokenTypesWalker extends TreeParser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "ACTION", "ACTION_CHAR_LITERAL",
"ACTION_ESC", "ACTION_STRING_LITERAL", "ALT", "AMPERSAND", "ARG", "ARGLIST",
"ARG_ACTION", "ASSIGN", "BACKTRACK_SEMPRED", "BANG", "BLOCK", "CATCH",
"CHAR_LITERAL", "CHAR_RANGE", "CLOSE_ELEMENT_OPTION", "CLOSURE", "COLON",
"COMBINED_GRAMMAR", "COMMA", "COMMENT", "DIGIT", "DOC_COMMENT", "DOLLAR",
"DOT", "DOUBLE_ANGLE_STRING_LITERAL", "DOUBLE_QUOTE_STRING_LITERAL", "EOA",
"EOB", "EOR", "EPSILON", "ESC", "ETC", "FINALLY", "FORCED_ACTION", "FRAGMENT",
"GATED_SEMPRED", "GRAMMAR", "ID", "IMPLIES", "IMPORT", "INITACTION", "INT",
"LABEL", "LEXER", "LEXER_GRAMMAR", "LPAREN", "ML_COMMENT", "NESTED_ACTION",
"NESTED_ARG_ACTION", "NOT", "OPEN_ELEMENT_OPTION", "OPTIONAL", "OPTIONS",
"OR", "PARSER", "PARSER_GRAMMAR", "PLUS", "PLUS_ASSIGN", "POSITIVE_CLOSURE",
"PREC_RULE", "PRIVATE", "PROTECTED", "PUBLIC", "QUESTION", "RANGE", "RCURLY",
"RECURSIVE_RULE_REF", "RET", "RETURNS", "REWRITE", "REWRITES", "ROOT",
"RPAREN", "RULE", "RULE_REF", "SCOPE", "SEMI", "SEMPRED", "SL_COMMENT",
"SRC", "STAR", "STRAY_BRACKET", "STRING_LITERAL", "SYNPRED", "SYN_SEMPRED",
"TEMPLATE", "THROWS", "TOKENS", "TOKEN_REF", "TREE", "TREE_BEGIN", "TREE_GRAMMAR",
"WILDCARD", "WS", "WS_LOOP", "WS_OPT", "XDIGIT", "CHARSET"
};
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 ALT=8;
public static final int AMPERSAND=9;
public static final int ARG=10;
public static final int ARGLIST=11;
public static final int ARG_ACTION=12;
public static final int ASSIGN=13;
public static final int BACKTRACK_SEMPRED=14;
public static final int BANG=15;
public static final int BLOCK=16;
public static final int CATCH=17;
public static final int CHAR_LITERAL=18;
public static final int CHAR_RANGE=19;
public static final int CLOSE_ELEMENT_OPTION=20;
public static final int CLOSURE=21;
public static final int COLON=22;
public static final int COMBINED_GRAMMAR=23;
public static final int COMMA=24;
public static final int =25;
public static final int DIGIT=26;
public static final int =27;
public static final int DOLLAR=28;
public static final int DOT=29;
public static final int DOUBLE_ANGLE_STRING_LITERAL=30;
public static final int DOUBLE_QUOTE_STRING_LITERAL=31;
public static final int EOA=32;
public static final int EOB=33;
public static final int EOR=34;
public static final int EPSILON=35;
public static final int ESC=36;
public static final int ETC=37;
public static final int FINALLY=38;
public static final int FORCED_ACTION=39;
public static final int FRAGMENT=40;
public static final int GATED_SEMPRED=41;
public static final int GRAMMAR=42;
public static final int ID=43;
public static final int IMPLIES=44;
public static final int IMPORT=45;
public static final int INITACTION=46;
public static final int INT=47;
public static final int LABEL=48;
public static final int LEXER=49;
public static final int LEXER_GRAMMAR=50;
public static final int LPAREN=51;
public static final int =52;
public static final int NESTED_ACTION=53;
public static final int NESTED_ARG_ACTION=54;
public static final int NOT=55;
public static final int OPEN_ELEMENT_OPTION=56;
public static final int OPTIONAL=57;
public static final int OPTIONS=58;
public static final int OR=59;
public static final int PARSER=60;
public static final int PARSER_GRAMMAR=61;
public static final int PLUS=62;
public static final int PLUS_ASSIGN=63;
public static final int POSITIVE_CLOSURE=64;
public static final int PREC_RULE=65;
public static final int PRIVATE=66;
public static final int PROTECTED=67;
public static final int PUBLIC=68;
public static final int QUESTION=69;
public static final int RANGE=70;
public static final int RCURLY=71;
public static final int RECURSIVE_RULE_REF=72;
public static final int RET=73;
public static final int RETURNS=74;
public static final int REWRITE=75;
public static final int REWRITES=76;
public static final int ROOT=77;
public static final int RPAREN=78;
public static final int RULE=79;
public static final int RULE_REF=80;
public static final int SCOPE=81;
public static final int SEMI=82;
public static final int SEMPRED=83;
public static final int =84;
public static final int SRC=85;
public static final int STAR=86;
public static final int STRAY_BRACKET=87;
public static final int STRING_LITERAL=88;
public static final int SYNPRED=89;
public static final int SYN_SEMPRED=90;
public static final int TEMPLATE=91;
public static final int THROWS=92;
public static final int TOKENS=93;
public static final int TOKEN_REF=94;
public static final int TREE=95;
public static final int TREE_BEGIN=96;
public static final int TREE_GRAMMAR=97;
public static final int WILDCARD=98;
public static final int WS=99;
public static final int WS_LOOP=100;
public static final int WS_OPT=101;
public static final int XDIGIT=102;
public static final int CHARSET=103;
public TreeParser[] getDelegates() {
return new TreeParser[] {};
}
public AssignTokenTypesWalker(TreeNodeStream input) {
this(input, new RecognizerSharedState());
}
public AssignTokenTypesWalker(TreeNodeStream input, RecognizerSharedState state) {
super(input, state);
}
@Override public String[] getTokenNames() { return AssignTokenTypesWalker.tokenNames; }
@Override public String getGrammarFileName() { return "org\\antlr\\grammar\\v3\\AssignTokenTypesWalker.g"; }
protected Grammar grammar;
protected String currentRuleName;
protected static GrammarAST stringAlias;
protected static GrammarAST charAlias;
protected static GrammarAST stringAlias2;
protected static GrammarAST charAlias2;
@Override
public void reportError(RecognitionException ex)
{
Token token = null;
if (ex instanceof MismatchedTokenException) {
token = ((MismatchedTokenException)ex).token;
} else if (ex instanceof NoViableAltException) {
token = ((NoViableAltException)ex).token;
}
ErrorManager.syntaxError(
ErrorManager.MSG_SYNTAX_ERROR,
grammar,
token,
"assign.types: " + ex.toString(),
ex);
}
protected void initASTPatterns()
{
TreeAdaptor adaptor = new ANTLRParser.grammar_Adaptor(null);
stringAlias = (GrammarAST)adaptor.create( BLOCK, "BLOCK" );
{
GrammarAST alt = (GrammarAST)adaptor.create( ALT, "ALT" );
adaptor.addChild( alt, adaptor.create( STRING_LITERAL, "STRING_LITERAL" ) );
adaptor.addChild( alt, adaptor.create( EOA, "EOA" ) );
adaptor.addChild( stringAlias, alt );
}
adaptor.addChild( stringAlias, adaptor.create( EOB, "EOB" ) );
charAlias = (GrammarAST)adaptor.create( BLOCK, "BLOCK" );
{
GrammarAST alt = (GrammarAST)adaptor.create( ALT, "ALT" );
adaptor.addChild( alt, adaptor.create( CHAR_LITERAL, "CHAR_LITERAL" ) );
adaptor.addChild( alt, adaptor.create( EOA, "EOA" ) );
adaptor.addChild( charAlias, alt );
}
adaptor.addChild( charAlias, adaptor.create( EOB, "EOB" ) );
stringAlias2 = (GrammarAST)adaptor.create( BLOCK, "BLOCK" );
{
GrammarAST alt = (GrammarAST)adaptor.create( ALT, "ALT" );
adaptor.addChild( alt, adaptor.create( STRING_LITERAL, "STRING_LITERAL" ) );
adaptor.addChild( alt, adaptor.create( ACTION, "ACTION" ) );
adaptor.addChild( alt, adaptor.create( EOA, "EOA" ) );
adaptor.addChild( stringAlias2, alt );
}
adaptor.addChild( stringAlias2, adaptor.create( EOB, "EOB" ) );
charAlias2 = (GrammarAST)adaptor.create( BLOCK, "BLOCK" );
{
GrammarAST alt = (GrammarAST)adaptor.create( ALT, "ALT" );
adaptor.addChild( alt, adaptor.create( CHAR_LITERAL, "CHAR_LITERAL" ) );
adaptor.addChild( alt, adaptor.create( ACTION, "ACTION" ) );
adaptor.addChild( alt, adaptor.create( EOA, "EOA" ) );
adaptor.addChild( charAlias2, alt );
}
adaptor.addChild( charAlias2, adaptor.create( EOB, "EOB" ) );
}
protected void trackString(GrammarAST t) {}
protected void trackToken( GrammarAST t ) {}
protected void trackTokenRule( GrammarAST t, GrammarAST modifier, GrammarAST block ) {}
protected void alias( GrammarAST t, GrammarAST s ) {}
public void defineTokens( Grammar root ) {}
protected void defineStringLiteralsFromDelegates() {}
protected void assignStringTypes( Grammar root ) {}
protected void aliasTokenIDsAndLiterals( Grammar root ) {}
protected void assignTokenIDTypes( Grammar root ) {}
protected void defineTokenNamesAndLiteralsInGrammar( Grammar root ) {}
protected void init( Grammar root ) {}
public final void grammar_(Grammar g) throws RecognitionException {
if ( state.backtracking == 0 )
init(g);
try {
{
int alt1=4;
switch ( input.LA(1) ) {
case LEXER_GRAMMAR:
{
alt1=1;
}
break;
case PARSER_GRAMMAR:
{
alt1=2;
}
break;
case TREE_GRAMMAR:
{
alt1=3;
}
break;
case COMBINED_GRAMMAR:
{
alt1=4;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 1, 0, input);
throw nvae;
}
switch (alt1) {
case 1 :
{
match(input,LEXER_GRAMMAR,FOLLOW_LEXER_GRAMMAR_in_grammar_69);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_grammarSpec_in_grammar_74);
grammarSpec();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 2 :
{
match(input,PARSER_GRAMMAR,FOLLOW_PARSER_GRAMMAR_in_grammar_84);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_grammarSpec_in_grammar_88);
grammarSpec();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 3 :
{
match(input,TREE_GRAMMAR,FOLLOW_TREE_GRAMMAR_in_grammar_98);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_grammarSpec_in_grammar_104);
grammarSpec();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 4 :
{
match(input,COMBINED_GRAMMAR,FOLLOW_COMBINED_GRAMMAR_in_grammar_114);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_grammarSpec_in_grammar_116);
grammarSpec();
state._fsp--;
match(input, Token.UP, null);
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void grammarSpec() throws RecognitionException {
GrammarAST id=null;
GrammarAST cmt=null;
try {
{
id=(GrammarAST)match(input,ID,FOLLOW_ID_in_grammarSpec135);
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0==DOC_COMMENT) ) {
alt2=1;
}
switch (alt2) {
case 1 :
{
cmt=(GrammarAST)match(input,DOC_COMMENT,FOLLOW_DOC_COMMENT_in_grammarSpec142);
}
break;
}
int alt3=2;
int LA3_0 = input.LA(1);
if ( (LA3_0==OPTIONS) ) {
alt3=1;
}
switch (alt3) {
case 1 :
{
pushFollow(FOLLOW_optionsSpec_in_grammarSpec149);
optionsSpec();
state._fsp--;
}
break;
}
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0==IMPORT) ) {
alt4=1;
}
switch (alt4) {
case 1 :
{
pushFollow(FOLLOW_delegateGrammars_in_grammarSpec156);
delegateGrammars();
state._fsp--;
}
break;
}
int alt5=2;
int LA5_0 = input.LA(1);
if ( (LA5_0==TOKENS) ) {
alt5=1;
}
switch (alt5) {
case 1 :
{
pushFollow(FOLLOW_tokensSpec_in_grammarSpec163);
tokensSpec();
state._fsp--;
}
break;
}
loop6:
while (true) {
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==SCOPE) ) {
alt6=1;
}
switch (alt6) {
case 1 :
{
pushFollow(FOLLOW_attrScope_in_grammarSpec170);
attrScope();
state._fsp--;
}
break;
default :
break loop6;
}
}
loop8:
while (true) {
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==AMPERSAND) ) {
alt8=1;
}
switch (alt8) {
case 1 :
{
match(input,AMPERSAND,FOLLOW_AMPERSAND_in_grammarSpec179);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop7:
while (true) {
int alt7=2;
int LA7_0 = input.LA(1);
if ( ((LA7_0 >= ACTION && LA7_0 <= CHARSET)) ) {
alt7=1;
}
else if ( (LA7_0==UP) ) {
alt7=2;
}
switch (alt7) {
case 1 :
{
matchAny(input);
}
break;
default :
break loop7;
}
}
match(input, Token.UP, null);
}
}
break;
default :
break loop8;
}
}
pushFollow(FOLLOW_rules_in_grammarSpec191);
rules();
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void attrScope() throws RecognitionException {
try {
{
match(input,SCOPE,FOLLOW_SCOPE_in_attrScope204);
match(input, Token.DOWN, null);
match(input,ID,FOLLOW_ID_in_attrScope206);
loop10:
while (true) {
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==AMPERSAND) ) {
alt10=1;
}
switch (alt10) {
case 1 :
{
match(input,AMPERSAND,FOLLOW_AMPERSAND_in_attrScope211);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop9:
while (true) {
int alt9=2;
int LA9_0 = input.LA(1);
if ( ((LA9_0 >= ACTION && LA9_0 <= CHARSET)) ) {
alt9=1;
}
else if ( (LA9_0==UP) ) {
alt9=2;
}
switch (alt9) {
case 1 :
{
matchAny(input);
}
break;
default :
break loop9;
}
}
match(input, Token.UP, null);
}
}
break;
default :
break loop10;
}
}
match(input,ACTION,FOLLOW_ACTION_in_attrScope220);
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final Map<Object, Object> optionsSpec() throws RecognitionException {
Map<Object, Object> opts = new HashMap<Object, Object>();
try {
{
match(input,OPTIONS,FOLLOW_OPTIONS_in_optionsSpec239);
match(input, Token.DOWN, null);
int cnt11=0;
loop11:
while (true) {
int alt11=2;
int LA11_0 = input.LA(1);
if ( (LA11_0==ASSIGN) ) {
alt11=1;
}
switch (alt11) {
case 1 :
{
pushFollow(FOLLOW_option_in_optionsSpec242);
option(opts);
state._fsp--;
}
break;
default :
if ( cnt11 >= 1 ) break loop11;
EarlyExitException eee = new EarlyExitException(11, input);
throw eee;
}
cnt11++;
}
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return opts;
}
public final void option(Map<Object, Object> opts) throws RecognitionException {
GrammarAST ID1=null;
TreeRuleReturnScope optionValue2 =null;
try {
{
match(input,ASSIGN,FOLLOW_ASSIGN_in_option261);
match(input, Token.DOWN, null);
ID1=(GrammarAST)match(input,ID,FOLLOW_ID_in_option263);
pushFollow(FOLLOW_optionValue_in_option265);
optionValue2=optionValue();
state._fsp--;
match(input, Token.UP, null);
String key = (ID1!=null?ID1.getText():null);
opts.put(key, (optionValue2!=null?((AssignTokenTypesWalker.optionValue_return)optionValue2).value:null));
if ( currentRuleName==null && key.equals("tokenVocab") )
{
grammar.importTokenVocabulary(ID1,(String)(optionValue2!=null?((AssignTokenTypesWalker.optionValue_return)optionValue2).value:null));
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public static class optionValue_return extends TreeRuleReturnScope {
public Object value=null;
};
public final AssignTokenTypesWalker.optionValue_return optionValue() throws RecognitionException {
AssignTokenTypesWalker.optionValue_return retval = new AssignTokenTypesWalker.optionValue_return();
retval.start = input.LT(1);
GrammarAST INT3=null;
if ( state.backtracking == 0 )
retval.value = ((GrammarAST)retval.start).getText();
try {
int alt12=4;
switch ( input.LA(1) ) {
case ID:
{
alt12=1;
}
break;
case STRING_LITERAL:
{
alt12=2;
}
break;
case CHAR_LITERAL:
{
alt12=3;
}
break;
case INT:
{
alt12=4;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 12, 0, input);
throw nvae;
}
switch (alt12) {
case 1 :
{
match(input,ID,FOLLOW_ID_in_optionValue291);
}
break;
case 2 :
{
match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_optionValue296);
}
break;
case 3 :
{
match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_optionValue301);
}
break;
case 4 :
{
INT3=(GrammarAST)match(input,INT,FOLLOW_INT_in_optionValue306);
retval.value = Integer.parseInt((INT3!=null?INT3.getText():null));
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
public final void charSet() throws RecognitionException {
try {
{
match(input,CHARSET,FOLLOW_CHARSET_in_charSet324);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_charSetElement_in_charSet326);
charSetElement();
state._fsp--;
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void charSetElement() throws RecognitionException {
try {
int alt13=3;
switch ( input.LA(1) ) {
case CHAR_LITERAL:
{
alt13=1;
}
break;
case OR:
{
alt13=2;
}
break;
case RANGE:
{
alt13=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 13, 0, input);
throw nvae;
}
switch (alt13) {
case 1 :
{
match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_charSetElement339);
}
break;
case 2 :
{
match(input,OR,FOLLOW_OR_in_charSetElement346);
match(input, Token.DOWN, null);
match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_charSetElement348);
match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_charSetElement350);
match(input, Token.UP, null);
}
break;
case 3 :
{
match(input,RANGE,FOLLOW_RANGE_in_charSetElement359);
match(input, Token.DOWN, null);
match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_charSetElement361);
match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_charSetElement363);
match(input, Token.UP, null);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void delegateGrammars() throws RecognitionException {
try {
{
match(input,IMPORT,FOLLOW_IMPORT_in_delegateGrammars378);
match(input, Token.DOWN, null);
int cnt14=0;
loop14:
while (true) {
int alt14=3;
int LA14_0 = input.LA(1);
if ( (LA14_0==ASSIGN) ) {
alt14=1;
}
else if ( (LA14_0==ID) ) {
alt14=2;
}
switch (alt14) {
case 1 :
{
match(input,ASSIGN,FOLLOW_ASSIGN_in_delegateGrammars386);
match(input, Token.DOWN, null);
match(input,ID,FOLLOW_ID_in_delegateGrammars388);
match(input,ID,FOLLOW_ID_in_delegateGrammars390);
match(input, Token.UP, null);
}
break;
case 2 :
{
match(input,ID,FOLLOW_ID_in_delegateGrammars398);
}
break;
default :
if ( cnt14 >= 1 ) break loop14;
EarlyExitException eee = new EarlyExitException(14, input);
throw eee;
}
cnt14++;
}
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void tokensSpec() throws RecognitionException {
try {
{
match(input,TOKENS,FOLLOW_TOKENS_in_tokensSpec420);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop15:
while (true) {
int alt15=2;
int LA15_0 = input.LA(1);
if ( (LA15_0==ASSIGN||LA15_0==TOKEN_REF) ) {
alt15=1;
}
switch (alt15) {
case 1 :
{
pushFollow(FOLLOW_tokenSpec_in_tokensSpec422);
tokenSpec();
state._fsp--;
}
break;
default :
break loop15;
}
}
match(input, Token.UP, null);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void tokenSpec() throws RecognitionException {
GrammarAST t=null;
GrammarAST t2=null;
GrammarAST s=null;
GrammarAST c=null;
try {
int alt17=2;
int LA17_0 = input.LA(1);
if ( (LA17_0==TOKEN_REF) ) {
alt17=1;
}
else if ( (LA17_0==ASSIGN) ) {
alt17=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 17, 0, input);
throw nvae;
}
switch (alt17) {
case 1 :
{
t=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec437);
trackToken(t);
}
break;
case 2 :
{
match(input,ASSIGN,FOLLOW_ASSIGN_in_tokenSpec457);
match(input, Token.DOWN, null);
t2=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec464);
trackToken(t2);
int alt16=2;
int LA16_0 = input.LA(1);
if ( (LA16_0==STRING_LITERAL) ) {
alt16=1;
}
else if ( (LA16_0==CHAR_LITERAL) ) {
alt16=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 16, 0, input);
throw nvae;
}
switch (alt16) {
case 1 :
{
s=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_tokenSpec481);
trackString(s); alias(t2,s);
}
break;
case 2 :
{
c=(GrammarAST)match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_tokenSpec492);
trackString(c); alias(t2,c);
}
break;
}
match(input, Token.UP, null);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void rules() throws RecognitionException {
try {
{
int cnt18=0;
loop18:
while (true) {
int alt18=2;
int LA18_0 = input.LA(1);
if ( (LA18_0==PREC_RULE||LA18_0==RULE) ) {
alt18=1;
}
switch (alt18) {
case 1 :
{
pushFollow(FOLLOW_rule_in_rules516);
rule();
state._fsp--;
}
break;
default :
if ( cnt18 >= 1 ) break loop18;
EarlyExitException eee = new EarlyExitException(18, input);
throw eee;
}
cnt18++;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void rule() throws RecognitionException {
try {
int alt19=2;
int LA19_0 = input.LA(1);
if ( (LA19_0==RULE) ) {
alt19=1;
}
else if ( (LA19_0==PREC_RULE) ) {
alt19=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 19, 0, input);
throw nvae;
}
switch (alt19) {
case 1 :
{
match(input,RULE,FOLLOW_RULE_in_rule529);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_ruleBody_in_rule531);
ruleBody();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 2 :
{
match(input,PREC_RULE,FOLLOW_PREC_RULE_in_rule538);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_ruleBody_in_rule540);
ruleBody();
state._fsp--;
match(input, Token.UP, null);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void ruleBody() throws RecognitionException {
GrammarAST id=null;
TreeRuleReturnScope m =null;
TreeRuleReturnScope b =null;
try {
{
id=(GrammarAST)match(input,ID,FOLLOW_ID_in_ruleBody554);
currentRuleName=(id!=null?id.getText():null);
int alt20=2;
int LA20_0 = input.LA(1);
if ( (LA20_0==FRAGMENT||(LA20_0 >= PRIVATE && LA20_0 <= PUBLIC)) ) {
alt20=1;
}
switch (alt20) {
case 1 :
{
pushFollow(FOLLOW_modifier_in_ruleBody563);
m=modifier();
state._fsp--;
}
break;
}
match(input,ARG,FOLLOW_ARG_in_ruleBody570);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
int alt21=2;
int LA21_0 = input.LA(1);
if ( (LA21_0==ARG_ACTION) ) {
alt21=1;
}
switch (alt21) {
case 1 :
{
match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleBody573);
}
break;
}
match(input, Token.UP, null);
}
match(input,RET,FOLLOW_RET_in_ruleBody581);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
int alt22=2;
int LA22_0 = input.LA(1);
if ( (LA22_0==ARG_ACTION) ) {
alt22=1;
}
switch (alt22) {
case 1 :
{
match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleBody584);
}
break;
}
match(input, Token.UP, null);
}
int alt23=2;
int LA23_0 = input.LA(1);
if ( (LA23_0==THROWS) ) {
alt23=1;
}
switch (alt23) {
case 1 :
{
pushFollow(FOLLOW_throwsSpec_in_ruleBody592);
throwsSpec();
state._fsp--;
}
break;
}
int alt24=2;
int LA24_0 = input.LA(1);
if ( (LA24_0==OPTIONS) ) {
alt24=1;
}
switch (alt24) {
case 1 :
{
pushFollow(FOLLOW_optionsSpec_in_ruleBody599);
optionsSpec();
state._fsp--;
}
break;
}
int alt25=2;
int LA25_0 = input.LA(1);
if ( (LA25_0==SCOPE) ) {
alt25=1;
}
switch (alt25) {
case 1 :
{
pushFollow(FOLLOW_ruleScopeSpec_in_ruleBody606);
ruleScopeSpec();
state._fsp--;
}
break;
}
loop27:
while (true) {
int alt27=2;
int LA27_0 = input.LA(1);
if ( (LA27_0==AMPERSAND) ) {
alt27=1;
}
switch (alt27) {
case 1 :
{
match(input,AMPERSAND,FOLLOW_AMPERSAND_in_ruleBody615);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop26:
while (true) {
int alt26=2;
int LA26_0 = input.LA(1);
if ( ((LA26_0 >= ACTION && LA26_0 <= CHARSET)) ) {
alt26=1;
}
else if ( (LA26_0==UP) ) {
alt26=2;
}
switch (alt26) {
case 1 :
{
matchAny(input);
}
break;
default :
break loop26;
}
}
match(input, Token.UP, null);
}
}
break;
default :
break loop27;
}
}
pushFollow(FOLLOW_block_in_ruleBody628);
b=block();
state._fsp--;
int alt28=2;
int LA28_0 = input.LA(1);
if ( (LA28_0==CATCH||LA28_0==FINALLY) ) {
alt28=1;
}
switch (alt28) {
case 1 :
{
pushFollow(FOLLOW_exceptionGroup_in_ruleBody633);
exceptionGroup();
state._fsp--;
}
break;
}
match(input,EOR,FOLLOW_EOR_in_ruleBody639);
trackTokenRule(id,(m!=null?((GrammarAST)m.start):null),(b!=null?((GrammarAST)b.start):null));
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public static class modifier_return extends TreeRuleReturnScope {
};
public final AssignTokenTypesWalker.modifier_return modifier() throws RecognitionException {
AssignTokenTypesWalker.modifier_return retval = new AssignTokenTypesWalker.modifier_return();
retval.start = input.LT(1);
try {
{
if ( input.LA(1)==FRAGMENT||(input.LA(1) >= PRIVATE && input.LA(1) <= PUBLIC) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
public final void throwsSpec() throws RecognitionException {
try {
{
match(input,THROWS,FOLLOW_THROWS_in_throwsSpec681);
match(input, Token.DOWN, null);
int cnt29=0;
loop29:
while (true) {
int alt29=2;
int LA29_0 = input.LA(1);
if ( (LA29_0==ID) ) {
alt29=1;
}
switch (alt29) {
case 1 :
{
match(input,ID,FOLLOW_ID_in_throwsSpec683);
}
break;
default :
if ( cnt29 >= 1 ) break loop29;
EarlyExitException eee = new EarlyExitException(29, input);
throw eee;
}
cnt29++;
}
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void ruleScopeSpec() throws RecognitionException {
try {
{
match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec698);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop31:
while (true) {
int alt31=2;
int LA31_0 = input.LA(1);
if ( (LA31_0==AMPERSAND) ) {
alt31=1;
}
switch (alt31) {
case 1 :
{
match(input,AMPERSAND,FOLLOW_AMPERSAND_in_ruleScopeSpec703);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop30:
while (true) {
int alt30=2;
int LA30_0 = input.LA(1);
if ( ((LA30_0 >= ACTION && LA30_0 <= CHARSET)) ) {
alt30=1;
}
else if ( (LA30_0==UP) ) {
alt30=2;
}
switch (alt30) {
case 1 :
{
matchAny(input);
}
break;
default :
break loop30;
}
}
match(input, Token.UP, null);
}
}
break;
default :
break loop31;
}
}
int alt32=2;
int LA32_0 = input.LA(1);
if ( (LA32_0==ACTION) ) {
alt32=1;
}
switch (alt32) {
case 1 :
{
match(input,ACTION,FOLLOW_ACTION_in_ruleScopeSpec713);
}
break;
}
loop33:
while (true) {
int alt33=2;
int LA33_0 = input.LA(1);
if ( (LA33_0==ID) ) {
alt33=1;
}
switch (alt33) {
case 1 :
{
match(input,ID,FOLLOW_ID_in_ruleScopeSpec719);
}
break;
default :
break loop33;
}
}
match(input, Token.UP, null);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public static class block_return extends TreeRuleReturnScope {
};
public final AssignTokenTypesWalker.block_return block() throws RecognitionException {
AssignTokenTypesWalker.block_return retval = new AssignTokenTypesWalker.block_return();
retval.start = input.LT(1);
try {
{
match(input,BLOCK,FOLLOW_BLOCK_in_block737);
match(input, Token.DOWN, null);
int alt34=2;
int LA34_0 = input.LA(1);
if ( (LA34_0==OPTIONS) ) {
alt34=1;
}
switch (alt34) {
case 1 :
{
pushFollow(FOLLOW_optionsSpec_in_block743);
optionsSpec();
state._fsp--;
}
break;
}
int cnt35=0;
loop35:
while (true) {
int alt35=2;
int LA35_0 = input.LA(1);
if ( (LA35_0==ALT) ) {
alt35=1;
}
switch (alt35) {
case 1 :
{
pushFollow(FOLLOW_alternative_in_block752);
alternative();
state._fsp--;
pushFollow(FOLLOW_rewrite_in_block754);
rewrite();
state._fsp--;
}
break;
default :
if ( cnt35 >= 1 ) break loop35;
EarlyExitException eee = new EarlyExitException(35, input);
throw eee;
}
cnt35++;
}
match(input,EOB,FOLLOW_EOB_in_block762);
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
public final void alternative() throws RecognitionException {
try {
{
match(input,ALT,FOLLOW_ALT_in_alternative779);
match(input, Token.DOWN, null);
int cnt36=0;
loop36:
while (true) {
int alt36=2;
int LA36_0 = input.LA(1);
if ( (LA36_0==ACTION||(LA36_0 >= ASSIGN && LA36_0 <= BLOCK)||(LA36_0 >= CHAR_LITERAL && LA36_0 <= CHAR_RANGE)||LA36_0==CLOSURE||LA36_0==DOT||LA36_0==EPSILON||LA36_0==FORCED_ACTION||LA36_0==GATED_SEMPRED||LA36_0==NOT||LA36_0==OPTIONAL||(LA36_0 >= PLUS_ASSIGN && LA36_0 <= POSITIVE_CLOSURE)||LA36_0==RANGE||LA36_0==ROOT||LA36_0==RULE_REF||LA36_0==SEMPRED||(LA36_0 >= STRING_LITERAL && LA36_0 <= SYN_SEMPRED)||LA36_0==TOKEN_REF||LA36_0==TREE_BEGIN||LA36_0==WILDCARD) ) {
alt36=1;
}
switch (alt36) {
case 1 :
{
pushFollow(FOLLOW_element_in_alternative782);
element();
state._fsp--;
}
break;
default :
if ( cnt36 >= 1 ) break loop36;
EarlyExitException eee = new EarlyExitException(36, input);
throw eee;
}
cnt36++;
}
match(input,EOA,FOLLOW_EOA_in_alternative786);
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void exceptionGroup() throws RecognitionException {
try {
int alt39=2;
int LA39_0 = input.LA(1);
if ( (LA39_0==CATCH) ) {
alt39=1;
}
else if ( (LA39_0==FINALLY) ) {
alt39=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 39, 0, input);
throw nvae;
}
switch (alt39) {
case 1 :
{
int cnt37=0;
loop37:
while (true) {
int alt37=2;
int LA37_0 = input.LA(1);
if ( (LA37_0==CATCH) ) {
alt37=1;
}
switch (alt37) {
case 1 :
{
pushFollow(FOLLOW_exceptionHandler_in_exceptionGroup801);
exceptionHandler();
state._fsp--;
}
break;
default :
if ( cnt37 >= 1 ) break loop37;
EarlyExitException eee = new EarlyExitException(37, input);
throw eee;
}
cnt37++;
}
int alt38=2;
int LA38_0 = input.LA(1);
if ( (LA38_0==FINALLY) ) {
alt38=1;
}
switch (alt38) {
case 1 :
{
pushFollow(FOLLOW_finallyClause_in_exceptionGroup807);
finallyClause();
state._fsp--;
}
break;
}
}
break;
case 2 :
{
pushFollow(FOLLOW_finallyClause_in_exceptionGroup814);
finallyClause();
state._fsp--;
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void exceptionHandler() throws RecognitionException {
try {
{
match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler826);
match(input, Token.DOWN, null);
match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_exceptionHandler828);
match(input,ACTION,FOLLOW_ACTION_in_exceptionHandler830);
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void finallyClause() throws RecognitionException {
try {
{
match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause843);
match(input, Token.DOWN, null);
match(input,ACTION,FOLLOW_ACTION_in_finallyClause845);
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void rewrite() throws RecognitionException {
try {
int alt42=2;
int LA42_0 = input.LA(1);
if ( (LA42_0==REWRITES) ) {
alt42=1;
}
else if ( (LA42_0==ALT||LA42_0==EOB) ) {
alt42=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 42, 0, input);
throw nvae;
}
switch (alt42) {
case 1 :
{
match(input,REWRITES,FOLLOW_REWRITES_in_rewrite858);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop41:
while (true) {
int alt41=2;
int LA41_0 = input.LA(1);
if ( (LA41_0==REWRITE) ) {
alt41=1;
}
switch (alt41) {
case 1 :
{
match(input,REWRITE,FOLLOW_REWRITE_in_rewrite863);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop40:
while (true) {
int alt40=2;
int LA40_0 = input.LA(1);
if ( ((LA40_0 >= ACTION && LA40_0 <= CHARSET)) ) {
alt40=1;
}
else if ( (LA40_0==UP) ) {
alt40=2;
}
switch (alt40) {
case 1 :
{
matchAny(input);
}
break;
default :
break loop40;
}
}
match(input, Token.UP, null);
}
}
break;
default :
break loop41;
}
}
match(input, Token.UP, null);
}
}
break;
case 2 :
{
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void element() throws RecognitionException {
try {
int alt44=18;
switch ( input.LA(1) ) {
case ROOT:
{
alt44=1;
}
break;
case BANG:
{
alt44=2;
}
break;
case CHAR_LITERAL:
case DOT:
case RULE_REF:
case STRING_LITERAL:
case TOKEN_REF:
case WILDCARD:
{
alt44=3;
}
break;
case NOT:
{
alt44=4;
}
break;
case RANGE:
{
alt44=5;
}
break;
case CHAR_RANGE:
{
alt44=6;
}
break;
case ASSIGN:
{
alt44=7;
}
break;
case PLUS_ASSIGN:
{
alt44=8;
}
break;
case BLOCK:
case CLOSURE:
case OPTIONAL:
case POSITIVE_CLOSURE:
{
alt44=9;
}
break;
case TREE_BEGIN:
{
alt44=10;
}
break;
case SYNPRED:
{
alt44=11;
}
break;
case FORCED_ACTION:
{
alt44=12;
}
break;
case ACTION:
{
alt44=13;
}
break;
case SEMPRED:
{
alt44=14;
}
break;
case SYN_SEMPRED:
{
alt44=15;
}
break;
case BACKTRACK_SEMPRED:
{
alt44=16;
}
break;
case GATED_SEMPRED:
{
alt44=17;
}
break;
case EPSILON:
{
alt44=18;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 44, 0, input);
throw nvae;
}
switch (alt44) {
case 1 :
{
match(input,ROOT,FOLLOW_ROOT_in_element887);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_element_in_element889);
element();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 2 :
{
match(input,BANG,FOLLOW_BANG_in_element896);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_element_in_element898);
element();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 3 :
{
pushFollow(FOLLOW_atom_in_element904);
atom();
state._fsp--;
}
break;
case 4 :
{
match(input,NOT,FOLLOW_NOT_in_element910);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_element_in_element912);
element();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 5 :
{
match(input,RANGE,FOLLOW_RANGE_in_element919);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_atom_in_element921);
atom();
state._fsp--;
pushFollow(FOLLOW_atom_in_element923);
atom();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 6 :
{
match(input,CHAR_RANGE,FOLLOW_CHAR_RANGE_in_element930);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_atom_in_element932);
atom();
state._fsp--;
pushFollow(FOLLOW_atom_in_element934);
atom();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 7 :
{
match(input,ASSIGN,FOLLOW_ASSIGN_in_element941);
match(input, Token.DOWN, null);
match(input,ID,FOLLOW_ID_in_element943);
pushFollow(FOLLOW_element_in_element945);
element();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 8 :
{
match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_element952);
match(input, Token.DOWN, null);
match(input,ID,FOLLOW_ID_in_element954);
pushFollow(FOLLOW_element_in_element956);
element();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 9 :
{
pushFollow(FOLLOW_ebnf_in_element962);
ebnf();
state._fsp--;
}
break;
case 10 :
{
pushFollow(FOLLOW_tree__in_element967);
tree_();
state._fsp--;
}
break;
case 11 :
{
match(input,SYNPRED,FOLLOW_SYNPRED_in_element974);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_block_in_element976);
block();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 12 :
{
match(input,FORCED_ACTION,FOLLOW_FORCED_ACTION_in_element983);
}
break;
case 13 :
{
match(input,ACTION,FOLLOW_ACTION_in_element988);
}
break;
case 14 :
{
match(input,SEMPRED,FOLLOW_SEMPRED_in_element993);
}
break;
case 15 :
{
match(input,SYN_SEMPRED,FOLLOW_SYN_SEMPRED_in_element998);
}
break;
case 16 :
{
match(input,BACKTRACK_SEMPRED,FOLLOW_BACKTRACK_SEMPRED_in_element1004);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
loop43:
while (true) {
int alt43=2;
int LA43_0 = input.LA(1);
if ( ((LA43_0 >= ACTION && LA43_0 <= CHARSET)) ) {
alt43=1;
}
else if ( (LA43_0==UP) ) {
alt43=2;
}
switch (alt43) {
case 1 :
{
matchAny(input);
}
break;
default :
break loop43;
}
}
match(input, Token.UP, null);
}
}
break;
case 17 :
{
match(input,GATED_SEMPRED,FOLLOW_GATED_SEMPRED_in_element1013);
}
break;
case 18 :
{
match(input,EPSILON,FOLLOW_EPSILON_in_element1018);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void ebnf() throws RecognitionException {
try {
int alt45=4;
switch ( input.LA(1) ) {
case BLOCK:
{
alt45=1;
}
break;
case OPTIONAL:
{
alt45=2;
}
break;
case CLOSURE:
{
alt45=3;
}
break;
case POSITIVE_CLOSURE:
{
alt45=4;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 45, 0, input);
throw nvae;
}
switch (alt45) {
case 1 :
{
pushFollow(FOLLOW_block_in_ebnf1029);
block();
state._fsp--;
}
break;
case 2 :
{
match(input,OPTIONAL,FOLLOW_OPTIONAL_in_ebnf1036);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_block_in_ebnf1038);
block();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 3 :
{
match(input,CLOSURE,FOLLOW_CLOSURE_in_ebnf1047);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_block_in_ebnf1049);
block();
state._fsp--;
match(input, Token.UP, null);
}
break;
case 4 :
{
match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_ebnf1058);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_block_in_ebnf1060);
block();
state._fsp--;
match(input, Token.UP, null);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void tree_() throws RecognitionException {
try {
{
match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_tree_1074);
match(input, Token.DOWN, null);
int cnt46=0;
loop46:
while (true) {
int alt46=2;
int LA46_0 = input.LA(1);
if ( (LA46_0==ACTION||(LA46_0 >= ASSIGN && LA46_0 <= BLOCK)||(LA46_0 >= CHAR_LITERAL && LA46_0 <= CHAR_RANGE)||LA46_0==CLOSURE||LA46_0==DOT||LA46_0==EPSILON||LA46_0==FORCED_ACTION||LA46_0==GATED_SEMPRED||LA46_0==NOT||LA46_0==OPTIONAL||(LA46_0 >= PLUS_ASSIGN && LA46_0 <= POSITIVE_CLOSURE)||LA46_0==RANGE||LA46_0==ROOT||LA46_0==RULE_REF||LA46_0==SEMPRED||(LA46_0 >= STRING_LITERAL && LA46_0 <= SYN_SEMPRED)||LA46_0==TOKEN_REF||LA46_0==TREE_BEGIN||LA46_0==WILDCARD) ) {
alt46=1;
}
switch (alt46) {
case 1 :
{
pushFollow(FOLLOW_element_in_tree_1076);
element();
state._fsp--;
}
break;
default :
if ( cnt46 >= 1 ) break loop46;
EarlyExitException eee = new EarlyExitException(46, input);
throw eee;
}
cnt46++;
}
match(input, Token.UP, null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void atom() throws RecognitionException {
GrammarAST t=null;
GrammarAST c=null;
GrammarAST s=null;
try {
int alt49=6;
switch ( input.LA(1) ) {
case RULE_REF:
{
alt49=1;
}
break;
case TOKEN_REF:
{
alt49=2;
}
break;
case CHAR_LITERAL:
{
alt49=3;
}
break;
case STRING_LITERAL:
{
alt49=4;
}
break;
case WILDCARD:
{
alt49=5;
}
break;
case DOT:
{
alt49=6;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 49, 0, input);
throw nvae;
}
switch (alt49) {
case 1 :
{
match(input,RULE_REF,FOLLOW_RULE_REF_in_atom1091);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
int alt47=2;
int LA47_0 = input.LA(1);
if ( (LA47_0==ARG_ACTION) ) {
alt47=1;
}
switch (alt47) {
case 1 :
{
match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_atom1094);
}
break;
}
match(input, Token.UP, null);
}
}
break;
case 2 :
{
t=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_atom1107);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
int alt48=2;
int LA48_0 = input.LA(1);
if ( (LA48_0==ARG_ACTION) ) {
alt48=1;
}
switch (alt48) {
case 1 :
{
match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_atom1110);
}
break;
}
match(input, Token.UP, null);
}
trackToken(t);
}
break;
case 3 :
{
c=(GrammarAST)match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_atom1124);
trackString(c);
}
break;
case 4 :
{
s=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_atom1135);
trackString(s);
}
break;
case 5 :
{
match(input,WILDCARD,FOLLOW_WILDCARD_in_atom1142);
}
break;
case 6 :
{
match(input,DOT,FOLLOW_DOT_in_atom1148);
match(input, Token.DOWN, null);
match(input,ID,FOLLOW_ID_in_atom1150);
pushFollow(FOLLOW_atom_in_atom1152);
atom();
state._fsp--;
match(input, Token.UP, null);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void ast_suffix() throws RecognitionException {
try {
{
if ( input.LA(1)==BANG||input.LA(1)==ROOT ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public static final BitSet FOLLOW_LEXER_GRAMMAR_in_grammar_69 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_grammarSpec_in_grammar_74 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_PARSER_GRAMMAR_in_grammar_84 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_grammarSpec_in_grammar_88 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_TREE_GRAMMAR_in_grammar_98 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_grammarSpec_in_grammar_104 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_COMBINED_GRAMMAR_in_grammar_114 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_grammarSpec_in_grammar_116 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ID_in_grammarSpec135 = new BitSet(new long[]{0x0400200008000200L,0x0000000020028002L});
public static final BitSet = new BitSet(new long[]{0x0400200000000200L,0x0000000020028002L});
public static final BitSet FOLLOW_optionsSpec_in_grammarSpec149 = new BitSet(new long[]{0x0000200000000200L,0x0000000020028002L});
public static final BitSet FOLLOW_delegateGrammars_in_grammarSpec156 = new BitSet(new long[]{0x0000000000000200L,0x0000000020028002L});
public static final BitSet FOLLOW_tokensSpec_in_grammarSpec163 = new BitSet(new long[]{0x0000000000000200L,0x0000000000028002L});
public static final BitSet FOLLOW_attrScope_in_grammarSpec170 = new BitSet(new long[]{0x0000000000000200L,0x0000000000028002L});
public static final BitSet FOLLOW_AMPERSAND_in_grammarSpec179 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_rules_in_grammarSpec191 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SCOPE_in_attrScope204 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_attrScope206 = new BitSet(new long[]{0x0000000000000210L});
public static final BitSet FOLLOW_AMPERSAND_in_attrScope211 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ACTION_in_attrScope220 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_OPTIONS_in_optionsSpec239 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_option_in_optionsSpec242 = new BitSet(new long[]{0x0000000000002008L});
public static final BitSet FOLLOW_ASSIGN_in_option261 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_option263 = new BitSet(new long[]{0x0000880000040000L,0x0000000001000000L});
public static final BitSet FOLLOW_optionValue_in_option265 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ID_in_optionValue291 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_STRING_LITERAL_in_optionValue296 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_optionValue301 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_INT_in_optionValue306 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_CHARSET_in_charSet324 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_charSetElement_in_charSet326 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_charSetElement339 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_OR_in_charSetElement346 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_charSetElement348 = new BitSet(new long[]{0x0000000000040000L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_charSetElement350 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_RANGE_in_charSetElement359 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_charSetElement361 = new BitSet(new long[]{0x0000000000040000L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_charSetElement363 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_IMPORT_in_delegateGrammars378 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ASSIGN_in_delegateGrammars386 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_delegateGrammars388 = new BitSet(new long[]{0x0000080000000000L});
public static final BitSet FOLLOW_ID_in_delegateGrammars390 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ID_in_delegateGrammars398 = new BitSet(new long[]{0x0000080000002008L});
public static final BitSet FOLLOW_TOKENS_in_tokensSpec420 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_tokenSpec_in_tokensSpec422 = new BitSet(new long[]{0x0000000000002008L,0x0000000040000000L});
public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec437 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ASSIGN_in_tokenSpec457 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec464 = new BitSet(new long[]{0x0000000000040000L,0x0000000001000000L});
public static final BitSet FOLLOW_STRING_LITERAL_in_tokenSpec481 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_tokenSpec492 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_rule_in_rules516 = new BitSet(new long[]{0x0000000000000002L,0x0000000000008002L});
public static final BitSet FOLLOW_RULE_in_rule529 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ruleBody_in_rule531 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_PREC_RULE_in_rule538 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ruleBody_in_rule540 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ID_in_ruleBody554 = new BitSet(new long[]{0x0000010000000400L,0x000000000000001CL});
public static final BitSet FOLLOW_modifier_in_ruleBody563 = new BitSet(new long[]{0x0000000000000400L});
public static final BitSet FOLLOW_ARG_in_ruleBody570 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_ruleBody573 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_RET_in_ruleBody581 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_ruleBody584 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_throwsSpec_in_ruleBody592 = new BitSet(new long[]{0x0400000000010200L,0x0000000000020000L});
public static final BitSet FOLLOW_optionsSpec_in_ruleBody599 = new BitSet(new long[]{0x0000000000010200L,0x0000000000020000L});
public static final BitSet FOLLOW_ruleScopeSpec_in_ruleBody606 = new BitSet(new long[]{0x0000000000010200L});
public static final BitSet FOLLOW_AMPERSAND_in_ruleBody615 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_block_in_ruleBody628 = new BitSet(new long[]{0x0000004400020000L});
public static final BitSet FOLLOW_exceptionGroup_in_ruleBody633 = new BitSet(new long[]{0x0000000400000000L});
public static final BitSet FOLLOW_EOR_in_ruleBody639 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_THROWS_in_throwsSpec681 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_throwsSpec683 = new BitSet(new long[]{0x0000080000000008L});
public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec698 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_AMPERSAND_in_ruleScopeSpec703 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ACTION_in_ruleScopeSpec713 = new BitSet(new long[]{0x0000080000000008L});
public static final BitSet FOLLOW_ID_in_ruleScopeSpec719 = new BitSet(new long[]{0x0000080000000008L});
public static final BitSet FOLLOW_BLOCK_in_block737 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_optionsSpec_in_block743 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_alternative_in_block752 = new BitSet(new long[]{0x0000000200000100L,0x0000000000001000L});
public static final BitSet FOLLOW_rewrite_in_block754 = new BitSet(new long[]{0x0000000200000100L});
public static final BitSet FOLLOW_EOB_in_block762 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ALT_in_alternative779 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_element_in_alternative782 = new BitSet(new long[]{0x82800289202DE010L,0x0000000547092041L});
public static final BitSet FOLLOW_EOA_in_alternative786 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_exceptionHandler_in_exceptionGroup801 = new BitSet(new long[]{0x0000004000020002L});
public static final BitSet FOLLOW_finallyClause_in_exceptionGroup807 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_finallyClause_in_exceptionGroup814 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_CATCH_in_exceptionHandler826 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_exceptionHandler828 = new BitSet(new long[]{0x0000000000000010L});
public static final BitSet FOLLOW_ACTION_in_exceptionHandler830 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_FINALLY_in_finallyClause843 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ACTION_in_finallyClause845 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_REWRITES_in_rewrite858 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_REWRITE_in_rewrite863 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ROOT_in_element887 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_element_in_element889 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_BANG_in_element896 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_element_in_element898 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_atom_in_element904 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_NOT_in_element910 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_element_in_element912 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_RANGE_in_element919 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_atom_in_element921 = new BitSet(new long[]{0x0000000020040000L,0x0000000441010000L});
public static final BitSet FOLLOW_atom_in_element923 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_CHAR_RANGE_in_element930 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_atom_in_element932 = new BitSet(new long[]{0x0000000020040000L,0x0000000441010000L});
public static final BitSet FOLLOW_atom_in_element934 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ASSIGN_in_element941 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_element943 = new BitSet(new long[]{0x82800288202DE010L,0x0000000547092041L});
public static final BitSet FOLLOW_element_in_element945 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_PLUS_ASSIGN_in_element952 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_element954 = new BitSet(new long[]{0x82800288202DE010L,0x0000000547092041L});
public static final BitSet FOLLOW_element_in_element956 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ebnf_in_element962 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_tree__in_element967 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SYNPRED_in_element974 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_block_in_element976 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_FORCED_ACTION_in_element983 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ACTION_in_element988 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SEMPRED_in_element993 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SYN_SEMPRED_in_element998 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BACKTRACK_SEMPRED_in_element1004 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_GATED_SEMPRED_in_element1013 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_EPSILON_in_element1018 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_block_in_ebnf1029 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_OPTIONAL_in_ebnf1036 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_block_in_ebnf1038 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_CLOSURE_in_ebnf1047 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_block_in_ebnf1049 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_POSITIVE_CLOSURE_in_ebnf1058 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_block_in_ebnf1060 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_TREE_BEGIN_in_tree_1074 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_element_in_tree_1076 = new BitSet(new long[]{0x82800288202DE018L,0x0000000547092041L});
public static final BitSet FOLLOW_RULE_REF_in_atom1091 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_atom1094 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_TOKEN_REF_in_atom1107 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_atom1110 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_CHAR_LITERAL_in_atom1124 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_STRING_LITERAL_in_atom1135 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_WILDCARD_in_atom1142 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOT_in_atom1148 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_atom1150 = new BitSet(new long[]{0x0000000020040000L,0x0000000441010000L});
public static final BitSet FOLLOW_atom_in_atom1152 = new BitSet(new long[]{0x0000000000000008L});
}