got basic semantic checker for attributes written

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 6685]
This commit is contained in:
parrt 2010-02-10 17:21:13 -08:00
parent f94ef660f4
commit b51019140c
13 changed files with 911 additions and 598 deletions

View File

@ -1,4 +1,4 @@
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRLexer.g 2010-02-07 17:00:03
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRLexer.g 2010-02-10 17:19:36
/*
[The "BSD licence"]

View File

@ -1,4 +1,4 @@
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRParser.g 2010-02-07 17:00:06
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ANTLRParser.g 2010-02-10 17:19:39
/*
[The "BSD licence"]
@ -284,7 +284,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: prequelConstruct, DOC_COMMENT, id, grammarType, rules
// elements: DOC_COMMENT, grammarType, id, rules, prequelConstruct
// token labels:
// rule labels: retval
// token list labels:
@ -1559,7 +1559,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: STRING_LITERAL, id, ASSIGN
// elements: ASSIGN, STRING_LITERAL, id
// token labels:
// rule labels: retval
// token list labels:
@ -2353,7 +2353,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: exceptionGroup, id, ruleReturns, ruleModifiers, altListAsBlock, rulePrequel, ARG_ACTION, DOC_COMMENT
// elements: id, altListAsBlock, ARG_ACTION, exceptionGroup, ruleReturns, rulePrequel, DOC_COMMENT, ruleModifiers
// token labels:
// rule labels: retval
// token list labels:
@ -2976,7 +2976,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: THROWS, qid
// elements: qid, THROWS
// token labels:
// rule labels: retval
// token list labels:
@ -3284,7 +3284,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: ACTION, id, AT
// elements: AT, ACTION, id
// token labels:
// rule labels: retval
// token list labels:
@ -3800,7 +3800,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: rewrite, elements
// elements: elements, rewrite
// token labels:
// rule labels: retval
// token list labels:
@ -4165,7 +4165,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: labeledElement, ebnfSuffix
// elements: ebnfSuffix, labeledElement
// token labels:
// rule labels: retval
// token list labels:
@ -4504,7 +4504,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: ebnfSuffix, treeSpec
// elements: treeSpec, ebnfSuffix
// token labels:
// rule labels: retval
// token list labels:
@ -4829,7 +4829,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: element, TREE_BEGIN
// elements: TREE_BEGIN, element
// token labels:
// rule labels: retval
// token list labels:
@ -4944,7 +4944,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: block, blockSuffixe
// elements: blockSuffixe, block
// token labels:
// rule labels: retval
// token list labels:
@ -5450,7 +5450,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: ruleref, DOT, id
// elements: DOT, id, ruleref
// token labels:
// rule labels: retval
// token list labels:
@ -5508,7 +5508,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: terminal, DOT, id
// elements: id, DOT, terminal
// token labels:
// rule labels: retval
// token list labels:
@ -6014,7 +6014,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: ra, optionsSpec, ACTION, altList
// elements: altList, ra, ACTION, optionsSpec
// token labels:
// rule labels: retval
// token list labels:
@ -6195,7 +6195,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: RULE_REF, op, ARG_ACTION
// elements: ARG_ACTION, RULE_REF, op
// token labels: op
// rule labels: retval
// token list labels:
@ -6242,7 +6242,7 @@ public class ANTLRParser extends Parser {
{
// AST REWRITE
// elements: RULE_REF, ARG_ACTION
// elements: ARG_ACTION, RULE_REF
// token labels:
// rule labels: retval
// token list labels:
@ -6548,7 +6548,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: ARG_ACTION, elementOptions, TOKEN_REF
// elements: elementOptions, ARG_ACTION, TOKEN_REF
// token labels:
// rule labels: retval
// token list labels:
@ -6619,7 +6619,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: STRING_LITERAL, elementOptions
// elements: elementOptions, STRING_LITERAL
// token labels:
// rule labels: retval
// token list labels:
@ -7229,7 +7229,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: nakedRewrite, predicatedRewrite
// elements: predicatedRewrite, nakedRewrite
// token labels:
// rule labels: retval
// token list labels:
@ -7317,7 +7317,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: SEMPRED, rewriteAlt, SEMPRED, rewriteAlt
// elements: SEMPRED, rewriteAlt, rewriteAlt, SEMPRED
// token labels:
// rule labels: retval
// token list labels:
@ -7540,7 +7540,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
ETC186=(Token)match(input,ETC,FOLLOW_ETC_in_rewriteAlt4362); if (state.failed) return retval;
ETC186=(Token)match(input,ETC,FOLLOW_ETC_in_rewriteAlt4356); if (state.failed) return retval;
if ( state.backtracking==0 ) {
ETC186_tree = (GrammarAST)adaptor.create(ETC186);
adaptor.addChild(root_0, ETC186_tree);
@ -7632,7 +7632,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:829:7: rewriteTreeElement
{
pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTreeAlt4393);
pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTreeAlt4387);
rewriteTreeElement187=rewriteTreeElement();
state._fsp--;
@ -7749,7 +7749,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4417);
pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4411);
rewriteTreeAtom188=rewriteTreeAtom();
state._fsp--;
@ -7761,13 +7761,13 @@ public class ANTLRParser extends Parser {
case 2 :
// ANTLRParser.g:834:4: rewriteTreeAtom ebnfSuffix
{
pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4422);
pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4416);
rewriteTreeAtom189=rewriteTreeAtom();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_rewriteTreeAtom.add(rewriteTreeAtom189.getTree());
pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeElement4424);
pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeElement4418);
ebnfSuffix190=ebnfSuffix();
state._fsp--;
@ -7823,7 +7823,7 @@ public class ANTLRParser extends Parser {
case 3 :
// ANTLRParser.g:835:6: rewriteTree ( ebnfSuffix -> ^( ebnfSuffix ^( REWRITE_BLOCK ^( ALT rewriteTree ) ) ) | -> rewriteTree )
{
pushFollow(FOLLOW_rewriteTree_in_rewriteTreeElement4449);
pushFollow(FOLLOW_rewriteTree_in_rewriteTreeElement4443);
rewriteTree191=rewriteTree();
state._fsp--;
@ -7850,7 +7850,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:836:5: ebnfSuffix
{
pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeElement4455);
pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeElement4449);
ebnfSuffix192=ebnfSuffix();
state._fsp--;
@ -7859,7 +7859,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: ebnfSuffix, rewriteTree
// elements: rewriteTree, ebnfSuffix
// token labels:
// rule labels: retval
// token list labels:
@ -7939,7 +7939,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement4494);
pushFollow(FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement4488);
rewriteTreeEbnf193=rewriteTreeEbnf();
state._fsp--;
@ -8049,7 +8049,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:844:9: TOKEN_REF ( elementOptions )? ( ARG_ACTION )?
{
TOKEN_REF194=(Token)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewriteTreeAtom4510); if (state.failed) return retval;
TOKEN_REF194=(Token)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewriteTreeAtom4504); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_TOKEN_REF.add(TOKEN_REF194);
// ANTLRParser.g:844:19: ( elementOptions )?
@ -8063,7 +8063,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:844:19: elementOptions
{
pushFollow(FOLLOW_elementOptions_in_rewriteTreeAtom4512);
pushFollow(FOLLOW_elementOptions_in_rewriteTreeAtom4506);
elementOptions195=elementOptions();
state._fsp--;
@ -8086,7 +8086,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:844:35: ARG_ACTION
{
ARG_ACTION196=(Token)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rewriteTreeAtom4515); if (state.failed) return retval;
ARG_ACTION196=(Token)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rewriteTreeAtom4509); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ARG_ACTION.add(ARG_ACTION196);
@ -8142,7 +8142,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
RULE_REF197=(Token)match(input,RULE_REF,FOLLOW_RULE_REF_in_rewriteTreeAtom4542); if (state.failed) return retval;
RULE_REF197=(Token)match(input,RULE_REF,FOLLOW_RULE_REF_in_rewriteTreeAtom4536); if (state.failed) return retval;
if ( state.backtracking==0 ) {
RULE_REF197_tree = (GrammarAST)adaptor.create(RULE_REF197);
adaptor.addChild(root_0, RULE_REF197_tree);
@ -8153,7 +8153,7 @@ public class ANTLRParser extends Parser {
case 3 :
// ANTLRParser.g:846:6: STRING_LITERAL ( elementOptions )?
{
STRING_LITERAL198=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_rewriteTreeAtom4549); if (state.failed) return retval;
STRING_LITERAL198=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_rewriteTreeAtom4543); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_STRING_LITERAL.add(STRING_LITERAL198);
// ANTLRParser.g:846:21: ( elementOptions )?
@ -8167,7 +8167,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:846:21: elementOptions
{
pushFollow(FOLLOW_elementOptions_in_rewriteTreeAtom4551);
pushFollow(FOLLOW_elementOptions_in_rewriteTreeAtom4545);
elementOptions199=elementOptions();
state._fsp--;
@ -8182,7 +8182,7 @@ public class ANTLRParser extends Parser {
// AST REWRITE
// elements: STRING_LITERAL, elementOptions
// elements: elementOptions, STRING_LITERAL
// token labels:
// rule labels: retval
// token list labels:
@ -8218,10 +8218,10 @@ public class ANTLRParser extends Parser {
case 4 :
// ANTLRParser.g:847:6: DOLLAR id
{
DOLLAR200=(Token)match(input,DOLLAR,FOLLOW_DOLLAR_in_rewriteTreeAtom4574); if (state.failed) return retval;
DOLLAR200=(Token)match(input,DOLLAR,FOLLOW_DOLLAR_in_rewriteTreeAtom4568); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_DOLLAR.add(DOLLAR200);
pushFollow(FOLLOW_id_in_rewriteTreeAtom4576);
pushFollow(FOLLOW_id_in_rewriteTreeAtom4570);
id201=id();
state._fsp--;
@ -8255,7 +8255,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
ACTION202=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteTreeAtom4587); if (state.failed) return retval;
ACTION202=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteTreeAtom4581); if (state.failed) return retval;
if ( state.backtracking==0 ) {
ACTION202_tree = (GrammarAST)adaptor.create(ACTION202);
adaptor.addChild(root_0, ACTION202_tree);
@ -8318,19 +8318,19 @@ public class ANTLRParser extends Parser {
// ANTLRParser.g:859:2: (lp= LPAREN rewriteTreeAlt RPAREN ebnfSuffix -> ^( ebnfSuffix ^( REWRITE_BLOCK[$lp] rewriteTreeAlt ) ) )
// ANTLRParser.g:859:4: lp= LPAREN rewriteTreeAlt RPAREN ebnfSuffix
{
lp=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteTreeEbnf4610); if (state.failed) return retval;
lp=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteTreeEbnf4604); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_LPAREN.add(lp);
pushFollow(FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf4612);
pushFollow(FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf4606);
rewriteTreeAlt203=rewriteTreeAlt();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_rewriteTreeAlt.add(rewriteTreeAlt203.getTree());
RPAREN204=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTreeEbnf4614); if (state.failed) return retval;
RPAREN204=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTreeEbnf4608); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN204);
pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeEbnf4616);
pushFollow(FOLLOW_ebnfSuffix_in_rewriteTreeEbnf4610);
ebnfSuffix205=ebnfSuffix();
state._fsp--;
@ -8431,10 +8431,10 @@ public class ANTLRParser extends Parser {
// ANTLRParser.g:863:2: ( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* RPAREN -> ^( TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* ) )
// ANTLRParser.g:863:4: TREE_BEGIN rewriteTreeAtom ( rewriteTreeElement )* RPAREN
{
TREE_BEGIN206=(Token)match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_rewriteTree4640); if (state.failed) return retval;
TREE_BEGIN206=(Token)match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_rewriteTree4634); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_TREE_BEGIN.add(TREE_BEGIN206);
pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTree4642);
pushFollow(FOLLOW_rewriteTreeAtom_in_rewriteTree4636);
rewriteTreeAtom207=rewriteTreeAtom();
state._fsp--;
@ -8455,7 +8455,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:863:31: rewriteTreeElement
{
pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTree4644);
pushFollow(FOLLOW_rewriteTreeElement_in_rewriteTree4638);
rewriteTreeElement208=rewriteTreeElement();
state._fsp--;
@ -8470,13 +8470,13 @@ public class ANTLRParser extends Parser {
}
} while (true);
RPAREN209=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTree4647); if (state.failed) return retval;
RPAREN209=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTree4641); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN209);
// AST REWRITE
// elements: TREE_BEGIN, rewriteTreeAtom, rewriteTreeElement
// elements: rewriteTreeAtom, TREE_BEGIN, rewriteTreeElement
// token labels:
// rule labels: retval
// token list labels:
@ -8574,19 +8574,19 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:879:3: TEMPLATE LPAREN rewriteTemplateArgs RPAREN (str= DOUBLE_QUOTE_STRING_LITERAL | str= DOUBLE_ANGLE_STRING_LITERAL )
{
TEMPLATE210=(Token)match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplate4679); if (state.failed) return retval;
TEMPLATE210=(Token)match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewriteTemplate4673); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_TEMPLATE.add(TEMPLATE210);
LPAREN211=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteTemplate4681); if (state.failed) return retval;
LPAREN211=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteTemplate4675); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN211);
pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplate4683);
pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplate4677);
rewriteTemplateArgs212=rewriteTemplateArgs();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_rewriteTemplateArgs.add(rewriteTemplateArgs212.getTree());
RPAREN213=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTemplate4685); if (state.failed) return retval;
RPAREN213=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTemplate4679); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN213);
// ANTLRParser.g:880:3: (str= DOUBLE_QUOTE_STRING_LITERAL | str= DOUBLE_ANGLE_STRING_LITERAL )
@ -8610,7 +8610,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:880:5: str= DOUBLE_QUOTE_STRING_LITERAL
{
str=(Token)match(input,DOUBLE_QUOTE_STRING_LITERAL,FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate4693); if (state.failed) return retval;
str=(Token)match(input,DOUBLE_QUOTE_STRING_LITERAL,FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate4687); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_DOUBLE_QUOTE_STRING_LITERAL.add(str);
@ -8619,7 +8619,7 @@ public class ANTLRParser extends Parser {
case 2 :
// ANTLRParser.g:880:39: str= DOUBLE_ANGLE_STRING_LITERAL
{
str=(Token)match(input,DOUBLE_ANGLE_STRING_LITERAL,FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate4699); if (state.failed) return retval;
str=(Token)match(input,DOUBLE_ANGLE_STRING_LITERAL,FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate4693); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_DOUBLE_ANGLE_STRING_LITERAL.add(str);
@ -8671,7 +8671,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_rewriteTemplateRef_in_rewriteTemplate4725);
pushFollow(FOLLOW_rewriteTemplateRef_in_rewriteTemplate4719);
rewriteTemplateRef214=rewriteTemplateRef();
state._fsp--;
@ -8685,7 +8685,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate4734);
pushFollow(FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate4728);
rewriteIndirectTemplateHead215=rewriteIndirectTemplateHead();
state._fsp--;
@ -8699,7 +8699,7 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
ACTION216=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplate4743); if (state.failed) return retval;
ACTION216=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplate4737); if (state.failed) return retval;
if ( state.backtracking==0 ) {
ACTION216_tree = (GrammarAST)adaptor.create(ACTION216);
adaptor.addChild(root_0, ACTION216_tree);
@ -8759,22 +8759,22 @@ public class ANTLRParser extends Parser {
// ANTLRParser.g:895:2: ( id LPAREN rewriteTemplateArgs RPAREN -> ^( TEMPLATE[$LPAREN,\"TEMPLATE\"] id ( rewriteTemplateArgs )? ) )
// ANTLRParser.g:895:4: id LPAREN rewriteTemplateArgs RPAREN
{
pushFollow(FOLLOW_id_in_rewriteTemplateRef4756);
pushFollow(FOLLOW_id_in_rewriteTemplateRef4750);
id217=id();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_id.add(id217.getTree());
LPAREN218=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteTemplateRef4758); if (state.failed) return retval;
LPAREN218=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteTemplateRef4752); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN218);
pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef4760);
pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef4754);
rewriteTemplateArgs219=rewriteTemplateArgs();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_rewriteTemplateArgs.add(rewriteTemplateArgs219.getTree());
RPAREN220=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTemplateRef4762); if (state.failed) return retval;
RPAREN220=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteTemplateRef4756); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN220);
@ -8868,25 +8868,25 @@ public class ANTLRParser extends Parser {
// ANTLRParser.g:901:2: (lp= LPAREN ACTION RPAREN LPAREN rewriteTemplateArgs RPAREN -> ^( TEMPLATE[$lp,\"TEMPLATE\"] ACTION ( rewriteTemplateArgs )? ) )
// ANTLRParser.g:901:4: lp= LPAREN ACTION RPAREN LPAREN rewriteTemplateArgs RPAREN
{
lp=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4791); if (state.failed) return retval;
lp=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4785); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_LPAREN.add(lp);
ACTION221=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteIndirectTemplateHead4793); if (state.failed) return retval;
ACTION221=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteIndirectTemplateHead4787); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ACTION.add(ACTION221);
RPAREN222=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4795); if (state.failed) return retval;
RPAREN222=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4789); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN222);
LPAREN223=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4797); if (state.failed) return retval;
LPAREN223=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4791); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN223);
pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead4799);
pushFollow(FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead4793);
rewriteTemplateArgs224=rewriteTemplateArgs();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_rewriteTemplateArgs.add(rewriteTemplateArgs224.getTree());
RPAREN225=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4801); if (state.failed) return retval;
RPAREN225=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4795); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN225);
@ -8990,7 +8990,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:906:4: rewriteTemplateArg ( COMMA rewriteTemplateArg )*
{
pushFollow(FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4826);
pushFollow(FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4820);
rewriteTemplateArg226=rewriteTemplateArg();
state._fsp--;
@ -9011,10 +9011,10 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:906:24: COMMA rewriteTemplateArg
{
COMMA227=(Token)match(input,COMMA,FOLLOW_COMMA_in_rewriteTemplateArgs4829); if (state.failed) return retval;
COMMA227=(Token)match(input,COMMA,FOLLOW_COMMA_in_rewriteTemplateArgs4823); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA227);
pushFollow(FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4831);
pushFollow(FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4825);
rewriteTemplateArg228=rewriteTemplateArg();
state._fsp--;
@ -9123,22 +9123,22 @@ public class ANTLRParser extends Parser {
// ANTLRParser.g:912:2: ( id ASSIGN ACTION -> ^( ARG[$ASSIGN] id ACTION ) )
// ANTLRParser.g:912:6: id ASSIGN ACTION
{
pushFollow(FOLLOW_id_in_rewriteTemplateArg4860);
pushFollow(FOLLOW_id_in_rewriteTemplateArg4854);
id229=id();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_id.add(id229.getTree());
ASSIGN230=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_rewriteTemplateArg4862); if (state.failed) return retval;
ASSIGN230=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_rewriteTemplateArg4856); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ASSIGN.add(ASSIGN230);
ACTION231=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplateArg4864); if (state.failed) return retval;
ACTION231=(Token)match(input,ACTION,FOLLOW_ACTION_in_rewriteTemplateArg4858); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ACTION.add(ACTION231);
// AST REWRITE
// elements: ACTION, id
// elements: id, ACTION
// token labels:
// rule labels: retval
// token list labels:
@ -9242,7 +9242,7 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:920:7: RULE_REF
{
RULE_REF232=(Token)match(input,RULE_REF,FOLLOW_RULE_REF_in_id4893); if (state.failed) return retval;
RULE_REF232=(Token)match(input,RULE_REF,FOLLOW_RULE_REF_in_id4887); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_RULE_REF.add(RULE_REF232);
@ -9271,7 +9271,7 @@ public class ANTLRParser extends Parser {
case 2 :
// ANTLRParser.g:921:7: TOKEN_REF
{
TOKEN_REF233=(Token)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_id4906); if (state.failed) return retval;
TOKEN_REF233=(Token)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_id4900); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_TOKEN_REF.add(TOKEN_REF233);
@ -9300,7 +9300,7 @@ public class ANTLRParser extends Parser {
case 3 :
// ANTLRParser.g:922:7: TEMPLATE
{
TEMPLATE234=(Token)match(input,TEMPLATE,FOLLOW_TEMPLATE_in_id4918); if (state.failed) return retval;
TEMPLATE234=(Token)match(input,TEMPLATE,FOLLOW_TEMPLATE_in_id4912); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_TEMPLATE.add(TEMPLATE234);
@ -9374,7 +9374,7 @@ public class ANTLRParser extends Parser {
// ANTLRParser.g:925:5: ( id ( DOT id )* -> ID[$qid.start, $text] )
// ANTLRParser.g:925:7: id ( DOT id )*
{
pushFollow(FOLLOW_id_in_qid4941);
pushFollow(FOLLOW_id_in_qid4935);
id235=id();
state._fsp--;
@ -9395,10 +9395,10 @@ public class ANTLRParser extends Parser {
case 1 :
// ANTLRParser.g:925:11: DOT id
{
DOT236=(Token)match(input,DOT,FOLLOW_DOT_in_qid4944); if (state.failed) return retval;
DOT236=(Token)match(input,DOT,FOLLOW_DOT_in_qid4938); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_DOT.add(DOT236);
pushFollow(FOLLOW_id_in_qid4946);
pushFollow(FOLLOW_id_in_qid4940);
id237=id();
state._fsp--;
@ -9481,13 +9481,13 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_alternative_in_alternativeEntry4962);
pushFollow(FOLLOW_alternative_in_alternativeEntry4956);
alternative238=alternative();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, alternative238.getTree());
EOF239=(Token)match(input,EOF,FOLLOW_EOF_in_alternativeEntry4964); if (state.failed) return retval;
EOF239=(Token)match(input,EOF,FOLLOW_EOF_in_alternativeEntry4958); if (state.failed) return retval;
if ( state.backtracking==0 ) {
EOF239_tree = (GrammarAST)adaptor.create(EOF239);
adaptor.addChild(root_0, EOF239_tree);
@ -9540,13 +9540,13 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_element_in_elementEntry4973);
pushFollow(FOLLOW_element_in_elementEntry4967);
element240=element();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, element240.getTree());
EOF241=(Token)match(input,EOF,FOLLOW_EOF_in_elementEntry4975); if (state.failed) return retval;
EOF241=(Token)match(input,EOF,FOLLOW_EOF_in_elementEntry4969); if (state.failed) return retval;
if ( state.backtracking==0 ) {
EOF241_tree = (GrammarAST)adaptor.create(EOF241);
adaptor.addChild(root_0, EOF241_tree);
@ -9599,13 +9599,13 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_rule_in_ruleEntry4983);
pushFollow(FOLLOW_rule_in_ruleEntry4977);
rule242=rule();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, rule242.getTree());
EOF243=(Token)match(input,EOF,FOLLOW_EOF_in_ruleEntry4985); if (state.failed) return retval;
EOF243=(Token)match(input,EOF,FOLLOW_EOF_in_ruleEntry4979); if (state.failed) return retval;
if ( state.backtracking==0 ) {
EOF243_tree = (GrammarAST)adaptor.create(EOF243);
adaptor.addChild(root_0, EOF243_tree);
@ -9658,13 +9658,13 @@ public class ANTLRParser extends Parser {
{
root_0 = (GrammarAST)adaptor.nil();
pushFollow(FOLLOW_block_in_blockEntry4993);
pushFollow(FOLLOW_block_in_blockEntry4987);
block244=block();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, block244.getTree());
EOF245=(Token)match(input,EOF,FOLLOW_EOF_in_blockEntry4995); if (state.failed) return retval;
EOF245=(Token)match(input,EOF,FOLLOW_EOF_in_blockEntry4989); if (state.failed) return retval;
if ( state.backtracking==0 ) {
EOF245_tree = (GrammarAST)adaptor.create(EOF245);
adaptor.addChild(root_0, EOF245_tree);
@ -10579,70 +10579,70 @@ public class ANTLRParser extends Parser {
public static final BitSet FOLLOW_rewriteAlt_in_nakedRewrite4244 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTemplate_in_rewriteAlt4308 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeAlt_in_rewriteAlt4347 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ETC_in_rewriteAlt4362 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTreeAlt4393 = new BitSet(new long[]{0xC420010000010002L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4417 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4422 = new BitSet(new long[]{0x0003400000000000L});
public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeElement4424 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTree_in_rewriteTreeElement4449 = new BitSet(new long[]{0x0003400000000002L});
public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeElement4455 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement4494 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TOKEN_REF_in_rewriteTreeAtom4510 = new BitSet(new long[]{0x0000080000004002L});
public static final BitSet FOLLOW_elementOptions_in_rewriteTreeAtom4512 = new BitSet(new long[]{0x0000000000004002L});
public static final BitSet FOLLOW_ARG_ACTION_in_rewriteTreeAtom4515 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_REF_in_rewriteTreeAtom4542 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_STRING_LITERAL_in_rewriteTreeAtom4549 = new BitSet(new long[]{0x0000080000000002L});
public static final BitSet FOLLOW_elementOptions_in_rewriteTreeAtom4551 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOLLAR_in_rewriteTreeAtom4574 = new BitSet(new long[]{0xC000000800000000L});
public static final BitSet FOLLOW_id_in_rewriteTreeAtom4576 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ACTION_in_rewriteTreeAtom4587 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LPAREN_in_rewriteTreeEbnf4610 = new BitSet(new long[]{0xC420010000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf4612 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTreeEbnf4614 = new BitSet(new long[]{0x0003400000000000L});
public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeEbnf4616 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TREE_BEGIN_in_rewriteTree4640 = new BitSet(new long[]{0xC020000000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTree4642 = new BitSet(new long[]{0xC420030000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTree4644 = new BitSet(new long[]{0xC420030000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTree4647 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplate4679 = new BitSet(new long[]{0x0000010000000000L});
public static final BitSet FOLLOW_LPAREN_in_rewriteTemplate4681 = new BitSet(new long[]{0xC000020800000000L});
public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplate4683 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTemplate4685 = new BitSet(new long[]{0x0000000000000C00L});
public static final BitSet FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate4693 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate4699 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTemplateRef_in_rewriteTemplate4725 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate4734 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ACTION_in_rewriteTemplate4743 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_id_in_rewriteTemplateRef4756 = new BitSet(new long[]{0x0000010000000000L});
public static final BitSet FOLLOW_LPAREN_in_rewriteTemplateRef4758 = new BitSet(new long[]{0xC000020800000000L});
public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef4760 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTemplateRef4762 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4791 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_rewriteIndirectTemplateHead4793 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4795 = new BitSet(new long[]{0x0000010000000000L});
public static final BitSet FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4797 = new BitSet(new long[]{0xC000020800000000L});
public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead4799 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4801 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4826 = new BitSet(new long[]{0x0000004000000002L});
public static final BitSet FOLLOW_COMMA_in_rewriteTemplateArgs4829 = new BitSet(new long[]{0xC000000800000000L});
public static final BitSet FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4831 = new BitSet(new long[]{0x0000004000000002L});
public static final BitSet FOLLOW_id_in_rewriteTemplateArg4860 = new BitSet(new long[]{0x0000200000000000L});
public static final BitSet FOLLOW_ASSIGN_in_rewriteTemplateArg4862 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_rewriteTemplateArg4864 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_REF_in_id4893 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TOKEN_REF_in_id4906 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEMPLATE_in_id4918 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_id_in_qid4941 = new BitSet(new long[]{0x0040000000000002L});
public static final BitSet FOLLOW_DOT_in_qid4944 = new BitSet(new long[]{0xC000000800000000L});
public static final BitSet FOLLOW_id_in_qid4946 = new BitSet(new long[]{0x0040000000000002L});
public static final BitSet FOLLOW_alternative_in_alternativeEntry4962 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_alternativeEntry4964 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_element_in_elementEntry4973 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_elementEntry4975 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rule_in_ruleEntry4983 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_ruleEntry4985 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_block_in_blockEntry4993 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_blockEntry4995 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ETC_in_rewriteAlt4356 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTreeAlt4387 = new BitSet(new long[]{0xC420010000010002L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4411 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTreeElement4416 = new BitSet(new long[]{0x0003400000000000L});
public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeElement4418 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTree_in_rewriteTreeElement4443 = new BitSet(new long[]{0x0003400000000002L});
public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeElement4449 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeEbnf_in_rewriteTreeElement4488 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TOKEN_REF_in_rewriteTreeAtom4504 = new BitSet(new long[]{0x0000080000004002L});
public static final BitSet FOLLOW_elementOptions_in_rewriteTreeAtom4506 = new BitSet(new long[]{0x0000000000004002L});
public static final BitSet FOLLOW_ARG_ACTION_in_rewriteTreeAtom4509 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_REF_in_rewriteTreeAtom4536 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_STRING_LITERAL_in_rewriteTreeAtom4543 = new BitSet(new long[]{0x0000080000000002L});
public static final BitSet FOLLOW_elementOptions_in_rewriteTreeAtom4545 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOLLAR_in_rewriteTreeAtom4568 = new BitSet(new long[]{0xC000000800000000L});
public static final BitSet FOLLOW_id_in_rewriteTreeAtom4570 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ACTION_in_rewriteTreeAtom4581 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LPAREN_in_rewriteTreeEbnf4604 = new BitSet(new long[]{0xC420010000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeAlt_in_rewriteTreeEbnf4606 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTreeEbnf4608 = new BitSet(new long[]{0x0003400000000000L});
public static final BitSet FOLLOW_ebnfSuffix_in_rewriteTreeEbnf4610 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TREE_BEGIN_in_rewriteTree4634 = new BitSet(new long[]{0xC020000000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeAtom_in_rewriteTree4636 = new BitSet(new long[]{0xC420030000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_rewriteTreeElement_in_rewriteTree4638 = new BitSet(new long[]{0xC420030000010000L,0x0000000000000008L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTree4641 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEMPLATE_in_rewriteTemplate4673 = new BitSet(new long[]{0x0000010000000000L});
public static final BitSet FOLLOW_LPAREN_in_rewriteTemplate4675 = new BitSet(new long[]{0xC000020800000000L});
public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplate4677 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTemplate4679 = new BitSet(new long[]{0x0000000000000C00L});
public static final BitSet FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewriteTemplate4687 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewriteTemplate4693 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTemplateRef_in_rewriteTemplate4719 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteIndirectTemplateHead_in_rewriteTemplate4728 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ACTION_in_rewriteTemplate4737 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_id_in_rewriteTemplateRef4750 = new BitSet(new long[]{0x0000010000000000L});
public static final BitSet FOLLOW_LPAREN_in_rewriteTemplateRef4752 = new BitSet(new long[]{0xC000020800000000L});
public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteTemplateRef4754 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteTemplateRef4756 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4785 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_rewriteIndirectTemplateHead4787 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4789 = new BitSet(new long[]{0x0000010000000000L});
public static final BitSet FOLLOW_LPAREN_in_rewriteIndirectTemplateHead4791 = new BitSet(new long[]{0xC000020800000000L});
public static final BitSet FOLLOW_rewriteTemplateArgs_in_rewriteIndirectTemplateHead4793 = new BitSet(new long[]{0x0000020000000000L});
public static final BitSet FOLLOW_RPAREN_in_rewriteIndirectTemplateHead4795 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4820 = new BitSet(new long[]{0x0000004000000002L});
public static final BitSet FOLLOW_COMMA_in_rewriteTemplateArgs4823 = new BitSet(new long[]{0xC000000800000000L});
public static final BitSet FOLLOW_rewriteTemplateArg_in_rewriteTemplateArgs4825 = new BitSet(new long[]{0x0000004000000002L});
public static final BitSet FOLLOW_id_in_rewriteTemplateArg4854 = new BitSet(new long[]{0x0000200000000000L});
public static final BitSet FOLLOW_ASSIGN_in_rewriteTemplateArg4856 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_rewriteTemplateArg4858 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_REF_in_id4887 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TOKEN_REF_in_id4900 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEMPLATE_in_id4912 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_id_in_qid4935 = new BitSet(new long[]{0x0040000000000002L});
public static final BitSet FOLLOW_DOT_in_qid4938 = new BitSet(new long[]{0xC000000800000000L});
public static final BitSet FOLLOW_id_in_qid4940 = new BitSet(new long[]{0x0040000000000002L});
public static final BitSet FOLLOW_alternative_in_alternativeEntry4956 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_alternativeEntry4958 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_element_in_elementEntry4967 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_elementEntry4969 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rule_in_ruleEntry4977 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_ruleEntry4979 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_block_in_blockEntry4987 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_blockEntry4989 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTemplate_in_synpred1_ANTLRParser4308 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rewriteTreeAlt_in_synpred2_ANTLRParser4347 = new BitSet(new long[]{0x0000000000000002L});

View File

@ -1,4 +1,4 @@
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ASTVerifier.g 2010-02-07 17:00:06
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 ASTVerifier.g 2010-02-10 17:19:39
/*
[The "BSD license"]

View File

@ -8,7 +8,8 @@ import org.antlr.v4.tool.*;
}
@members {
public void setQualifiedAttr() { }
public void setQualifiedAttr(Token x, Token y, Token expr) { }
public void qualifiedAttr(Token x, Token y) { }
public void setDynamicScopeAttr() { }
public void dynamicScopeAttr() { }
public void setDynamicNegativeIndexedScopeAttr() { }
@ -24,18 +25,29 @@ public void setAttribute() { }
public void templateExpr() { }
public void unknownSyntax() { }
public void text() { }
public List<Token> getActionChunks() {
List<Token> chunks = new ArrayList<Token>();
Token t = nextToken();
while ( t.getType()!=Token.EOF ) {
chunks.add(t);
t = nextToken();
}
return chunks;
}
}
SET_QUALIFIED_ATTR
: '$' x=ID '.' y=ID WS? '=' expr=ATTR_VALUE_EXPR ';'
{setQualifiedAttr($x, $y, $expr);}
;
QUALIFIED_ATTR
: '$' x=ID '.' y=ID {input.LA(1)!='('}?
: '$' x=ID '.' y=ID {input.LA(1)!='('}? {qualifiedAttr($x, $y);}
;
SET_DYNAMIC_SCOPE_ATTR
: DYNAMIC_SCOPE_ATTR WS? '=' expr=ATTR_VALUE_EXPR ';'
: '$' x=ID '::' y=ID WS? '=' expr=ATTR_VALUE_EXPR ';'
;
DYNAMIC_SCOPE_ATTR
@ -51,7 +63,7 @@ DYNAMIC_SCOPE_ATTR
* $x[0]::y is the absolute 0 indexed element (bottom of the stack)
*/
SET_DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
: DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
: '$' x=ID '[' '-' expr=SCOPE_INDEX_EXPR ']' '::' y=ID
WS? ('=' expr=ATTR_VALUE_EXPR ';')?
;
@ -60,7 +72,7 @@ DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
;
SET_DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
: DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
: '$' x=ID '[' expr=SCOPE_INDEX_EXPR ']' '::' y=ID
WS? ('=' expr=ATTR_VALUE_EXPR ';')?
;

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
INDIRECT_TEMPLATE_INSTANCE=21
DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR=11
DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR=13
SET_DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR=12
SET_ATTRIBUTE=23
TEMPLATE_EXPR=24
@ -9,15 +9,15 @@ QUALIFIED_ATTR=8
ACTION=20
UNKNOWN_SYNTAX=25
SET_QUALIFIED_ATTR=7
SET_DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR=15
SET_DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR=14
WS=5
ARG=18
TEMPLATE_INSTANCE=19
SET_EXPR_ATTRIBUTE=22
ATTR_VALUE_EXPR=6
SET_DYNAMIC_SCOPE_ATTR=10
SCOPE_INDEX_EXPR=13
DYNAMIC_SCOPE_ATTR=9
SET_DYNAMIC_SCOPE_ATTR=9
SCOPE_INDEX_EXPR=11
DYNAMIC_SCOPE_ATTR=10
SET_ATTR=17
ATTR=16
DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR=14
DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR=15

