diff --git a/tool/resources/org/antlr/v4/tool/templates/messages/languages/en.stg b/tool/resources/org/antlr/v4/tool/templates/messages/languages/en.stg index 7721a371c..fe46cf6e0 100644 --- a/tool/resources/org/antlr/v4/tool/templates/messages/languages/en.stg +++ b/tool/resources/org/antlr/v4/tool/templates/messages/languages/en.stg @@ -292,5 +292,5 @@ NONREGULAR_DECISION(ruleName,alts) ::= << >> /* l10n for message levels */ -warning() ::= "warning" -error() ::= "error" +WARNING() ::= "warning" +ERROR() ::= "error" diff --git a/tool/src/org/antlr/v4/Tool.java b/tool/src/org/antlr/v4/Tool.java index 82acc661c..1af2df92a 100644 --- a/tool/src/org/antlr/v4/Tool.java +++ b/tool/src/org/antlr/v4/Tool.java @@ -53,6 +53,8 @@ public class Tool { */ private boolean make = false; private boolean showBanner = true; + + /** Exit after showing version or whatever */ private static boolean exitNow = false; // The internal options are for my use on the command line during dev @@ -301,7 +303,7 @@ public class Tool { p.setTreeAdaptor(astAdaptor); ParserRuleReturnScope r = p.grammarSpec(); GrammarAST t = (GrammarAST) r.getTree(); - System.out.println(t.toStringTree()); + if ( internalOption_PrintGrammarTree ) System.out.println(t.toStringTree()); g = new Grammar(this, t); g.fileName = fileName; grammars.put(g.name, g); diff --git a/tool/src/org/antlr/v4/parse/ANTLRLexer.java b/tool/src/org/antlr/v4/parse/ANTLRLexer.java index 78b09d41d..9a0b7efbb 100644 --- a/tool/src/org/antlr/v4/parse/ANTLRLexer.java +++ b/tool/src/org/antlr/v4/parse/ANTLRLexer.java @@ -1,4 +1,4 @@ -// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRLexer.g 2010-01-31 12:53:18 +// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRLexer.g 2010-01-31 13:25:10 /* [The "BSD licence"] @@ -269,7 +269,7 @@ public class ANTLRLexer extends Lexer { if ( (( input.LA(2) != '/')) ) { alt3=1; } - else if ( (((( true )&&( !(input.LA(1) == '*' && input.LA(2) == '/') ))||( true ))) ) { + else if ( ((( true )||(( true )&&( !(input.LA(1) == '*' && input.LA(2) == '/') )))) ) { alt3=2; } else { diff --git a/tool/src/org/antlr/v4/parse/ANTLRParser.java b/tool/src/org/antlr/v4/parse/ANTLRParser.java index be59d78ff..2ecd6061a 100644 --- a/tool/src/org/antlr/v4/parse/ANTLRParser.java +++ b/tool/src/org/antlr/v4/parse/ANTLRParser.java @@ -1,4 +1,4 @@ -// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRParser.g 2010-01-31 12:53:20 +// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRParser.g 2010-01-31 13:25:12 /* [The "BSD licence"] @@ -292,7 +292,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: rules, DOC_COMMENT, prequelConstruct, id, grammarType + // elements: rules, id, prequelConstruct, grammarType, DOC_COMMENT // token labels: // rule labels: retval // token list labels: @@ -1138,7 +1138,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: delegateGrammar, IMPORT + // elements: IMPORT, delegateGrammar // token labels: // rule labels: retval // token list labels: @@ -1396,7 +1396,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: tokenSpec, TOKENS + // elements: TOKENS, tokenSpec // token labels: // rule labels: retval // token list labels: @@ -1713,7 +1713,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: ACTION, id, SCOPE + // elements: id, ACTION, SCOPE // token labels: // rule labels: retval // token list labels: @@ -1858,7 +1858,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: actionScopeName, ACTION, id, AT + // elements: actionScopeName, AT, id, ACTION // token labels: // rule labels: retval // token list labels: @@ -2357,7 +2357,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: rulePrequel, DOC_COMMENT, ARG_ACTION, ruleReturns, exceptionGroup, ruleModifiers, altListAsBlock, id + // elements: ARG_ACTION, rulePrequel, exceptionGroup, id, altListAsBlock, ruleReturns, DOC_COMMENT, ruleModifiers // token labels: // rule labels: retval // token list labels: @@ -2583,7 +2583,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: ACTION, CATCH, ARG_ACTION + // elements: ARG_ACTION, ACTION, CATCH // token labels: // rule labels: retval // token list labels: @@ -3189,7 +3189,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: id, SCOPE + // elements: SCOPE, id // token labels: // rule labels: retval // token list labels: @@ -3288,7 +3288,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: id, ACTION, AT + // elements: ACTION, id, AT // token labels: // rule labels: retval // token list labels: @@ -4582,7 +4582,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: ebnfSuffix, treeSpec + // elements: treeSpec, ebnfSuffix // token labels: // rule labels: retval // token list labels: @@ -4907,7 +4907,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: TREE_BEGIN, element + // elements: element, TREE_BEGIN // token labels: // rule labels: retval // token list labels: @@ -5828,7 +5828,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: block, NOT + // elements: NOT, block // token labels: // rule labels: retval // token list labels: @@ -6092,7 +6092,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: ra, optionsSpec, altList, ACTION + // elements: altList, optionsSpec, ACTION, ra // token labels: // rule labels: retval // token list labels: @@ -6273,7 +6273,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: RULE_REF, ARG_ACTION, op + // elements: op, ARG_ACTION, RULE_REF // token labels: op // rule labels: retval // token list labels: @@ -6609,7 +6609,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: elementOptions, CHAR_LITERAL + // elements: CHAR_LITERAL, elementOptions // token labels: // rule labels: retval // token list labels: @@ -6694,7 +6694,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: TOKEN_REF, elementOptions, ARG_ACTION + // elements: TOKEN_REF, ARG_ACTION, elementOptions // token labels: // rule labels: retval // token list labels: @@ -6886,7 +6886,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: ROOT, terminal + // elements: terminal, ROOT // token labels: // rule labels: retval // token list labels: @@ -6923,7 +6923,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: BANG, terminal + // elements: terminal, BANG // token labels: // rule labels: retval // token list labels: @@ -7440,7 +7440,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: rewriteAlt, SEMPRED, SEMPRED, rewriteAlt + // elements: rewriteAlt, SEMPRED, rewriteAlt, SEMPRED // token labels: // rule labels: retval // token list labels: @@ -8532,7 +8532,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: rewriteTreeAtom, TREE_BEGIN, rewriteTreeElement + // elements: rewriteTreeAtom, rewriteTreeElement, TREE_BEGIN // token labels: // rule labels: retval // token list labels: @@ -8716,7 +8716,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: rewriteTemplateArgs, str, TEMPLATE + // elements: str, TEMPLATE, rewriteTemplateArgs // token labels: str // rule labels: retval // token list labels: @@ -8977,7 +8977,7 @@ public class ANTLRParser extends Parser { // AST REWRITE - // elements: rewriteTemplateArgs, ACTION + // elements: ACTION, rewriteTemplateArgs // token labels: // rule labels: retval // token list labels: diff --git a/tool/src/org/antlr/v4/parse/ASTVerifier.g b/tool/src/org/antlr/v4/parse/ASTVerifier.g index 1f7f7a65e..d75d08a37 100644 --- a/tool/src/org/antlr/v4/parse/ASTVerifier.g +++ b/tool/src/org/antlr/v4/parse/ASTVerifier.g @@ -131,12 +131,13 @@ option : ^(ASSIGN ID optionValue) ; -optionValue - : ID +optionValue returns [String v] +@init {$v = $start.token.getText();} + : ID | STRING_LITERAL | CHAR_LITERAL - | INT - | STAR + | INT + | STAR ; delegateGrammars diff --git a/tool/src/org/antlr/v4/parse/ASTVerifier.java b/tool/src/org/antlr/v4/parse/ASTVerifier.java index 0cbc5877e..2e87f39ce 100644 --- a/tool/src/org/antlr/v4/parse/ASTVerifier.java +++ b/tool/src/org/antlr/v4/parse/ASTVerifier.java @@ -1,4 +1,4 @@ -// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ASTVerifier.g 2010-01-31 12:53:21 +// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ASTVerifier.g 2010-01-31 13:25:13 /* [The "BSD license"] @@ -520,12 +520,19 @@ public class ASTVerifier extends TreeParser { } // $ANTLR end "option" + public static class optionValue_return extends TreeRuleReturnScope { + public String v; + }; // $ANTLR start "optionValue" - // ASTVerifier.g:134:1: optionValue : ( ID | STRING_LITERAL | CHAR_LITERAL | INT | STAR ); - public final void optionValue() throws RecognitionException { + // ASTVerifier.g:134:1: optionValue returns [String v] : ( ID | STRING_LITERAL | CHAR_LITERAL | INT | STAR ); + public final ASTVerifier.optionValue_return optionValue() throws RecognitionException { + ASTVerifier.optionValue_return retval = new ASTVerifier.optionValue_return(); + retval.start = input.LT(1); + + retval.v = ((GrammarAST)retval.start).token.getText(); try { - // ASTVerifier.g:135:5: ( ID | STRING_LITERAL | CHAR_LITERAL | INT | STAR ) + // ASTVerifier.g:136:5: ( ID | STRING_LITERAL | CHAR_LITERAL | INT | STAR ) // ASTVerifier.g: { if ( input.LA(1)==STAR||input.LA(1)==INT||input.LA(1)==STRING_LITERAL||input.LA(1)==CHAR_LITERAL||input.LA(1)==ID ) { @@ -547,22 +554,22 @@ public class ASTVerifier extends TreeParser { } finally { } - return ; + return retval; } // $ANTLR end "optionValue" // $ANTLR start "delegateGrammars" - // ASTVerifier.g:142:1: delegateGrammars : ^( IMPORT ( delegateGrammar )+ ) ; + // ASTVerifier.g:143:1: delegateGrammars : ^( IMPORT ( delegateGrammar )+ ) ; public final void delegateGrammars() throws RecognitionException { try { - // ASTVerifier.g:143:2: ( ^( IMPORT ( delegateGrammar )+ ) ) - // ASTVerifier.g:143:6: ^( IMPORT ( delegateGrammar )+ ) + // ASTVerifier.g:144:2: ( ^( IMPORT ( delegateGrammar )+ ) ) + // ASTVerifier.g:144:6: ^( IMPORT ( delegateGrammar )+ ) { - match(input,IMPORT,FOLLOW_IMPORT_in_delegateGrammars291); + match(input,IMPORT,FOLLOW_IMPORT_in_delegateGrammars309); match(input, Token.DOWN, null); - // ASTVerifier.g:143:15: ( delegateGrammar )+ + // ASTVerifier.g:144:15: ( delegateGrammar )+ int cnt5=0; loop5: do { @@ -576,9 +583,9 @@ public class ASTVerifier extends TreeParser { switch (alt5) { case 1 : - // ASTVerifier.g:143:15: delegateGrammar + // ASTVerifier.g:144:15: delegateGrammar { - pushFollow(FOLLOW_delegateGrammar_in_delegateGrammars293); + pushFollow(FOLLOW_delegateGrammar_in_delegateGrammars311); delegateGrammar(); state._fsp--; @@ -614,10 +621,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "delegateGrammar" - // ASTVerifier.g:146:1: delegateGrammar : ( ^( ASSIGN ID ID ) | ID ); + // ASTVerifier.g:147:1: delegateGrammar : ( ^( ASSIGN ID ID ) | ID ); public final void delegateGrammar() throws RecognitionException { try { - // ASTVerifier.g:147:5: ( ^( ASSIGN ID ID ) | ID ) + // ASTVerifier.g:148:5: ( ^( ASSIGN ID ID ) | ID ) int alt6=2; int LA6_0 = input.LA(1); @@ -635,22 +642,22 @@ public class ASTVerifier extends TreeParser { } switch (alt6) { case 1 : - // ASTVerifier.g:147:9: ^( ASSIGN ID ID ) + // ASTVerifier.g:148:9: ^( ASSIGN ID ID ) { - match(input,ASSIGN,FOLLOW_ASSIGN_in_delegateGrammar312); + match(input,ASSIGN,FOLLOW_ASSIGN_in_delegateGrammar330); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_delegateGrammar314); - match(input,ID,FOLLOW_ID_in_delegateGrammar316); + match(input,ID,FOLLOW_ID_in_delegateGrammar332); + match(input,ID,FOLLOW_ID_in_delegateGrammar334); match(input, Token.UP, null); } break; case 2 : - // ASTVerifier.g:148:9: ID + // ASTVerifier.g:149:9: ID { - match(input,ID,FOLLOW_ID_in_delegateGrammar327); + match(input,ID,FOLLOW_ID_in_delegateGrammar345); } break; @@ -669,16 +676,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "tokensSpec" - // ASTVerifier.g:151:1: tokensSpec : ^( TOKENS ( tokenSpec )+ ) ; + // ASTVerifier.g:152:1: tokensSpec : ^( TOKENS ( tokenSpec )+ ) ; public final void tokensSpec() throws RecognitionException { try { - // ASTVerifier.g:152:2: ( ^( TOKENS ( tokenSpec )+ ) ) - // ASTVerifier.g:152:6: ^( TOKENS ( tokenSpec )+ ) + // ASTVerifier.g:153:2: ( ^( TOKENS ( tokenSpec )+ ) ) + // ASTVerifier.g:153:6: ^( TOKENS ( tokenSpec )+ ) { - match(input,TOKENS,FOLLOW_TOKENS_in_tokensSpec344); + match(input,TOKENS,FOLLOW_TOKENS_in_tokensSpec362); match(input, Token.DOWN, null); - // ASTVerifier.g:152:15: ( tokenSpec )+ + // ASTVerifier.g:153:15: ( tokenSpec )+ int cnt7=0; loop7: do { @@ -692,9 +699,9 @@ public class ASTVerifier extends TreeParser { switch (alt7) { case 1 : - // ASTVerifier.g:152:15: tokenSpec + // ASTVerifier.g:153:15: tokenSpec { - pushFollow(FOLLOW_tokenSpec_in_tokensSpec346); + pushFollow(FOLLOW_tokenSpec_in_tokensSpec364); tokenSpec(); state._fsp--; @@ -730,10 +737,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "tokenSpec" - // ASTVerifier.g:155:1: tokenSpec : ( ^( ASSIGN TOKEN_REF STRING_LITERAL ) | ^( ASSIGN TOKEN_REF CHAR_LITERAL ) | TOKEN_REF | RULE_REF ); + // ASTVerifier.g:156:1: tokenSpec : ( ^( ASSIGN TOKEN_REF STRING_LITERAL ) | ^( ASSIGN TOKEN_REF CHAR_LITERAL ) | TOKEN_REF | RULE_REF ); public final void tokenSpec() throws RecognitionException { try { - // ASTVerifier.g:156:2: ( ^( ASSIGN TOKEN_REF STRING_LITERAL ) | ^( ASSIGN TOKEN_REF CHAR_LITERAL ) | TOKEN_REF | RULE_REF ) + // ASTVerifier.g:157:2: ( ^( ASSIGN TOKEN_REF STRING_LITERAL ) | ^( ASSIGN TOKEN_REF CHAR_LITERAL ) | TOKEN_REF | RULE_REF ) int alt8=4; switch ( input.LA(1) ) { case ASSIGN: @@ -793,42 +800,42 @@ public class ASTVerifier extends TreeParser { switch (alt8) { case 1 : - // ASTVerifier.g:156:4: ^( ASSIGN TOKEN_REF STRING_LITERAL ) + // ASTVerifier.g:157:4: ^( ASSIGN TOKEN_REF STRING_LITERAL ) { - match(input,ASSIGN,FOLLOW_ASSIGN_in_tokenSpec360); + match(input,ASSIGN,FOLLOW_ASSIGN_in_tokenSpec378); match(input, Token.DOWN, null); - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec362); - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_tokenSpec364); + match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec380); + match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_tokenSpec382); match(input, Token.UP, null); } break; case 2 : - // ASTVerifier.g:157:9: ^( ASSIGN TOKEN_REF CHAR_LITERAL ) + // ASTVerifier.g:158:9: ^( ASSIGN TOKEN_REF CHAR_LITERAL ) { - match(input,ASSIGN,FOLLOW_ASSIGN_in_tokenSpec376); + match(input,ASSIGN,FOLLOW_ASSIGN_in_tokenSpec394); match(input, Token.DOWN, null); - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec378); - match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_tokenSpec380); + match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec396); + match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_tokenSpec398); match(input, Token.UP, null); } break; case 3 : - // ASTVerifier.g:158:6: TOKEN_REF + // ASTVerifier.g:159:6: TOKEN_REF { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec388); + match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec406); } break; case 4 : - // ASTVerifier.g:159:4: RULE_REF + // ASTVerifier.g:160:4: RULE_REF { - match(input,RULE_REF,FOLLOW_RULE_REF_in_tokenSpec393); + match(input,RULE_REF,FOLLOW_RULE_REF_in_tokenSpec411); } break; @@ -847,17 +854,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "attrScope" - // ASTVerifier.g:162:1: attrScope : ^( SCOPE ID ACTION ) ; + // ASTVerifier.g:163:1: attrScope : ^( SCOPE ID ACTION ) ; public final void attrScope() throws RecognitionException { try { - // ASTVerifier.g:163:2: ( ^( SCOPE ID ACTION ) ) - // ASTVerifier.g:163:4: ^( SCOPE ID ACTION ) + // ASTVerifier.g:164:2: ( ^( SCOPE ID ACTION ) ) + // ASTVerifier.g:164:4: ^( SCOPE ID ACTION ) { - match(input,SCOPE,FOLLOW_SCOPE_in_attrScope405); + match(input,SCOPE,FOLLOW_SCOPE_in_attrScope423); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_attrScope407); - match(input,ACTION,FOLLOW_ACTION_in_attrScope409); + match(input,ID,FOLLOW_ID_in_attrScope425); + match(input,ACTION,FOLLOW_ACTION_in_attrScope427); match(input, Token.UP, null); @@ -876,16 +883,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "action" - // ASTVerifier.g:166:1: action : ^( AT ( ID )? ID ACTION ) ; + // ASTVerifier.g:167:1: action : ^( AT ( ID )? ID ACTION ) ; public final void action() throws RecognitionException { try { - // ASTVerifier.g:167:2: ( ^( AT ( ID )? ID ACTION ) ) - // ASTVerifier.g:167:4: ^( AT ( ID )? ID ACTION ) + // ASTVerifier.g:168:2: ( ^( AT ( ID )? ID ACTION ) ) + // ASTVerifier.g:168:4: ^( AT ( ID )? ID ACTION ) { - match(input,AT,FOLLOW_AT_in_action422); + match(input,AT,FOLLOW_AT_in_action440); match(input, Token.DOWN, null); - // ASTVerifier.g:167:9: ( ID )? + // ASTVerifier.g:168:9: ( ID )? int alt9=2; int LA9_0 = input.LA(1); @@ -898,17 +905,17 @@ public class ASTVerifier extends TreeParser { } switch (alt9) { case 1 : - // ASTVerifier.g:167:9: ID + // ASTVerifier.g:168:9: ID { - match(input,ID,FOLLOW_ID_in_action424); + match(input,ID,FOLLOW_ID_in_action442); } break; } - match(input,ID,FOLLOW_ID_in_action427); - match(input,ACTION,FOLLOW_ACTION_in_action429); + match(input,ID,FOLLOW_ID_in_action445); + match(input,ACTION,FOLLOW_ACTION_in_action447); match(input, Token.UP, null); @@ -927,17 +934,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rules" - // ASTVerifier.g:170:1: rules : ^( RULES ( rule )* ) ; + // ASTVerifier.g:171:1: rules : ^( RULES ( rule )* ) ; public final void rules() throws RecognitionException { try { - // ASTVerifier.g:171:5: ( ^( RULES ( rule )* ) ) - // ASTVerifier.g:171:7: ^( RULES ( rule )* ) + // ASTVerifier.g:172:5: ( ^( RULES ( rule )* ) ) + // ASTVerifier.g:172:7: ^( RULES ( rule )* ) { - match(input,RULES,FOLLOW_RULES_in_rules445); + match(input,RULES,FOLLOW_RULES_in_rules463); if ( input.LA(1)==Token.DOWN ) { match(input, Token.DOWN, null); - // ASTVerifier.g:171:15: ( rule )* + // ASTVerifier.g:172:15: ( rule )* loop10: do { int alt10=2; @@ -950,9 +957,9 @@ public class ASTVerifier extends TreeParser { switch (alt10) { case 1 : - // ASTVerifier.g:171:15: rule + // ASTVerifier.g:172:15: rule { - pushFollow(FOLLOW_rule_in_rules447); + pushFollow(FOLLOW_rule_in_rules465); rule(); state._fsp--; @@ -985,17 +992,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rule" - // ASTVerifier.g:174:1: rule : ^( RULE ID ( DOC_COMMENT )? ( ruleModifiers )? ( ARG_ACTION )? ( ruleReturns )? ( rulePrequel )* altListAsBlock exceptionGroup ) ; + // ASTVerifier.g:175:1: rule : ^( RULE ID ( DOC_COMMENT )? ( ruleModifiers )? ( ARG_ACTION )? ( ruleReturns )? ( rulePrequel )* altListAsBlock exceptionGroup ) ; public final void rule() throws RecognitionException { try { - // ASTVerifier.g:174:5: ( ^( RULE ID ( DOC_COMMENT )? ( ruleModifiers )? ( ARG_ACTION )? ( ruleReturns )? ( rulePrequel )* altListAsBlock exceptionGroup ) ) - // ASTVerifier.g:174:9: ^( RULE ID ( DOC_COMMENT )? ( ruleModifiers )? ( ARG_ACTION )? ( ruleReturns )? ( rulePrequel )* altListAsBlock exceptionGroup ) + // ASTVerifier.g:175:5: ( ^( RULE ID ( DOC_COMMENT )? ( ruleModifiers )? ( ARG_ACTION )? ( ruleReturns )? ( rulePrequel )* altListAsBlock exceptionGroup ) ) + // ASTVerifier.g:175:9: ^( RULE ID ( DOC_COMMENT )? ( ruleModifiers )? ( ARG_ACTION )? ( ruleReturns )? ( rulePrequel )* altListAsBlock exceptionGroup ) { - match(input,RULE,FOLLOW_RULE_in_rule465); + match(input,RULE,FOLLOW_RULE_in_rule483); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_rule467); - // ASTVerifier.g:174:20: ( DOC_COMMENT )? + match(input,ID,FOLLOW_ID_in_rule485); + // ASTVerifier.g:175:20: ( DOC_COMMENT )? int alt11=2; int LA11_0 = input.LA(1); @@ -1004,16 +1011,16 @@ public class ASTVerifier extends TreeParser { } switch (alt11) { case 1 : - // ASTVerifier.g:174:20: DOC_COMMENT + // ASTVerifier.g:175:20: DOC_COMMENT { - match(input,DOC_COMMENT,FOLLOW_DOC_COMMENT_in_rule469); + match(input,DOC_COMMENT,FOLLOW_DOC_COMMENT_in_rule487); } break; } - // ASTVerifier.g:174:33: ( ruleModifiers )? + // ASTVerifier.g:175:33: ( ruleModifiers )? int alt12=2; int LA12_0 = input.LA(1); @@ -1022,9 +1029,9 @@ public class ASTVerifier extends TreeParser { } switch (alt12) { case 1 : - // ASTVerifier.g:174:33: ruleModifiers + // ASTVerifier.g:175:33: ruleModifiers { - pushFollow(FOLLOW_ruleModifiers_in_rule472); + pushFollow(FOLLOW_ruleModifiers_in_rule490); ruleModifiers(); state._fsp--; @@ -1035,7 +1042,7 @@ public class ASTVerifier extends TreeParser { } - // ASTVerifier.g:174:48: ( ARG_ACTION )? + // ASTVerifier.g:175:48: ( ARG_ACTION )? int alt13=2; int LA13_0 = input.LA(1); @@ -1044,16 +1051,16 @@ public class ASTVerifier extends TreeParser { } switch (alt13) { case 1 : - // ASTVerifier.g:174:48: ARG_ACTION + // ASTVerifier.g:175:48: ARG_ACTION { - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rule475); + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rule493); } break; } - // ASTVerifier.g:175:11: ( ruleReturns )? + // ASTVerifier.g:176:11: ( ruleReturns )? int alt14=2; int LA14_0 = input.LA(1); @@ -1062,9 +1069,9 @@ public class ASTVerifier extends TreeParser { } switch (alt14) { case 1 : - // ASTVerifier.g:175:11: ruleReturns + // ASTVerifier.g:176:11: ruleReturns { - pushFollow(FOLLOW_ruleReturns_in_rule488); + pushFollow(FOLLOW_ruleReturns_in_rule506); ruleReturns(); state._fsp--; @@ -1075,7 +1082,7 @@ public class ASTVerifier extends TreeParser { } - // ASTVerifier.g:175:24: ( rulePrequel )* + // ASTVerifier.g:176:24: ( rulePrequel )* loop15: do { int alt15=2; @@ -1088,9 +1095,9 @@ public class ASTVerifier extends TreeParser { switch (alt15) { case 1 : - // ASTVerifier.g:175:24: rulePrequel + // ASTVerifier.g:176:24: rulePrequel { - pushFollow(FOLLOW_rulePrequel_in_rule491); + pushFollow(FOLLOW_rulePrequel_in_rule509); rulePrequel(); state._fsp--; @@ -1104,12 +1111,12 @@ public class ASTVerifier extends TreeParser { } } while (true); - pushFollow(FOLLOW_altListAsBlock_in_rule494); + pushFollow(FOLLOW_altListAsBlock_in_rule512); altListAsBlock(); state._fsp--; - pushFollow(FOLLOW_exceptionGroup_in_rule496); + pushFollow(FOLLOW_exceptionGroup_in_rule514); exceptionGroup(); state._fsp--; @@ -1132,13 +1139,13 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "exceptionGroup" - // ASTVerifier.g:179:1: exceptionGroup : ( exceptionHandler )* ( finallyClause )? ; + // ASTVerifier.g:180:1: exceptionGroup : ( exceptionHandler )* ( finallyClause )? ; public final void exceptionGroup() throws RecognitionException { try { - // ASTVerifier.g:180:5: ( ( exceptionHandler )* ( finallyClause )? ) - // ASTVerifier.g:180:7: ( exceptionHandler )* ( finallyClause )? + // ASTVerifier.g:181:5: ( ( exceptionHandler )* ( finallyClause )? ) + // ASTVerifier.g:181:7: ( exceptionHandler )* ( finallyClause )? { - // ASTVerifier.g:180:7: ( exceptionHandler )* + // ASTVerifier.g:181:7: ( exceptionHandler )* loop16: do { int alt16=2; @@ -1151,9 +1158,9 @@ public class ASTVerifier extends TreeParser { switch (alt16) { case 1 : - // ASTVerifier.g:180:7: exceptionHandler + // ASTVerifier.g:181:7: exceptionHandler { - pushFollow(FOLLOW_exceptionHandler_in_exceptionGroup523); + pushFollow(FOLLOW_exceptionHandler_in_exceptionGroup541); exceptionHandler(); state._fsp--; @@ -1167,7 +1174,7 @@ public class ASTVerifier extends TreeParser { } } while (true); - // ASTVerifier.g:180:25: ( finallyClause )? + // ASTVerifier.g:181:25: ( finallyClause )? int alt17=2; int LA17_0 = input.LA(1); @@ -1176,9 +1183,9 @@ public class ASTVerifier extends TreeParser { } switch (alt17) { case 1 : - // ASTVerifier.g:180:25: finallyClause + // ASTVerifier.g:181:25: finallyClause { - pushFollow(FOLLOW_finallyClause_in_exceptionGroup526); + pushFollow(FOLLOW_finallyClause_in_exceptionGroup544); finallyClause(); state._fsp--; @@ -1205,17 +1212,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "exceptionHandler" - // ASTVerifier.g:183:1: exceptionHandler : ^( CATCH ARG_ACTION ACTION ) ; + // ASTVerifier.g:184:1: exceptionHandler : ^( CATCH ARG_ACTION ACTION ) ; public final void exceptionHandler() throws RecognitionException { try { - // ASTVerifier.g:184:2: ( ^( CATCH ARG_ACTION ACTION ) ) - // ASTVerifier.g:184:4: ^( CATCH ARG_ACTION ACTION ) + // ASTVerifier.g:185:2: ( ^( CATCH ARG_ACTION ACTION ) ) + // ASTVerifier.g:185:4: ^( CATCH ARG_ACTION ACTION ) { - match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler542); + match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler560); match(input, Token.DOWN, null); - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_exceptionHandler544); - match(input,ACTION,FOLLOW_ACTION_in_exceptionHandler546); + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_exceptionHandler562); + match(input,ACTION,FOLLOW_ACTION_in_exceptionHandler564); match(input, Token.UP, null); @@ -1234,16 +1241,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "finallyClause" - // ASTVerifier.g:187:1: finallyClause : ^( FINALLY ACTION ) ; + // ASTVerifier.g:188:1: finallyClause : ^( FINALLY ACTION ) ; public final void finallyClause() throws RecognitionException { try { - // ASTVerifier.g:188:2: ( ^( FINALLY ACTION ) ) - // ASTVerifier.g:188:4: ^( FINALLY ACTION ) + // ASTVerifier.g:189:2: ( ^( FINALLY ACTION ) ) + // ASTVerifier.g:189:4: ^( FINALLY ACTION ) { - match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause559); + match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause577); match(input, Token.DOWN, null); - match(input,ACTION,FOLLOW_ACTION_in_finallyClause561); + match(input,ACTION,FOLLOW_ACTION_in_finallyClause579); match(input, Token.UP, null); @@ -1262,10 +1269,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rulePrequel" - // ASTVerifier.g:191:1: rulePrequel : ( throwsSpec | ruleScopeSpec | optionsSpec | ruleAction ); + // ASTVerifier.g:192:1: rulePrequel : ( throwsSpec | ruleScopeSpec | optionsSpec | ruleAction ); public final void rulePrequel() throws RecognitionException { try { - // ASTVerifier.g:192:5: ( throwsSpec | ruleScopeSpec | optionsSpec | ruleAction ) + // ASTVerifier.g:193:5: ( throwsSpec | ruleScopeSpec | optionsSpec | ruleAction ) int alt18=4; switch ( input.LA(1) ) { case THROWS: @@ -1297,9 +1304,9 @@ public class ASTVerifier extends TreeParser { switch (alt18) { case 1 : - // ASTVerifier.g:192:9: throwsSpec + // ASTVerifier.g:193:9: throwsSpec { - pushFollow(FOLLOW_throwsSpec_in_rulePrequel578); + pushFollow(FOLLOW_throwsSpec_in_rulePrequel596); throwsSpec(); state._fsp--; @@ -1308,9 +1315,9 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:193:9: ruleScopeSpec + // ASTVerifier.g:194:9: ruleScopeSpec { - pushFollow(FOLLOW_ruleScopeSpec_in_rulePrequel588); + pushFollow(FOLLOW_ruleScopeSpec_in_rulePrequel606); ruleScopeSpec(); state._fsp--; @@ -1319,9 +1326,9 @@ public class ASTVerifier extends TreeParser { } break; case 3 : - // ASTVerifier.g:194:9: optionsSpec + // ASTVerifier.g:195:9: optionsSpec { - pushFollow(FOLLOW_optionsSpec_in_rulePrequel598); + pushFollow(FOLLOW_optionsSpec_in_rulePrequel616); optionsSpec(); state._fsp--; @@ -1330,9 +1337,9 @@ public class ASTVerifier extends TreeParser { } break; case 4 : - // ASTVerifier.g:195:9: ruleAction + // ASTVerifier.g:196:9: ruleAction { - pushFollow(FOLLOW_ruleAction_in_rulePrequel608); + pushFollow(FOLLOW_ruleAction_in_rulePrequel626); ruleAction(); state._fsp--; @@ -1355,16 +1362,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ruleReturns" - // ASTVerifier.g:198:1: ruleReturns : ^( RETURNS ARG_ACTION ) ; + // ASTVerifier.g:199:1: ruleReturns : ^( RETURNS ARG_ACTION ) ; public final void ruleReturns() throws RecognitionException { try { - // ASTVerifier.g:199:2: ( ^( RETURNS ARG_ACTION ) ) - // ASTVerifier.g:199:4: ^( RETURNS ARG_ACTION ) + // ASTVerifier.g:200:2: ( ^( RETURNS ARG_ACTION ) ) + // ASTVerifier.g:200:4: ^( RETURNS ARG_ACTION ) { - match(input,RETURNS,FOLLOW_RETURNS_in_ruleReturns623); + match(input,RETURNS,FOLLOW_RETURNS_in_ruleReturns641); match(input, Token.DOWN, null); - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleReturns625); + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleReturns643); match(input, Token.UP, null); @@ -1383,16 +1390,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "throwsSpec" - // ASTVerifier.g:201:1: throwsSpec : ^( THROWS ( ID )+ ) ; + // ASTVerifier.g:202:1: throwsSpec : ^( THROWS ( ID )+ ) ; public final void throwsSpec() throws RecognitionException { try { - // ASTVerifier.g:202:5: ( ^( THROWS ( ID )+ ) ) - // ASTVerifier.g:202:7: ^( THROWS ( ID )+ ) + // ASTVerifier.g:203:5: ( ^( THROWS ( ID )+ ) ) + // ASTVerifier.g:203:7: ^( THROWS ( ID )+ ) { - match(input,THROWS,FOLLOW_THROWS_in_throwsSpec640); + match(input,THROWS,FOLLOW_THROWS_in_throwsSpec658); match(input, Token.DOWN, null); - // ASTVerifier.g:202:16: ( ID )+ + // ASTVerifier.g:203:16: ( ID )+ int cnt19=0; loop19: do { @@ -1406,9 +1413,9 @@ public class ASTVerifier extends TreeParser { switch (alt19) { case 1 : - // ASTVerifier.g:202:16: ID + // ASTVerifier.g:203:16: ID { - match(input,ID,FOLLOW_ID_in_throwsSpec642); + match(input,ID,FOLLOW_ID_in_throwsSpec660); } break; @@ -1440,10 +1447,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ruleScopeSpec" - // ASTVerifier.g:205:1: ruleScopeSpec : ( ^( SCOPE ACTION ) | ^( SCOPE ( ID )+ ) ); + // ASTVerifier.g:206:1: ruleScopeSpec : ( ^( SCOPE ACTION ) | ^( SCOPE ( ID )+ ) ); public final void ruleScopeSpec() throws RecognitionException { try { - // ASTVerifier.g:206:2: ( ^( SCOPE ACTION ) | ^( SCOPE ( ID )+ ) ) + // ASTVerifier.g:207:2: ( ^( SCOPE ACTION ) | ^( SCOPE ( ID )+ ) ) int alt21=2; int LA21_0 = input.LA(1); @@ -1481,24 +1488,24 @@ public class ASTVerifier extends TreeParser { } switch (alt21) { case 1 : - // ASTVerifier.g:206:4: ^( SCOPE ACTION ) + // ASTVerifier.g:207:4: ^( SCOPE ACTION ) { - match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec659); + match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec677); match(input, Token.DOWN, null); - match(input,ACTION,FOLLOW_ACTION_in_ruleScopeSpec661); + match(input,ACTION,FOLLOW_ACTION_in_ruleScopeSpec679); match(input, Token.UP, null); } break; case 2 : - // ASTVerifier.g:207:4: ^( SCOPE ( ID )+ ) + // ASTVerifier.g:208:4: ^( SCOPE ( ID )+ ) { - match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec668); + match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec686); match(input, Token.DOWN, null); - // ASTVerifier.g:207:12: ( ID )+ + // ASTVerifier.g:208:12: ( ID )+ int cnt20=0; loop20: do { @@ -1512,9 +1519,9 @@ public class ASTVerifier extends TreeParser { switch (alt20) { case 1 : - // ASTVerifier.g:207:12: ID + // ASTVerifier.g:208:12: ID { - match(input,ID,FOLLOW_ID_in_ruleScopeSpec670); + match(input,ID,FOLLOW_ID_in_ruleScopeSpec688); } break; @@ -1548,17 +1555,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ruleAction" - // ASTVerifier.g:210:1: ruleAction : ^( AT ID ACTION ) ; + // ASTVerifier.g:211:1: ruleAction : ^( AT ID ACTION ) ; public final void ruleAction() throws RecognitionException { try { - // ASTVerifier.g:211:2: ( ^( AT ID ACTION ) ) - // ASTVerifier.g:211:4: ^( AT ID ACTION ) + // ASTVerifier.g:212:2: ( ^( AT ID ACTION ) ) + // ASTVerifier.g:212:4: ^( AT ID ACTION ) { - match(input,AT,FOLLOW_AT_in_ruleAction684); + match(input,AT,FOLLOW_AT_in_ruleAction702); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_ruleAction686); - match(input,ACTION,FOLLOW_ACTION_in_ruleAction688); + match(input,ID,FOLLOW_ID_in_ruleAction704); + match(input,ACTION,FOLLOW_ACTION_in_ruleAction706); match(input, Token.UP, null); @@ -1577,16 +1584,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ruleModifiers" - // ASTVerifier.g:214:1: ruleModifiers : ^( RULEMODIFIERS ( ruleModifier )+ ) ; + // ASTVerifier.g:215:1: ruleModifiers : ^( RULEMODIFIERS ( ruleModifier )+ ) ; public final void ruleModifiers() throws RecognitionException { try { - // ASTVerifier.g:215:5: ( ^( RULEMODIFIERS ( ruleModifier )+ ) ) - // ASTVerifier.g:215:7: ^( RULEMODIFIERS ( ruleModifier )+ ) + // ASTVerifier.g:216:5: ( ^( RULEMODIFIERS ( ruleModifier )+ ) ) + // ASTVerifier.g:216:7: ^( RULEMODIFIERS ( ruleModifier )+ ) { - match(input,RULEMODIFIERS,FOLLOW_RULEMODIFIERS_in_ruleModifiers704); + match(input,RULEMODIFIERS,FOLLOW_RULEMODIFIERS_in_ruleModifiers722); match(input, Token.DOWN, null); - // ASTVerifier.g:215:23: ( ruleModifier )+ + // ASTVerifier.g:216:23: ( ruleModifier )+ int cnt22=0; loop22: do { @@ -1600,9 +1607,9 @@ public class ASTVerifier extends TreeParser { switch (alt22) { case 1 : - // ASTVerifier.g:215:23: ruleModifier + // ASTVerifier.g:216:23: ruleModifier { - pushFollow(FOLLOW_ruleModifier_in_ruleModifiers706); + pushFollow(FOLLOW_ruleModifier_in_ruleModifiers724); ruleModifier(); state._fsp--; @@ -1638,10 +1645,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ruleModifier" - // ASTVerifier.g:218:1: ruleModifier : ( PUBLIC | PRIVATE | PROTECTED | FRAGMENT ); + // ASTVerifier.g:219:1: ruleModifier : ( PUBLIC | PRIVATE | PROTECTED | FRAGMENT ); public final void ruleModifier() throws RecognitionException { try { - // ASTVerifier.g:219:5: ( PUBLIC | PRIVATE | PROTECTED | FRAGMENT ) + // ASTVerifier.g:220:5: ( PUBLIC | PRIVATE | PROTECTED | FRAGMENT ) // ASTVerifier.g: { if ( input.LA(1)==FRAGMENT||(input.LA(1)>=PROTECTED && input.LA(1)<=PRIVATE) ) { @@ -1669,13 +1676,13 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "altList" - // ASTVerifier.g:225:1: altList : ( alternative )+ ; + // ASTVerifier.g:226:1: altList : ( alternative )+ ; public final void altList() throws RecognitionException { try { - // ASTVerifier.g:226:5: ( ( alternative )+ ) - // ASTVerifier.g:226:7: ( alternative )+ + // ASTVerifier.g:227:5: ( ( alternative )+ ) + // ASTVerifier.g:227:7: ( alternative )+ { - // ASTVerifier.g:226:7: ( alternative )+ + // ASTVerifier.g:227:7: ( alternative )+ int cnt23=0; loop23: do { @@ -1689,9 +1696,9 @@ public class ASTVerifier extends TreeParser { switch (alt23) { case 1 : - // ASTVerifier.g:226:7: alternative + // ASTVerifier.g:227:7: alternative { - pushFollow(FOLLOW_alternative_in_altList766); + pushFollow(FOLLOW_alternative_in_altList784); alternative(); state._fsp--; @@ -1725,16 +1732,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "altListAsBlock" - // ASTVerifier.g:229:1: altListAsBlock : ^( BLOCK altList ) ; + // ASTVerifier.g:230:1: altListAsBlock : ^( BLOCK altList ) ; public final void altListAsBlock() throws RecognitionException { try { - // ASTVerifier.g:230:5: ( ^( BLOCK altList ) ) - // ASTVerifier.g:230:7: ^( BLOCK altList ) + // ASTVerifier.g:231:5: ( ^( BLOCK altList ) ) + // ASTVerifier.g:231:7: ^( BLOCK altList ) { - match(input,BLOCK,FOLLOW_BLOCK_in_altListAsBlock785); + match(input,BLOCK,FOLLOW_BLOCK_in_altListAsBlock803); match(input, Token.DOWN, null); - pushFollow(FOLLOW_altList_in_altListAsBlock787); + pushFollow(FOLLOW_altList_in_altListAsBlock805); altList(); state._fsp--; @@ -1757,10 +1764,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "alternative" - // ASTVerifier.g:233:1: alternative : ( ^( ALT_REWRITE alternative rewrite ) | ^( ALT EPSILON ) | elements ); + // ASTVerifier.g:234:1: alternative : ( ^( ALT_REWRITE alternative rewrite ) | ^( ALT EPSILON ) | elements ); public final void alternative() throws RecognitionException { try { - // ASTVerifier.g:234:5: ( ^( ALT_REWRITE alternative rewrite ) | ^( ALT EPSILON ) | elements ) + // ASTVerifier.g:235:5: ( ^( ALT_REWRITE alternative rewrite ) | ^( ALT EPSILON ) | elements ) int alt24=3; int LA24_0 = input.LA(1); @@ -1801,17 +1808,17 @@ public class ASTVerifier extends TreeParser { } switch (alt24) { case 1 : - // ASTVerifier.g:234:7: ^( ALT_REWRITE alternative rewrite ) + // ASTVerifier.g:235:7: ^( ALT_REWRITE alternative rewrite ) { - match(input,ALT_REWRITE,FOLLOW_ALT_REWRITE_in_alternative806); + match(input,ALT_REWRITE,FOLLOW_ALT_REWRITE_in_alternative824); match(input, Token.DOWN, null); - pushFollow(FOLLOW_alternative_in_alternative808); + pushFollow(FOLLOW_alternative_in_alternative826); alternative(); state._fsp--; - pushFollow(FOLLOW_rewrite_in_alternative810); + pushFollow(FOLLOW_rewrite_in_alternative828); rewrite(); state._fsp--; @@ -1822,21 +1829,21 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:235:7: ^( ALT EPSILON ) + // ASTVerifier.g:236:7: ^( ALT EPSILON ) { - match(input,ALT,FOLLOW_ALT_in_alternative820); + match(input,ALT,FOLLOW_ALT_in_alternative838); match(input, Token.DOWN, null); - match(input,EPSILON,FOLLOW_EPSILON_in_alternative822); + match(input,EPSILON,FOLLOW_EPSILON_in_alternative840); match(input, Token.UP, null); } break; case 3 : - // ASTVerifier.g:236:9: elements + // ASTVerifier.g:237:9: elements { - pushFollow(FOLLOW_elements_in_alternative833); + pushFollow(FOLLOW_elements_in_alternative851); elements(); state._fsp--; @@ -1859,16 +1866,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "elements" - // ASTVerifier.g:239:1: elements : ^( ALT ( element )+ ) ; + // ASTVerifier.g:240:1: elements : ^( ALT ( element )+ ) ; public final void elements() throws RecognitionException { try { - // ASTVerifier.g:240:5: ( ^( ALT ( element )+ ) ) - // ASTVerifier.g:240:7: ^( ALT ( element )+ ) + // ASTVerifier.g:241:5: ( ^( ALT ( element )+ ) ) + // ASTVerifier.g:241:7: ^( ALT ( element )+ ) { - match(input,ALT,FOLLOW_ALT_in_elements851); + match(input,ALT,FOLLOW_ALT_in_elements869); match(input, Token.DOWN, null); - // ASTVerifier.g:240:13: ( element )+ + // ASTVerifier.g:241:13: ( element )+ int cnt25=0; loop25: do { @@ -1882,9 +1889,9 @@ public class ASTVerifier extends TreeParser { switch (alt25) { case 1 : - // ASTVerifier.g:240:13: element + // ASTVerifier.g:241:13: element { - pushFollow(FOLLOW_element_in_elements853); + pushFollow(FOLLOW_element_in_elements871); element(); state._fsp--; @@ -1920,17 +1927,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "element" - // ASTVerifier.g:243:1: element : ( labeledElement | atom | ebnf | ACTION | SEMPRED | GATED_SEMPRED | treeSpec ); + // ASTVerifier.g:244:1: element : ( labeledElement | atom | ebnf | ACTION | SEMPRED | GATED_SEMPRED | treeSpec ); public final void element() throws RecognitionException { try { - // ASTVerifier.g:244:2: ( labeledElement | atom | ebnf | ACTION | SEMPRED | GATED_SEMPRED | treeSpec ) + // ASTVerifier.g:245:2: ( labeledElement | atom | ebnf | ACTION | SEMPRED | GATED_SEMPRED | treeSpec ) int alt26=7; alt26 = dfa26.predict(input); switch (alt26) { case 1 : - // ASTVerifier.g:244:4: labeledElement + // ASTVerifier.g:245:4: labeledElement { - pushFollow(FOLLOW_labeledElement_in_element869); + pushFollow(FOLLOW_labeledElement_in_element887); labeledElement(); state._fsp--; @@ -1939,9 +1946,9 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:245:4: atom + // ASTVerifier.g:246:4: atom { - pushFollow(FOLLOW_atom_in_element874); + pushFollow(FOLLOW_atom_in_element892); atom(); state._fsp--; @@ -1950,9 +1957,9 @@ public class ASTVerifier extends TreeParser { } break; case 3 : - // ASTVerifier.g:246:4: ebnf + // ASTVerifier.g:247:4: ebnf { - pushFollow(FOLLOW_ebnf_in_element879); + pushFollow(FOLLOW_ebnf_in_element897); ebnf(); state._fsp--; @@ -1961,30 +1968,30 @@ public class ASTVerifier extends TreeParser { } break; case 4 : - // ASTVerifier.g:247:6: ACTION + // ASTVerifier.g:248:6: ACTION { - match(input,ACTION,FOLLOW_ACTION_in_element886); + match(input,ACTION,FOLLOW_ACTION_in_element904); } break; case 5 : - // ASTVerifier.g:248:6: SEMPRED + // ASTVerifier.g:249:6: SEMPRED { - match(input,SEMPRED,FOLLOW_SEMPRED_in_element893); + match(input,SEMPRED,FOLLOW_SEMPRED_in_element911); } break; case 6 : - // ASTVerifier.g:249:4: GATED_SEMPRED + // ASTVerifier.g:250:4: GATED_SEMPRED { - match(input,GATED_SEMPRED,FOLLOW_GATED_SEMPRED_in_element898); + match(input,GATED_SEMPRED,FOLLOW_GATED_SEMPRED_in_element916); } break; case 7 : - // ASTVerifier.g:250:4: treeSpec + // ASTVerifier.g:251:4: treeSpec { - pushFollow(FOLLOW_treeSpec_in_element903); + pushFollow(FOLLOW_treeSpec_in_element921); treeSpec(); state._fsp--; @@ -2007,10 +2014,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "labeledElement" - // ASTVerifier.g:253:1: labeledElement : ( ^( ASSIGN ID ( atom | block ) ) | ^( PLUS_ASSIGN ID ( atom | block ) ) ); + // ASTVerifier.g:254:1: labeledElement : ( ^( ASSIGN ID ( atom | block ) ) | ^( PLUS_ASSIGN ID ( atom | block ) ) ); public final void labeledElement() throws RecognitionException { try { - // ASTVerifier.g:254:2: ( ^( ASSIGN ID ( atom | block ) ) | ^( PLUS_ASSIGN ID ( atom | block ) ) ) + // ASTVerifier.g:255:2: ( ^( ASSIGN ID ( atom | block ) ) | ^( PLUS_ASSIGN ID ( atom | block ) ) ) int alt29=2; int LA29_0 = input.LA(1); @@ -2028,13 +2035,13 @@ public class ASTVerifier extends TreeParser { } switch (alt29) { case 1 : - // ASTVerifier.g:254:4: ^( ASSIGN ID ( atom | block ) ) + // ASTVerifier.g:255:4: ^( ASSIGN ID ( atom | block ) ) { - match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement916); + match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement934); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_labeledElement918); - // ASTVerifier.g:254:16: ( atom | block ) + match(input,ID,FOLLOW_ID_in_labeledElement936); + // ASTVerifier.g:255:16: ( atom | block ) int alt27=2; int LA27_0 = input.LA(1); @@ -2052,9 +2059,9 @@ public class ASTVerifier extends TreeParser { } switch (alt27) { case 1 : - // ASTVerifier.g:254:17: atom + // ASTVerifier.g:255:17: atom { - pushFollow(FOLLOW_atom_in_labeledElement921); + pushFollow(FOLLOW_atom_in_labeledElement939); atom(); state._fsp--; @@ -2063,9 +2070,9 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:254:22: block + // ASTVerifier.g:255:22: block { - pushFollow(FOLLOW_block_in_labeledElement923); + pushFollow(FOLLOW_block_in_labeledElement941); block(); state._fsp--; @@ -2082,13 +2089,13 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:255:4: ^( PLUS_ASSIGN ID ( atom | block ) ) + // ASTVerifier.g:256:4: ^( PLUS_ASSIGN ID ( atom | block ) ) { - match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement931); + match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement949); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_labeledElement933); - // ASTVerifier.g:255:21: ( atom | block ) + match(input,ID,FOLLOW_ID_in_labeledElement951); + // ASTVerifier.g:256:21: ( atom | block ) int alt28=2; int LA28_0 = input.LA(1); @@ -2106,9 +2113,9 @@ public class ASTVerifier extends TreeParser { } switch (alt28) { case 1 : - // ASTVerifier.g:255:22: atom + // ASTVerifier.g:256:22: atom { - pushFollow(FOLLOW_atom_in_labeledElement936); + pushFollow(FOLLOW_atom_in_labeledElement954); atom(); state._fsp--; @@ -2117,9 +2124,9 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:255:27: block + // ASTVerifier.g:256:27: block { - pushFollow(FOLLOW_block_in_labeledElement938); + pushFollow(FOLLOW_block_in_labeledElement956); block(); state._fsp--; @@ -2150,16 +2157,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "treeSpec" - // ASTVerifier.g:258:1: treeSpec : ^( TREE_BEGIN ( element )+ ) ; + // ASTVerifier.g:259:1: treeSpec : ^( TREE_BEGIN ( element )+ ) ; public final void treeSpec() throws RecognitionException { try { - // ASTVerifier.g:259:5: ( ^( TREE_BEGIN ( element )+ ) ) - // ASTVerifier.g:259:7: ^( TREE_BEGIN ( element )+ ) + // ASTVerifier.g:260:5: ( ^( TREE_BEGIN ( element )+ ) ) + // ASTVerifier.g:260:7: ^( TREE_BEGIN ( element )+ ) { - match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_treeSpec955); + match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_treeSpec973); match(input, Token.DOWN, null); - // ASTVerifier.g:259:20: ( element )+ + // ASTVerifier.g:260:20: ( element )+ int cnt30=0; loop30: do { @@ -2173,9 +2180,9 @@ public class ASTVerifier extends TreeParser { switch (alt30) { case 1 : - // ASTVerifier.g:259:20: element + // ASTVerifier.g:260:20: element { - pushFollow(FOLLOW_element_in_treeSpec957); + pushFollow(FOLLOW_element_in_treeSpec975); element(); state._fsp--; @@ -2211,10 +2218,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ebnf" - // ASTVerifier.g:262:1: ebnf : ( ^( blockSuffix block ) | block ); + // ASTVerifier.g:263:1: ebnf : ( ^( blockSuffix block ) | block ); public final void ebnf() throws RecognitionException { try { - // ASTVerifier.g:262:5: ( ^( blockSuffix block ) | block ) + // ASTVerifier.g:263:5: ( ^( blockSuffix block ) | block ) int alt31=2; int LA31_0 = input.LA(1); @@ -2232,16 +2239,16 @@ public class ASTVerifier extends TreeParser { } switch (alt31) { case 1 : - // ASTVerifier.g:262:7: ^( blockSuffix block ) + // ASTVerifier.g:263:7: ^( blockSuffix block ) { - pushFollow(FOLLOW_blockSuffix_in_ebnf972); + pushFollow(FOLLOW_blockSuffix_in_ebnf990); blockSuffix(); state._fsp--; match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_ebnf974); + pushFollow(FOLLOW_block_in_ebnf992); block(); state._fsp--; @@ -2252,9 +2259,9 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:263:5: block + // ASTVerifier.g:264:5: block { - pushFollow(FOLLOW_block_in_ebnf981); + pushFollow(FOLLOW_block_in_ebnf999); block(); state._fsp--; @@ -2277,10 +2284,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "blockSuffix" - // ASTVerifier.g:266:1: blockSuffix : ( ebnfSuffix | ROOT | IMPLIES | BANG ); + // ASTVerifier.g:267:1: blockSuffix : ( ebnfSuffix | ROOT | IMPLIES | BANG ); public final void blockSuffix() throws RecognitionException { try { - // ASTVerifier.g:267:5: ( ebnfSuffix | ROOT | IMPLIES | BANG ) + // ASTVerifier.g:268:5: ( ebnfSuffix | ROOT | IMPLIES | BANG ) int alt32=4; switch ( input.LA(1) ) { case OPTIONAL: @@ -2314,9 +2321,9 @@ public class ASTVerifier extends TreeParser { switch (alt32) { case 1 : - // ASTVerifier.g:267:7: ebnfSuffix + // ASTVerifier.g:268:7: ebnfSuffix { - pushFollow(FOLLOW_ebnfSuffix_in_blockSuffix998); + pushFollow(FOLLOW_ebnfSuffix_in_blockSuffix1016); ebnfSuffix(); state._fsp--; @@ -2325,23 +2332,23 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:268:7: ROOT + // ASTVerifier.g:269:7: ROOT { - match(input,ROOT,FOLLOW_ROOT_in_blockSuffix1006); + match(input,ROOT,FOLLOW_ROOT_in_blockSuffix1024); } break; case 3 : - // ASTVerifier.g:269:7: IMPLIES + // ASTVerifier.g:270:7: IMPLIES { - match(input,IMPLIES,FOLLOW_IMPLIES_in_blockSuffix1014); + match(input,IMPLIES,FOLLOW_IMPLIES_in_blockSuffix1032); } break; case 4 : - // ASTVerifier.g:270:7: BANG + // ASTVerifier.g:271:7: BANG { - match(input,BANG,FOLLOW_BANG_in_blockSuffix1022); + match(input,BANG,FOLLOW_BANG_in_blockSuffix1040); } break; @@ -2360,10 +2367,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ebnfSuffix" - // ASTVerifier.g:273:1: ebnfSuffix : ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ); + // ASTVerifier.g:274:1: ebnfSuffix : ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ); public final void ebnfSuffix() throws RecognitionException { try { - // ASTVerifier.g:274:2: ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ) + // ASTVerifier.g:275:2: ( OPTIONAL | CLOSURE | POSITIVE_CLOSURE ) // ASTVerifier.g: { if ( (input.LA(1)>=OPTIONAL && input.LA(1)<=POSITIVE_CLOSURE) ) { @@ -2391,20 +2398,20 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "atom" - // ASTVerifier.g:279:1: atom : ( ^( ROOT range ) | ^( BANG range ) | ^( ROOT notSet ) | ^( BANG notSet ) | range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | terminal | ruleref ); + // ASTVerifier.g:280:1: atom : ( ^( ROOT range ) | ^( BANG range ) | ^( ROOT notSet ) | ^( BANG notSet ) | range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | terminal | ruleref ); public final void atom() throws RecognitionException { try { - // ASTVerifier.g:279:5: ( ^( ROOT range ) | ^( BANG range ) | ^( ROOT notSet ) | ^( BANG notSet ) | range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | terminal | ruleref ) + // ASTVerifier.g:280:5: ( ^( ROOT range ) | ^( BANG range ) | ^( ROOT notSet ) | ^( BANG notSet ) | range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | terminal | ruleref ) int alt33=9; alt33 = dfa33.predict(input); switch (alt33) { case 1 : - // ASTVerifier.g:279:7: ^( ROOT range ) + // ASTVerifier.g:280:7: ^( ROOT range ) { - match(input,ROOT,FOLLOW_ROOT_in_atom1062); + match(input,ROOT,FOLLOW_ROOT_in_atom1080); match(input, Token.DOWN, null); - pushFollow(FOLLOW_range_in_atom1064); + pushFollow(FOLLOW_range_in_atom1082); range(); state._fsp--; @@ -2415,12 +2422,12 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:280:4: ^( BANG range ) + // ASTVerifier.g:281:4: ^( BANG range ) { - match(input,BANG,FOLLOW_BANG_in_atom1071); + match(input,BANG,FOLLOW_BANG_in_atom1089); match(input, Token.DOWN, null); - pushFollow(FOLLOW_range_in_atom1073); + pushFollow(FOLLOW_range_in_atom1091); range(); state._fsp--; @@ -2431,12 +2438,12 @@ public class ASTVerifier extends TreeParser { } break; case 3 : - // ASTVerifier.g:281:4: ^( ROOT notSet ) + // ASTVerifier.g:282:4: ^( ROOT notSet ) { - match(input,ROOT,FOLLOW_ROOT_in_atom1080); + match(input,ROOT,FOLLOW_ROOT_in_atom1098); match(input, Token.DOWN, null); - pushFollow(FOLLOW_notSet_in_atom1082); + pushFollow(FOLLOW_notSet_in_atom1100); notSet(); state._fsp--; @@ -2447,12 +2454,12 @@ public class ASTVerifier extends TreeParser { } break; case 4 : - // ASTVerifier.g:282:4: ^( BANG notSet ) + // ASTVerifier.g:283:4: ^( BANG notSet ) { - match(input,BANG,FOLLOW_BANG_in_atom1089); + match(input,BANG,FOLLOW_BANG_in_atom1107); match(input, Token.DOWN, null); - pushFollow(FOLLOW_notSet_in_atom1091); + pushFollow(FOLLOW_notSet_in_atom1109); notSet(); state._fsp--; @@ -2463,9 +2470,9 @@ public class ASTVerifier extends TreeParser { } break; case 5 : - // ASTVerifier.g:283:4: range + // ASTVerifier.g:284:4: range { - pushFollow(FOLLOW_range_in_atom1097); + pushFollow(FOLLOW_range_in_atom1115); range(); state._fsp--; @@ -2474,13 +2481,13 @@ public class ASTVerifier extends TreeParser { } break; case 6 : - // ASTVerifier.g:284:4: ^( DOT ID terminal ) + // ASTVerifier.g:285:4: ^( DOT ID terminal ) { - match(input,DOT,FOLLOW_DOT_in_atom1103); + match(input,DOT,FOLLOW_DOT_in_atom1121); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom1105); - pushFollow(FOLLOW_terminal_in_atom1107); + match(input,ID,FOLLOW_ID_in_atom1123); + pushFollow(FOLLOW_terminal_in_atom1125); terminal(); state._fsp--; @@ -2491,13 +2498,13 @@ public class ASTVerifier extends TreeParser { } break; case 7 : - // ASTVerifier.g:285:4: ^( DOT ID ruleref ) + // ASTVerifier.g:286:4: ^( DOT ID ruleref ) { - match(input,DOT,FOLLOW_DOT_in_atom1114); + match(input,DOT,FOLLOW_DOT_in_atom1132); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_atom1116); - pushFollow(FOLLOW_ruleref_in_atom1118); + match(input,ID,FOLLOW_ID_in_atom1134); + pushFollow(FOLLOW_ruleref_in_atom1136); ruleref(); state._fsp--; @@ -2508,9 +2515,9 @@ public class ASTVerifier extends TreeParser { } break; case 8 : - // ASTVerifier.g:286:9: terminal + // ASTVerifier.g:287:9: terminal { - pushFollow(FOLLOW_terminal_in_atom1129); + pushFollow(FOLLOW_terminal_in_atom1147); terminal(); state._fsp--; @@ -2519,9 +2526,9 @@ public class ASTVerifier extends TreeParser { } break; case 9 : - // ASTVerifier.g:287:9: ruleref + // ASTVerifier.g:288:9: ruleref { - pushFollow(FOLLOW_ruleref_in_atom1139); + pushFollow(FOLLOW_ruleref_in_atom1157); ruleref(); state._fsp--; @@ -2544,10 +2551,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "notSet" - // ASTVerifier.g:290:1: notSet : ( ^( NOT notTerminal ) | ^( NOT block ) ); + // ASTVerifier.g:291:1: notSet : ( ^( NOT notTerminal ) | ^( NOT block ) ); public final void notSet() throws RecognitionException { try { - // ASTVerifier.g:291:5: ( ^( NOT notTerminal ) | ^( NOT block ) ) + // ASTVerifier.g:292:5: ( ^( NOT notTerminal ) | ^( NOT block ) ) int alt34=2; int LA34_0 = input.LA(1); @@ -2585,12 +2592,12 @@ public class ASTVerifier extends TreeParser { } switch (alt34) { case 1 : - // ASTVerifier.g:291:7: ^( NOT notTerminal ) + // ASTVerifier.g:292:7: ^( NOT notTerminal ) { - match(input,NOT,FOLLOW_NOT_in_notSet1157); + match(input,NOT,FOLLOW_NOT_in_notSet1175); match(input, Token.DOWN, null); - pushFollow(FOLLOW_notTerminal_in_notSet1159); + pushFollow(FOLLOW_notTerminal_in_notSet1177); notTerminal(); state._fsp--; @@ -2601,12 +2608,12 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:292:7: ^( NOT block ) + // ASTVerifier.g:293:7: ^( NOT block ) { - match(input,NOT,FOLLOW_NOT_in_notSet1169); + match(input,NOT,FOLLOW_NOT_in_notSet1187); match(input, Token.DOWN, null); - pushFollow(FOLLOW_block_in_notSet1171); + pushFollow(FOLLOW_block_in_notSet1189); block(); state._fsp--; @@ -2631,10 +2638,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "notTerminal" - // ASTVerifier.g:295:1: notTerminal : ( CHAR_LITERAL | TOKEN_REF | STRING_LITERAL ); + // ASTVerifier.g:296:1: notTerminal : ( CHAR_LITERAL | TOKEN_REF | STRING_LITERAL ); public final void notTerminal() throws RecognitionException { try { - // ASTVerifier.g:296:5: ( CHAR_LITERAL | TOKEN_REF | STRING_LITERAL ) + // ASTVerifier.g:297:5: ( CHAR_LITERAL | TOKEN_REF | STRING_LITERAL ) // ASTVerifier.g: { if ( input.LA(1)==TOKEN_REF||input.LA(1)==STRING_LITERAL||input.LA(1)==CHAR_LITERAL ) { @@ -2662,16 +2669,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "block" - // ASTVerifier.g:301:1: block : ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? altList ) ; + // ASTVerifier.g:302:1: block : ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? altList ) ; public final void block() throws RecognitionException { try { - // ASTVerifier.g:302:5: ( ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? altList ) ) - // ASTVerifier.g:302:7: ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? altList ) + // ASTVerifier.g:303:5: ( ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? altList ) ) + // ASTVerifier.g:303:7: ^( BLOCK ( optionsSpec )? ( ruleAction )* ( ACTION )? altList ) { - match(input,BLOCK,FOLLOW_BLOCK_in_block1223); + match(input,BLOCK,FOLLOW_BLOCK_in_block1241); match(input, Token.DOWN, null); - // ASTVerifier.g:302:15: ( optionsSpec )? + // ASTVerifier.g:303:15: ( optionsSpec )? int alt35=2; int LA35_0 = input.LA(1); @@ -2680,9 +2687,9 @@ public class ASTVerifier extends TreeParser { } switch (alt35) { case 1 : - // ASTVerifier.g:302:15: optionsSpec + // ASTVerifier.g:303:15: optionsSpec { - pushFollow(FOLLOW_optionsSpec_in_block1225); + pushFollow(FOLLOW_optionsSpec_in_block1243); optionsSpec(); state._fsp--; @@ -2693,7 +2700,7 @@ public class ASTVerifier extends TreeParser { } - // ASTVerifier.g:302:28: ( ruleAction )* + // ASTVerifier.g:303:28: ( ruleAction )* loop36: do { int alt36=2; @@ -2706,9 +2713,9 @@ public class ASTVerifier extends TreeParser { switch (alt36) { case 1 : - // ASTVerifier.g:302:28: ruleAction + // ASTVerifier.g:303:28: ruleAction { - pushFollow(FOLLOW_ruleAction_in_block1228); + pushFollow(FOLLOW_ruleAction_in_block1246); ruleAction(); state._fsp--; @@ -2722,7 +2729,7 @@ public class ASTVerifier extends TreeParser { } } while (true); - // ASTVerifier.g:302:40: ( ACTION )? + // ASTVerifier.g:303:40: ( ACTION )? int alt37=2; int LA37_0 = input.LA(1); @@ -2731,16 +2738,16 @@ public class ASTVerifier extends TreeParser { } switch (alt37) { case 1 : - // ASTVerifier.g:302:40: ACTION + // ASTVerifier.g:303:40: ACTION { - match(input,ACTION,FOLLOW_ACTION_in_block1231); + match(input,ACTION,FOLLOW_ACTION_in_block1249); } break; } - pushFollow(FOLLOW_altList_in_block1234); + pushFollow(FOLLOW_altList_in_block1252); altList(); state._fsp--; @@ -2763,10 +2770,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "ruleref" - // ASTVerifier.g:305:1: ruleref : ( ^( ROOT RULE_REF ( ARG_ACTION )? ) | ^( BANG RULE_REF ( ARG_ACTION )? ) | ^( RULE_REF ( ARG_ACTION )? ) ); + // ASTVerifier.g:306:1: ruleref : ( ^( ROOT RULE_REF ( ARG_ACTION )? ) | ^( BANG RULE_REF ( ARG_ACTION )? ) | ^( RULE_REF ( ARG_ACTION )? ) ); public final void ruleref() throws RecognitionException { try { - // ASTVerifier.g:306:5: ( ^( ROOT RULE_REF ( ARG_ACTION )? ) | ^( BANG RULE_REF ( ARG_ACTION )? ) | ^( RULE_REF ( ARG_ACTION )? ) ) + // ASTVerifier.g:307:5: ( ^( ROOT RULE_REF ( ARG_ACTION )? ) | ^( BANG RULE_REF ( ARG_ACTION )? ) | ^( RULE_REF ( ARG_ACTION )? ) ) int alt41=3; switch ( input.LA(1) ) { case ROOT: @@ -2793,13 +2800,13 @@ public class ASTVerifier extends TreeParser { switch (alt41) { case 1 : - // ASTVerifier.g:306:7: ^( ROOT RULE_REF ( ARG_ACTION )? ) + // ASTVerifier.g:307:7: ^( ROOT RULE_REF ( ARG_ACTION )? ) { - match(input,ROOT,FOLLOW_ROOT_in_ruleref1253); + match(input,ROOT,FOLLOW_ROOT_in_ruleref1271); match(input, Token.DOWN, null); - match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref1255); - // ASTVerifier.g:306:23: ( ARG_ACTION )? + match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref1273); + // ASTVerifier.g:307:23: ( ARG_ACTION )? int alt38=2; int LA38_0 = input.LA(1); @@ -2808,9 +2815,9 @@ public class ASTVerifier extends TreeParser { } switch (alt38) { case 1 : - // ASTVerifier.g:306:23: ARG_ACTION + // ASTVerifier.g:307:23: ARG_ACTION { - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref1257); + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref1275); } break; @@ -2823,13 +2830,13 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:307:7: ^( BANG RULE_REF ( ARG_ACTION )? ) + // ASTVerifier.g:308:7: ^( BANG RULE_REF ( ARG_ACTION )? ) { - match(input,BANG,FOLLOW_BANG_in_ruleref1268); + match(input,BANG,FOLLOW_BANG_in_ruleref1286); match(input, Token.DOWN, null); - match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref1270); - // ASTVerifier.g:307:23: ( ARG_ACTION )? + match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref1288); + // ASTVerifier.g:308:23: ( ARG_ACTION )? int alt39=2; int LA39_0 = input.LA(1); @@ -2838,9 +2845,9 @@ public class ASTVerifier extends TreeParser { } switch (alt39) { case 1 : - // ASTVerifier.g:307:23: ARG_ACTION + // ASTVerifier.g:308:23: ARG_ACTION { - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref1272); + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref1290); } break; @@ -2853,13 +2860,13 @@ public class ASTVerifier extends TreeParser { } break; case 3 : - // ASTVerifier.g:308:7: ^( RULE_REF ( ARG_ACTION )? ) + // ASTVerifier.g:309:7: ^( RULE_REF ( ARG_ACTION )? ) { - match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref1283); + match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref1301); if ( input.LA(1)==Token.DOWN ) { match(input, Token.DOWN, null); - // ASTVerifier.g:308:18: ( ARG_ACTION )? + // ASTVerifier.g:309:18: ( ARG_ACTION )? int alt40=2; int LA40_0 = input.LA(1); @@ -2868,9 +2875,9 @@ public class ASTVerifier extends TreeParser { } switch (alt40) { case 1 : - // ASTVerifier.g:308:18: ARG_ACTION + // ASTVerifier.g:309:18: ARG_ACTION { - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref1285); + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref1303); } break; @@ -2898,21 +2905,21 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "range" - // ASTVerifier.g:311:1: range : ^( RANGE rangeElement rangeElement ) ; + // ASTVerifier.g:312:1: range : ^( RANGE rangeElement rangeElement ) ; public final void range() throws RecognitionException { try { - // ASTVerifier.g:312:5: ( ^( RANGE rangeElement rangeElement ) ) - // ASTVerifier.g:312:7: ^( RANGE rangeElement rangeElement ) + // ASTVerifier.g:313:5: ( ^( RANGE rangeElement rangeElement ) ) + // ASTVerifier.g:313:7: ^( RANGE rangeElement rangeElement ) { - match(input,RANGE,FOLLOW_RANGE_in_range1305); + match(input,RANGE,FOLLOW_RANGE_in_range1323); match(input, Token.DOWN, null); - pushFollow(FOLLOW_rangeElement_in_range1307); + pushFollow(FOLLOW_rangeElement_in_range1325); rangeElement(); state._fsp--; - pushFollow(FOLLOW_rangeElement_in_range1309); + pushFollow(FOLLOW_rangeElement_in_range1327); rangeElement(); state._fsp--; @@ -2935,10 +2942,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rangeElement" - // ASTVerifier.g:315:1: rangeElement : ( CHAR_LITERAL | STRING_LITERAL | RULE_REF | TOKEN_REF ); + // ASTVerifier.g:316:1: rangeElement : ( CHAR_LITERAL | STRING_LITERAL | RULE_REF | TOKEN_REF ); public final void rangeElement() throws RecognitionException { try { - // ASTVerifier.g:316:5: ( CHAR_LITERAL | STRING_LITERAL | RULE_REF | TOKEN_REF ) + // ASTVerifier.g:317:5: ( CHAR_LITERAL | STRING_LITERAL | RULE_REF | TOKEN_REF ) // ASTVerifier.g: { if ( (input.LA(1)>=TOKEN_REF && input.LA(1)<=RULE_REF)||input.LA(1)==STRING_LITERAL||input.LA(1)==CHAR_LITERAL ) { @@ -2966,20 +2973,20 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "terminal" - // ASTVerifier.g:322:1: terminal : ( ^( CHAR_LITERAL elementOptions ) | CHAR_LITERAL | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( ROOT terminal ) | ^( BANG terminal ) ); + // ASTVerifier.g:323:1: terminal : ( ^( CHAR_LITERAL elementOptions ) | CHAR_LITERAL | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( ROOT terminal ) | ^( BANG terminal ) ); public final void terminal() throws RecognitionException { try { - // ASTVerifier.g:323:5: ( ^( CHAR_LITERAL elementOptions ) | CHAR_LITERAL | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( ROOT terminal ) | ^( BANG terminal ) ) + // ASTVerifier.g:324:5: ( ^( CHAR_LITERAL elementOptions ) | CHAR_LITERAL | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( ROOT terminal ) | ^( BANG terminal ) ) int alt42=10; alt42 = dfa42.predict(input); switch (alt42) { case 1 : - // ASTVerifier.g:323:9: ^( CHAR_LITERAL elementOptions ) + // ASTVerifier.g:324:9: ^( CHAR_LITERAL elementOptions ) { - match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_terminal1371); + match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_terminal1389); match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_terminal1373); + pushFollow(FOLLOW_elementOptions_in_terminal1391); elementOptions(); state._fsp--; @@ -2990,19 +2997,19 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:324:9: CHAR_LITERAL + // ASTVerifier.g:325:9: CHAR_LITERAL { - match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_terminal1384); + match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_terminal1402); } break; case 3 : - // ASTVerifier.g:325:7: ^( STRING_LITERAL elementOptions ) + // ASTVerifier.g:326:7: ^( STRING_LITERAL elementOptions ) { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal1393); + match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal1411); match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_terminal1395); + pushFollow(FOLLOW_elementOptions_in_terminal1413); elementOptions(); state._fsp--; @@ -3013,19 +3020,19 @@ public class ASTVerifier extends TreeParser { } break; case 4 : - // ASTVerifier.g:326:7: STRING_LITERAL + // ASTVerifier.g:327:7: STRING_LITERAL { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal1404); + match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal1422); } break; case 5 : - // ASTVerifier.g:327:7: ^( TOKEN_REF elementOptions ) + // ASTVerifier.g:328:7: ^( TOKEN_REF elementOptions ) { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal1413); + match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal1431); match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_terminal1415); + pushFollow(FOLLOW_elementOptions_in_terminal1433); elementOptions(); state._fsp--; @@ -3036,19 +3043,19 @@ public class ASTVerifier extends TreeParser { } break; case 6 : - // ASTVerifier.g:328:7: TOKEN_REF + // ASTVerifier.g:329:7: TOKEN_REF { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal1424); + match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal1442); } break; case 7 : - // ASTVerifier.g:329:7: ^( WILDCARD elementOptions ) + // ASTVerifier.g:330:7: ^( WILDCARD elementOptions ) { - match(input,WILDCARD,FOLLOW_WILDCARD_in_terminal1433); + match(input,WILDCARD,FOLLOW_WILDCARD_in_terminal1451); match(input, Token.DOWN, null); - pushFollow(FOLLOW_elementOptions_in_terminal1435); + pushFollow(FOLLOW_elementOptions_in_terminal1453); elementOptions(); state._fsp--; @@ -3059,19 +3066,19 @@ public class ASTVerifier extends TreeParser { } break; case 8 : - // ASTVerifier.g:330:7: WILDCARD + // ASTVerifier.g:331:7: WILDCARD { - match(input,WILDCARD,FOLLOW_WILDCARD_in_terminal1444); + match(input,WILDCARD,FOLLOW_WILDCARD_in_terminal1462); } break; case 9 : - // ASTVerifier.g:331:7: ^( ROOT terminal ) + // ASTVerifier.g:332:7: ^( ROOT terminal ) { - match(input,ROOT,FOLLOW_ROOT_in_terminal1453); + match(input,ROOT,FOLLOW_ROOT_in_terminal1471); match(input, Token.DOWN, null); - pushFollow(FOLLOW_terminal_in_terminal1455); + pushFollow(FOLLOW_terminal_in_terminal1473); terminal(); state._fsp--; @@ -3082,12 +3089,12 @@ public class ASTVerifier extends TreeParser { } break; case 10 : - // ASTVerifier.g:332:7: ^( BANG terminal ) + // ASTVerifier.g:333:7: ^( BANG terminal ) { - match(input,BANG,FOLLOW_BANG_in_terminal1465); + match(input,BANG,FOLLOW_BANG_in_terminal1483); match(input, Token.DOWN, null); - pushFollow(FOLLOW_terminal_in_terminal1467); + pushFollow(FOLLOW_terminal_in_terminal1485); terminal(); state._fsp--; @@ -3112,16 +3119,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "elementOptions" - // ASTVerifier.g:335:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption )+ ) ; + // ASTVerifier.g:336:1: elementOptions : ^( ELEMENT_OPTIONS ( elementOption )+ ) ; public final void elementOptions() throws RecognitionException { try { - // ASTVerifier.g:336:5: ( ^( ELEMENT_OPTIONS ( elementOption )+ ) ) - // ASTVerifier.g:336:7: ^( ELEMENT_OPTIONS ( elementOption )+ ) + // ASTVerifier.g:337:5: ( ^( ELEMENT_OPTIONS ( elementOption )+ ) ) + // ASTVerifier.g:337:7: ^( ELEMENT_OPTIONS ( elementOption )+ ) { - match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOptions1486); + match(input,ELEMENT_OPTIONS,FOLLOW_ELEMENT_OPTIONS_in_elementOptions1504); match(input, Token.DOWN, null); - // ASTVerifier.g:336:25: ( elementOption )+ + // ASTVerifier.g:337:25: ( elementOption )+ int cnt43=0; loop43: do { @@ -3135,9 +3142,9 @@ public class ASTVerifier extends TreeParser { switch (alt43) { case 1 : - // ASTVerifier.g:336:25: elementOption + // ASTVerifier.g:337:25: elementOption { - pushFollow(FOLLOW_elementOption_in_elementOptions1488); + pushFollow(FOLLOW_elementOption_in_elementOptions1506); elementOption(); state._fsp--; @@ -3173,10 +3180,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "elementOption" - // ASTVerifier.g:339:1: elementOption : ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) ); + // ASTVerifier.g:340:1: elementOption : ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) ); public final void elementOption() throws RecognitionException { try { - // ASTVerifier.g:340:5: ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) ) + // ASTVerifier.g:341:5: ( ID | ^( ASSIGN ID ID ) | ^( ASSIGN ID STRING_LITERAL ) ) int alt44=3; int LA44_0 = input.LA(1); @@ -3227,33 +3234,33 @@ public class ASTVerifier extends TreeParser { } switch (alt44) { case 1 : - // ASTVerifier.g:340:7: ID + // ASTVerifier.g:341:7: ID { - match(input,ID,FOLLOW_ID_in_elementOption1507); + match(input,ID,FOLLOW_ID_in_elementOption1525); } break; case 2 : - // ASTVerifier.g:341:9: ^( ASSIGN ID ID ) + // ASTVerifier.g:342:9: ^( ASSIGN ID ID ) { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1518); + match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1536); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption1520); - match(input,ID,FOLLOW_ID_in_elementOption1522); + match(input,ID,FOLLOW_ID_in_elementOption1538); + match(input,ID,FOLLOW_ID_in_elementOption1540); match(input, Token.UP, null); } break; case 3 : - // ASTVerifier.g:342:9: ^( ASSIGN ID STRING_LITERAL ) + // ASTVerifier.g:343:9: ^( ASSIGN ID STRING_LITERAL ) { - match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1534); + match(input,ASSIGN,FOLLOW_ASSIGN_in_elementOption1552); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_elementOption1536); - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption1538); + match(input,ID,FOLLOW_ID_in_elementOption1554); + match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_elementOption1556); match(input, Token.UP, null); @@ -3274,13 +3281,13 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewrite" - // ASTVerifier.g:345:1: rewrite : ( predicatedRewrite )* nakedRewrite ; + // ASTVerifier.g:346:1: rewrite : ( predicatedRewrite )* nakedRewrite ; public final void rewrite() throws RecognitionException { try { - // ASTVerifier.g:346:2: ( ( predicatedRewrite )* nakedRewrite ) - // ASTVerifier.g:346:4: ( predicatedRewrite )* nakedRewrite + // ASTVerifier.g:347:2: ( ( predicatedRewrite )* nakedRewrite ) + // ASTVerifier.g:347:4: ( predicatedRewrite )* nakedRewrite { - // ASTVerifier.g:346:4: ( predicatedRewrite )* + // ASTVerifier.g:347:4: ( predicatedRewrite )* loop45: do { int alt45=2; @@ -3320,9 +3327,9 @@ public class ASTVerifier extends TreeParser { switch (alt45) { case 1 : - // ASTVerifier.g:346:4: predicatedRewrite + // ASTVerifier.g:347:4: predicatedRewrite { - pushFollow(FOLLOW_predicatedRewrite_in_rewrite1553); + pushFollow(FOLLOW_predicatedRewrite_in_rewrite1571); predicatedRewrite(); state._fsp--; @@ -3336,7 +3343,7 @@ public class ASTVerifier extends TreeParser { } } while (true); - pushFollow(FOLLOW_nakedRewrite_in_rewrite1556); + pushFollow(FOLLOW_nakedRewrite_in_rewrite1574); nakedRewrite(); state._fsp--; @@ -3357,10 +3364,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "predicatedRewrite" - // ASTVerifier.g:349:1: predicatedRewrite : ( ^( ST_RESULT SEMPRED rewriteAlt ) | ^( RESULT SEMPRED rewriteAlt ) ); + // ASTVerifier.g:350:1: predicatedRewrite : ( ^( ST_RESULT SEMPRED rewriteAlt ) | ^( RESULT SEMPRED rewriteAlt ) ); public final void predicatedRewrite() throws RecognitionException { try { - // ASTVerifier.g:350:2: ( ^( ST_RESULT SEMPRED rewriteAlt ) | ^( RESULT SEMPRED rewriteAlt ) ) + // ASTVerifier.g:351:2: ( ^( ST_RESULT SEMPRED rewriteAlt ) | ^( RESULT SEMPRED rewriteAlt ) ) int alt46=2; int LA46_0 = input.LA(1); @@ -3378,13 +3385,13 @@ public class ASTVerifier extends TreeParser { } switch (alt46) { case 1 : - // ASTVerifier.g:350:4: ^( ST_RESULT SEMPRED rewriteAlt ) + // ASTVerifier.g:351:4: ^( ST_RESULT SEMPRED rewriteAlt ) { - match(input,ST_RESULT,FOLLOW_ST_RESULT_in_predicatedRewrite1568); + match(input,ST_RESULT,FOLLOW_ST_RESULT_in_predicatedRewrite1586); match(input, Token.DOWN, null); - match(input,SEMPRED,FOLLOW_SEMPRED_in_predicatedRewrite1570); - pushFollow(FOLLOW_rewriteAlt_in_predicatedRewrite1572); + match(input,SEMPRED,FOLLOW_SEMPRED_in_predicatedRewrite1588); + pushFollow(FOLLOW_rewriteAlt_in_predicatedRewrite1590); rewriteAlt(); state._fsp--; @@ -3395,13 +3402,13 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:351:4: ^( RESULT SEMPRED rewriteAlt ) + // ASTVerifier.g:352:4: ^( RESULT SEMPRED rewriteAlt ) { - match(input,RESULT,FOLLOW_RESULT_in_predicatedRewrite1579); + match(input,RESULT,FOLLOW_RESULT_in_predicatedRewrite1597); match(input, Token.DOWN, null); - match(input,SEMPRED,FOLLOW_SEMPRED_in_predicatedRewrite1581); - pushFollow(FOLLOW_rewriteAlt_in_predicatedRewrite1583); + match(input,SEMPRED,FOLLOW_SEMPRED_in_predicatedRewrite1599); + pushFollow(FOLLOW_rewriteAlt_in_predicatedRewrite1601); rewriteAlt(); state._fsp--; @@ -3426,10 +3433,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "nakedRewrite" - // ASTVerifier.g:354:1: nakedRewrite : ( ^( ST_RESULT rewriteAlt ) | ^( RESULT rewriteAlt ) ); + // ASTVerifier.g:355:1: nakedRewrite : ( ^( ST_RESULT rewriteAlt ) | ^( RESULT rewriteAlt ) ); public final void nakedRewrite() throws RecognitionException { try { - // ASTVerifier.g:355:2: ( ^( ST_RESULT rewriteAlt ) | ^( RESULT rewriteAlt ) ) + // ASTVerifier.g:356:2: ( ^( ST_RESULT rewriteAlt ) | ^( RESULT rewriteAlt ) ) int alt47=2; int LA47_0 = input.LA(1); @@ -3447,12 +3454,12 @@ public class ASTVerifier extends TreeParser { } switch (alt47) { case 1 : - // ASTVerifier.g:355:4: ^( ST_RESULT rewriteAlt ) + // ASTVerifier.g:356:4: ^( ST_RESULT rewriteAlt ) { - match(input,ST_RESULT,FOLLOW_ST_RESULT_in_nakedRewrite1597); + match(input,ST_RESULT,FOLLOW_ST_RESULT_in_nakedRewrite1615); match(input, Token.DOWN, null); - pushFollow(FOLLOW_rewriteAlt_in_nakedRewrite1599); + pushFollow(FOLLOW_rewriteAlt_in_nakedRewrite1617); rewriteAlt(); state._fsp--; @@ -3463,12 +3470,12 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:356:4: ^( RESULT rewriteAlt ) + // ASTVerifier.g:357:4: ^( RESULT rewriteAlt ) { - match(input,RESULT,FOLLOW_RESULT_in_nakedRewrite1606); + match(input,RESULT,FOLLOW_RESULT_in_nakedRewrite1624); match(input, Token.DOWN, null); - pushFollow(FOLLOW_rewriteAlt_in_nakedRewrite1608); + pushFollow(FOLLOW_rewriteAlt_in_nakedRewrite1626); rewriteAlt(); state._fsp--; @@ -3493,10 +3500,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteAlt" - // ASTVerifier.g:359:1: rewriteAlt : ( rewriteTemplate | rewriteTreeAlt | ETC | EPSILON ); + // ASTVerifier.g:360:1: rewriteAlt : ( rewriteTemplate | rewriteTreeAlt | ETC | EPSILON ); public final void rewriteAlt() throws RecognitionException { try { - // ASTVerifier.g:360:5: ( rewriteTemplate | rewriteTreeAlt | ETC | EPSILON ) + // ASTVerifier.g:361:5: ( rewriteTemplate | rewriteTreeAlt | ETC | EPSILON ) int alt48=4; switch ( input.LA(1) ) { case ACTION: @@ -3529,9 +3536,9 @@ public class ASTVerifier extends TreeParser { switch (alt48) { case 1 : - // ASTVerifier.g:360:7: rewriteTemplate + // ASTVerifier.g:361:7: rewriteTemplate { - pushFollow(FOLLOW_rewriteTemplate_in_rewriteAlt1624); + pushFollow(FOLLOW_rewriteTemplate_in_rewriteAlt1642); rewriteTemplate(); state._fsp--; @@ -3540,9 +3547,9 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:361:7: rewriteTreeAlt + // ASTVerifier.g:362:7: rewriteTreeAlt { - pushFollow(FOLLOW_rewriteTreeAlt_in_rewriteAlt1632); + pushFollow(FOLLOW_rewriteTreeAlt_in_rewriteAlt1650); rewriteTreeAlt(); state._fsp--; @@ -3551,16 +3558,16 @@ public class ASTVerifier extends TreeParser { } break; case 3 : - // ASTVerifier.g:362:7: ETC + // ASTVerifier.g:363:7: ETC { - match(input,ETC,FOLLOW_ETC_in_rewriteAlt1640); + match(input,ETC,FOLLOW_ETC_in_rewriteAlt1658); } break; case 4 : - // ASTVerifier.g:363:7: EPSILON + // ASTVerifier.g:364:7: EPSILON { - match(input,EPSILON,FOLLOW_EPSILON_in_rewriteAlt1648); + match(input,EPSILON,FOLLOW_EPSILON_in_rewriteAlt1666); } break; @@ -3579,16 +3586,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTreeAlt" - // ASTVerifier.g:366:1: rewriteTreeAlt : ^( ALT ( rewriteTreeElement )+ ) ; + // ASTVerifier.g:367:1: rewriteTreeAlt : ^( ALT ( rewriteTreeElement )+ ) ; public final void rewriteTreeAlt() throws RecognitionException { try { - // ASTVerifier.g:367:5: ( ^( ALT ( rewriteTreeElement )+ ) ) - // ASTVerifier.g:367:7: ^( ALT ( rewriteTreeElement )+ ) + // ASTVerifier.g:368:5: ( ^( ALT ( rewriteTreeElement )+ ) ) + // ASTVerifier.g:368:7: ^( ALT ( rewriteTreeElement )+ ) { - match(input,ALT,FOLLOW_ALT_in_rewriteTreeAlt1667); + match(input,ALT,FOLLOW_ALT_in_rewriteTreeAlt1685); match(input, Token.DOWN, null); - // ASTVerifier.g:367:13: ( rewriteTreeElement )+ + // ASTVerifier.g:368:13: ( rewriteTreeElement )+ int cnt49=0; loop49: do { @@ -3602,9 +3609,9 @@ public class ASTVerifier extends TreeParser { switch (alt49) { case 1 : - // ASTVerifier.g:367:13: rewriteTreeElement + // ASTVerifier.g:368:13: rewriteTreeElement { - pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTreeAlt1669); + pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTreeAlt1687); rewriteTreeElement(); state._fsp--; @@ -3640,10 +3647,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTreeElement" - // ASTVerifier.g:370:1: rewriteTreeElement : ( rewriteTreeAtom | rewriteTree | rewriteTreeEbnf ); + // ASTVerifier.g:371:1: rewriteTreeElement : ( rewriteTreeAtom | rewriteTree | rewriteTreeEbnf ); public final void rewriteTreeElement() throws RecognitionException { try { - // ASTVerifier.g:371:2: ( rewriteTreeAtom | rewriteTree | rewriteTreeEbnf ) + // ASTVerifier.g:372:2: ( rewriteTreeAtom | rewriteTree | rewriteTreeEbnf ) int alt50=3; switch ( input.LA(1) ) { case ACTION: @@ -3677,9 +3684,9 @@ public class ASTVerifier extends TreeParser { switch (alt50) { case 1 : - // ASTVerifier.g:371:4: rewriteTreeAtom + // ASTVerifier.g:372:4: rewriteTreeAtom { - pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTreeElement1685); + pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTreeElement1703); rewriteTreeAtom(); state._fsp--; @@ -3688,9 +3695,9 @@ public class ASTVerifier extends TreeParser { } break; case 2 : - // ASTVerifier.g:372:4: rewriteTree + // ASTVerifier.g:373:4: rewriteTree { - pushFollow(FOLLOW_rewriteTree_in_rewriteTreeElement1690); + pushFollow(FOLLOW_rewriteTree_in_rewriteTreeElement1708); rewriteTree(); state._fsp--; @@ -3699,9 +3706,9 @@ public class ASTVerifier extends TreeParser { } break; case 3 : - // ASTVerifier.g:373:6: rewriteTreeEbnf + // ASTVerifier.g:374:6: rewriteTreeEbnf { - pushFollow(FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement1697); + pushFollow(FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement1715); rewriteTreeEbnf(); state._fsp--; @@ -3724,10 +3731,10 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTreeAtom" - // ASTVerifier.g:376:1: rewriteTreeAtom : ( CHAR_LITERAL | ^( TOKEN_REF ARG_ACTION ) | TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL | ACTION ); + // ASTVerifier.g:377:1: rewriteTreeAtom : ( CHAR_LITERAL | ^( TOKEN_REF ARG_ACTION ) | TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL | ACTION ); public final void rewriteTreeAtom() throws RecognitionException { try { - // ASTVerifier.g:377:5: ( CHAR_LITERAL | ^( TOKEN_REF ARG_ACTION ) | TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL | ACTION ) + // ASTVerifier.g:378:5: ( CHAR_LITERAL | ^( TOKEN_REF ARG_ACTION ) | TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL | ACTION ) int alt51=7; switch ( input.LA(1) ) { case CHAR_LITERAL: @@ -3782,56 +3789,56 @@ public class ASTVerifier extends TreeParser { switch (alt51) { case 1 : - // ASTVerifier.g:377:9: CHAR_LITERAL + // ASTVerifier.g:378:9: CHAR_LITERAL { - match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_rewriteTreeAtom1713); + match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_rewriteTreeAtom1731); } break; case 2 : - // ASTVerifier.g:378:6: ^( TOKEN_REF ARG_ACTION ) + // ASTVerifier.g:379:6: ^( TOKEN_REF ARG_ACTION ) { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewriteTreeAtom1721); + match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewriteTreeAtom1739); match(input, Token.DOWN, null); - match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rewriteTreeAtom1723); + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rewriteTreeAtom1741); match(input, Token.UP, null); } break; case 3 : - // ASTVerifier.g:379:6: TOKEN_REF + // ASTVerifier.g:380:6: TOKEN_REF { - match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewriteTreeAtom1731); + match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewriteTreeAtom1749); } break; case 4 : - // ASTVerifier.g:380:9: RULE_REF + // ASTVerifier.g:381:9: RULE_REF { - match(input,RULE_REF,FOLLOW_RULE_REF_in_rewriteTreeAtom1741); + match(input,RULE_REF,FOLLOW_RULE_REF_in_rewriteTreeAtom1759); } break; case 5 : - // ASTVerifier.g:381:6: STRING_LITERAL + // ASTVerifier.g:382:6: STRING_LITERAL { - match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_rewriteTreeAtom1748); + match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_rewriteTreeAtom1766); } break; case 6 : - // ASTVerifier.g:382:6: LABEL + // ASTVerifier.g:383:6: LABEL { - match(input,LABEL,FOLLOW_LABEL_in_rewriteTreeAtom1755); + match(input,LABEL,FOLLOW_LABEL_in_rewriteTreeAtom1773); } break; case 7 : - // ASTVerifier.g:383:4: ACTION + // ASTVerifier.g:384:4: ACTION { - match(input,ACTION,FOLLOW_ACTION_in_rewriteTreeAtom1760); + match(input,ACTION,FOLLOW_ACTION_in_rewriteTreeAtom1778); } break; @@ -3850,23 +3857,23 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTreeEbnf" - // ASTVerifier.g:386:1: rewriteTreeEbnf : ^( ebnfSuffix ^( BLOCK rewriteTreeAlt ) ) ; + // ASTVerifier.g:387:1: rewriteTreeEbnf : ^( ebnfSuffix ^( BLOCK rewriteTreeAlt ) ) ; public final void rewriteTreeEbnf() throws RecognitionException { try { - // ASTVerifier.g:387:2: ( ^( ebnfSuffix ^( BLOCK rewriteTreeAlt ) ) ) - // ASTVerifier.g:387:4: ^( ebnfSuffix ^( BLOCK rewriteTreeAlt ) ) + // ASTVerifier.g:388:2: ( ^( ebnfSuffix ^( BLOCK rewriteTreeAlt ) ) ) + // ASTVerifier.g:388:4: ^( ebnfSuffix ^( BLOCK rewriteTreeAlt ) ) { - pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeEbnf1772); + pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeEbnf1790); ebnfSuffix(); state._fsp--; match(input, Token.DOWN, null); - match(input,BLOCK,FOLLOW_BLOCK_in_rewriteTreeEbnf1775); + match(input,BLOCK,FOLLOW_BLOCK_in_rewriteTreeEbnf1793); match(input, Token.DOWN, null); - pushFollow(FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf1777); + pushFollow(FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf1795); rewriteTreeAlt(); state._fsp--; @@ -3891,21 +3898,21 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTree" - // ASTVerifier.g:389:1: rewriteTree : ^( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* ) ; + // ASTVerifier.g:390:1: rewriteTree : ^( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* ) ; public final void rewriteTree() throws RecognitionException { try { - // ASTVerifier.g:390:2: ( ^( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* ) ) - // ASTVerifier.g:390:4: ^( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* ) + // ASTVerifier.g:391:2: ( ^( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* ) ) + // ASTVerifier.g:391:4: ^( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* ) { - match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_rewriteTree1790); + match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_rewriteTree1808); match(input, Token.DOWN, null); - pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTree1792); + pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTree1810); rewriteTreeAtom(); state._fsp--; - // ASTVerifier.g:390:33: ( rewriteTreeElement )* + // ASTVerifier.g:391:33: ( rewriteTreeElement )* loop52: do { int alt52=2; @@ -3918,9 +3925,9 @@ public class ASTVerifier extends TreeParser { switch (alt52) { case 1 : - // ASTVerifier.g:390:33: rewriteTreeElement + // ASTVerifier.g:391:33: rewriteTreeElement { - pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTree1794); + pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTree1812); rewriteTreeElement(); state._fsp--; @@ -3952,20 +3959,20 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTemplate" - // ASTVerifier.g:393:1: rewriteTemplate : ( ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) | ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) | rewriteTemplateRef | rewriteIndirectTemplateHead | ACTION ); + // ASTVerifier.g:394:1: rewriteTemplate : ( ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) | ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) | rewriteTemplateRef | rewriteIndirectTemplateHead | ACTION ); public final void rewriteTemplate() throws RecognitionException { try { - // ASTVerifier.g:394:2: ( ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) | ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) | rewriteTemplateRef | rewriteIndirectTemplateHead | ACTION ) + // ASTVerifier.g:395:2: ( ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) | ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) | rewriteTemplateRef | rewriteIndirectTemplateHead | ACTION ) int alt55=5; alt55 = dfa55.predict(input); switch (alt55) { case 1 : - // ASTVerifier.g:394:4: ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) + // ASTVerifier.g:395:4: ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) { - match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplate1809); + match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplate1827); match(input, Token.DOWN, null); - // ASTVerifier.g:394:15: ( rewriteTemplateArgs )? + // ASTVerifier.g:395:15: ( rewriteTemplateArgs )? int alt53=2; int LA53_0 = input.LA(1); @@ -3974,9 +3981,9 @@ public class ASTVerifier extends TreeParser { } switch (alt53) { case 1 : - // ASTVerifier.g:394:15: rewriteTemplateArgs + // ASTVerifier.g:395:15: rewriteTemplateArgs { - pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1811); + pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1829); rewriteTemplateArgs(); state._fsp--; @@ -3987,19 +3994,19 @@ public class ASTVerifier extends TreeParser { } - match(input,DOUBLE_QUOTE_STRING_LITERAL,FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate1814); + match(input,DOUBLE_QUOTE_STRING_LITERAL,FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate1832); match(input, Token.UP, null); } break; case 2 : - // ASTVerifier.g:395:4: ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) + // ASTVerifier.g:396:4: ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) { - match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplate1821); + match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplate1839); match(input, Token.DOWN, null); - // ASTVerifier.g:395:15: ( rewriteTemplateArgs )? + // ASTVerifier.g:396:15: ( rewriteTemplateArgs )? int alt54=2; int LA54_0 = input.LA(1); @@ -4008,9 +4015,9 @@ public class ASTVerifier extends TreeParser { } switch (alt54) { case 1 : - // ASTVerifier.g:395:15: rewriteTemplateArgs + // ASTVerifier.g:396:15: rewriteTemplateArgs { - pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1823); + pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1841); rewriteTemplateArgs(); state._fsp--; @@ -4021,16 +4028,16 @@ public class ASTVerifier extends TreeParser { } - match(input,DOUBLE_ANGLE_STRING_LITERAL,FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate1826); + match(input,DOUBLE_ANGLE_STRING_LITERAL,FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate1844); match(input, Token.UP, null); } break; case 3 : - // ASTVerifier.g:396:4: rewriteTemplateRef + // ASTVerifier.g:397:4: rewriteTemplateRef { - pushFollow(FOLLOW_rewriteTemplateRef_in_rewriteTemplate1832); + pushFollow(FOLLOW_rewriteTemplateRef_in_rewriteTemplate1850); rewriteTemplateRef(); state._fsp--; @@ -4039,9 +4046,9 @@ public class ASTVerifier extends TreeParser { } break; case 4 : - // ASTVerifier.g:397:4: rewriteIndirectTemplateHead + // ASTVerifier.g:398:4: rewriteIndirectTemplateHead { - pushFollow(FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate1837); + pushFollow(FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate1855); rewriteIndirectTemplateHead(); state._fsp--; @@ -4050,9 +4057,9 @@ public class ASTVerifier extends TreeParser { } break; case 5 : - // ASTVerifier.g:398:4: ACTION + // ASTVerifier.g:399:4: ACTION { - match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplate1842); + match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplate1860); } break; @@ -4071,17 +4078,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTemplateRef" - // ASTVerifier.g:401:1: rewriteTemplateRef : ^( TEMPLATE ID ( rewriteTemplateArgs )? ) ; + // ASTVerifier.g:402:1: rewriteTemplateRef : ^( TEMPLATE ID ( rewriteTemplateArgs )? ) ; public final void rewriteTemplateRef() throws RecognitionException { try { - // ASTVerifier.g:402:2: ( ^( TEMPLATE ID ( rewriteTemplateArgs )? ) ) - // ASTVerifier.g:402:4: ^( TEMPLATE ID ( rewriteTemplateArgs )? ) + // ASTVerifier.g:403:2: ( ^( TEMPLATE ID ( rewriteTemplateArgs )? ) ) + // ASTVerifier.g:403:4: ^( TEMPLATE ID ( rewriteTemplateArgs )? ) { - match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplateRef1854); + match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplateRef1872); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_rewriteTemplateRef1856); - // ASTVerifier.g:402:18: ( rewriteTemplateArgs )? + match(input,ID,FOLLOW_ID_in_rewriteTemplateRef1874); + // ASTVerifier.g:403:18: ( rewriteTemplateArgs )? int alt56=2; int LA56_0 = input.LA(1); @@ -4090,9 +4097,9 @@ public class ASTVerifier extends TreeParser { } switch (alt56) { case 1 : - // ASTVerifier.g:402:18: rewriteTemplateArgs + // ASTVerifier.g:403:18: rewriteTemplateArgs { - pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef1858); + pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef1876); rewriteTemplateArgs(); state._fsp--; @@ -4121,17 +4128,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteIndirectTemplateHead" - // ASTVerifier.g:405:1: rewriteIndirectTemplateHead : ^( TEMPLATE ACTION ( rewriteTemplateArgs )? ) ; + // ASTVerifier.g:406:1: rewriteIndirectTemplateHead : ^( TEMPLATE ACTION ( rewriteTemplateArgs )? ) ; public final void rewriteIndirectTemplateHead() throws RecognitionException { try { - // ASTVerifier.g:406:2: ( ^( TEMPLATE ACTION ( rewriteTemplateArgs )? ) ) - // ASTVerifier.g:406:4: ^( TEMPLATE ACTION ( rewriteTemplateArgs )? ) + // ASTVerifier.g:407:2: ( ^( TEMPLATE ACTION ( rewriteTemplateArgs )? ) ) + // ASTVerifier.g:407:4: ^( TEMPLATE ACTION ( rewriteTemplateArgs )? ) { - match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteIndirectTemplateHead1872); + match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteIndirectTemplateHead1890); match(input, Token.DOWN, null); - match(input,ACTION,FOLLOW_ACTION_in_rewriteIndirectTemplateHead1874); - // ASTVerifier.g:406:22: ( rewriteTemplateArgs )? + match(input,ACTION,FOLLOW_ACTION_in_rewriteIndirectTemplateHead1892); + // ASTVerifier.g:407:22: ( rewriteTemplateArgs )? int alt57=2; int LA57_0 = input.LA(1); @@ -4140,9 +4147,9 @@ public class ASTVerifier extends TreeParser { } switch (alt57) { case 1 : - // ASTVerifier.g:406:22: rewriteTemplateArgs + // ASTVerifier.g:407:22: rewriteTemplateArgs { - pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead1876); + pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead1894); rewriteTemplateArgs(); state._fsp--; @@ -4171,16 +4178,16 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTemplateArgs" - // ASTVerifier.g:409:1: rewriteTemplateArgs : ^( ARGLIST ( rewriteTemplateArg )+ ) ; + // ASTVerifier.g:410:1: rewriteTemplateArgs : ^( ARGLIST ( rewriteTemplateArg )+ ) ; public final void rewriteTemplateArgs() throws RecognitionException { try { - // ASTVerifier.g:410:2: ( ^( ARGLIST ( rewriteTemplateArg )+ ) ) - // ASTVerifier.g:410:4: ^( ARGLIST ( rewriteTemplateArg )+ ) + // ASTVerifier.g:411:2: ( ^( ARGLIST ( rewriteTemplateArg )+ ) ) + // ASTVerifier.g:411:4: ^( ARGLIST ( rewriteTemplateArg )+ ) { - match(input,ARGLIST,FOLLOW_ARGLIST_in_rewriteTemplateArgs1890); + match(input,ARGLIST,FOLLOW_ARGLIST_in_rewriteTemplateArgs1908); match(input, Token.DOWN, null); - // ASTVerifier.g:410:14: ( rewriteTemplateArg )+ + // ASTVerifier.g:411:14: ( rewriteTemplateArg )+ int cnt58=0; loop58: do { @@ -4194,9 +4201,9 @@ public class ASTVerifier extends TreeParser { switch (alt58) { case 1 : - // ASTVerifier.g:410:14: rewriteTemplateArg + // ASTVerifier.g:411:14: rewriteTemplateArg { - pushFollow(FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs1892); + pushFollow(FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs1910); rewriteTemplateArg(); state._fsp--; @@ -4232,17 +4239,17 @@ public class ASTVerifier extends TreeParser { // $ANTLR start "rewriteTemplateArg" - // ASTVerifier.g:413:1: rewriteTemplateArg : ^( ARG ID ACTION ) ; + // ASTVerifier.g:414:1: rewriteTemplateArg : ^( ARG ID ACTION ) ; public final void rewriteTemplateArg() throws RecognitionException { try { - // ASTVerifier.g:414:2: ( ^( ARG ID ACTION ) ) - // ASTVerifier.g:414:6: ^( ARG ID ACTION ) + // ASTVerifier.g:415:2: ( ^( ARG ID ACTION ) ) + // ASTVerifier.g:415:6: ^( ARG ID ACTION ) { - match(input,ARG,FOLLOW_ARG_in_rewriteTemplateArg1908); + match(input,ARG,FOLLOW_ARG_in_rewriteTemplateArg1926); match(input, Token.DOWN, null); - match(input,ID,FOLLOW_ID_in_rewriteTemplateArg1910); - match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplateArg1912); + match(input,ID,FOLLOW_ID_in_rewriteTemplateArg1928); + match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplateArg1930); match(input, Token.UP, null); @@ -4327,7 +4334,7 @@ public class ASTVerifier extends TreeParser { this.transition = DFA26_transition; } public String getDescription() { - return "243:1: element : ( labeledElement | atom | ebnf | ACTION | SEMPRED | GATED_SEMPRED | treeSpec );"; + return "244:1: element : ( labeledElement | atom | ebnf | ACTION | SEMPRED | GATED_SEMPRED | treeSpec );"; } } static final String DFA33_eotS = @@ -4405,7 +4412,7 @@ public class ASTVerifier extends TreeParser { this.transition = DFA33_transition; } public String getDescription() { - return "279:1: atom : ( ^( ROOT range ) | ^( BANG range ) | ^( ROOT notSet ) | ^( BANG notSet ) | range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | terminal | ruleref );"; + return "280:1: atom : ( ^( ROOT range ) | ^( BANG range ) | ^( ROOT notSet ) | ^( BANG notSet ) | range | ^( DOT ID terminal ) | ^( DOT ID ruleref ) | terminal | ruleref );"; } } static final String DFA42_eotS = @@ -4481,7 +4488,7 @@ public class ASTVerifier extends TreeParser { this.transition = DFA42_transition; } public String getDescription() { - return "322:1: terminal : ( ^( CHAR_LITERAL elementOptions ) | CHAR_LITERAL | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( ROOT terminal ) | ^( BANG terminal ) );"; + return "323:1: terminal : ( ^( CHAR_LITERAL elementOptions ) | CHAR_LITERAL | ^( STRING_LITERAL elementOptions ) | STRING_LITERAL | ^( TOKEN_REF elementOptions ) | TOKEN_REF | ^( WILDCARD elementOptions ) | WILDCARD | ^( ROOT terminal ) | ^( BANG terminal ) );"; } } static final String DFA55_eotS = @@ -4547,7 +4554,7 @@ public class ASTVerifier extends TreeParser { this.transition = DFA55_transition; } public String getDescription() { - return "393:1: rewriteTemplate : ( ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) | ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) | rewriteTemplateRef | rewriteIndirectTemplateHead | ACTION );"; + return "394:1: rewriteTemplate : ( ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_QUOTE_STRING_LITERAL ) | ^( TEMPLATE ( rewriteTemplateArgs )? DOUBLE_ANGLE_STRING_LITERAL ) | rewriteTemplateRef | rewriteIndirectTemplateHead | ACTION );"; } } @@ -4569,219 +4576,219 @@ public class ASTVerifier extends TreeParser { public static final BitSet FOLLOW_ID_in_option212 = new BitSet(new long[]{0x0001000000000000L,0x0000000000800015L}); public static final BitSet FOLLOW_optionValue_in_option214 = new BitSet(new long[]{0x0000000000000008L}); public static final BitSet FOLLOW_set_in_optionValue0 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_IMPORT_in_delegateGrammars291 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_delegateGrammar_in_delegateGrammars293 = new BitSet(new long[]{0x0000200000000008L,0x0000000000800000L}); - public static final BitSet FOLLOW_ASSIGN_in_delegateGrammar312 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_delegateGrammar314 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L}); - public static final BitSet FOLLOW_ID_in_delegateGrammar316 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ID_in_delegateGrammar327 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_TOKENS_in_tokensSpec344 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_tokenSpec_in_tokensSpec346 = new BitSet(new long[]{0xC000200000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_tokenSpec360 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec362 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_tokenSpec364 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_tokenSpec376 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec378 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000010L}); - public static final BitSet FOLLOW_CHAR_LITERAL_in_tokenSpec380 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec388 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_REF_in_tokenSpec393 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_SCOPE_in_attrScope405 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_attrScope407 = new BitSet(new long[]{0x0000000000010000L}); - public static final BitSet FOLLOW_ACTION_in_attrScope409 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_AT_in_action422 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_action424 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L}); - public static final BitSet FOLLOW_ID_in_action427 = new BitSet(new long[]{0x0000000000010000L}); - public static final BitSet FOLLOW_ACTION_in_action429 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RULES_in_rules445 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rule_in_rules447 = new BitSet(new long[]{0x0000000000000008L,0x0000000000000200L}); - public static final BitSet FOLLOW_RULE_in_rule465 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_rule467 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); - public static final BitSet FOLLOW_DOC_COMMENT_in_rule469 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); - public static final BitSet FOLLOW_ruleModifiers_in_rule472 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); - public static final BitSet FOLLOW_ARG_ACTION_in_rule475 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); - public static final BitSet FOLLOW_ruleReturns_in_rule488 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); - public static final BitSet FOLLOW_rulePrequel_in_rule491 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); - public static final BitSet FOLLOW_altListAsBlock_in_rule494 = new BitSet(new long[]{0x0000000600000008L}); - public static final BitSet FOLLOW_exceptionGroup_in_rule496 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_exceptionHandler_in_exceptionGroup523 = new BitSet(new long[]{0x0000000600000002L}); - public static final BitSet FOLLOW_finallyClause_in_exceptionGroup526 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_CATCH_in_exceptionHandler542 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ARG_ACTION_in_exceptionHandler544 = new BitSet(new long[]{0x0000000000010000L}); - public static final BitSet FOLLOW_ACTION_in_exceptionHandler546 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_FINALLY_in_finallyClause559 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ACTION_in_finallyClause561 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_throwsSpec_in_rulePrequel578 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleScopeSpec_in_rulePrequel588 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_optionsSpec_in_rulePrequel598 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleAction_in_rulePrequel608 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RETURNS_in_ruleReturns623 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ARG_ACTION_in_ruleReturns625 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_THROWS_in_throwsSpec640 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_throwsSpec642 = new BitSet(new long[]{0x0000000000000008L,0x0000000000800000L}); - public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec659 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ACTION_in_ruleScopeSpec661 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec668 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_ruleScopeSpec670 = new BitSet(new long[]{0x0000000000000008L,0x0000000000800000L}); - public static final BitSet FOLLOW_AT_in_ruleAction684 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_ruleAction686 = new BitSet(new long[]{0x0000000000010000L}); - public static final BitSet FOLLOW_ACTION_in_ruleAction688 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RULEMODIFIERS_in_ruleModifiers704 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ruleModifier_in_ruleModifiers706 = new BitSet(new long[]{0x0000000070800008L}); + public static final BitSet FOLLOW_IMPORT_in_delegateGrammars309 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_delegateGrammar_in_delegateGrammars311 = new BitSet(new long[]{0x0000200000000008L,0x0000000000800000L}); + public static final BitSet FOLLOW_ASSIGN_in_delegateGrammar330 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_delegateGrammar332 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L}); + public static final BitSet FOLLOW_ID_in_delegateGrammar334 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ID_in_delegateGrammar345 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_TOKENS_in_tokensSpec362 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_tokenSpec_in_tokensSpec364 = new BitSet(new long[]{0xC000200000000008L}); + public static final BitSet FOLLOW_ASSIGN_in_tokenSpec378 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec380 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L}); + public static final BitSet FOLLOW_STRING_LITERAL_in_tokenSpec382 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ASSIGN_in_tokenSpec394 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec396 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000010L}); + public static final BitSet FOLLOW_CHAR_LITERAL_in_tokenSpec398 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_TOKEN_REF_in_tokenSpec406 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_RULE_REF_in_tokenSpec411 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_SCOPE_in_attrScope423 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_attrScope425 = new BitSet(new long[]{0x0000000000010000L}); + public static final BitSet FOLLOW_ACTION_in_attrScope427 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_AT_in_action440 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_action442 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L}); + public static final BitSet FOLLOW_ID_in_action445 = new BitSet(new long[]{0x0000000000010000L}); + public static final BitSet FOLLOW_ACTION_in_action447 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_RULES_in_rules463 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rule_in_rules465 = new BitSet(new long[]{0x0000000000000008L,0x0000000000000200L}); + public static final BitSet FOLLOW_RULE_in_rule483 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_rule485 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); + public static final BitSet FOLLOW_DOC_COMMENT_in_rule487 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); + public static final BitSet FOLLOW_ruleModifiers_in_rule490 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); + public static final BitSet FOLLOW_ARG_ACTION_in_rule493 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); + public static final BitSet FOLLOW_ruleReturns_in_rule506 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); + public static final BitSet FOLLOW_rulePrequel_in_rule509 = new BitSet(new long[]{0x0800000180284040L,0x0000000000002800L}); + public static final BitSet FOLLOW_altListAsBlock_in_rule512 = new BitSet(new long[]{0x0000000600000008L}); + public static final BitSet FOLLOW_exceptionGroup_in_rule514 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_exceptionHandler_in_exceptionGroup541 = new BitSet(new long[]{0x0000000600000002L}); + public static final BitSet FOLLOW_finallyClause_in_exceptionGroup544 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_CATCH_in_exceptionHandler560 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ARG_ACTION_in_exceptionHandler562 = new BitSet(new long[]{0x0000000000010000L}); + public static final BitSet FOLLOW_ACTION_in_exceptionHandler564 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_FINALLY_in_finallyClause577 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ACTION_in_finallyClause579 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_throwsSpec_in_rulePrequel596 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ruleScopeSpec_in_rulePrequel606 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_optionsSpec_in_rulePrequel616 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ruleAction_in_rulePrequel626 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_RETURNS_in_ruleReturns641 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ARG_ACTION_in_ruleReturns643 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_THROWS_in_throwsSpec658 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_throwsSpec660 = new BitSet(new long[]{0x0000000000000008L,0x0000000000800000L}); + public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec677 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ACTION_in_ruleScopeSpec679 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec686 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_ruleScopeSpec688 = new BitSet(new long[]{0x0000000000000008L,0x0000000000800000L}); + public static final BitSet FOLLOW_AT_in_ruleAction702 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_ruleAction704 = new BitSet(new long[]{0x0000000000010000L}); + public static final BitSet FOLLOW_ACTION_in_ruleAction706 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_RULEMODIFIERS_in_ruleModifiers722 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ruleModifier_in_ruleModifiers724 = new BitSet(new long[]{0x0000000070800008L}); public static final BitSet FOLLOW_set_in_ruleModifier0 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_alternative_in_altList766 = new BitSet(new long[]{0x0000000000000002L,0x0000010000100000L}); - public static final BitSet FOLLOW_BLOCK_in_altListAsBlock785 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_altList_in_altListAsBlock787 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ALT_REWRITE_in_alternative806 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_alternative_in_alternative808 = new BitSet(new long[]{0x0000000000000000L,0x0000008000400000L}); - public static final BitSet FOLLOW_rewrite_in_alternative810 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ALT_in_alternative820 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_EPSILON_in_alternative822 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_elements_in_alternative833 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ALT_in_elements851 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_element_in_elements853 = new BitSet(new long[]{0xC4D4A40000010018L,0x000000120001E014L}); - public static final BitSet FOLLOW_labeledElement_in_element869 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_atom_in_element874 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ebnf_in_element879 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ACTION_in_element886 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_SEMPRED_in_element893 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_GATED_SEMPRED_in_element898 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_treeSpec_in_element903 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ASSIGN_in_labeledElement916 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_labeledElement918 = new BitSet(new long[]{0xC0D0840000000000L,0x000000100001E014L}); - public static final BitSet FOLLOW_atom_in_labeledElement921 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_block_in_labeledElement923 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_PLUS_ASSIGN_in_labeledElement931 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_labeledElement933 = new BitSet(new long[]{0xC0D0840000000000L,0x000000100001E014L}); - public static final BitSet FOLLOW_atom_in_labeledElement936 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_block_in_labeledElement938 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TREE_BEGIN_in_treeSpec955 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_element_in_treeSpec957 = new BitSet(new long[]{0xC4D4A40000010018L,0x000000120001E014L}); - public static final BitSet FOLLOW_blockSuffix_in_ebnf972 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_block_in_ebnf974 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_block_in_ebnf981 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ebnfSuffix_in_blockSuffix998 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ROOT_in_blockSuffix1006 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_IMPLIES_in_blockSuffix1014 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_BANG_in_blockSuffix1022 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_alternative_in_altList784 = new BitSet(new long[]{0x0000000000000002L,0x0000010000100000L}); + public static final BitSet FOLLOW_BLOCK_in_altListAsBlock803 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_altList_in_altListAsBlock805 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ALT_REWRITE_in_alternative824 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_alternative_in_alternative826 = new BitSet(new long[]{0x0000000000000000L,0x0000008000400000L}); + public static final BitSet FOLLOW_rewrite_in_alternative828 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ALT_in_alternative838 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_EPSILON_in_alternative840 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_elements_in_alternative851 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ALT_in_elements869 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_element_in_elements871 = new BitSet(new long[]{0xC4D4A40000010018L,0x000000120001E014L}); + public static final BitSet FOLLOW_labeledElement_in_element887 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_atom_in_element892 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ebnf_in_element897 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ACTION_in_element904 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_SEMPRED_in_element911 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_GATED_SEMPRED_in_element916 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_treeSpec_in_element921 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ASSIGN_in_labeledElement934 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_labeledElement936 = new BitSet(new long[]{0xC0D0840000000000L,0x000000100001E014L}); + public static final BitSet FOLLOW_atom_in_labeledElement939 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_block_in_labeledElement941 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_PLUS_ASSIGN_in_labeledElement949 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_labeledElement951 = new BitSet(new long[]{0xC0D0840000000000L,0x000000100001E014L}); + public static final BitSet FOLLOW_atom_in_labeledElement954 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_block_in_labeledElement956 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_TREE_BEGIN_in_treeSpec973 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_element_in_treeSpec975 = new BitSet(new long[]{0xC4D4A40000010018L,0x000000120001E014L}); + public static final BitSet FOLLOW_blockSuffix_in_ebnf990 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_block_in_ebnf992 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_block_in_ebnf999 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ebnfSuffix_in_blockSuffix1016 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ROOT_in_blockSuffix1024 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_IMPLIES_in_blockSuffix1032 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_BANG_in_blockSuffix1040 = new BitSet(new long[]{0x0000000000000002L}); public static final BitSet FOLLOW_set_in_ebnfSuffix0 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ROOT_in_atom1062 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_range_in_atom1064 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_BANG_in_atom1071 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_range_in_atom1073 = new BitSet(new long[]{0x0000000000000008L}); public static final BitSet FOLLOW_ROOT_in_atom1080 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_notSet_in_atom1082 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_range_in_atom1082 = new BitSet(new long[]{0x0000000000000008L}); public static final BitSet FOLLOW_BANG_in_atom1089 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_notSet_in_atom1091 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_range_in_atom1097 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_DOT_in_atom1103 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_atom1105 = new BitSet(new long[]{0x4050800000000000L,0x0000000000000014L}); - public static final BitSet FOLLOW_terminal_in_atom1107 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_DOT_in_atom1114 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_atom1116 = new BitSet(new long[]{0xC0D0800000000000L,0x0000001000000014L}); - public static final BitSet FOLLOW_ruleref_in_atom1118 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_terminal_in_atom1129 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleref_in_atom1139 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_NOT_in_notSet1157 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_notTerminal_in_notSet1159 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_NOT_in_notSet1169 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_block_in_notSet1171 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_range_in_atom1091 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ROOT_in_atom1098 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_notSet_in_atom1100 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_BANG_in_atom1107 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_notSet_in_atom1109 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_range_in_atom1115 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_DOT_in_atom1121 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_atom1123 = new BitSet(new long[]{0x4050800000000000L,0x0000000000000014L}); + public static final BitSet FOLLOW_terminal_in_atom1125 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_DOT_in_atom1132 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_atom1134 = new BitSet(new long[]{0xC0D0800000000000L,0x0000001000000014L}); + public static final BitSet FOLLOW_ruleref_in_atom1136 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_terminal_in_atom1147 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ruleref_in_atom1157 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_NOT_in_notSet1175 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_notTerminal_in_notSet1177 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_NOT_in_notSet1187 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_block_in_notSet1189 = new BitSet(new long[]{0x0000000000000008L}); public static final BitSet FOLLOW_set_in_notTerminal0 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_BLOCK_in_block1223 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_optionsSpec_in_block1225 = new BitSet(new long[]{0x0800000100290000L,0x0000010000100000L}); - public static final BitSet FOLLOW_ruleAction_in_block1228 = new BitSet(new long[]{0x0800000100290000L,0x0000010000100000L}); - public static final BitSet FOLLOW_ACTION_in_block1231 = new BitSet(new long[]{0x0800000100290000L,0x0000010000100000L}); - public static final BitSet FOLLOW_altList_in_block1234 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ROOT_in_ruleref1253 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_RULE_REF_in_ruleref1255 = new BitSet(new long[]{0x0000000000004008L}); - public static final BitSet FOLLOW_ARG_ACTION_in_ruleref1257 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_BANG_in_ruleref1268 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_RULE_REF_in_ruleref1270 = new BitSet(new long[]{0x0000000000004008L}); - public static final BitSet FOLLOW_ARG_ACTION_in_ruleref1272 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RULE_REF_in_ruleref1283 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ARG_ACTION_in_ruleref1285 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RANGE_in_range1305 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rangeElement_in_range1307 = new BitSet(new long[]{0xC000000000000000L,0x0000000000000014L}); - public static final BitSet FOLLOW_rangeElement_in_range1309 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_BLOCK_in_block1241 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_optionsSpec_in_block1243 = new BitSet(new long[]{0x0800000100290000L,0x0000010000100000L}); + public static final BitSet FOLLOW_ruleAction_in_block1246 = new BitSet(new long[]{0x0800000100290000L,0x0000010000100000L}); + public static final BitSet FOLLOW_ACTION_in_block1249 = new BitSet(new long[]{0x0800000100290000L,0x0000010000100000L}); + public static final BitSet FOLLOW_altList_in_block1252 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ROOT_in_ruleref1271 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_RULE_REF_in_ruleref1273 = new BitSet(new long[]{0x0000000000004008L}); + public static final BitSet FOLLOW_ARG_ACTION_in_ruleref1275 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_BANG_in_ruleref1286 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_RULE_REF_in_ruleref1288 = new BitSet(new long[]{0x0000000000004008L}); + public static final BitSet FOLLOW_ARG_ACTION_in_ruleref1290 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_RULE_REF_in_ruleref1301 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ARG_ACTION_in_ruleref1303 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_RANGE_in_range1323 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rangeElement_in_range1325 = new BitSet(new long[]{0xC000000000000000L,0x0000000000000014L}); + public static final BitSet FOLLOW_rangeElement_in_range1327 = new BitSet(new long[]{0x0000000000000008L}); public static final BitSet FOLLOW_set_in_rangeElement0 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_CHAR_LITERAL_in_terminal1371 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_terminal1373 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_CHAR_LITERAL_in_terminal1384 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_terminal1393 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_terminal1395 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_terminal1404 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_TOKEN_REF_in_terminal1413 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_terminal1415 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TOKEN_REF_in_terminal1424 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_WILDCARD_in_terminal1433 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOptions_in_terminal1435 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_WILDCARD_in_terminal1444 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ROOT_in_terminal1453 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_terminal_in_terminal1455 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_BANG_in_terminal1465 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_terminal_in_terminal1467 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ELEMENT_OPTIONS_in_elementOptions1486 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_elementOption_in_elementOptions1488 = new BitSet(new long[]{0x0000200000000008L,0x0000000000800000L}); - public static final BitSet FOLLOW_ID_in_elementOption1507 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption1518 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption1520 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L}); - public static final BitSet FOLLOW_ID_in_elementOption1522 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ASSIGN_in_elementOption1534 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_elementOption1536 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_elementOption1538 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_predicatedRewrite_in_rewrite1553 = new BitSet(new long[]{0x0000000000000000L,0x0000008000400000L}); - public static final BitSet FOLLOW_nakedRewrite_in_rewrite1556 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ST_RESULT_in_predicatedRewrite1568 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_SEMPRED_in_predicatedRewrite1570 = new BitSet(new long[]{0x0100000800010000L,0x0000000000180000L}); - public static final BitSet FOLLOW_rewriteAlt_in_predicatedRewrite1572 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RESULT_in_predicatedRewrite1579 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_SEMPRED_in_predicatedRewrite1581 = new BitSet(new long[]{0x0100000800010000L,0x0000000000180000L}); - public static final BitSet FOLLOW_rewriteAlt_in_predicatedRewrite1583 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ST_RESULT_in_nakedRewrite1597 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteAlt_in_nakedRewrite1599 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_RESULT_in_nakedRewrite1606 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteAlt_in_nakedRewrite1608 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_rewriteTemplate_in_rewriteAlt1624 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rewriteTreeAlt_in_rewriteAlt1632 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ETC_in_rewriteAlt1640 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_EPSILON_in_rewriteAlt1648 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ALT_in_rewriteTreeAlt1667 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTreeAlt1669 = new BitSet(new long[]{0xC400000000010008L,0x000000010001C014L}); - public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTreeElement1685 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rewriteTree_in_rewriteTreeElement1690 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement1697 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_CHAR_LITERAL_in_rewriteTreeAtom1713 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_TOKEN_REF_in_rewriteTreeAtom1721 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ARG_ACTION_in_rewriteTreeAtom1723 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TOKEN_REF_in_rewriteTreeAtom1731 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_REF_in_rewriteTreeAtom1741 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_STRING_LITERAL_in_rewriteTreeAtom1748 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_LABEL_in_rewriteTreeAtom1755 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ACTION_in_rewriteTreeAtom1760 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeEbnf1772 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_BLOCK_in_rewriteTreeEbnf1775 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf1777 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TREE_BEGIN_in_rewriteTree1790 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTree1792 = new BitSet(new long[]{0xC400000000010008L,0x000000010001C014L}); - public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTree1794 = new BitSet(new long[]{0xC400000000010008L,0x000000010001C014L}); - public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplate1809 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1811 = new BitSet(new long[]{0x0000000000000400L}); - public static final BitSet FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate1814 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplate1821 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1823 = new BitSet(new long[]{0x0000000000000800L}); - public static final BitSet FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate1826 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_rewriteTemplateRef_in_rewriteTemplate1832 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate1837 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ACTION_in_rewriteTemplate1842 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplateRef1854 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_rewriteTemplateRef1856 = new BitSet(new long[]{0x0000000000000008L,0x0000000002000000L}); - public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef1858 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_TEMPLATE_in_rewriteIndirectTemplateHead1872 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ACTION_in_rewriteIndirectTemplateHead1874 = new BitSet(new long[]{0x0000000000000008L,0x0000000002000000L}); - public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead1876 = new BitSet(new long[]{0x0000000000000008L}); - public static final BitSet FOLLOW_ARGLIST_in_rewriteTemplateArgs1890 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs1892 = new BitSet(new long[]{0x0000000000000008L,0x0000000001000000L}); - public static final BitSet FOLLOW_ARG_in_rewriteTemplateArg1908 = new BitSet(new long[]{0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_rewriteTemplateArg1910 = new BitSet(new long[]{0x0000000000010000L}); - public static final BitSet FOLLOW_ACTION_in_rewriteTemplateArg1912 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_CHAR_LITERAL_in_terminal1389 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_elementOptions_in_terminal1391 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_CHAR_LITERAL_in_terminal1402 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_STRING_LITERAL_in_terminal1411 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_elementOptions_in_terminal1413 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_STRING_LITERAL_in_terminal1422 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_TOKEN_REF_in_terminal1431 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_elementOptions_in_terminal1433 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_TOKEN_REF_in_terminal1442 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_WILDCARD_in_terminal1451 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_elementOptions_in_terminal1453 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_WILDCARD_in_terminal1462 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ROOT_in_terminal1471 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_terminal_in_terminal1473 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_BANG_in_terminal1483 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_terminal_in_terminal1485 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ELEMENT_OPTIONS_in_elementOptions1504 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_elementOption_in_elementOptions1506 = new BitSet(new long[]{0x0000200000000008L,0x0000000000800000L}); + public static final BitSet FOLLOW_ID_in_elementOption1525 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ASSIGN_in_elementOption1536 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_elementOption1538 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L}); + public static final BitSet FOLLOW_ID_in_elementOption1540 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ASSIGN_in_elementOption1552 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_elementOption1554 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L}); + public static final BitSet FOLLOW_STRING_LITERAL_in_elementOption1556 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_predicatedRewrite_in_rewrite1571 = new BitSet(new long[]{0x0000000000000000L,0x0000008000400000L}); + public static final BitSet FOLLOW_nakedRewrite_in_rewrite1574 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ST_RESULT_in_predicatedRewrite1586 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_SEMPRED_in_predicatedRewrite1588 = new BitSet(new long[]{0x0100000800010000L,0x0000000000180000L}); + public static final BitSet FOLLOW_rewriteAlt_in_predicatedRewrite1590 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_RESULT_in_predicatedRewrite1597 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_SEMPRED_in_predicatedRewrite1599 = new BitSet(new long[]{0x0100000800010000L,0x0000000000180000L}); + public static final BitSet FOLLOW_rewriteAlt_in_predicatedRewrite1601 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ST_RESULT_in_nakedRewrite1615 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteAlt_in_nakedRewrite1617 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_RESULT_in_nakedRewrite1624 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteAlt_in_nakedRewrite1626 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_rewriteTemplate_in_rewriteAlt1642 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_rewriteTreeAlt_in_rewriteAlt1650 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ETC_in_rewriteAlt1658 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_EPSILON_in_rewriteAlt1666 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ALT_in_rewriteTreeAlt1685 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTreeAlt1687 = new BitSet(new long[]{0xC400000000010008L,0x000000010001C014L}); + public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTreeElement1703 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_rewriteTree_in_rewriteTreeElement1708 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement1715 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_CHAR_LITERAL_in_rewriteTreeAtom1731 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_TOKEN_REF_in_rewriteTreeAtom1739 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ARG_ACTION_in_rewriteTreeAtom1741 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_TOKEN_REF_in_rewriteTreeAtom1749 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_RULE_REF_in_rewriteTreeAtom1759 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_STRING_LITERAL_in_rewriteTreeAtom1766 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_LABEL_in_rewriteTreeAtom1773 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ACTION_in_rewriteTreeAtom1778 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeEbnf1790 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_BLOCK_in_rewriteTreeEbnf1793 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf1795 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_TREE_BEGIN_in_rewriteTree1808 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTree1810 = new BitSet(new long[]{0xC400000000010008L,0x000000010001C014L}); + public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTree1812 = new BitSet(new long[]{0xC400000000010008L,0x000000010001C014L}); + public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplate1827 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1829 = new BitSet(new long[]{0x0000000000000400L}); + public static final BitSet FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate1832 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplate1839 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplate1841 = new BitSet(new long[]{0x0000000000000800L}); + public static final BitSet FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate1844 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_rewriteTemplateRef_in_rewriteTemplate1850 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate1855 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ACTION_in_rewriteTemplate1860 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplateRef1872 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_rewriteTemplateRef1874 = new BitSet(new long[]{0x0000000000000008L,0x0000000002000000L}); + public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef1876 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_TEMPLATE_in_rewriteIndirectTemplateHead1890 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ACTION_in_rewriteIndirectTemplateHead1892 = new BitSet(new long[]{0x0000000000000008L,0x0000000002000000L}); + public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead1894 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_ARGLIST_in_rewriteTemplateArgs1908 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs1910 = new BitSet(new long[]{0x0000000000000008L,0x0000000001000000L}); + public static final BitSet FOLLOW_ARG_in_rewriteTemplateArg1926 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_rewriteTemplateArg1928 = new BitSet(new long[]{0x0000000000010000L}); + public static final BitSet FOLLOW_ACTION_in_rewriteTemplateArg1930 = new BitSet(new long[]{0x0000000000000008L}); } \ No newline at end of file diff --git a/tool/src/org/antlr/v4/semantics/BasicSemanticsChecker.g b/tool/src/org/antlr/v4/semantics/BasicSemanticsChecker.g index e1a2c40c3..6ee81f74b 100644 --- a/tool/src/org/antlr/v4/semantics/BasicSemanticsChecker.g +++ b/tool/src/org/antlr/v4/semantics/BasicSemanticsChecker.g @@ -103,30 +103,38 @@ import org.antlr.v4.tool.*; } @members { -Grammar g; // which grammar are we checking -public BasicSemanticsChecker(TreeNodeStream input, Grammar g) { +public String name; +public String fileName; +public Map options = new HashMap(); +protected int gtype; +//Grammar g; // which grammar are we checking +public BasicSemanticsChecker(TreeNodeStream input, String fileName) { this(input); - this.g = g; + this.fileName = fileName; } } topdown : grammarSpec | optionsSpec - | tokensSpec + | rule + | ruleref +// | tokensSpec ; grammarSpec : ^(grammarType ID .*) { - if ( !g.fileName.equals($ID.text) ) { + name = $ID.text; + if ( !fileName.equals(name+".g") ) { ErrorManager.grammarError(ErrorType.FILE_AND_GRAMMAR_NAME_DIFFER, - g, $ID.token, $ID.text, g.fileName); + fileName, $ID.token, name, fileName); } } ; grammarType +@init {gtype = $start.getType();} : LEXER_GRAMMAR | PARSER_GRAMMAR | TREE_GRAMMAR | COMBINED_GRAMMAR ; @@ -135,10 +143,11 @@ optionsSpec ; option - : ^(ASSIGN ID optionValue) + : ^('=' o=ID optionValue) {options.put($o.text, $optionValue.v);} ; -optionValue +optionValue returns [String v] +@init {$v = $start.token.getText();} : ID | STRING_LITERAL | CHAR_LITERAL @@ -146,6 +155,33 @@ optionValue | STAR ; +rule: ^( RULE r=ID .*) + { + if ( gtype==LEXER_GRAMMAR && Character.isLowerCase($r.text.charAt(0)) ) { + ErrorManager.grammarError(ErrorType.PARSER_RULES_NOT_ALLOWED, + fileName, $r.token, $r.text); + } + if ( (gtype==PARSER_GRAMMAR||gtype==PARSER_GRAMMAR) && + Character.isUpperCase($r.text.charAt(0)) ) + { + ErrorManager.grammarError(ErrorType.LEXER_RULES_NOT_ALLOWED, + fileName, $r.token, $r.text); + } + } + ; + +ruleref + : {gtype==LEXER_GRAMMAR}? + ( ^((ROOT|BANG) r=RULE_REF ARG_ACTION?) + | ^(r=RULE_REF ARG_ACTION?) + ) + { + ErrorManager.grammarError(ErrorType.PARSER_RULES_NOT_ALLOWED, + fileName, $r.token, $r.text); + } + ; + +/* tokensSpec : ^(TOKENS tokenSpec+) ; @@ -157,5 +193,4 @@ tokenSpec | RULE_REF ; -rule: ^( RULE ID .*) - ; +*/ \ No newline at end of file diff --git a/tool/src/org/antlr/v4/semantics/BasicSemanticsChecker.java b/tool/src/org/antlr/v4/semantics/BasicSemanticsChecker.java new file mode 100644 index 000000000..75d042b21 --- /dev/null +++ b/tool/src/org/antlr/v4/semantics/BasicSemanticsChecker.java @@ -0,0 +1,785 @@ +// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 BasicSemanticsChecker.g 2010-01-31 13:57:42 + +/* + [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; +/** Check the basic semantics of the input. We check for: + FILE_AND_GRAMMAR_NAME_DIFFER + RULE_REDEFINITION(MessageSeverity.ERROR, true, true), + LEXER_RULES_NOT_ALLOWED(MessageSeverity.ERROR, true, true), + PARSER_RULES_NOT_ALLOWED(MessageSeverity.ERROR, true, true), + UNDEFINED_RULE_REF(MessageSeverity.ERROR, true, true), + CANNOT_ALIAS_TOKENS_IN_LEXER(MessageSeverity.ERROR, true, true), + INVALID_RULE_PARAMETER_REF(MessageSeverity.ERROR, true, true), + SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE(MessageSeverity.ERROR, true, true), + LABEL_CONFLICTS_WITH_RULE(MessageSeverity.ERROR, true, true), + LABEL_CONFLICTS_WITH_TOKEN(MessageSeverity.ERROR, true, true), + LABEL_TYPE_CONFLICT(MessageSeverity.ERROR, true, true), + MISSING_RULE_ARGS(MessageSeverity.ERROR, true, true), + RULE_HAS_NO_ARGS(MessageSeverity.ERROR, true, true), + ARGS_ON_TOKEN_REF(MessageSeverity.ERROR, true, true), + ILLEGAL_OPTION(MessageSeverity.ERROR, true, true), + UNDEFINED_TOKEN_REF_IN_REWRITE(MessageSeverity.ERROR, true, true), + REWRITE_ELEMENT_NOT_PRESENT_ON_LHS(MessageSeverity.ERROR, true, true), + UNDEFINED_LABEL_REF_IN_REWRITE(MessageSeverity.ERROR, true, true), + EMPTY_COMPLEMENT(MessageSeverity.ERROR, true, true), + ACTION_REDEFINITION(MessageSeverity.ERROR, true, true), + REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION(MessageSeverity.ERROR, true, true), + NO_RULES(MessageSeverity.ERROR, true, true), + REWRITE_FOR_MULTI_ELEMENT_ALT(MessageSeverity.ERROR, true, true), + RULE_INVALID_SET(MessageSeverity.ERROR, true, true), + HETERO_ILLEGAL_IN_REWRITE_ALT(MessageSeverity.ERROR, true, true), + NO_SUCH_RULE_IN_SCOPE(MessageSeverity.ERROR, true, true), + TOKEN_ALIAS_CONFLICT(MessageSeverity.ERROR, true, true), + TOKEN_ALIAS_REASSIGNMENT(MessageSeverity.ERROR, true, true), + TOKEN_VOCAB_IN_DELEGATE(MessageSeverity.ERROR, true, true), + INVALID_IMPORT(MessageSeverity.ERROR, true, true), + IMPORTED_TOKENS_RULE_EMPTY(MessageSeverity.ERROR, true, true), + IMPORT_NAME_CLASH(MessageSeverity.ERROR, true, true), + AST_OP_WITH_NON_AST_OUTPUT_OPTION(MessageSeverity.ERROR, true, true), + AST_OP_IN_ALT_WITH_REWRITE(MessageSeverity.ERROR, true, true), + WILDCARD_AS_ROOT(MessageSeverity.ERROR, true, true), + CONFLICTING_OPTION_IN_TREE_FILTER(MessageSeverity.ERROR, true, true), + * + */ +public class BasicSemanticsChecker extends TreeFilter { + public static final String[] tokenNames = new String[] { + "", "", "", "", "SEMPRED", "FORCED_ACTION", "DOC_COMMENT", "SRC", "NLCHARS", "COMMENT", "DOUBLE_QUOTE_STRING_LITERAL", "DOUBLE_ANGLE_STRING_LITERAL", "ACTION_STRING_LITERAL", "ACTION_CHAR_LITERAL", "ARG_ACTION", "NESTED_ACTION", "ACTION", "ACTION_ESC", "WSNLCHARS", "OPTIONS", "TOKENS", "SCOPE", "IMPORT", "FRAGMENT", "LEXER", "PARSER", "TREE", "GRAMMAR", "PROTECTED", "PUBLIC", "PRIVATE", "RETURNS", "THROWS", "CATCH", "FINALLY", "TEMPLATE", "COLON", "COLONCOLON", "COMMA", "SEMI", "LPAREN", "RPAREN", "IMPLIES", "LT", "GT", "ASSIGN", "QUESTION", "BANG", "STAR", "PLUS", "PLUS_ASSIGN", "OR", "ROOT", "DOLLAR", "WILDCARD", "RANGE", "ETC", "RARROW", "TREE_BEGIN", "AT", "NOT", "RBRACE", "TOKEN_REF", "RULE_REF", "INT", "WSCHARS", "STRING_LITERAL", "ESC_SEQ", "CHAR_LITERAL", "HEX_DIGIT", "UNICODE_ESC", "WS", "ERRCHAR", "RULE", "RULES", "RULEMODIFIERS", "RULEACTIONS", "BLOCK", "OPTIONAL", "CLOSURE", "POSITIVE_CLOSURE", "SYNPRED", "CHAR_RANGE", "EPSILON", "ALT", "ALTLIST", "RESULT", "ID", "ARG", "ARGLIST", "RET", "LEXER_GRAMMAR", "PARSER_GRAMMAR", "TREE_GRAMMAR", "COMBINED_GRAMMAR", "INITACTION", "LABEL", "GATED_SEMPRED", "SYN_SEMPRED", "BACKTRACK_SEMPRED", "DOT", "LIST", "ELEMENT_OPTIONS", "ST_RESULT", "ALT_REWRITE", "'='" + }; + public static final int LT=43; + public static final int STAR=48; + public static final int BACKTRACK_SEMPRED=99; + public static final int DOUBLE_ANGLE_STRING_LITERAL=11; + public static final int FORCED_ACTION=5; + public static final int LEXER_GRAMMAR=91; + public static final int ARGLIST=89; + public static final int ALTLIST=85; + public static final int NOT=60; + public static final int EOF=-1; + public static final int SEMPRED=4; + public static final int ACTION=16; + public static final int TOKEN_REF=62; + public static final int RULEMODIFIERS=75; + public static final int ST_RESULT=103; + public static final int RPAREN=41; + public static final int RET=90; + public static final int IMPORT=22; + public static final int STRING_LITERAL=66; + public static final int ARG=88; + public static final int ARG_ACTION=14; + public static final int DOUBLE_QUOTE_STRING_LITERAL=10; + public static final int COMMENT=9; + public static final int ACTION_CHAR_LITERAL=13; + public static final int GRAMMAR=27; + public static final int RULEACTIONS=76; + public static final int WSCHARS=65; + public static final int INITACTION=95; + public static final int ALT_REWRITE=104; + public static final int IMPLIES=42; + public static final int RULE=73; + public static final int RBRACE=61; + public static final int ACTION_ESC=17; + public static final int PARSER_GRAMMAR=92; + public static final int PRIVATE=30; + public static final int SRC=7; + public static final int THROWS=32; + public static final int CHAR_RANGE=82; + public static final int INT=64; + public static final int EPSILON=83; + public static final int LIST=101; + public static final int COLONCOLON=37; + public static final int WSNLCHARS=18; + public static final int WS=71; + public static final int COMBINED_GRAMMAR=94; + public static final int LEXER=24; + public static final int OR=51; + public static final int GT=44; + public static final int TREE_GRAMMAR=93; + public static final int CATCH=33; + public static final int CLOSURE=79; + public static final int PARSER=25; + public static final int DOLLAR=53; + public static final int PROTECTED=28; + public static final int ELEMENT_OPTIONS=102; + public static final int NESTED_ACTION=15; + public static final int FRAGMENT=23; + public static final int ID=87; + public static final int TREE_BEGIN=58; + public static final int LPAREN=40; + public static final int AT=59; + public static final int ESC_SEQ=67; + public static final int ALT=84; + public static final int TREE=26; + public static final int SCOPE=21; + public static final int ETC=56; + public static final int COMMA=38; + public static final int WILDCARD=54; + public static final int T__105=105; + public static final int DOC_COMMENT=6; + public static final int PLUS=49; + public static final int DOT=100; + public static final int RETURNS=31; + public static final int RULES=74; + public static final int RARROW=57; + public static final int UNICODE_ESC=70; + public static final int HEX_DIGIT=69; + public static final int RANGE=55; + public static final int TOKENS=20; + public static final int GATED_SEMPRED=97; + public static final int RESULT=86; + public static final int BANG=47; + public static final int ACTION_STRING_LITERAL=12; + public static final int ROOT=52; + public static final int SEMI=39; + public static final int RULE_REF=63; + public static final int NLCHARS=8; + public static final int OPTIONAL=78; + public static final int SYNPRED=81; + public static final int COLON=36; + public static final int QUESTION=46; + public static final int FINALLY=34; + public static final int CHAR_LITERAL=68; + public static final int TEMPLATE=35; + public static final int LABEL=96; + public static final int SYN_SEMPRED=98; + public static final int ERRCHAR=72; + public static final int BLOCK=77; + public static final int ASSIGN=45; + public static final int PLUS_ASSIGN=50; + public static final int PUBLIC=29; + public static final int POSITIVE_CLOSURE=80; + public static final int OPTIONS=19; + + // delegates + // delegators + + + public BasicSemanticsChecker(TreeNodeStream input) { + this(input, new RecognizerSharedState()); + } + public BasicSemanticsChecker(TreeNodeStream input, RecognizerSharedState state) { + super(input, state); + + } + + + public String[] getTokenNames() { return BasicSemanticsChecker.tokenNames; } + public String getGrammarFileName() { return "BasicSemanticsChecker.g"; } + + + public String name; + public String fileName; + public Map options = new HashMap(); + protected int gtype; + //Grammar g; // which grammar are we checking + public BasicSemanticsChecker(TreeNodeStream input, String fileName) { + this(input); + this.fileName = fileName; + } + + + + // $ANTLR start "topdown" + // BasicSemanticsChecker.g:117:1: topdown : ( grammarSpec | optionsSpec | rule | ruleref ); + public final void topdown() throws RecognitionException { + try { + // BasicSemanticsChecker.g:118:2: ( grammarSpec | optionsSpec | rule | ruleref ) + int alt1=4; + switch ( input.LA(1) ) { + case LEXER_GRAMMAR: + case PARSER_GRAMMAR: + case TREE_GRAMMAR: + case COMBINED_GRAMMAR: + { + alt1=1; + } + break; + case OPTIONS: + { + alt1=2; + } + break; + case RULE: + { + alt1=3; + } + break; + case BANG: + case ROOT: + case RULE_REF: + { + alt1=4; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return ;} + NoViableAltException nvae = + new NoViableAltException("", 1, 0, input); + + throw nvae; + } + + switch (alt1) { + case 1 : + // BasicSemanticsChecker.g:118:4: grammarSpec + { + pushFollow(FOLLOW_grammarSpec_in_topdown83); + grammarSpec(); + + state._fsp--; + if (state.failed) return ; + + } + break; + case 2 : + // BasicSemanticsChecker.g:119:4: optionsSpec + { + pushFollow(FOLLOW_optionsSpec_in_topdown88); + optionsSpec(); + + state._fsp--; + if (state.failed) return ; + + } + break; + case 3 : + // BasicSemanticsChecker.g:120:4: rule + { + pushFollow(FOLLOW_rule_in_topdown93); + rule(); + + state._fsp--; + if (state.failed) return ; + + } + break; + case 4 : + // BasicSemanticsChecker.g:121:4: ruleref + { + pushFollow(FOLLOW_ruleref_in_topdown98); + ruleref(); + + state._fsp--; + if (state.failed) return ; + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return ; + } + // $ANTLR end "topdown" + + + // $ANTLR start "grammarSpec" + // BasicSemanticsChecker.g:125:1: grammarSpec : ^( grammarType ID ( . )* ) ; + public final void grammarSpec() throws RecognitionException { + GrammarAST ID1=null; + + try { + // BasicSemanticsChecker.g:126:5: ( ^( grammarType ID ( . )* ) ) + // BasicSemanticsChecker.g:126:9: ^( grammarType ID ( . )* ) + { + pushFollow(FOLLOW_grammarType_in_grammarSpec116); + grammarType(); + + state._fsp--; + if (state.failed) return ; + + match(input, Token.DOWN, null); if (state.failed) return ; + ID1=(GrammarAST)match(input,ID,FOLLOW_ID_in_grammarSpec118); if (state.failed) return ; + // BasicSemanticsChecker.g:126:26: ( . )* + loop2: + do { + int alt2=2; + int LA2_0 = input.LA(1); + + if ( ((LA2_0>=SEMPRED && LA2_0<=105)) ) { + alt2=1; + } + else if ( (LA2_0==UP) ) { + alt2=2; + } + + + switch (alt2) { + case 1 : + // BasicSemanticsChecker.g:126:26: . + { + matchAny(input); if (state.failed) return ; + + } + break; + + default : + break loop2; + } + } while (true); + + + match(input, Token.UP, null); if (state.failed) return ; + if ( state.backtracking==1 ) { + + name = (ID1!=null?ID1.getText():null); + if ( !fileName.equals(name+".g") ) { + ErrorManager.grammarError(ErrorType.FILE_AND_GRAMMAR_NAME_DIFFER, + fileName, ID1.token, name, fileName); + } + + } + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return ; + } + // $ANTLR end "grammarSpec" + + public static class grammarType_return extends TreeRuleReturnScope { + }; + + // $ANTLR start "grammarType" + // BasicSemanticsChecker.g:136:1: grammarType : ( LEXER_GRAMMAR | PARSER_GRAMMAR | TREE_GRAMMAR | COMBINED_GRAMMAR ); + public final BasicSemanticsChecker.grammarType_return grammarType() throws RecognitionException { + BasicSemanticsChecker.grammarType_return retval = new BasicSemanticsChecker.grammarType_return(); + retval.start = input.LT(1); + + gtype = ((GrammarAST)retval.start).getType(); + try { + // BasicSemanticsChecker.g:138:5: ( LEXER_GRAMMAR | PARSER_GRAMMAR | TREE_GRAMMAR | COMBINED_GRAMMAR ) + // BasicSemanticsChecker.g: + { + if ( (input.LA(1)>=LEXER_GRAMMAR && input.LA(1)<=COMBINED_GRAMMAR) ) { + 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 { + } + return retval; + } + // $ANTLR end "grammarType" + + + // $ANTLR start "optionsSpec" + // BasicSemanticsChecker.g:141:1: optionsSpec : ^( OPTIONS ( option )+ ) ; + public final void optionsSpec() throws RecognitionException { + try { + // BasicSemanticsChecker.g:142:2: ( ^( OPTIONS ( option )+ ) ) + // BasicSemanticsChecker.g:142:4: ^( OPTIONS ( option )+ ) + { + match(input,OPTIONS,FOLLOW_OPTIONS_in_optionsSpec179); if (state.failed) return ; + + match(input, Token.DOWN, null); if (state.failed) return ; + // BasicSemanticsChecker.g:142:14: ( option )+ + int cnt3=0; + loop3: + do { + int alt3=2; + int LA3_0 = input.LA(1); + + if ( (LA3_0==105) ) { + alt3=1; + } + + + switch (alt3) { + case 1 : + // BasicSemanticsChecker.g:142:14: option + { + pushFollow(FOLLOW_option_in_optionsSpec181); + option(); + + state._fsp--; + if (state.failed) return ; + + } + break; + + default : + if ( cnt3 >= 1 ) break loop3; + if (state.backtracking>0) {state.failed=true; return ;} + EarlyExitException eee = + new EarlyExitException(3, input); + throw eee; + } + cnt3++; + } while (true); + + + match(input, Token.UP, null); if (state.failed) return ; + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return ; + } + // $ANTLR end "optionsSpec" + + + // $ANTLR start "option" + // BasicSemanticsChecker.g:145:1: option : ^( '=' o= ID optionValue ) ; + public final void option() throws RecognitionException { + GrammarAST o=null; + BasicSemanticsChecker.optionValue_return optionValue2 = null; + + + try { + // BasicSemanticsChecker.g:146:5: ( ^( '=' o= ID optionValue ) ) + // BasicSemanticsChecker.g:146:9: ^( '=' o= ID optionValue ) + { + match(input,105,FOLLOW_105_in_option203); if (state.failed) return ; + + match(input, Token.DOWN, null); if (state.failed) return ; + o=(GrammarAST)match(input,ID,FOLLOW_ID_in_option207); if (state.failed) return ; + pushFollow(FOLLOW_optionValue_in_option209); + optionValue2=optionValue(); + + state._fsp--; + if (state.failed) return ; + + match(input, Token.UP, null); if (state.failed) return ; + if ( state.backtracking==1 ) { + options.put((o!=null?o.getText():null), (optionValue2!=null?optionValue2.v:null)); + } + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return ; + } + // $ANTLR end "option" + + public static class optionValue_return extends TreeRuleReturnScope { + public String v; + }; + + // $ANTLR start "optionValue" + // BasicSemanticsChecker.g:149:1: optionValue returns [String v] : ( ID | STRING_LITERAL | CHAR_LITERAL | INT | STAR ); + public final BasicSemanticsChecker.optionValue_return optionValue() throws RecognitionException { + BasicSemanticsChecker.optionValue_return retval = new BasicSemanticsChecker.optionValue_return(); + retval.start = input.LT(1); + + retval.v = ((GrammarAST)retval.start).token.getText(); + try { + // BasicSemanticsChecker.g:151:5: ( ID | STRING_LITERAL | CHAR_LITERAL | INT | STAR ) + // BasicSemanticsChecker.g: + { + if ( input.LA(1)==STAR||input.LA(1)==INT||input.LA(1)==STRING_LITERAL||input.LA(1)==CHAR_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 { + } + return retval; + } + // $ANTLR end "optionValue" + + + // $ANTLR start "rule" + // BasicSemanticsChecker.g:158:1: rule : ^( RULE r= ID ( . )* ) ; + public final void rule() throws RecognitionException { + GrammarAST r=null; + + try { + // BasicSemanticsChecker.g:158:5: ( ^( RULE r= ID ( . )* ) ) + // BasicSemanticsChecker.g:158:9: ^( RULE r= ID ( . )* ) + { + match(input,RULE,FOLLOW_RULE_in_rule297); if (state.failed) return ; + + match(input, Token.DOWN, null); if (state.failed) return ; + r=(GrammarAST)match(input,ID,FOLLOW_ID_in_rule301); if (state.failed) return ; + // BasicSemanticsChecker.g:158:22: ( . )* + loop4: + do { + int alt4=2; + int LA4_0 = input.LA(1); + + if ( ((LA4_0>=SEMPRED && LA4_0<=105)) ) { + alt4=1; + } + else if ( (LA4_0==UP) ) { + alt4=2; + } + + + switch (alt4) { + case 1 : + // BasicSemanticsChecker.g:158:22: . + { + matchAny(input); if (state.failed) return ; + + } + break; + + default : + break loop4; + } + } while (true); + + + match(input, Token.UP, null); if (state.failed) return ; + if ( state.backtracking==1 ) { + + if ( gtype==LEXER_GRAMMAR && Character.isLowerCase((r!=null?r.getText():null).charAt(0)) ) { + ErrorManager.grammarError(ErrorType.PARSER_RULES_NOT_ALLOWED, + fileName, r.token, (r!=null?r.getText():null)); + } + if ( (gtype==PARSER_GRAMMAR||gtype==PARSER_GRAMMAR) && + Character.isUpperCase((r!=null?r.getText():null).charAt(0)) ) + { + ErrorManager.grammarError(ErrorType.LEXER_RULES_NOT_ALLOWED, + fileName, r.token, (r!=null?r.getText():null)); + } + + } + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return ; + } + // $ANTLR end "rule" + + + // $ANTLR start "ruleref" + // BasicSemanticsChecker.g:173:1: ruleref : {...}? ( ^( ( ROOT | BANG ) r= RULE_REF ( ARG_ACTION )? ) | ^(r= RULE_REF ( ARG_ACTION )? ) ) ; + public final void ruleref() throws RecognitionException { + GrammarAST r=null; + + try { + // BasicSemanticsChecker.g:174:5: ({...}? ( ^( ( ROOT | BANG ) r= RULE_REF ( ARG_ACTION )? ) | ^(r= RULE_REF ( ARG_ACTION )? ) ) ) + // BasicSemanticsChecker.g:174:7: {...}? ( ^( ( ROOT | BANG ) r= RULE_REF ( ARG_ACTION )? ) | ^(r= RULE_REF ( ARG_ACTION )? ) ) + { + if ( !((gtype==LEXER_GRAMMAR)) ) { + if (state.backtracking>0) {state.failed=true; return ;} + throw new FailedPredicateException(input, "ruleref", "gtype==LEXER_GRAMMAR"); + } + // BasicSemanticsChecker.g:175:6: ( ^( ( ROOT | BANG ) r= RULE_REF ( ARG_ACTION )? ) | ^(r= RULE_REF ( ARG_ACTION )? ) ) + int alt7=2; + int LA7_0 = input.LA(1); + + if ( (LA7_0==BANG||LA7_0==ROOT) ) { + alt7=1; + } + else if ( (LA7_0==RULE_REF) ) { + alt7=2; + } + else { + if (state.backtracking>0) {state.failed=true; return ;} + NoViableAltException nvae = + new NoViableAltException("", 7, 0, input); + + throw nvae; + } + switch (alt7) { + case 1 : + // BasicSemanticsChecker.g:175:8: ^( ( ROOT | BANG ) r= RULE_REF ( ARG_ACTION )? ) + { + if ( input.LA(1)==BANG||input.LA(1)==ROOT ) { + input.consume(); + state.errorRecovery=false;state.failed=false; + } + else { + if (state.backtracking>0) {state.failed=true; return ;} + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + match(input, Token.DOWN, null); if (state.failed) return ; + r=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref347); if (state.failed) return ; + // BasicSemanticsChecker.g:175:33: ( ARG_ACTION )? + int alt5=2; + int LA5_0 = input.LA(1); + + if ( (LA5_0==ARG_ACTION) ) { + alt5=1; + } + switch (alt5) { + case 1 : + // BasicSemanticsChecker.g:175:33: ARG_ACTION + { + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref349); if (state.failed) return ; + + } + break; + + } + + + match(input, Token.UP, null); if (state.failed) return ; + + } + break; + case 2 : + // BasicSemanticsChecker.g:176:8: ^(r= RULE_REF ( ARG_ACTION )? ) + { + r=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref363); if (state.failed) return ; + + if ( input.LA(1)==Token.DOWN ) { + match(input, Token.DOWN, null); if (state.failed) return ; + // BasicSemanticsChecker.g:176:21: ( ARG_ACTION )? + int alt6=2; + int LA6_0 = input.LA(1); + + if ( (LA6_0==ARG_ACTION) ) { + alt6=1; + } + switch (alt6) { + case 1 : + // BasicSemanticsChecker.g:176:21: ARG_ACTION + { + match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleref365); if (state.failed) return ; + + } + break; + + } + + + match(input, Token.UP, null); if (state.failed) return ; + } + + } + break; + + } + + if ( state.backtracking==1 ) { + + ErrorManager.grammarError(ErrorType.PARSER_RULES_NOT_ALLOWED, + fileName, r.token, (r!=null?r.getText():null)); + + } + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return ; + } + // $ANTLR end "ruleref" + + // Delegated rules + + + + + public static final BitSet FOLLOW_grammarSpec_in_topdown83 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_optionsSpec_in_topdown88 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_rule_in_topdown93 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ruleref_in_topdown98 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_grammarType_in_grammarSpec116 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_grammarSpec118 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF8L,0x000003FFFFFFFFFFL}); + public static final BitSet FOLLOW_set_in_grammarType0 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_OPTIONS_in_optionsSpec179 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_option_in_optionsSpec181 = new BitSet(new long[]{0x0000000000000008L,0x0000020000000000L}); + public static final BitSet FOLLOW_105_in_option203 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_option207 = new BitSet(new long[]{0x0001000000000000L,0x0000000000800015L}); + public static final BitSet FOLLOW_optionValue_in_option209 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_set_in_optionValue0 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_RULE_in_rule297 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_rule301 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF8L,0x000003FFFFFFFFFFL}); + public static final BitSet FOLLOW_set_in_ruleref339 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_RULE_REF_in_ruleref347 = new BitSet(new long[]{0x0000000000004008L}); + public static final BitSet FOLLOW_ARG_ACTION_in_ruleref349 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_RULE_REF_in_ruleref363 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ARG_ACTION_in_ruleref365 = new BitSet(new long[]{0x0000000000000008L}); + +} \ No newline at end of file diff --git a/tool/src/org/antlr/v4/semantics/SemanticsPipeline.java b/tool/src/org/antlr/v4/semantics/SemanticsPipeline.java index 26c18316b..0eeb3ff4b 100644 --- a/tool/src/org/antlr/v4/semantics/SemanticsPipeline.java +++ b/tool/src/org/antlr/v4/semantics/SemanticsPipeline.java @@ -23,7 +23,7 @@ public class SemanticsPipeline { // DO BASIC / EASY SEMANTIC CHECKS nodes.reset(); - BasicSemanticsChecker basics = new BasicSemanticsChecker(nodes,g); + BasicSemanticsChecker basics = new BasicSemanticsChecker(nodes,g.fileName); basics.downup(g.ast); } } diff --git a/tool/src/org/antlr/v4/tool/ErrorManager.java b/tool/src/org/antlr/v4/tool/ErrorManager.java index 20c5b467f..6efb7ae6a 100644 --- a/tool/src/org/antlr/v4/tool/ErrorManager.java +++ b/tool/src/org/antlr/v4/tool/ErrorManager.java @@ -57,6 +57,10 @@ public class ErrorManager { private static Locale locale; private static String formatName; + // TODO: make thread local to hold this state + public static int errors; + public static int warnings; + static ANTLRErrorListener theDefaultErrorListener = new ANTLRErrorListener() { public void info(String msg) { if (formatWantsSingleLineMessage()) { @@ -130,14 +134,18 @@ public class ErrorManager { public static ST getLocationFormat() { return format.getInstanceOf("location"); } - public static ST getReportFormat() { - return format.getInstanceOf("report"); + public static ST getReportFormat(ErrorSeverity severity) { + ST st = format.getInstanceOf("report"); + ST type = messages.getInstanceOf(severity.toString()); + st.add("type", type); + return st; + } public static ST getMessageFormat() { return format.getInstanceOf("message"); } public static boolean formatWantsSingleLineMessage() { - return format.getInstanceOf("wantsSingleLineMessage").toString().equals("true"); + return format.getInstanceOf("wantsSingleLineMessage").render().equals("true"); } public static ST getMessageTemplate(ErrorType etype) { String msgName = etype.toString(); @@ -152,12 +160,14 @@ public class ErrorManager { } public static void internalError(String error, Throwable e) { + errors++; StackTraceElement location = getLastNonErrorManagerCodeLocation(e); String msg = "Exception "+e+"@"+location+": "+error; System.err.println("internal error: "+msg); } public static void internalError(String error) { + errors++; StackTraceElement location = getLastNonErrorManagerCodeLocation(new Exception()); String msg = location+": "+error; @@ -171,6 +181,7 @@ public class ErrorManager { * @param args The arguments to pass to the StringTemplate */ public static void toolError(ErrorType errorType, Object... args) { + errors++; theDefaultErrorListener.error(new ToolMessage(errorType, args)); } @@ -206,10 +217,21 @@ public class ErrorManager { Token token, Object... args) { + errors++; Message msg = new GrammarSemanticsMessage(etype,g,token,args); theDefaultErrorListener.error(msg); } + public static void grammarError(ErrorType etype, + String fileName, + Token token, + Object... args) + { + errors++; + Message msg = new GrammarSemanticsMessage(etype,fileName,token,args); + theDefaultErrorListener.error(msg); + } + /** Process a new message by sending it on to the error listener associated with the current thread * and recording any information we need in the error state for the current thread. */ @@ -217,7 +239,7 @@ public class ErrorManager { } public static int getNumErrors() { - return 0; + return errors; } /** Return first non ErrorManager code location for generating messages */ @@ -335,11 +357,11 @@ public class ErrorManager { } } // check for special templates - if (!messages.isDefined("warning")) { + if (!messages.isDefined("WARNING")) { System.err.println("Message template 'warning' not found in locale "+ locale); ok = false; } - if (!messages.isDefined("error")) { + if (!messages.isDefined("ERROR")) { System.err.println("Message template 'error' not found in locale "+ locale); ok = false; } diff --git a/tool/src/org/antlr/v4/tool/Grammar.java b/tool/src/org/antlr/v4/tool/Grammar.java index b58c83227..346237035 100644 --- a/tool/src/org/antlr/v4/tool/Grammar.java +++ b/tool/src/org/antlr/v4/tool/Grammar.java @@ -23,7 +23,6 @@ public class Grammar { public Grammar(Tool tool, GrammarAST ast) { this.tool = tool; - this.name = ast.getChild(0).getText(); this.ast = ast; } diff --git a/tool/src/org/antlr/v4/tool/GrammarSemanticsMessage.java b/tool/src/org/antlr/v4/tool/GrammarSemanticsMessage.java index 36efda36a..fe0df60b0 100644 --- a/tool/src/org/antlr/v4/tool/GrammarSemanticsMessage.java +++ b/tool/src/org/antlr/v4/tool/GrammarSemanticsMessage.java @@ -19,11 +19,25 @@ public class GrammarSemanticsMessage extends Message { { super(etype,args); this.g = g; - if ( g!=null ) file = g.fileName; + if ( g!=null ) fileName = g.fileName; this.offendingToken = offendingToken; if ( offendingToken!=null ) { line = offendingToken.getLine(); - column = offendingToken.getCharPositionInLine(); + charPosition = offendingToken.getCharPositionInLine(); + } + } + + public GrammarSemanticsMessage(ErrorType etype, + String fileName, + Token offendingToken, + Object... args) + { + super(etype,args); + this.fileName = fileName; + this.offendingToken = offendingToken; + if ( offendingToken!=null ) { + line = offendingToken.getLine(); + charPosition = offendingToken.getCharPositionInLine(); } } } diff --git a/tool/src/org/antlr/v4/tool/Message.java b/tool/src/org/antlr/v4/tool/Message.java index fa14c9232..0118d9efc 100644 --- a/tool/src/org/antlr/v4/tool/Message.java +++ b/tool/src/org/antlr/v4/tool/Message.java @@ -8,9 +8,9 @@ public class Message { public Throwable e; // used for location template - public String file; + public String fileName; public int line = -1; - public int column = -1; + public int charPosition = -1; public Message() { } @@ -35,7 +35,7 @@ public class Message { public ST getMessageTemplate() { ST messageST = ErrorManager.getMessageTemplate(errorType); ST locationST = ErrorManager.getLocationFormat(); - ST reportST = ErrorManager.getReportFormat(); + ST reportST = ErrorManager.getReportFormat(errorType.getSeverity()); ST messageFormatST = ErrorManager.getMessageFormat(); if ( args!=null ) { // fill in arg1, arg2, ... @@ -55,24 +55,21 @@ public class Message { locationST.add("line", line); locationValid = true; } - if (column != -1) { - locationST.add("column", column); + if (charPosition != -1) { + locationST.add("column", charPosition); locationValid = true; } - if (file != null) { - locationST.add("file", file); + if (fileName != null) { + locationST.add("file", fileName); locationValid = true; } - messageFormatST.add("id", errorType); + messageFormatST.add("id", errorType.ordinal()); messageFormatST.add("text", messageST); - if (locationValid) { - reportST.add("location", locationST); - } + if (locationValid) reportST.add("location", locationST); reportST.add("message", messageFormatST); - reportST.add("type", errorType.getSeverity()); - return messageST; + return reportST; } public String toString() {