View File

@ -1,5 +1,31 @@
package org.antlr.v4.semantics;
/** Check attribute refs in actions */
public class AttributeChecks {
import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.Token;
import org.antlr.v4.parse.ActionSplitter;
import org.antlr.v4.tool.Grammar;
/** Trigger checks for various kinds of attribute expressions. no side-effects */
public class AttributeChecks extends ActionSplitter {
public Grammar g;
public AttributeChecks(Grammar g, String action) {
super(new ANTLRStringStream(action));
this.g = g;
}
public void setQualifiedAttr(Token x, Token y, Token expr) { }
public void qualifiedAttr(Token x, Token y) {
System.out.println(x+"."+y);
}
public void setDynamicScopeAttr() { }
public void dynamicScopeAttr() { }
public void setDynamicNegativeIndexedScopeAttr() { }
public void dynamicNegativeIndexedScopeAttr() { }
public void setDynamicAbsoluteIndexedScopeAttr() { }
public void dynamicAbsoluteIndexedScopeAttr() { }
public void setAttr() { }
public void attr() { }
public void unknownSyntax() { }
public void text() { }
}

View File

@ -1,4 +1,4 @@
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 BasicSemanticTriggers.g 2010-02-10 12:02:43
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 BasicSemanticTriggers.g 2010-02-10 17:19:41
/*
[The "BSD license"]

View File

@ -92,7 +92,7 @@ public CollectSymbols(TreeNodeStream input, Grammar g) {
topdown
//@init {System.out.println("topdown: "+((Tree)input.LT(1)).getText());}
: globalScope
| action
| globalNamedAction
| tokensSection
| rule
| ruleArg
@ -104,6 +104,9 @@ topdown
| terminal
| labeledElement
| setAlt
| ruleAction
| finallyClause
| exceptionHandler
;
bottomup
@ -114,7 +117,7 @@ globalScope
: {inContext("GRAMMAR")}? ^(SCOPE ID ACTION) {scopes.add($SCOPE);}
;
action
globalNamedAction
: {inContext("GRAMMAR")}? ^(AT ID? ID ACTION)
{actions.add($AT);}
;
@ -148,6 +151,23 @@ finishRule
: RULE {currentRule = null;}
;
rulelNamedAction
: {inContext("RULE")}? ^(AT ID ACTION)
{currentRule.namedActions.put($ID.text,$ACTION);}
;
ruleAction
: {inContext("RULE ...")}? ACTION {currentRule.inlineActions.add($ACTION);}
;
exceptionHandler
: ^(CATCH ARG_ACTION ACTION) {currentRule.inlineActions.add($ACTION);}
;
finallyClause
: ^(FINALLY ACTION) {currentRule.inlineActions.add($ACTION);}
;
ruleArg
: {inContext("RULE")}? ARG_ACTION
{

View File

@ -1,4 +1,4 @@
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 CollectSymbols.g 2010-02-10 12:02:43
// $ANTLR 3.2.1-SNAPSHOT Jan 26, 2010 15:12:28 CollectSymbols.g 2010-02-10 17:19:40
/*
[The "BSD license"]
@ -178,11 +178,11 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "topdown"
// CollectSymbols.g:92:1: topdown : ( globalScope | action | tokensSection | rule | ruleArg | ruleReturns | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt );
// CollectSymbols.g:92:1: topdown : ( globalScope | globalNamedAction | tokensSection | rule | ruleArg | ruleReturns | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt | ruleAction | finallyClause | exceptionHandler );
public final void topdown() throws RecognitionException {
try {
// CollectSymbols.g:94:5: ( globalScope | action | tokensSection | rule | ruleArg | ruleReturns | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt )
int alt1=12;
// CollectSymbols.g:94:5: ( globalScope | globalNamedAction | tokensSection | rule | ruleArg | ruleReturns | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt | ruleAction | finallyClause | exceptionHandler )
int alt1=15;
alt1 = dfa1.predict(input);
switch (alt1) {
case 1 :
@ -197,10 +197,10 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
break;
case 2 :
// CollectSymbols.g:95:7: action
// CollectSymbols.g:95:7: globalNamedAction
{
pushFollow(FOLLOW_action_in_topdown105);
action();
pushFollow(FOLLOW_globalNamedAction_in_topdown105);
globalNamedAction();
state._fsp--;
if (state.failed) return ;
@ -315,6 +315,39 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
state._fsp--;
if (state.failed) return ;
}
break;
case 13 :
// CollectSymbols.g:107:7: ruleAction
{
pushFollow(FOLLOW_ruleAction_in_topdown206);
ruleAction();
state._fsp--;
if (state.failed) return ;
}
break;
case 14 :
// CollectSymbols.g:108:7: finallyClause
{
pushFollow(FOLLOW_finallyClause_in_topdown214);
finallyClause();
state._fsp--;
if (state.failed) return ;
}
break;
case 15 :
// CollectSymbols.g:109:7: exceptionHandler
{
pushFollow(FOLLOW_exceptionHandler_in_topdown222);
exceptionHandler();
state._fsp--;
if (state.failed) return ;
}
break;
@ -332,13 +365,13 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "bottomup"
// CollectSymbols.g:109:1: bottomup : finishRule ;
// CollectSymbols.g:112:1: bottomup : finishRule ;
public final void bottomup() throws RecognitionException {
try {
// CollectSymbols.g:110:2: ( finishRule )
// CollectSymbols.g:110:4: finishRule
// CollectSymbols.g:113:2: ( finishRule )
// CollectSymbols.g:113:4: finishRule
{
pushFollow(FOLLOW_finishRule_in_bottomup209);
pushFollow(FOLLOW_finishRule_in_bottomup233);
finishRule();
state._fsp--;
@ -359,23 +392,23 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "globalScope"
// CollectSymbols.g:113:1: globalScope : {...}? ^( SCOPE ID ACTION ) ;
// CollectSymbols.g:116:1: globalScope : {...}? ^( SCOPE ID ACTION ) ;
public final void globalScope() throws RecognitionException {
GrammarAST SCOPE1=null;
try {
// CollectSymbols.g:114:2: ({...}? ^( SCOPE ID ACTION ) )
// CollectSymbols.g:114:4: {...}? ^( SCOPE ID ACTION )
// CollectSymbols.g:117:2: ({...}? ^( SCOPE ID ACTION ) )
// CollectSymbols.g:117:4: {...}? ^( SCOPE ID ACTION )
{
if ( !((inContext("GRAMMAR"))) ) {
if (state.backtracking>0) {state.failed=true; return ;}
throw new FailedPredicateException(input, "globalScope", "inContext(\"GRAMMAR\")");
}
SCOPE1=(GrammarAST)match(input,SCOPE,FOLLOW_SCOPE_in_globalScope223); if (state.failed) return ;
SCOPE1=(GrammarAST)match(input,SCOPE,FOLLOW_SCOPE_in_globalScope247); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
match(input,ID,FOLLOW_ID_in_globalScope225); if (state.failed) return ;
match(input,ACTION,FOLLOW_ACTION_in_globalScope227); if (state.failed) return ;
match(input,ID,FOLLOW_ID_in_globalScope249); if (state.failed) return ;
match(input,ACTION,FOLLOW_ACTION_in_globalScope251); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
@ -396,23 +429,23 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR end "globalScope"
// $ANTLR start "action"
// CollectSymbols.g:117:1: action : {...}? ^( AT ( ID )? ID ACTION ) ;
public final void action() throws RecognitionException {
// $ANTLR start "globalNamedAction"
// CollectSymbols.g:120:1: globalNamedAction : {...}? ^( AT ( ID )? ID ACTION ) ;
public final void globalNamedAction() throws RecognitionException {
GrammarAST AT2=null;
try {
// CollectSymbols.g:118:2: ({...}? ^( AT ( ID )? ID ACTION ) )
// CollectSymbols.g:118:4: {...}? ^( AT ( ID )? ID ACTION )
// CollectSymbols.g:121:2: ({...}? ^( AT ( ID )? ID ACTION ) )
// CollectSymbols.g:121:4: {...}? ^( AT ( ID )? ID ACTION )
{
if ( !((inContext("GRAMMAR"))) ) {
if (state.backtracking>0) {state.failed=true; return ;}
throw new FailedPredicateException(input, "action", "inContext(\"GRAMMAR\")");
throw new FailedPredicateException(input, "globalNamedAction", "inContext(\"GRAMMAR\")");
}
AT2=(GrammarAST)match(input,AT,FOLLOW_AT_in_action244); if (state.failed) return ;
AT2=(GrammarAST)match(input,AT,FOLLOW_AT_in_globalNamedAction268); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
// CollectSymbols.g:118:33: ( ID )?
// CollectSymbols.g:121:33: ( ID )?
int alt2=2;
int LA2_0 = input.LA(1);
@ -425,17 +458,17 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
switch (alt2) {
case 1 :
// CollectSymbols.g:118:33: ID
// CollectSymbols.g:121:33: ID
{
match(input,ID,FOLLOW_ID_in_action246); if (state.failed) return ;
match(input,ID,FOLLOW_ID_in_globalNamedAction270); if (state.failed) return ;
}
break;
}
match(input,ID,FOLLOW_ID_in_action249); if (state.failed) return ;
match(input,ACTION,FOLLOW_ACTION_in_action251); if (state.failed) return ;
match(input,ID,FOLLOW_ID_in_globalNamedAction273); if (state.failed) return ;
match(input,ACTION,FOLLOW_ACTION_in_globalNamedAction275); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
@ -453,25 +486,25 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
return ;
}
// $ANTLR end "action"
// $ANTLR end "globalNamedAction"
// $ANTLR start "tokensSection"
// CollectSymbols.g:122:1: tokensSection : {...}? ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID ) ;
// CollectSymbols.g:125:1: tokensSection : {...}? ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID ) ;
public final void tokensSection() throws RecognitionException {
GrammarAST t=null;
GrammarAST ASSIGN3=null;
GrammarAST STRING_LITERAL4=null;
try {
// CollectSymbols.g:123:2: ({...}? ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID ) )
// CollectSymbols.g:123:4: {...}? ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID )
// CollectSymbols.g:126:2: ({...}? ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID ) )
// CollectSymbols.g:126:4: {...}? ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID )
{
if ( !((inContext("TOKENS"))) ) {
if (state.backtracking>0) {state.failed=true; return ;}
throw new FailedPredicateException(input, "tokensSection", "inContext(\"TOKENS\")");
}
// CollectSymbols.g:124:3: ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID )
// CollectSymbols.g:127:3: ( ^( ASSIGN t= ID STRING_LITERAL ) | t= ID )
int alt3=2;
int LA3_0 = input.LA(1);
@ -490,13 +523,13 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
switch (alt3) {
case 1 :
// CollectSymbols.g:124:5: ^( ASSIGN t= ID STRING_LITERAL )
// CollectSymbols.g:127:5: ^( ASSIGN t= ID STRING_LITERAL )
{
ASSIGN3=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_tokensSection274); if (state.failed) return ;
ASSIGN3=(GrammarAST)match(input,ASSIGN,FOLLOW_ASSIGN_in_tokensSection298); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
t=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokensSection278); if (state.failed) return ;
STRING_LITERAL4=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_tokensSection280); if (state.failed) return ;
t=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokensSection302); if (state.failed) return ;
STRING_LITERAL4=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_tokensSection304); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
@ -507,9 +540,9 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
break;
case 2 :
// CollectSymbols.g:127:5: t= ID
// CollectSymbols.g:130:5: t= ID
{
t=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokensSection294); if (state.failed) return ;
t=(GrammarAST)match(input,ID,FOLLOW_ID_in_tokensSection318); if (state.failed) return ;
if ( state.backtracking==1 ) {
terminals.add(t); tokenIDRefs.add(t); tokensDefs.add(t);
}
@ -535,20 +568,20 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "rule"
// CollectSymbols.g:132:1: rule : ^( RULE name= ID ( . )+ ) ;
// CollectSymbols.g:135:1: rule : ^( RULE name= ID ( . )+ ) ;
public final void rule() throws RecognitionException {
GrammarAST name=null;
GrammarAST RULE5=null;
try {
// CollectSymbols.g:132:5: ( ^( RULE name= ID ( . )+ ) )
// CollectSymbols.g:132:9: ^( RULE name= ID ( . )+ )
// CollectSymbols.g:135:5: ( ^( RULE name= ID ( . )+ ) )
// CollectSymbols.g:135:9: ^( RULE name= ID ( . )+ )
{
RULE5=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_rule316); if (state.failed) return ;
RULE5=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_rule340); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
name=(GrammarAST)match(input,ID,FOLLOW_ID_in_rule320); if (state.failed) return ;
// CollectSymbols.g:132:25: ( . )+
name=(GrammarAST)match(input,ID,FOLLOW_ID_in_rule344); if (state.failed) return ;
// CollectSymbols.g:135:25: ( . )+
int cnt4=0;
loop4:
do {
@ -565,7 +598,7 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
switch (alt4) {
case 1 :
// CollectSymbols.g:132:25: .
// CollectSymbols.g:135:25: .
{
matchAny(input); if (state.failed) return ;
@ -611,14 +644,14 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
};
// $ANTLR start "setAlt"
// CollectSymbols.g:142:1: setAlt : {...}? ( ALT | ALT_REWRITE ) ;
// CollectSymbols.g:145:1: setAlt : {...}? ( ALT | ALT_REWRITE ) ;
public final CollectSymbols.setAlt_return setAlt() throws RecognitionException {
CollectSymbols.setAlt_return retval = new CollectSymbols.setAlt_return();
retval.start = input.LT(1);
try {
// CollectSymbols.g:143:2: ({...}? ( ALT | ALT_REWRITE ) )
// CollectSymbols.g:143:4: {...}? ( ALT | ALT_REWRITE )
// CollectSymbols.g:146:2: ({...}? ( ALT | ALT_REWRITE ) )
// CollectSymbols.g:146:4: {...}? ( ALT | ALT_REWRITE )
{
if ( !((inContext("RULE BLOCK"))) ) {
if (state.backtracking>0) {state.failed=true; return retval;}
@ -653,13 +686,13 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "finishRule"
// CollectSymbols.g:147:1: finishRule : RULE ;
// CollectSymbols.g:150:1: finishRule : RULE ;
public final void finishRule() throws RecognitionException {
try {
// CollectSymbols.g:148:2: ( RULE )
// CollectSymbols.g:148:4: RULE
// CollectSymbols.g:151:2: ( RULE )
// CollectSymbols.g:151:4: RULE
{
match(input,RULE,FOLLOW_RULE_in_finishRule368); if (state.failed) return ;
match(input,RULE,FOLLOW_RULE_in_finishRule392); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule = null;
}
@ -678,24 +711,162 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR end "finishRule"
// $ANTLR start "ruleArg"
// CollectSymbols.g:151:1: ruleArg : {...}? ARG_ACTION ;
public final void ruleArg() throws RecognitionException {
GrammarAST ARG_ACTION6=null;
// $ANTLR start "rulelNamedAction"
// CollectSymbols.g:154:1: rulelNamedAction : {...}? ^( AT ID ACTION ) ;
public final void rulelNamedAction() throws RecognitionException {
GrammarAST ID6=null;
GrammarAST ACTION7=null;
try {
// CollectSymbols.g:152:2: ({...}? ARG_ACTION )
// CollectSymbols.g:152:4: {...}? ARG_ACTION
// CollectSymbols.g:155:2: ({...}? ^( AT ID ACTION ) )
// CollectSymbols.g:155:4: {...}? ^( AT ID ACTION )
{
if ( !((inContext("RULE"))) ) {
if (state.backtracking>0) {state.failed=true; return ;}
throw new FailedPredicateException(input, "rulelNamedAction", "inContext(\"RULE\")");
}
match(input,AT,FOLLOW_AT_in_rulelNamedAction408); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
ID6=(GrammarAST)match(input,ID,FOLLOW_ID_in_rulelNamedAction410); if (state.failed) return ;
ACTION7=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_rulelNamedAction412); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule.namedActions.put((ID6!=null?ID6.getText():null),ACTION7);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
}
// $ANTLR end "rulelNamedAction"
// $ANTLR start "ruleAction"
// CollectSymbols.g:159:1: ruleAction : {...}? ACTION ;
public final void ruleAction() throws RecognitionException {
GrammarAST ACTION8=null;
try {
// CollectSymbols.g:160:2: ({...}? ACTION )
// CollectSymbols.g:160:4: {...}? ACTION
{
if ( !((inContext("RULE ..."))) ) {
if (state.backtracking>0) {state.failed=true; return ;}
throw new FailedPredicateException(input, "ruleAction", "inContext(\"RULE ...\")");
}
ACTION8=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_ruleAction430); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule.inlineActions.add(ACTION8);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
}
// $ANTLR end "ruleAction"
// $ANTLR start "exceptionHandler"
// CollectSymbols.g:163:1: exceptionHandler : ^( CATCH ARG_ACTION ACTION ) ;
public final void exceptionHandler() throws RecognitionException {
GrammarAST ACTION9=null;
try {
// CollectSymbols.g:164:2: ( ^( CATCH ARG_ACTION ACTION ) )
// CollectSymbols.g:164:4: ^( CATCH ARG_ACTION ACTION )
{
match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler444); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_exceptionHandler446); if (state.failed) return ;
ACTION9=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_exceptionHandler448); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule.inlineActions.add(ACTION9);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
}
// $ANTLR end "exceptionHandler"
// $ANTLR start "finallyClause"
// CollectSymbols.g:167:1: finallyClause : ^( FINALLY ACTION ) ;
public final void finallyClause() throws RecognitionException {
GrammarAST ACTION10=null;
try {
// CollectSymbols.g:168:2: ( ^( FINALLY ACTION ) )
// CollectSymbols.g:168:4: ^( FINALLY ACTION )
{
match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause463); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
ACTION10=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_finallyClause465); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule.inlineActions.add(ACTION10);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
}
// $ANTLR end "finallyClause"
// $ANTLR start "ruleArg"
// CollectSymbols.g:171:1: ruleArg : {...}? ARG_ACTION ;
public final void ruleArg() throws RecognitionException {
GrammarAST ARG_ACTION11=null;
try {
// CollectSymbols.g:172:2: ({...}? ARG_ACTION )
// CollectSymbols.g:172:4: {...}? ARG_ACTION
{
if ( !((inContext("RULE"))) ) {
if (state.backtracking>0) {state.failed=true; return ;}
throw new FailedPredicateException(input, "ruleArg", "inContext(\"RULE\")");
}
ARG_ACTION6=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleArg383); if (state.failed) return ;
ARG_ACTION11=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleArg485); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule.args = ScopeParser.parseTypeList((ARG_ACTION6!=null?ARG_ACTION6.getText():null));
currentRule.args.ast = ARG_ACTION6;
currentRule.args = ScopeParser.parseTypeList((ARG_ACTION11!=null?ARG_ACTION11.getText():null));
currentRule.args.ast = ARG_ACTION11;
}
@ -714,24 +885,24 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "ruleReturns"
// CollectSymbols.g:159:1: ruleReturns : ^( RETURNS ARG_ACTION ) ;
// CollectSymbols.g:179:1: ruleReturns : ^( RETURNS ARG_ACTION ) ;
public final void ruleReturns() throws RecognitionException {
GrammarAST ARG_ACTION7=null;
GrammarAST ARG_ACTION12=null;
try {
// CollectSymbols.g:160:2: ( ^( RETURNS ARG_ACTION ) )
// CollectSymbols.g:160:4: ^( RETURNS ARG_ACTION )
// CollectSymbols.g:180:2: ( ^( RETURNS ARG_ACTION ) )
// CollectSymbols.g:180:4: ^( RETURNS ARG_ACTION )
{
match(input,RETURNS,FOLLOW_RETURNS_in_ruleReturns400); if (state.failed) return ;
match(input,RETURNS,FOLLOW_RETURNS_in_ruleReturns502); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
ARG_ACTION7=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleReturns402); if (state.failed) return ;
ARG_ACTION12=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_ruleReturns504); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule.retvals = ScopeParser.parseTypeList((ARG_ACTION7!=null?ARG_ACTION7.getText():null));
currentRule.retvals.ast = ARG_ACTION7;
currentRule.retvals = ScopeParser.parseTypeList((ARG_ACTION12!=null?ARG_ACTION12.getText():null));
currentRule.retvals.ast = ARG_ACTION12;
}
@ -750,21 +921,21 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "ruleScopeSpec"
// CollectSymbols.g:167:1: ruleScopeSpec : {...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) ;
// CollectSymbols.g:187:1: ruleScopeSpec : {...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) ;
public final void ruleScopeSpec() throws RecognitionException {
GrammarAST ACTION8=null;
GrammarAST ACTION13=null;
GrammarAST ids=null;
List list_ids=null;
try {
// CollectSymbols.g:168:2: ({...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) )
// CollectSymbols.g:168:4: {...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) )
// CollectSymbols.g:188:2: ({...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) ) )
// CollectSymbols.g:188:4: {...}? ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) )
{
if ( !((inContext("RULE"))) ) {
if (state.backtracking>0) {state.failed=true; return ;}
throw new FailedPredicateException(input, "ruleScopeSpec", "inContext(\"RULE\")");
}
// CollectSymbols.g:169:3: ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) )
// CollectSymbols.g:189:3: ( ^( SCOPE ACTION ) | ^( SCOPE (ids+= ID )+ ) )
int alt6=2;
int LA6_0 = input.LA(1);
@ -805,30 +976,30 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
switch (alt6) {
case 1 :
// CollectSymbols.g:169:5: ^( SCOPE ACTION )
// CollectSymbols.g:189:5: ^( SCOPE ACTION )
{
match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec425); if (state.failed) return ;
match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec527); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
ACTION8=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_ruleScopeSpec427); if (state.failed) return ;
ACTION13=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_ruleScopeSpec529); if (state.failed) return ;
match(input, Token.UP, null); if (state.failed) return ;
if ( state.backtracking==1 ) {
currentRule.scope = ScopeParser.parseDynamicScope((ACTION8!=null?ACTION8.getText():null));
currentRule.scope.ast = ACTION8;
currentRule.scope = ScopeParser.parseDynamicScope((ACTION13!=null?ACTION13.getText():null));
currentRule.scope.ast = ACTION13;
}
}
break;
case 2 :
// CollectSymbols.g:174:5: ^( SCOPE (ids+= ID )+ )
// CollectSymbols.g:194:5: ^( SCOPE (ids+= ID )+ )
{
match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec440); if (state.failed) return ;
match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec542); if (state.failed) return ;
match(input, Token.DOWN, null); if (state.failed) return ;
// CollectSymbols.g:174:16: (ids+= ID )+
// CollectSymbols.g:194:16: (ids+= ID )+
int cnt5=0;
loop5:
do {
@ -842,9 +1013,9 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
switch (alt5) {
case 1 :
// CollectSymbols.g:174:16: ids+= ID
// CollectSymbols.g:194:16: ids+= ID
{
ids=(GrammarAST)match(input,ID,FOLLOW_ID_in_ruleScopeSpec444); if (state.failed) return ;
ids=(GrammarAST)match(input,ID,FOLLOW_ID_in_ruleScopeSpec546); if (state.failed) return ;
if (list_ids==null) list_ids=new ArrayList();
list_ids.add(ids);
@ -891,14 +1062,14 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
};
// $ANTLR start "rewriteElement"
// CollectSymbols.g:178:1: rewriteElement : {...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL ) ;
// CollectSymbols.g:198:1: rewriteElement : {...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL ) ;
public final CollectSymbols.rewriteElement_return rewriteElement() throws RecognitionException {
CollectSymbols.rewriteElement_return retval = new CollectSymbols.rewriteElement_return();
retval.start = input.LT(1);
try {
// CollectSymbols.g:180:2: ({...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL ) )
// CollectSymbols.g:181:6: {...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL )
// CollectSymbols.g:200:2: ({...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL ) )
// CollectSymbols.g:201:6: {...}? ( TOKEN_REF | RULE_REF | STRING_LITERAL | LABEL )
{
if ( !((inContext("RESULT ..."))) ) {
if (state.backtracking>0) {state.failed=true; return retval;}
@ -935,7 +1106,7 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
};
// $ANTLR start "labeledElement"
// CollectSymbols.g:185:1: labeledElement : {...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) ;
// CollectSymbols.g:205:1: labeledElement : {...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) ;
public final CollectSymbols.labeledElement_return labeledElement() throws RecognitionException {
CollectSymbols.labeledElement_return retval = new CollectSymbols.labeledElement_return();
retval.start = input.LT(1);
@ -944,14 +1115,14 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
GrammarAST e=null;
try {
// CollectSymbols.g:191:2: ({...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) )
// CollectSymbols.g:191:4: {...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) )
// CollectSymbols.g:211:2: ({...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) ) )
// CollectSymbols.g:211:4: {...}? ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) )
{
if ( !((inContext("RULE ..."))) ) {
if (state.backtracking>0) {state.failed=true; return retval;}
throw new FailedPredicateException(input, "labeledElement", "inContext(\"RULE ...\")");
}
// CollectSymbols.g:192:3: ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) )
// CollectSymbols.g:212:3: ( ^( ASSIGN id= ID e= . ) | ^( PLUS_ASSIGN id= ID e= . ) )
int alt7=2;
int LA7_0 = input.LA(1);
@ -970,12 +1141,12 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
switch (alt7) {
case 1 :
// CollectSymbols.g:192:5: ^( ASSIGN id= ID e= . )
// CollectSymbols.g:212:5: ^( ASSIGN id= ID e= . )
{
match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement508); if (state.failed) return retval;
match(input,ASSIGN,FOLLOW_ASSIGN_in_labeledElement610); if (state.failed) return retval;
match(input, Token.DOWN, null); if (state.failed) return retval;
id=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement512); if (state.failed) return retval;
id=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement614); if (state.failed) return retval;
e=(GrammarAST)input.LT(1);
matchAny(input); if (state.failed) return retval;
@ -984,12 +1155,12 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
break;
case 2 :
// CollectSymbols.g:193:5: ^( PLUS_ASSIGN id= ID e= . )
// CollectSymbols.g:213:5: ^( PLUS_ASSIGN id= ID e= . )
{
match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement524); if (state.failed) return retval;
match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_labeledElement626); if (state.failed) return retval;
match(input, Token.DOWN, null); if (state.failed) return retval;
id=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement528); if (state.failed) return retval;
id=(GrammarAST)match(input,ID,FOLLOW_ID_in_labeledElement630); if (state.failed) return retval;
e=(GrammarAST)input.LT(1);
matchAny(input); if (state.failed) return retval;
@ -1025,16 +1196,16 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
};
// $ANTLR start "terminal"
// CollectSymbols.g:197:1: terminal : ({...}? STRING_LITERAL | TOKEN_REF );
// CollectSymbols.g:217:1: terminal : ({...}? STRING_LITERAL | TOKEN_REF );
public final CollectSymbols.terminal_return terminal() throws RecognitionException {
CollectSymbols.terminal_return retval = new CollectSymbols.terminal_return();
retval.start = input.LT(1);
GrammarAST STRING_LITERAL9=null;
GrammarAST TOKEN_REF10=null;
GrammarAST STRING_LITERAL14=null;
GrammarAST TOKEN_REF15=null;
try {
// CollectSymbols.g:198:5: ({...}? STRING_LITERAL | TOKEN_REF )
// CollectSymbols.g:218:5: ({...}? STRING_LITERAL | TOKEN_REF )
int alt8=2;
int LA8_0 = input.LA(1);
@ -1053,19 +1224,19 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
switch (alt8) {
case 1 :
// CollectSymbols.g:198:7: {...}? STRING_LITERAL
// CollectSymbols.g:218:7: {...}? STRING_LITERAL
{
if ( !((!inContext("TOKENS ASSIGN"))) ) {
if (state.backtracking>0) {state.failed=true; return retval;}
throw new FailedPredicateException(input, "terminal", "!inContext(\"TOKENS ASSIGN\")");
}
STRING_LITERAL9=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal554); if (state.failed) return retval;
STRING_LITERAL14=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_terminal656); if (state.failed) return retval;
if ( state.backtracking==1 ) {
terminals.add(((GrammarAST)retval.start));
strings.add(STRING_LITERAL9);
strings.add(STRING_LITERAL14);
if ( currentRule!=null ) {
currentRule.alt[currentAlt].tokenRefs.map((STRING_LITERAL9!=null?STRING_LITERAL9.getText():null), STRING_LITERAL9);
currentRule.alt[currentAlt].tokenRefs.map((STRING_LITERAL14!=null?STRING_LITERAL14.getText():null), STRING_LITERAL14);
}
}
@ -1073,15 +1244,15 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
}
break;
case 2 :
// CollectSymbols.g:206:7: TOKEN_REF
// CollectSymbols.g:226:7: TOKEN_REF
{
TOKEN_REF10=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal569); if (state.failed) return retval;
TOKEN_REF15=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_terminal671); if (state.failed) return retval;
if ( state.backtracking==1 ) {
terminals.add(TOKEN_REF10);
tokenIDRefs.add(TOKEN_REF10);
terminals.add(TOKEN_REF15);
tokenIDRefs.add(TOKEN_REF15);
if ( currentRule!=null ) {
currentRule.alt[currentAlt].tokenRefs.map((TOKEN_REF10!=null?TOKEN_REF10.getText():null), TOKEN_REF10);
currentRule.alt[currentAlt].tokenRefs.map((TOKEN_REF15!=null?TOKEN_REF15.getText():null), TOKEN_REF15);
}
}
@ -1103,20 +1274,20 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
// $ANTLR start "ruleref"
// CollectSymbols.g:216:1: ruleref : RULE_REF ;
// CollectSymbols.g:236:1: ruleref : RULE_REF ;
public final void ruleref() throws RecognitionException {
GrammarAST RULE_REF11=null;
GrammarAST RULE_REF16=null;
try {
// CollectSymbols.g:218:5: ( RULE_REF )
// CollectSymbols.g:218:7: RULE_REF
// CollectSymbols.g:238:5: ( RULE_REF )
// CollectSymbols.g:238:7: RULE_REF
{
RULE_REF11=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref594); if (state.failed) return ;
RULE_REF16=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_ruleref696); if (state.failed) return ;
if ( state.backtracking==1 ) {
rulerefs.add(RULE_REF11);
rulerefs.add(RULE_REF16);
if ( currentRule!=null ) {
currentRule.alt[currentAlt].ruleRefs.map((RULE_REF11!=null?RULE_REF11.getText():null), RULE_REF11);
currentRule.alt[currentAlt].ruleRefs.map((RULE_REF16!=null?RULE_REF16.getText():null), RULE_REF16);
}
}
@ -1139,27 +1310,28 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
protected DFA1 dfa1 = new DFA1(this);
static final String DFA1_eotS =
"\30\uffff";
"\33\uffff";
static final String DFA1_eofS =
"\30\uffff";
"\33\uffff";
static final String DFA1_minS =
"\1\16\1\2\1\uffff\1\2\4\uffff\3\0\3\uffff\1\20\1\127\2\uffff\1\3"+
"\1\16\1\2\1\uffff\1\2\4\uffff\3\0\6\uffff\1\20\1\127\2\uffff\1\3"+
"\1\uffff\1\4\1\uffff\1\2\1\0";
static final String DFA1_maxS =
"\1\145\1\2\1\uffff\1\2\4\uffff\3\0\3\uffff\2\127\2\uffff\1\127\1"+
"\1\145\1\2\1\uffff\1\2\4\uffff\3\0\6\uffff\2\127\2\uffff\1\127\1"+
"\uffff\1\145\1\uffff\1\3\1\0";
static final String DFA1_acceptS =
"\2\uffff\1\2\1\uffff\1\3\1\4\1\5\1\6\3\uffff\1\11\1\13\1\14\2\uffff"+
"\1\10\1\12\1\uffff\1\7\1\uffff\1\1\2\uffff";
"\2\uffff\1\2\1\uffff\1\3\1\4\1\5\1\6\3\uffff\1\11\1\13\1\14\1\15"+
"\1\16\1\17\2\uffff\1\10\1\12\1\uffff\1\7\1\uffff\1\1\2\uffff";
static final String DFA1_specialS =
"\10\uffff\1\0\1\1\1\3\14\uffff\1\2}>";
"\10\uffff\1\3\1\0\1\1\17\uffff\1\2}>";
static final String[] DFA1_transitionS = {
"\1\6\6\uffff\1\1\11\uffff\1\7\15\uffff\1\3\4\uffff\1\14\10\uffff"+
"\1\2\2\uffff\1\12\1\10\3\uffff\1\11\4\uffff\1\5\13\uffff\1\15"+
"\2\uffff\1\4\5\uffff\1\13\7\uffff\1\15",
"\1\16",
"\1\6\1\uffff\1\16\4\uffff\1\1\11\uffff\1\7\1\uffff\1\20\1\17"+
"\12\uffff\1\3\4\uffff\1\14\10\uffff\1\2\2\uffff\1\12\1\10\3"+
"\uffff\1\11\4\uffff\1\5\13\uffff\1\15\2\uffff\1\4\5\uffff\1"+
"\13\7\uffff\1\15",
"\1\21",
"",
"\1\17",
"\1\22",
"",
"",
"",
@ -1170,15 +1342,18 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
"",
"",
"",
"\1\23\106\uffff\1\22",
"\1\24",
"",
"",
"\1\23\14\uffff\1\25\106\uffff\1\23",
"",
"\77\14\1\26\42\14",
"\1\26\106\uffff\1\25",
"\1\27",
"",
"\1\14\1\27",
"",
"\1\26\14\uffff\1\30\106\uffff\1\26",
"",
"\77\14\1\31\42\14",
"",
"\1\14\1\32",
"\1\uffff"
};
@ -1212,28 +1387,13 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
this.transition = DFA1_transition;
}
public String getDescription() {
return "92:1: topdown : ( globalScope | action | tokensSection | rule | ruleArg | ruleReturns | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt );";
return "92:1: topdown : ( globalScope | globalNamedAction | tokensSection | rule | ruleArg | ruleReturns | ruleScopeSpec | ruleref | rewriteElement | terminal | labeledElement | setAlt | ruleAction | finallyClause | exceptionHandler );";
}
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
TreeNodeStream input = (TreeNodeStream)_input;
int _s = s;
switch ( s ) {
case 0 :
int LA1_8 = input.LA(1);
int index1_8 = input.index();
input.rewind();
s = -1;
if ( (!(((inContext("RESULT ..."))))) ) {s = 16;}
else if ( ((inContext("RESULT ..."))) ) {s = 11;}
input.seek(index1_8);
if ( s>=0 ) return s;
break;
case 1 :
int LA1_9 = input.LA(1);
@ -1242,28 +1402,13 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
s = -1;
if ( ((inContext("RESULT ..."))) ) {s = 11;}
else if ( ((!inContext("TOKENS ASSIGN"))) ) {s = 17;}
else if ( ((!inContext("TOKENS ASSIGN"))) ) {s = 20;}
input.seek(index1_9);
if ( s>=0 ) return s;
break;
case 2 :
int LA1_23 = input.LA(1);
int index1_23 = input.index();
input.rewind();
s = -1;
if ( ((inContext("TOKENS"))) ) {s = 4;}
else if ( ((inContext("RULE ..."))) ) {s = 12;}
input.seek(index1_23);
if ( s>=0 ) return s;
break;
case 3 :
case 1 :
int LA1_10 = input.LA(1);
@ -1272,12 +1417,42 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
s = -1;
if ( ((inContext("RESULT ..."))) ) {s = 11;}
else if ( (true) ) {s = 17;}
else if ( (true) ) {s = 20;}
input.seek(index1_10);
if ( s>=0 ) return s;
break;
case 2 :
int LA1_26 = input.LA(1);
int index1_26 = input.index();
input.rewind();
s = -1;
if ( ((inContext("TOKENS"))) ) {s = 4;}
else if ( ((inContext("RULE ..."))) ) {s = 12;}
input.seek(index1_26);
if ( s>=0 ) return s;
break;
case 3 :
int LA1_8 = input.LA(1);
int index1_8 = input.index();
input.rewind();
s = -1;
if ( (!(((inContext("RESULT ..."))))) ) {s = 19;}
else if ( ((inContext("RESULT ..."))) ) {s = 11;}
input.seek(index1_8);
if ( s>=0 ) return s;
break;
}
if (state.backtracking>0) {state.failed=true; return -1;}
NoViableAltException nvae =
@ -1289,7 +1464,7 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
public static final BitSet FOLLOW_globalScope_in_topdown97 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_action_in_topdown105 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_globalNamedAction_in_topdown105 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_tokensSection_in_topdown113 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_rule_in_topdown121 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleArg_in_topdown129 = new BitSet(new long[]{0x0000000000000002L});
@ -1300,36 +1475,48 @@ public class CollectSymbols extends org.antlr.v4.runtime.tree.TreeFilter {
public static final BitSet FOLLOW_terminal_in_topdown182 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_labeledElement_in_topdown190 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_setAlt_in_topdown198 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_finishRule_in_bottomup209 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SCOPE_in_globalScope223 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_globalScope225 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_globalScope227 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_AT_in_action244 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_action246 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L});
public static final BitSet FOLLOW_ID_in_action249 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_action251 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ASSIGN_in_tokensSection274 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_tokensSection278 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000008L});
public static final BitSet FOLLOW_STRING_LITERAL_in_tokensSection280 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ID_in_tokensSection294 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_in_rule316 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_rule320 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x0000003FFFFFFFFFL});
public static final BitSet FOLLOW_set_in_setAlt344 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_in_finishRule368 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ARG_ACTION_in_ruleArg383 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RETURNS_in_ruleReturns400 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_ruleReturns402 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec425 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ACTION_in_ruleScopeSpec427 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec440 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_ruleScopeSpec444 = new BitSet(new long[]{0x0000000000000008L,0x0000000000800000L});
public static final BitSet FOLLOW_set_in_rewriteElement472 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ASSIGN_in_labeledElement508 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_labeledElement512 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x0000003FFFFFFFFFL});
public static final BitSet FOLLOW_PLUS_ASSIGN_in_labeledElement524 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_labeledElement528 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x0000003FFFFFFFFFL});
public static final BitSet FOLLOW_STRING_LITERAL_in_terminal554 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TOKEN_REF_in_terminal569 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_REF_in_ruleref594 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ruleAction_in_topdown206 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_finallyClause_in_topdown214 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_exceptionHandler_in_topdown222 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_finishRule_in_bottomup233 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SCOPE_in_globalScope247 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_globalScope249 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_globalScope251 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_AT_in_globalNamedAction268 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_globalNamedAction270 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L});
public static final BitSet FOLLOW_ID_in_globalNamedAction273 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_globalNamedAction275 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ASSIGN_in_tokensSection298 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_tokensSection302 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000008L});
public static final BitSet FOLLOW_STRING_LITERAL_in_tokensSection304 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ID_in_tokensSection318 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_in_rule340 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_rule344 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x0000003FFFFFFFFFL});
public static final BitSet FOLLOW_set_in_setAlt368 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_in_finishRule392 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_AT_in_rulelNamedAction408 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_rulelNamedAction410 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_rulelNamedAction412 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ACTION_in_ruleAction430 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_CATCH_in_exceptionHandler444 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_exceptionHandler446 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_ACTION_in_exceptionHandler448 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_FINALLY_in_finallyClause463 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ACTION_in_finallyClause465 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ARG_ACTION_in_ruleArg485 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RETURNS_in_ruleReturns502 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ARG_ACTION_in_ruleReturns504 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec527 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ACTION_in_ruleScopeSpec529 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_SCOPE_in_ruleScopeSpec542 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_ruleScopeSpec546 = new BitSet(new long[]{0x0000000000000008L,0x0000000000800000L});
public static final BitSet FOLLOW_set_in_rewriteElement574 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ASSIGN_in_labeledElement610 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_labeledElement614 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x0000003FFFFFFFFFL});
public static final BitSet FOLLOW_PLUS_ASSIGN_in_labeledElement626 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_labeledElement630 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x0000003FFFFFFFFFL});
public static final BitSet FOLLOW_STRING_LITERAL_in_terminal656 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TOKEN_REF_in_terminal671 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RULE_REF_in_ruleref696 = new BitSet(new long[]{0x0000000000000002L});
}

View File

@ -3,10 +3,11 @@ package org.antlr.v4.semantics;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.tree.BufferedTreeNodeStream;
import org.antlr.v4.parse.ASTVerifier;
import org.antlr.v4.parse.ActionSplitter;
import org.antlr.v4.parse.GrammarASTAdaptor;
import org.antlr.v4.tool.ErrorManager;
import org.antlr.v4.tool.Grammar;
import org.antlr.v4.tool.GrammarAST;
import org.antlr.v4.tool.Rule;
/** */
public class SemanticPipeline {
@ -45,31 +46,26 @@ public class SemanticPipeline {
CollectSymbols collector = new CollectSymbols(nodes,g);
collector.downup(g.ast); // no side-effects; compute lists
// DEFINE RULES, ACTIONS
// DefineSymbols def = new DefineSymbols(g, collector);
// def.define(); // updates g
// CHECK FOR SYMBOL COLLISIONS
SymbolChecks symcheck = new SymbolChecks(g, collector);
symcheck.examine();
// ASSIGN TOKEN TYPES
// CHECK ATTRIBUTE EXPRESSIONS FOR SEMANTIC VALIDITY
checkAttributeExpressions(g, collector);
/* dump options
TreeVisitor v = new TreeVisitor(adaptor);
v.visit(g.ast,
new TreeVisitorAction() {
public Object pre(Object t) {
if ( t instanceof GrammarASTWithOptions ) {
GrammarASTWithOptions gt = (GrammarASTWithOptions)t;
if ( gt.getOptions()!=null ) {
System.out.println("options @ "+gt.toStringTree()+"="+gt.getOptions());
}
}
return t;
}
public Object post(Object t) { return t; }
});
*/
// ASSIGN TOKEN TYPES
}
public void checkAttributeExpressions(Grammar g, CollectSymbols collector) {
for (Rule r : collector.rules) {
for (GrammarAST a : r.namedActions.values()) {
AttributeChecks extractor = new AttributeChecks(g, a.getText());
extractor.getActionChunks(); // forces eval, fills extractor
}
for (GrammarAST a : r.inlineActions) {
AttributeChecks extractor = new AttributeChecks(g, a.getText());
extractor.getActionChunks(); // forces eval, fills extractor
}
}
}
}

View File

@ -3,7 +3,10 @@ package org.antlr.v4.tool;
import org.antlr.runtime.Token;
import org.stringtemplate.v4.misc.MultiMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Rule {
public String name;
@ -14,6 +17,22 @@ public class Rule {
/** A list of scope names used by this rule */
public List<Token> useScopes;
/** Map a name to an action for this rule like @init {...}.
* The code generator will use this to fill holes in the rule template.
* I track the AST node for the action in case I need the line number
* for errors.
*/
public Map<String, GrammarAST> namedActions =
new HashMap<String, GrammarAST>();
/** Track all executable actions other than named actions like @init
* including catch/finally so we can sniff attribute expressions.
* Also tracks exception handlers, predicates, and rewrite rewrites.
* We need to examine these actions before code generation so
* that we can detect refs to $rule.attr etc...
*/
public List<GrammarAST> inlineActions = new ArrayList<GrammarAST>();
public int numberOfAlts;
/** Labels are visible to all alts in a rule. Record all defs here.

View File

@ -5,7 +5,6 @@ import org.antlr.runtime.Token;
import org.antlr.v4.parse.ActionSplitter;
import org.junit.Test;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
@ -21,12 +20,12 @@ public class TestActionSplitter extends BaseTest {
"$ID.text = \"test\";", "['$ID.text = \"test\";'<7>]",
"$a.line == $b.line", "['$a.line'<8>, ' == '<26>, '$b.line'<8>]",
"$r.tree", "['$r.tree'<8>]",
"foo $a::n bar", "['foo '<26>, '$a::n'<9>, ' bar'<26>]",
"foo $a::n bar", "['foo '<26>, '$a::n'<10>, ' bar'<26>]",
"$Symbols[-1]::names.add($id.text);", "['$Symbols[-1]::names'<12>, '.add('<26>, '$id.text'<8>, ');'<26>]",
"$Symbols[0]::names.add($id.text);", "['$Symbols[0]::names'<15>, '.add('<26>, '$id.text'<8>, ');'<26>]",
"$Symbols::x;", "['$Symbols::x'<9>, ';'<26>]",
"$Symbols[0]::names.add($id.text);", "['$Symbols[0]::names'<14>, '.add('<26>, '$id.text'<8>, ');'<26>]",
"$Symbols::x;", "['$Symbols::x'<10>, ';'<26>]",
"$Symbols.size()>0", "['$Symbols'<16>, '.size()>0'<26>]",
"$field::x = $field.st;", "['$field::x = $field.st;'<10>]",
"$field::x = $field.st;", "['$field::x = $field.st;'<9>]",
"$foo.get(\"ick\");", "['$foo'<16>, '.get(\"ick\");'<26>]",
};