[antlr3] 02/04: Replaced the HashSets with LinkedHashSets in DefineGrammarItemsWalker to make the generated parsers reproducible

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Thu Oct 1 12:25:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository antlr3.

commit 7da3368bc4675ea593dfae7d3ab43fc41f41f4e6
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Mon Sep 7 15:19:10 2015 +0200

    Replaced the HashSets with LinkedHashSets in DefineGrammarItemsWalker to make the generated parsers reproducible
---
 debian/changelog                                   |   2 +
 .../antlr3/org/antlr/grammar/v3/ANTLRLexer.java    |   2 +-
 .../antlr3/org/antlr/grammar/v3/ANTLRParser.java   |  22 +-
 .../org/antlr/grammar/v3/ANTLRTreePrinter.java     |   2 +-
 .../antlr3/org/antlr/grammar/v3/ANTLRv3Lexer.java  |   2 +-
 .../antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java |  70 +--
 .../antlr3/org/antlr/grammar/v3/ANTLRv3Tree.java   |   2 +-
 .../org/antlr/grammar/v3/ActionAnalysis.java       |   2 +-
 .../org/antlr/grammar/v3/ActionTranslator.java     |   2 +-
 .../antlr/grammar/v3/AssignTokenTypesWalker.java   |   2 +-
 .../org/antlr/grammar/v3/CodeGenTreeWalker.java    |   2 +-
 .../antlr/grammar/v3/DefineGrammarItemsWalker.java | 521 +++++++++++----------
 .../antlr/grammar/v3/LeftRecursiveRuleWalker.java  |   2 +-
 .../org/antlr/grammar/v3/TreeToNFAConverter.java   |   2 +-
 debian/patches/05-reproducible-parsers.patch       |  42 ++
 debian/patches/series                              |   1 +
 16 files changed, 362 insertions(+), 316 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 08eb2b0..9c01e11 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ antlr3 (3.5.2-3) UNRELEASED; urgency=medium
 
   * Team upload.
   * Declare that ANTLR 3.5 breaks jython (<< 2.5.3-7~)
+  * Replaced the HashSets with LinkedHashSets in DefineGrammarItemsWalker
+    to make the generated parsers reproducible
   * d/README.source: Updated the instructions to build the generated sources
 
  -- Emmanuel Bourg <ebourg at apache.org>  Thu, 03 Sep 2015 12:36:24 +0200
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRLexer.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRLexer.java
index fa7ffb8..df8e5b5 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRLexer.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRLexer.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ANTLR.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/ANTLR.g 2015-09-07 14:14:34
 
 package org.antlr.grammar.v3;
 import org.antlr.tool.ErrorManager;
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRParser.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRParser.java
index 9d0447e..a86a50e 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRParser.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRParser.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ANTLR.g 2015-07-21 19:37:09
+// $ANTLR 3.5 org/antlr/grammar/v3/ANTLR.g 2015-09-07 14:14:34
 
 package org.antlr.grammar.v3;
 import org.antlr.tool.ErrorManager;
@@ -678,7 +678,7 @@ public class ANTLRParser extends Parser {
 			if ( state.backtracking==0 ) stream_EOF.add(EOF4);
 
 			// AST REWRITE
-			// elements: optionsSpec, gid, a, ts, gr, r, scopes, cmt, ig
+			// elements: ts, a, gr, ig, scopes, gid, cmt, optionsSpec, r
 			// token labels: cmt
 			// rule labels: a, r, gid, gr, scopes, ig, retval, ts
 			// token list labels: 
@@ -2659,8 +2659,8 @@ public class ANTLRParser extends Parser {
 			}
 
 			// AST REWRITE
-			// elements: optionsSpec, rt, ruleActions, scopes, p2, throwsSpec, p1, p4, p3, ruleAltList, ex, ruleName, aa
-			// token labels: aa, p1, rt, p2, p3, p4
+			// elements: p2, p1, ruleAltList, p3, scopes, optionsSpec, throwsSpec, ruleActions, ruleName, rt, ex, p4, aa
+			// token labels: aa, p1, p2, rt, p3, p4
 			// rule labels: ex, ruleName, scopes, retval
 			// token list labels: 
 			// rule list labels: 
@@ -2669,8 +2669,8 @@ public class ANTLRParser extends Parser {
 			retval.tree = root_0;
 			RewriteRuleTokenStream stream_aa=new RewriteRuleTokenStream(adaptor,"token aa",aa);
 			RewriteRuleTokenStream stream_p1=new RewriteRuleTokenStream(adaptor,"token p1",p1);
-			RewriteRuleTokenStream stream_rt=new RewriteRuleTokenStream(adaptor,"token rt",rt);
 			RewriteRuleTokenStream stream_p2=new RewriteRuleTokenStream(adaptor,"token p2",p2);
+			RewriteRuleTokenStream stream_rt=new RewriteRuleTokenStream(adaptor,"token rt",rt);
 			RewriteRuleTokenStream stream_p3=new RewriteRuleTokenStream(adaptor,"token p3",p3);
 			RewriteRuleTokenStream stream_p4=new RewriteRuleTokenStream(adaptor,"token p4",p4);
 			RewriteRuleSubtreeStream stream_ex=new RewriteRuleSubtreeStream(adaptor,"rule ex",ex!=null?ex.getTree():null);
@@ -3153,7 +3153,7 @@ public class ANTLRParser extends Parser {
 			}
 
 			// AST REWRITE
-			// elements: idList, ACTION, ruleActions
+			// elements: idList, ruleActions, ACTION
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -3299,7 +3299,7 @@ public class ANTLRParser extends Parser {
 			if ( state.backtracking==0 ) stream_rewrite.add(r1.getTree());
 			if ( state.backtracking==0 ) {if (LA(1)==OR||(LA(2)==QUESTION||LA(2)==PLUS||LA(2)==STAR)) prefixWithSynPred((a1!=null?((GrammarAST)a1.getTree()):null));}
 			// AST REWRITE
-			// elements: a1, r1
+			// elements: r1, a1
 			// token labels: 
 			// rule labels: a1, retval, r1
 			// token list labels: 
@@ -3379,7 +3379,7 @@ public class ANTLRParser extends Parser {
 							if ( state.backtracking==0 ) stream_rewrite.add(r2.getTree());
 							if ( state.backtracking==0 ) {if (LA(1)==OR||(LA(2)==QUESTION||LA(2)==PLUS||LA(2)==STAR)) prefixWithSynPred((a2!=null?((GrammarAST)a2.getTree()):null));}
 							// AST REWRITE
-							// elements: a2, r2, ruleAltList
+							// elements: r2, ruleAltList, a2
 							// token labels: 
 							// rule labels: r2, a2, retval
 							// token list labels: 
@@ -3695,7 +3695,7 @@ public class ANTLRParser extends Parser {
 			if ( state.backtracking==0 ) stream_RPAREN.add(rp);
 
 			// AST REWRITE
-			// elements: alternative, block, ruleActions, ACTION, optionsSpec
+			// elements: ruleActions, ACTION, alternative, block, optionsSpec
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -7977,7 +7977,7 @@ public class ANTLRParser extends Parser {
 					if (state.failed) return retval;
 					if ( state.backtracking==0 ) stream_rewrite_alternative.add(rewrite_alternative166.getTree());
 					// AST REWRITE
-					// elements: rewrite_alternative, rewrite_with_sempred, REWRITE
+					// elements: rewrite_with_sempred, REWRITE, rewrite_alternative
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -9817,7 +9817,7 @@ public class ANTLRParser extends Parser {
 			if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN205);
 
 			// AST REWRITE
-			// elements: rewrite_template_args, ACTION
+			// elements: ACTION, rewrite_template_args
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRTreePrinter.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRTreePrinter.java
index 3cf372a..fc508d5 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRTreePrinter.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRTreePrinter.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRTreePrinter.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRTreePrinter.g 2015-09-07 14:14:34
 
 package org.antlr.grammar.v3;
 import org.antlr.tool.*;
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Lexer.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Lexer.java
index f56c447..57c7c69 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Lexer.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Lexer.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRv3.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRv3.g 2015-09-07 14:14:35
 
     package org.antlr.grammar.v3;
 
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java
index 390c2aa..f60baec 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRv3.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRv3.g 2015-09-07 14:14:35
 
     package org.antlr.grammar.v3;
 
@@ -431,7 +431,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_EOF.add(EOF12);
 
 			// AST REWRITE
-			// elements: tokensSpec, action, optionsSpec, rule, attrScope, id, DOC_COMMENT
+			// elements: action, tokensSpec, id, rule, optionsSpec, attrScope, DOC_COMMENT
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -866,7 +866,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_ACTION.add(ACTION21);
 
 			// AST REWRITE
-			// elements: ACTION, SCOPE, id
+			// elements: ACTION, id, SCOPE
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -1005,7 +1005,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_ACTION.add(ACTION26);
 
 			// AST REWRITE
-			// elements: ACTION, id, actionScopeName, AT
+			// elements: AT, actionScopeName, ACTION, id
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -1377,7 +1377,7 @@ public class ANTLRv3Parser extends Parser {
 			if (state.failed) return retval;
 			if ( state.backtracking==0 ) stream_optionValue.add(optionValue34.getTree());
 			// AST REWRITE
-			// elements: optionValue, id, LABEL_ASSIGN
+			// elements: LABEL_ASSIGN, id, optionValue
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -1944,7 +1944,7 @@ public class ANTLRv3Parser extends Parser {
 			}
 
 			// AST REWRITE
-			// elements: exceptionGroup, RET, id, rt, ruleScopeSpec, altList, arg, throwsSpec, optionsSpec, ruleAction
+			// elements: id, arg, RET, optionsSpec, ruleScopeSpec, altList, rt, ruleAction, exceptionGroup, throwsSpec
 			// token labels: rt, arg
 			// rule labels: retval
 			// token list labels: 
@@ -2097,7 +2097,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_ACTION.add(ACTION53);
 
 			// AST REWRITE
-			// elements: AT, id, ACTION
+			// elements: id, AT, ACTION
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -2385,7 +2385,7 @@ public class ANTLRv3Parser extends Parser {
 					if ( state.backtracking==0 ) stream_ACTION.add(ACTION59);
 
 					// AST REWRITE
-					// elements: ACTION, SCOPE
+					// elements: SCOPE, ACTION
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -2544,7 +2544,7 @@ public class ANTLRv3Parser extends Parser {
 					if ( state.backtracking==0 ) stream_76.add(char_literal71);
 
 					// AST REWRITE
-					// elements: ACTION, SCOPE, id
+					// elements: SCOPE, ACTION, id
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -2720,7 +2720,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_69.add(rp);
 
 			// AST REWRITE
-			// elements: optionsSpec, altpair
+			// elements: altpair, optionsSpec
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -3314,7 +3314,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_ACTION.add(ACTION87);
 
 			// AST REWRITE
-			// elements: ACTION, 81, ARG_ACTION
+			// elements: 81, ACTION, ARG_ACTION
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -3799,7 +3799,7 @@ public class ANTLRv3Parser extends Parser {
 							if (state.failed) return retval;
 							if ( state.backtracking==0 ) stream_ebnfSuffix.add(ebnfSuffix92.getTree());
 							// AST REWRITE
-							// elements: atom, ebnfSuffix, id, labelOp
+							// elements: id, atom, labelOp, ebnfSuffix
 							// token labels: labelOp
 							// rule labels: retval
 							// token list labels: 
@@ -3857,7 +3857,7 @@ public class ANTLRv3Parser extends Parser {
 							// org/antlr/grammar/v3/ANTLRv3.g:237:8: 
 							{
 							// AST REWRITE
-							// elements: id, atom, labelOp
+							// elements: id, labelOp, atom
 							// token labels: labelOp
 							// rule labels: retval
 							// token list labels: 
@@ -3970,7 +3970,7 @@ public class ANTLRv3Parser extends Parser {
 							if (state.failed) return retval;
 							if ( state.backtracking==0 ) stream_ebnfSuffix.add(ebnfSuffix95.getTree());
 							// AST REWRITE
-							// elements: labelOp, block, ebnfSuffix, id
+							// elements: id, block, labelOp, ebnfSuffix
 							// token labels: labelOp
 							// rule labels: retval
 							// token list labels: 
@@ -4028,7 +4028,7 @@ public class ANTLRv3Parser extends Parser {
 							// org/antlr/grammar/v3/ANTLRv3.g:241:8: 
 							{
 							// AST REWRITE
-							// elements: labelOp, block, id
+							// elements: id, block, labelOp
 							// token labels: labelOp
 							// rule labels: retval
 							// token list labels: 
@@ -4099,7 +4099,7 @@ public class ANTLRv3Parser extends Parser {
 							if (state.failed) return retval;
 							if ( state.backtracking==0 ) stream_ebnfSuffix.add(ebnfSuffix97.getTree());
 							// AST REWRITE
-							// elements: ebnfSuffix, atom
+							// elements: atom, ebnfSuffix
 							// token labels: 
 							// rule labels: retval
 							// token list labels: 
@@ -4586,7 +4586,7 @@ public class ANTLRv3Parser extends Parser {
 							}
 
 							// AST REWRITE
-							// elements: range, op
+							// elements: op, range
 							// token labels: op
 							// rule labels: retval
 							// token list labels: 
@@ -4714,7 +4714,7 @@ public class ANTLRv3Parser extends Parser {
 							}
 
 							// AST REWRITE
-							// elements: notSet, op
+							// elements: op, notSet
 							// token labels: op
 							// rule labels: retval
 							// token list labels: 
@@ -4858,7 +4858,7 @@ public class ANTLRv3Parser extends Parser {
 							}
 
 							// AST REWRITE
-							// elements: RULE_REF, op, ARG_ACTION
+							// elements: RULE_REF, ARG_ACTION, op
 							// token labels: op
 							// rule labels: retval
 							// token list labels: 
@@ -5040,7 +5040,7 @@ public class ANTLRv3Parser extends Parser {
 					}
 
 					// AST REWRITE
-					// elements: 93, notTerminal, elementOptions
+					// elements: elementOptions, notTerminal, 93
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -5104,7 +5104,7 @@ public class ANTLRv3Parser extends Parser {
 					}
 
 					// AST REWRITE
-					// elements: block, 93, elementOptions
+					// elements: elementOptions, block, 93
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -5527,7 +5527,7 @@ public class ANTLRv3Parser extends Parser {
 			if (state.failed) return retval;
 			if ( state.backtracking==0 ) stream_optionValue.add(optionValue124.getTree());
 			// AST REWRITE
-			// elements: id, optionValue, LABEL_ASSIGN
+			// elements: LABEL_ASSIGN, optionValue, id
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -5767,7 +5767,7 @@ public class ANTLRv3Parser extends Parser {
 			}
 
 			// AST REWRITE
-			// elements: c1, c2, elementOptions
+			// elements: elementOptions, c1, c2
 			// token labels: c1, c2
 			// rule labels: retval
 			// token list labels: 
@@ -6008,7 +6008,7 @@ public class ANTLRv3Parser extends Parser {
 					}
 
 					// AST REWRITE
-					// elements: TOKEN_REF, elementOptions, ARG_ACTION
+					// elements: TOKEN_REF, ARG_ACTION, elementOptions
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -6075,7 +6075,7 @@ public class ANTLRv3Parser extends Parser {
 					}
 
 					// AST REWRITE
-					// elements: STRING_LITERAL, elementOptions
+					// elements: elementOptions, STRING_LITERAL
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -6190,7 +6190,7 @@ public class ANTLRv3Parser extends Parser {
 					if ( state.backtracking==0 ) stream_ROOT.add(char_literal140);
 
 					// AST REWRITE
-					// elements: ROOT, terminal
+					// elements: terminal, ROOT
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -6226,7 +6226,7 @@ public class ANTLRv3Parser extends Parser {
 					if ( state.backtracking==0 ) stream_BANG.add(char_literal141);
 
 					// AST REWRITE
-					// elements: BANG, terminal
+					// elements: terminal, BANG
 					// token labels: 
 					// rule labels: retval
 					// token list labels: 
@@ -6842,7 +6842,7 @@ public class ANTLRv3Parser extends Parser {
 					if (state.failed) return retval;
 					if ( state.backtracking==0 ) stream_rewrite_alternative.add(last.getTree());
 					// AST REWRITE
-					// elements: rew, preds, predicated, last, rew2
+					// elements: predicated, preds, rew, rew2, last
 					// token labels: rew2
 					// rule labels: last, retval
 					// token list labels: rew, preds
@@ -6860,7 +6860,7 @@ public class ANTLRv3Parser extends Parser {
 					// 357:9: -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last)
 					{
 						// org/antlr/grammar/v3/ANTLRv3.g:357:12: ( ^( $rew $preds $predicated) )*
-						while ( stream_rew.hasNext()||stream_preds.hasNext()||stream_predicated.hasNext() ) {
+						while ( stream_predicated.hasNext()||stream_preds.hasNext()||stream_rew.hasNext() ) {
 							// org/antlr/grammar/v3/ANTLRv3.g:357:12: ^( $rew $preds $predicated)
 							{
 							CommonTree root_1 = (CommonTree)adaptor.nil();
@@ -6871,9 +6871,9 @@ public class ANTLRv3Parser extends Parser {
 							}
 
 						}
-						stream_rew.reset();
-						stream_preds.reset();
 						stream_predicated.reset();
+						stream_preds.reset();
+						stream_rew.reset();
 
 						// org/antlr/grammar/v3/ANTLRv3.g:357:40: ^( $rew2 $last)
 						{
@@ -7956,7 +7956,7 @@ public class ANTLRv3Parser extends Parser {
 							if (state.failed) return retval;
 							if ( state.backtracking==0 ) stream_ebnfSuffix.add(ebnfSuffix156.getTree());
 							// AST REWRITE
-							// elements: ebnfSuffix, rewrite_tree
+							// elements: rewrite_tree, ebnfSuffix
 							// token labels: 
 							// rule labels: retval
 							// token list labels: 
@@ -8773,7 +8773,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_69.add(char_literal179);
 
 			// AST REWRITE
-			// elements: id, rewrite_template_args
+			// elements: rewrite_template_args, id
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -8880,7 +8880,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_69.add(char_literal184);
 
 			// AST REWRITE
-			// elements: ACTION, rewrite_template_args
+			// elements: rewrite_template_args, ACTION
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
@@ -9135,7 +9135,7 @@ public class ANTLRv3Parser extends Parser {
 			if ( state.backtracking==0 ) stream_ACTION.add(ACTION190);
 
 			// AST REWRITE
-			// elements: ACTION, id
+			// elements: id, ACTION
 			// token labels: 
 			// rule labels: retval
 			// token list labels: 
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Tree.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Tree.java
index 6ce1368..f3afe27 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Tree.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ANTLRv3Tree.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRv3Tree.g 2015-07-21 19:37:11
+// $ANTLR 3.5 org/antlr/grammar/v3/ANTLRv3Tree.g 2015-09-07 14:14:36
 
 package org.antlr.grammar.v3;
 
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionAnalysis.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionAnalysis.java
index 441612e..dac0505 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionAnalysis.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionAnalysis.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ActionAnalysis.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/ActionAnalysis.g 2015-09-07 14:14:35
 
 package org.antlr.grammar.v3;
 import org.antlr.runtime.*;
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionTranslator.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionTranslator.java
index 33508a4..8147a30 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionTranslator.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/ActionTranslator.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/ActionTranslator.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/ActionTranslator.g 2015-09-07 14:14:35
 
 package org.antlr.grammar.v3;
 import org.stringtemplate.v4.ST;
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/AssignTokenTypesWalker.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/AssignTokenTypesWalker.java
index 4ed7295..b7097a5 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/AssignTokenTypesWalker.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/AssignTokenTypesWalker.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/AssignTokenTypesWalker.g 2015-07-21 19:37:11
+// $ANTLR 3.5 org/antlr/grammar/v3/AssignTokenTypesWalker.g 2015-09-07 14:14:36
 
 package org.antlr.grammar.v3;
 
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/CodeGenTreeWalker.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/CodeGenTreeWalker.java
index ebd1cec..5f5f4bd 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/CodeGenTreeWalker.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/CodeGenTreeWalker.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/CodeGenTreeWalker.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/CodeGenTreeWalker.g 2015-09-07 14:14:35
 
 package org.antlr.grammar.v3;
 
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.java
index d192070..ba46aa0 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.java
@@ -1,8 +1,9 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/DefineGrammarItemsWalker.g 2015-07-21 19:37:11
+// $ANTLR 3.5 org/antlr/grammar/v3/DefineGrammarItemsWalker.g 2015-09-07 14:14:35
 
 package org.antlr.grammar.v3;
 import org.antlr.tool.*;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Set;
 
 
@@ -221,7 +222,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "grammar_"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:109:1: public grammar_[Grammar g] : ( ^( LEXER_GRAMMAR grammarSpec ) | ^( PARSER_GRAMMAR grammarSpec ) | ^( TREE_GRAMMAR grammarSpec ) | ^( COMBINED_GRAMMAR grammarSpec ) );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:110:1: public grammar_[Grammar g] : ( ^( LEXER_GRAMMAR grammarSpec ) | ^( PARSER_GRAMMAR grammarSpec ) | ^( TREE_GRAMMAR grammarSpec ) | ^( COMBINED_GRAMMAR grammarSpec ) );
 	public final DefineGrammarItemsWalker.grammar__return grammar_(Grammar g) throws RecognitionException {
 		DefineGrammarItemsWalker.grammar__return retval = new DefineGrammarItemsWalker.grammar__return();
 		retval.start = input.LT(1);
@@ -231,7 +232,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 		root = ((GrammarAST)retval.start);
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:119:2: ( ^( LEXER_GRAMMAR grammarSpec ) | ^( PARSER_GRAMMAR grammarSpec ) | ^( TREE_GRAMMAR grammarSpec ) | ^( COMBINED_GRAMMAR grammarSpec ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:120:2: ( ^( LEXER_GRAMMAR grammarSpec ) | ^( PARSER_GRAMMAR grammarSpec ) | ^( TREE_GRAMMAR grammarSpec ) | ^( COMBINED_GRAMMAR grammarSpec ) )
 			int alt1=4;
 			switch ( input.LA(1) ) {
 			case LEXER_GRAMMAR:
@@ -262,7 +263,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt1) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:119:4: ^( LEXER_GRAMMAR grammarSpec )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:120:4: ^( LEXER_GRAMMAR grammarSpec )
 					{
 					match(input,LEXER_GRAMMAR,FOLLOW_LEXER_GRAMMAR_in_grammar_76); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {grammar.type = Grammar.LEXER;}
@@ -276,7 +277,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:120:4: ^( PARSER_GRAMMAR grammarSpec )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:121:4: ^( PARSER_GRAMMAR grammarSpec )
 					{
 					match(input,PARSER_GRAMMAR,FOLLOW_PARSER_GRAMMAR_in_grammar_91); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {grammar.type = Grammar.PARSER;}
@@ -290,7 +291,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:121:4: ^( TREE_GRAMMAR grammarSpec )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:122:4: ^( TREE_GRAMMAR grammarSpec )
 					{
 					match(input,TREE_GRAMMAR,FOLLOW_TREE_GRAMMAR_in_grammar_105); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {grammar.type = Grammar.TREE_PARSER;}
@@ -304,7 +305,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 4 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:122:4: ^( COMBINED_GRAMMAR grammarSpec )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:123:4: ^( COMBINED_GRAMMAR grammarSpec )
 					{
 					match(input,COMBINED_GRAMMAR,FOLLOW_COMBINED_GRAMMAR_in_grammar_119); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {grammar.type = Grammar.COMBINED;}
@@ -337,7 +338,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "attrScope"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:125:1: attrScope : ^( 'scope' name= ID ( attrScopeAction )* attrs= ACTION ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:126:1: attrScope : ^( 'scope' name= ID ( attrScopeAction )* attrs= ACTION ) ;
 	public final void attrScope() throws RecognitionException {
 		AttributeScopeActions_stack.push(new AttributeScopeActions_scope());
 
@@ -348,13 +349,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			AttributeScopeActions_stack.peek().actions = new HashMap<GrammarAST, GrammarAST>();
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:131:2: ( ^( 'scope' name= ID ( attrScopeAction )* attrs= ACTION ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:131:4: ^( 'scope' name= ID ( attrScopeAction )* attrs= ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:132:2: ( ^( 'scope' name= ID ( attrScopeAction )* attrs= ACTION ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:132:4: ^( 'scope' name= ID ( attrScopeAction )* attrs= ACTION )
 			{
 			match(input,SCOPE,FOLLOW_SCOPE_in_attrScope149); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
 			name=(GrammarAST)match(input,ID,FOLLOW_ID_in_attrScope153); if (state.failed) return;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:131:23: ( attrScopeAction )*
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:132:23: ( attrScopeAction )*
 			loop2:
 			while (true) {
 				int alt2=2;
@@ -365,7 +366,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt2) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:131:23: attrScopeAction
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:132:23: attrScopeAction
 					{
 					pushFollow(FOLLOW_attrScopeAction_in_attrScope155);
 					attrScopeAction();
@@ -407,14 +408,14 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "attrScopeAction"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:141:1: attrScopeAction : ^( AMPERSAND ID ACTION ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:142:1: attrScopeAction : ^( AMPERSAND ID ACTION ) ;
 	public final void attrScopeAction() throws RecognitionException {
 		GrammarAST ID1=null;
 		GrammarAST ACTION2=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:142:2: ( ^( AMPERSAND ID ACTION ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:142:4: ^( AMPERSAND ID ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:143:2: ( ^( AMPERSAND ID ACTION ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:143:4: ^( AMPERSAND ID ACTION )
 			{
 			match(input,AMPERSAND,FOLLOW_AMPERSAND_in_attrScopeAction178); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
@@ -441,17 +442,17 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "grammarSpec"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:148:1: grammarSpec : id= ID (cmt= DOC_COMMENT )? ( optionsSpec )? ( delegateGrammars )? ( tokensSpec )? ( attrScope )* ( actions )? rules ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:149:1: grammarSpec : id= ID (cmt= DOC_COMMENT )? ( optionsSpec )? ( delegateGrammars )? ( tokensSpec )? ( attrScope )* ( actions )? rules ;
 	public final void grammarSpec() throws RecognitionException {
 		GrammarAST id=null;
 		GrammarAST cmt=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:149:2: (id= ID (cmt= DOC_COMMENT )? ( optionsSpec )? ( delegateGrammars )? ( tokensSpec )? ( attrScope )* ( actions )? rules )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:149:4: id= ID (cmt= DOC_COMMENT )? ( optionsSpec )? ( delegateGrammars )? ( tokensSpec )? ( attrScope )* ( actions )? rules
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:150:2: (id= ID (cmt= DOC_COMMENT )? ( optionsSpec )? ( delegateGrammars )? ( tokensSpec )? ( attrScope )* ( actions )? rules )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:150:4: id= ID (cmt= DOC_COMMENT )? ( optionsSpec )? ( delegateGrammars )? ( tokensSpec )? ( attrScope )* ( actions )? rules
 			{
 			id=(GrammarAST)match(input,ID,FOLLOW_ID_in_grammarSpec200); if (state.failed) return;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:150:3: (cmt= DOC_COMMENT )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:151:3: (cmt= DOC_COMMENT )?
 			int alt3=2;
 			int LA3_0 = input.LA(1);
 			if ( (LA3_0==DOC_COMMENT) ) {
@@ -459,7 +460,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt3) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:150:4: cmt= DOC_COMMENT
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:151:4: cmt= DOC_COMMENT
 					{
 					cmt=(GrammarAST)match(input,DOC_COMMENT,FOLLOW_DOC_COMMENT_in_grammarSpec207); if (state.failed) return;
 					}
@@ -467,7 +468,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:151:3: ( optionsSpec )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:152:3: ( optionsSpec )?
 			int alt4=2;
 			int LA4_0 = input.LA(1);
 			if ( (LA4_0==OPTIONS) ) {
@@ -475,7 +476,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt4) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:151:5: optionsSpec
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:152:5: optionsSpec
 					{
 					pushFollow(FOLLOW_optionsSpec_in_grammarSpec215);
 					optionsSpec();
@@ -486,7 +487,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:152:3: ( delegateGrammars )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:153:3: ( delegateGrammars )?
 			int alt5=2;
 			int LA5_0 = input.LA(1);
 			if ( (LA5_0==IMPORT) ) {
@@ -494,7 +495,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt5) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:152:4: delegateGrammars
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:153:4: delegateGrammars
 					{
 					pushFollow(FOLLOW_delegateGrammars_in_grammarSpec223);
 					delegateGrammars();
@@ -505,7 +506,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:153:3: ( tokensSpec )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:154:3: ( tokensSpec )?
 			int alt6=2;
 			int LA6_0 = input.LA(1);
 			if ( (LA6_0==TOKENS) ) {
@@ -513,7 +514,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt6) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:153:4: tokensSpec
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:154:4: tokensSpec
 					{
 					pushFollow(FOLLOW_tokensSpec_in_grammarSpec230);
 					tokensSpec();
@@ -524,7 +525,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:154:3: ( attrScope )*
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:155:3: ( attrScope )*
 			loop7:
 			while (true) {
 				int alt7=2;
@@ -535,7 +536,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt7) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:154:4: attrScope
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:155:4: attrScope
 					{
 					pushFollow(FOLLOW_attrScope_in_grammarSpec237);
 					attrScope();
@@ -549,7 +550,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 				}
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:155:3: ( actions )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:156:3: ( actions )?
 			int alt8=2;
 			int LA8_0 = input.LA(1);
 			if ( (LA8_0==AMPERSAND) ) {
@@ -557,7 +558,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt8) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:155:4: actions
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:156:4: actions
 					{
 					pushFollow(FOLLOW_actions_in_grammarSpec244);
 					actions();
@@ -588,13 +589,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "actions"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:159:1: actions : ( action )+ ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:160:1: actions : ( action )+ ;
 	public final void actions() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:160:2: ( ( action )+ )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:160:4: ( action )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:161:2: ( ( action )+ )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:161:4: ( action )+
 			{
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:160:4: ( action )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:161:4: ( action )+
 			int cnt9=0;
 			loop9:
 			while (true) {
@@ -606,7 +607,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt9) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:160:6: action
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:161:6: action
 					{
 					pushFollow(FOLLOW_action_in_actions263);
 					action();
@@ -640,7 +641,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "action"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:163:1: action : ^(amp= AMPERSAND id1= ID (id2= ID a1= ACTION |a2= ACTION ) ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:164:1: action : ^(amp= AMPERSAND id1= ID (id2= ID a1= ACTION |a2= ACTION ) ) ;
 	public final void action() throws RecognitionException {
 		GrammarAST amp=null;
 		GrammarAST id1=null;
@@ -653,13 +654,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			GrammarAST nameAST=null, actionAST=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:169:2: ( ^(amp= AMPERSAND id1= ID (id2= ID a1= ACTION |a2= ACTION ) ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:169:4: ^(amp= AMPERSAND id1= ID (id2= ID a1= ACTION |a2= ACTION ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:170:2: ( ^(amp= AMPERSAND id1= ID (id2= ID a1= ACTION |a2= ACTION ) ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:170:4: ^(amp= AMPERSAND id1= ID (id2= ID a1= ACTION |a2= ACTION ) )
 			{
 			amp=(GrammarAST)match(input,AMPERSAND,FOLLOW_AMPERSAND_in_action285); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
 			id1=(GrammarAST)match(input,ID,FOLLOW_ID_in_action289); if (state.failed) return;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:170:4: (id2= ID a1= ACTION |a2= ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:171:4: (id2= ID a1= ACTION |a2= ACTION )
 			int alt10=2;
 			int LA10_0 = input.LA(1);
 			if ( (LA10_0==ID) ) {
@@ -678,7 +679,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			switch (alt10) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:170:6: id2= ID a1= ACTION
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:171:6: id2= ID a1= ACTION
 					{
 					id2=(GrammarAST)match(input,ID,FOLLOW_ID_in_action298); if (state.failed) return;
 					a1=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_action302); if (state.failed) return;
@@ -686,7 +687,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:172:6: a2= ACTION
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:173:6: a2= ACTION
 					{
 					a2=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_action318); if (state.failed) return;
 					if ( state.backtracking==0 ) {scope=null; nameAST=id1; actionAST=a2;}
@@ -716,16 +717,16 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "optionsSpec"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:181:1: optionsSpec : ^( OPTIONS ( . )* ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:182:1: optionsSpec : ^( OPTIONS ( . )* ) ;
 	public final void optionsSpec() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:182:2: ( ^( OPTIONS ( . )* ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:182:4: ^( OPTIONS ( . )* )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:183:2: ( ^( OPTIONS ( . )* ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:183:4: ^( OPTIONS ( . )* )
 			{
 			match(input,OPTIONS,FOLLOW_OPTIONS_in_optionsSpec352); if (state.failed) return;
 			if ( input.LA(1)==Token.DOWN ) {
 				match(input, Token.DOWN, null); if (state.failed) return;
-				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:182:14: ( . )*
+				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:183:14: ( . )*
 				loop11:
 				while (true) {
 					int alt11=2;
@@ -739,7 +740,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 					switch (alt11) {
 					case 1 :
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:182:14: .
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:183:14: .
 						{
 						matchAny(input); if (state.failed) return;
 						}
@@ -769,15 +770,15 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "delegateGrammars"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:185:1: delegateGrammars : ^( 'import' ( ^( ASSIGN ID ID ) | ID )+ ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:186:1: delegateGrammars : ^( 'import' ( ^( ASSIGN ID ID ) | ID )+ ) ;
 	public final void delegateGrammars() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:186:2: ( ^( 'import' ( ^( ASSIGN ID ID ) | ID )+ ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:186:4: ^( 'import' ( ^( ASSIGN ID ID ) | ID )+ )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:187:2: ( ^( 'import' ( ^( ASSIGN ID ID ) | ID )+ ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:187:4: ^( 'import' ( ^( ASSIGN ID ID ) | ID )+ )
 			{
 			match(input,IMPORT,FOLLOW_IMPORT_in_delegateGrammars369); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:186:16: ( ^( ASSIGN ID ID ) | ID )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:187:16: ( ^( ASSIGN ID ID ) | ID )+
 			int cnt12=0;
 			loop12:
 			while (true) {
@@ -792,7 +793,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt12) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:186:18: ^( ASSIGN ID ID )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:187:18: ^( ASSIGN ID ID )
 					{
 					match(input,ASSIGN,FOLLOW_ASSIGN_in_delegateGrammars374); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -803,7 +804,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:186:36: ID
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:187:36: ID
 					{
 					match(input,ID,FOLLOW_ID_in_delegateGrammars383); if (state.failed) return;
 					}
@@ -836,16 +837,16 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "tokensSpec"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:189:1: tokensSpec : ^( TOKENS ( tokenSpec )* ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:190:1: tokensSpec : ^( TOKENS ( tokenSpec )* ) ;
 	public final void tokensSpec() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:190:2: ( ^( TOKENS ( tokenSpec )* ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:190:4: ^( TOKENS ( tokenSpec )* )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:191:2: ( ^( TOKENS ( tokenSpec )* ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:191:4: ^( TOKENS ( tokenSpec )* )
 			{
 			match(input,TOKENS,FOLLOW_TOKENS_in_tokensSpec400); if (state.failed) return;
 			if ( input.LA(1)==Token.DOWN ) {
 				match(input, Token.DOWN, null); if (state.failed) return;
-				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:190:13: ( tokenSpec )*
+				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:191:13: ( tokenSpec )*
 				loop13:
 				while (true) {
 					int alt13=2;
@@ -856,7 +857,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 					switch (alt13) {
 					case 1 :
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:190:13: tokenSpec
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:191:13: tokenSpec
 						{
 						pushFollow(FOLLOW_tokenSpec_in_tokensSpec402);
 						tokenSpec();
@@ -889,12 +890,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "tokenSpec"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:193:1: tokenSpec : (t= TOKEN_REF | ^( ASSIGN TOKEN_REF ( STRING_LITERAL | CHAR_LITERAL ) ) );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:194:1: tokenSpec : (t= TOKEN_REF | ^( ASSIGN TOKEN_REF ( STRING_LITERAL | CHAR_LITERAL ) ) );
 	public final void tokenSpec() throws RecognitionException {
 		GrammarAST t=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:194:2: (t= TOKEN_REF | ^( ASSIGN TOKEN_REF ( STRING_LITERAL | CHAR_LITERAL ) ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:195:2: (t= TOKEN_REF | ^( ASSIGN TOKEN_REF ( STRING_LITERAL | CHAR_LITERAL ) ) )
 			int alt14=2;
 			int LA14_0 = input.LA(1);
 			if ( (LA14_0==TOKEN_REF) ) {
@@ -913,13 +914,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			switch (alt14) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:194:4: t= TOKEN_REF
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:195:4: t= TOKEN_REF
 					{
 					t=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_tokenSpec417); if (state.failed) return;
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:195:4: ^( ASSIGN TOKEN_REF ( STRING_LITERAL | CHAR_LITERAL ) )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:196:4: ^( ASSIGN TOKEN_REF ( STRING_LITERAL | CHAR_LITERAL ) )
 					{
 					match(input,ASSIGN,FOLLOW_ASSIGN_in_tokenSpec424); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -954,13 +955,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rules"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:203:1: rules : ( rule | ^( PREC_RULE ( . )* ) )+ ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:1: rules : ( rule | ^( PREC_RULE ( . )* ) )+ ;
 	public final void rules() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:2: ( ( rule | ^( PREC_RULE ( . )* ) )+ )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:4: ( rule | ^( PREC_RULE ( . )* ) )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:205:2: ( ( rule | ^( PREC_RULE ( . )* ) )+ )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:205:4: ( rule | ^( PREC_RULE ( . )* ) )+
 			{
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:4: ( rule | ^( PREC_RULE ( . )* ) )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:205:4: ( rule | ^( PREC_RULE ( . )* ) )+
 			int cnt16=0;
 			loop16:
 			while (true) {
@@ -975,7 +976,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt16) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:5: rule
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:205:5: rule
 					{
 					pushFollow(FOLLOW_rule_in_rules465);
 					rule();
@@ -984,12 +985,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:12: ^( PREC_RULE ( . )* )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:205:12: ^( PREC_RULE ( . )* )
 					{
 					match(input,PREC_RULE,FOLLOW_PREC_RULE_in_rules470); if (state.failed) return;
 					if ( input.LA(1)==Token.DOWN ) {
 						match(input, Token.DOWN, null); if (state.failed) return;
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:24: ( . )*
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:205:24: ( . )*
 						loop15:
 						while (true) {
 							int alt15=2;
@@ -1003,7 +1004,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 							switch (alt15) {
 							case 1 :
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:204:24: .
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:205:24: .
 								{
 								matchAny(input); if (state.failed) return;
 								}
@@ -1048,7 +1049,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rule"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:207:1: rule : ^( RULE id= ID ( modifier )? ^( ARG (args= ARG_ACTION )? ) ^( RET (ret= ARG_ACTION )? ) ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec[r] )? ( ruleAction[r] )* b= block ( exceptionGroup )? EOR ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:208:1: rule : ^( RULE id= ID ( modifier )? ^( ARG (args= ARG_ACTION )? ) ^( RET (ret= ARG_ACTION )? ) ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec[r] )? ( ruleAction[r] )* b= block ( exceptionGroup )? EOR ) ;
 	public final DefineGrammarItemsWalker.rule_return rule() throws RecognitionException {
 		DefineGrammarItemsWalker.rule_return retval = new DefineGrammarItemsWalker.rule_return();
 		retval.start = input.LT(1);
@@ -1067,14 +1068,14 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			Rule r = null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:214:2: ( ^( RULE id= ID ( modifier )? ^( ARG (args= ARG_ACTION )? ) ^( RET (ret= ARG_ACTION )? ) ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec[r] )? ( ruleAction[r] )* b= block ( exceptionGroup )? EOR ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:214:5: ^( RULE id= ID ( modifier )? ^( ARG (args= ARG_ACTION )? ) ^( RET (ret= ARG_ACTION )? ) ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec[r] )? ( ruleAction[r] )* b= block ( exceptionGroup )? EOR )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:215:2: ( ^( RULE id= ID ( modifier )? ^( ARG (args= ARG_ACTION )? ) ^( RET (ret= ARG_ACTION )? ) ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec[r] )? ( ruleAction[r] )* b= block ( exceptionGroup )? EOR ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:215:5: ^( RULE id= ID ( modifier )? ^( ARG (args= ARG_ACTION )? ) ^( RET (ret= ARG_ACTION )? ) ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec[r] )? ( ruleAction[r] )* b= block ( exceptionGroup )? EOR )
 			{
 			RULE3=(GrammarAST)match(input,RULE,FOLLOW_RULE_in_rule495); if (state.failed) return retval;
 			match(input, Token.DOWN, null); if (state.failed) return retval;
 			id=(GrammarAST)match(input,ID,FOLLOW_ID_in_rule499); if (state.failed) return retval;
 			if ( state.backtracking==0 ) {opts = RULE3.getBlockOptions();}
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:215:4: ( modifier )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:216:4: ( modifier )?
 			int alt17=2;
 			int LA17_0 = input.LA(1);
 			if ( (LA17_0==FRAGMENT||(LA17_0 >= PRIVATE && LA17_0 <= PUBLIC)) ) {
@@ -1082,7 +1083,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt17) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:215:5: modifier
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:216:5: modifier
 					{
 					pushFollow(FOLLOW_modifier_in_rule507);
 					modifier4=modifier();
@@ -1096,7 +1097,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			match(input,ARG,FOLLOW_ARG_in_rule516); if (state.failed) return retval;
 			if ( input.LA(1)==Token.DOWN ) {
 				match(input, Token.DOWN, null); if (state.failed) return retval;
-				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:216:11: (args= ARG_ACTION )?
+				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:217:11: (args= ARG_ACTION )?
 				int alt18=2;
 				int LA18_0 = input.LA(1);
 				if ( (LA18_0==ARG_ACTION) ) {
@@ -1104,7 +1105,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 				}
 				switch (alt18) {
 					case 1 :
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:216:12: args= ARG_ACTION
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:217:12: args= ARG_ACTION
 						{
 						args=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rule521); if (state.failed) return retval;
 						}
@@ -1118,7 +1119,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			match(input,RET,FOLLOW_RET_in_rule532); if (state.failed) return retval;
 			if ( input.LA(1)==Token.DOWN ) {
 				match(input, Token.DOWN, null); if (state.failed) return retval;
-				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:217:11: (ret= ARG_ACTION )?
+				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:218:11: (ret= ARG_ACTION )?
 				int alt19=2;
 				int LA19_0 = input.LA(1);
 				if ( (LA19_0==ARG_ACTION) ) {
@@ -1126,7 +1127,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 				}
 				switch (alt19) {
 					case 1 :
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:217:12: ret= ARG_ACTION
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:218:12: ret= ARG_ACTION
 						{
 						ret=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rule537); if (state.failed) return retval;
 						}
@@ -1137,7 +1138,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 				match(input, Token.UP, null); if (state.failed) return retval;
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:218:4: ( throwsSpec )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:219:4: ( throwsSpec )?
 			int alt20=2;
 			int LA20_0 = input.LA(1);
 			if ( (LA20_0==THROWS) ) {
@@ -1145,7 +1146,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt20) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:218:5: throwsSpec
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:219:5: throwsSpec
 					{
 					pushFollow(FOLLOW_throwsSpec_in_rule547);
 					throwsSpec5=throwsSpec();
@@ -1156,7 +1157,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:219:4: ( optionsSpec )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:220:4: ( optionsSpec )?
 			int alt21=2;
 			int LA21_0 = input.LA(1);
 			if ( (LA21_0==OPTIONS) ) {
@@ -1164,7 +1165,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt21) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:219:5: optionsSpec
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:220:5: optionsSpec
 					{
 					pushFollow(FOLLOW_optionsSpec_in_rule555);
 					optionsSpec();
@@ -1205,7 +1206,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 								}
 							}
 						}
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:250:4: ( ruleScopeSpec[r] )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:251:4: ( ruleScopeSpec[r] )?
 			int alt22=2;
 			int LA22_0 = input.LA(1);
 			if ( (LA22_0==SCOPE) ) {
@@ -1213,7 +1214,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt22) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:250:5: ruleScopeSpec[r]
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:251:5: ruleScopeSpec[r]
 					{
 					pushFollow(FOLLOW_ruleScopeSpec_in_rule568);
 					ruleScopeSpec(r);
@@ -1224,7 +1225,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:251:4: ( ruleAction[r] )*
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:252:4: ( ruleAction[r] )*
 			loop23:
 			while (true) {
 				int alt23=2;
@@ -1235,7 +1236,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt23) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:251:5: ruleAction[r]
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:252:5: ruleAction[r]
 					{
 					pushFollow(FOLLOW_ruleAction_in_rule577);
 					ruleAction(r);
@@ -1254,7 +1255,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			b=block();
 			state._fsp--;
 			if (state.failed) return retval;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:254:4: ( exceptionGroup )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:255:4: ( exceptionGroup )?
 			int alt24=2;
 			int LA24_0 = input.LA(1);
 			if ( (LA24_0==CATCH||LA24_0==FINALLY) ) {
@@ -1262,7 +1263,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt24) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:254:5: exceptionGroup
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:255:5: exceptionGroup
 					{
 					pushFollow(FOLLOW_exceptionGroup_in_rule598);
 					exceptionGroup();
@@ -1298,15 +1299,15 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "ruleAction"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:264:1: ruleAction[Rule r] : ^(amp= AMPERSAND id= ID a= ACTION ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:265:1: ruleAction[Rule r] : ^(amp= AMPERSAND id= ID a= ACTION ) ;
 	public final void ruleAction(Rule r) throws RecognitionException {
 		GrammarAST amp=null;
 		GrammarAST id=null;
 		GrammarAST a=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:265:2: ( ^(amp= AMPERSAND id= ID a= ACTION ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:265:4: ^(amp= AMPERSAND id= ID a= ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:266:2: ( ^(amp= AMPERSAND id= ID a= ACTION ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:266:4: ^(amp= AMPERSAND id= ID a= ACTION )
 			{
 			amp=(GrammarAST)match(input,AMPERSAND,FOLLOW_AMPERSAND_in_ruleAction629); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
@@ -1335,7 +1336,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "modifier"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:268:1: modifier returns [String mod] : ( 'protected' | 'public' | 'private' | 'fragment' );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:269:1: modifier returns [String mod] : ( 'protected' | 'public' | 'private' | 'fragment' );
 	public final DefineGrammarItemsWalker.modifier_return modifier() throws RecognitionException {
 		DefineGrammarItemsWalker.modifier_return retval = new DefineGrammarItemsWalker.modifier_return();
 		retval.start = input.LT(1);
@@ -1344,7 +1345,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			retval.mod = ((GrammarAST)retval.start).getToken().getText();
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:273:2: ( 'protected' | 'public' | 'private' | 'fragment' )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:274:2: ( 'protected' | 'public' | 'private' | 'fragment' )
 			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:
 			{
 			if ( input.LA(1)==FRAGMENT||(input.LA(1) >= PRIVATE && input.LA(1) <= PUBLIC) ) {
@@ -1374,7 +1375,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "throwsSpec"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:279:1: throwsSpec returns [HashSet<String> exceptions] : ^( 'throws' ( ID )+ ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:280:1: throwsSpec returns [HashSet<String> exceptions] : ^( 'throws' ( ID )+ ) ;
 	public final HashSet<String> throwsSpec() throws RecognitionException {
 		HashSet<String> exceptions = null;
 
@@ -1382,15 +1383,15 @@ public class DefineGrammarItemsWalker extends TreeParser {
 		GrammarAST ID6=null;
 
 
-			exceptions = new HashSet<String>();
+			exceptions = new LinkedHashSet<String>();
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:284:2: ( ^( 'throws' ( ID )+ ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:284:4: ^( 'throws' ( ID )+ )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:285:2: ( ^( 'throws' ( ID )+ ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:285:4: ^( 'throws' ( ID )+ )
 			{
 			match(input,THROWS,FOLLOW_THROWS_in_throwsSpec697); if (state.failed) return exceptions;
 			match(input, Token.DOWN, null); if (state.failed) return exceptions;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:284:15: ( ID )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:285:15: ( ID )+
 			int cnt25=0;
 			loop25:
 			while (true) {
@@ -1402,7 +1403,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt25) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:284:16: ID
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:285:16: ID
 					{
 					ID6=(GrammarAST)match(input,ID,FOLLOW_ID_in_throwsSpec700); if (state.failed) return exceptions;
 					if ( state.backtracking==0 ) {exceptions.add((ID6!=null?ID6.getText():null));}
@@ -1437,7 +1438,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "ruleScopeSpec"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:287:1: ruleScopeSpec[Rule r] : ^( 'scope' ( ( attrScopeAction )* attrs= ACTION )? (uses= ID )* ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:288:1: ruleScopeSpec[Rule r] : ^( 'scope' ( ( attrScopeAction )* attrs= ACTION )? (uses= ID )* ) ;
 	public final void ruleScopeSpec(Rule r) throws RecognitionException {
 		AttributeScopeActions_stack.push(new AttributeScopeActions_scope());
 
@@ -1448,13 +1449,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			AttributeScopeActions_stack.peek().actions = new HashMap<GrammarAST, GrammarAST>();
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:293:2: ( ^( 'scope' ( ( attrScopeAction )* attrs= ACTION )? (uses= ID )* ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:293:4: ^( 'scope' ( ( attrScopeAction )* attrs= ACTION )? (uses= ID )* )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:294:2: ( ^( 'scope' ( ( attrScopeAction )* attrs= ACTION )? (uses= ID )* ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:294:4: ^( 'scope' ( ( attrScopeAction )* attrs= ACTION )? (uses= ID )* )
 			{
 			match(input,SCOPE,FOLLOW_SCOPE_in_ruleScopeSpec730); if (state.failed) return;
 			if ( input.LA(1)==Token.DOWN ) {
 				match(input, Token.DOWN, null); if (state.failed) return;
-				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:294:4: ( ( attrScopeAction )* attrs= ACTION )?
+				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:295:4: ( ( attrScopeAction )* attrs= ACTION )?
 				int alt27=2;
 				int LA27_0 = input.LA(1);
 				if ( (LA27_0==ACTION||LA27_0==AMPERSAND) ) {
@@ -1462,9 +1463,9 @@ public class DefineGrammarItemsWalker extends TreeParser {
 				}
 				switch (alt27) {
 					case 1 :
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:294:6: ( attrScopeAction )* attrs= ACTION
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:295:6: ( attrScopeAction )* attrs= ACTION
 						{
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:294:6: ( attrScopeAction )*
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:295:6: ( attrScopeAction )*
 						loop26:
 						while (true) {
 							int alt26=2;
@@ -1475,7 +1476,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 							switch (alt26) {
 							case 1 :
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:294:6: attrScopeAction
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:295:6: attrScopeAction
 								{
 								pushFollow(FOLLOW_attrScopeAction_in_ruleScopeSpec737);
 								attrScopeAction();
@@ -1502,7 +1503,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				}
 
-				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:303:4: (uses= ID )*
+				// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:304:4: (uses= ID )*
 				loop28:
 				while (true) {
 					int alt28=2;
@@ -1513,7 +1514,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 					switch (alt28) {
 					case 1 :
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:303:6: uses= ID
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:304:6: uses= ID
 						{
 						uses=(GrammarAST)match(input,ID,FOLLOW_ID_in_ruleScopeSpec763); if (state.failed) return;
 						if ( state.backtracking==0 ) {
@@ -1560,7 +1561,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "block"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:320:1: block : ^( BLOCK ( optionsSpec )? ( blockAction )* ( alternative rewrite )+ EOB ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:321:1: block : ^( BLOCK ( optionsSpec )? ( blockAction )* ( alternative rewrite )+ EOB ) ;
 	public final DefineGrammarItemsWalker.block_return block() throws RecognitionException {
 		DefineGrammarItemsWalker.block_return retval = new DefineGrammarItemsWalker.block_return();
 		retval.start = input.LT(1);
@@ -1572,12 +1573,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 				this.outerAltNum=1;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:328:2: ( ^( BLOCK ( optionsSpec )? ( blockAction )* ( alternative rewrite )+ EOB ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:328:4: ^( BLOCK ( optionsSpec )? ( blockAction )* ( alternative rewrite )+ EOB )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:329:2: ( ^( BLOCK ( optionsSpec )? ( blockAction )* ( alternative rewrite )+ EOB ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:329:4: ^( BLOCK ( optionsSpec )? ( blockAction )* ( alternative rewrite )+ EOB )
 			{
 			match(input,BLOCK,FOLLOW_BLOCK_in_block797); if (state.failed) return retval;
 			match(input, Token.DOWN, null); if (state.failed) return retval;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:329:4: ( optionsSpec )?
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:330:4: ( optionsSpec )?
 			int alt29=2;
 			int LA29_0 = input.LA(1);
 			if ( (LA29_0==OPTIONS) ) {
@@ -1585,7 +1586,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt29) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:329:5: optionsSpec
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:330:5: optionsSpec
 					{
 					pushFollow(FOLLOW_optionsSpec_in_block803);
 					optionsSpec();
@@ -1596,7 +1597,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:330:4: ( blockAction )*
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:331:4: ( blockAction )*
 			loop30:
 			while (true) {
 				int alt30=2;
@@ -1607,7 +1608,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt30) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:330:5: blockAction
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:331:5: blockAction
 					{
 					pushFollow(FOLLOW_blockAction_in_block811);
 					blockAction();
@@ -1621,7 +1622,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 				}
 			}
 
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:331:4: ( alternative rewrite )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:332:4: ( alternative rewrite )+
 			int cnt31=0;
 			loop31:
 			while (true) {
@@ -1633,7 +1634,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt31) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:331:6: alternative rewrite
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:332:6: alternative rewrite
 					{
 					pushFollow(FOLLOW_alternative_in_block820);
 					alternative();
@@ -1680,15 +1681,15 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "blockAction"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:343:1: blockAction : ^(amp= AMPERSAND id= ID a= ACTION ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:344:1: blockAction : ^(amp= AMPERSAND id= ID a= ACTION ) ;
 	public final void blockAction() throws RecognitionException {
 		GrammarAST amp=null;
 		GrammarAST id=null;
 		GrammarAST a=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:344:2: ( ^(amp= AMPERSAND id= ID a= ACTION ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:344:4: ^(amp= AMPERSAND id= ID a= ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:345:2: ( ^(amp= AMPERSAND id= ID a= ACTION ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:345:4: ^(amp= AMPERSAND id= ID a= ACTION )
 			{
 			amp=(GrammarAST)match(input,AMPERSAND,FOLLOW_AMPERSAND_in_blockAction863); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
@@ -1712,15 +1713,15 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "alternative"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:347:1: alternative : ^( ALT ( element )+ EOA ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:348:1: alternative : ^( ALT ( element )+ EOA ) ;
 	public final void alternative() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:370:2: ( ^( ALT ( element )+ EOA ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:370:4: ^( ALT ( element )+ EOA )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:371:2: ( ^( ALT ( element )+ EOA ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:371:4: ^( ALT ( element )+ EOA )
 			{
 			match(input,ALT,FOLLOW_ALT_in_alternative909); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:370:11: ( element )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:371:11: ( element )+
 			int cnt32=0;
 			loop32:
 			while (true) {
@@ -1732,7 +1733,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt32) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:370:12: element
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:371:12: element
 					{
 					pushFollow(FOLLOW_element_in_alternative912);
 					element();
@@ -1769,10 +1770,10 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "exceptionGroup"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:373:1: exceptionGroup : ( ( exceptionHandler )+ ( finallyClause )? | finallyClause );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:374:1: exceptionGroup : ( ( exceptionHandler )+ ( finallyClause )? | finallyClause );
 	public final void exceptionGroup() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:374:2: ( ( exceptionHandler )+ ( finallyClause )? | finallyClause )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:375:2: ( ( exceptionHandler )+ ( finallyClause )? | finallyClause )
 			int alt35=2;
 			int LA35_0 = input.LA(1);
 			if ( (LA35_0==CATCH) ) {
@@ -1791,9 +1792,9 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			switch (alt35) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:374:4: ( exceptionHandler )+ ( finallyClause )?
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:375:4: ( exceptionHandler )+ ( finallyClause )?
 					{
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:374:4: ( exceptionHandler )+
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:375:4: ( exceptionHandler )+
 					int cnt33=0;
 					loop33:
 					while (true) {
@@ -1805,7 +1806,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 						switch (alt33) {
 						case 1 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:374:6: exceptionHandler
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:375:6: exceptionHandler
 							{
 							pushFollow(FOLLOW_exceptionHandler_in_exceptionGroup931);
 							exceptionHandler();
@@ -1823,7 +1824,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 						cnt33++;
 					}
 
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:374:26: ( finallyClause )?
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:375:26: ( finallyClause )?
 					int alt34=2;
 					int LA34_0 = input.LA(1);
 					if ( (LA34_0==FINALLY) ) {
@@ -1831,7 +1832,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					switch (alt34) {
 						case 1 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:374:27: finallyClause
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:375:27: finallyClause
 							{
 							pushFollow(FOLLOW_finallyClause_in_exceptionGroup937);
 							finallyClause();
@@ -1845,7 +1846,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:375:4: finallyClause
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:376:4: finallyClause
 					{
 					pushFollow(FOLLOW_finallyClause_in_exceptionGroup944);
 					finallyClause();
@@ -1869,13 +1870,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "exceptionHandler"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:378:1: exceptionHandler : ^( 'catch' ARG_ACTION ACTION ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:379:1: exceptionHandler : ^( 'catch' ARG_ACTION ACTION ) ;
 	public final void exceptionHandler() throws RecognitionException {
 		GrammarAST ACTION7=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:379:2: ( ^( 'catch' ARG_ACTION ACTION ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:379:6: ^( 'catch' ARG_ACTION ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:380:2: ( ^( 'catch' ARG_ACTION ACTION ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:380:6: ^( 'catch' ARG_ACTION ACTION )
 			{
 			match(input,CATCH,FOLLOW_CATCH_in_exceptionHandler958); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
@@ -1900,13 +1901,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "finallyClause"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:382:1: finallyClause : ^( 'finally' ACTION ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:383:1: finallyClause : ^( 'finally' ACTION ) ;
 	public final void finallyClause() throws RecognitionException {
 		GrammarAST ACTION8=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:383:2: ( ^( 'finally' ACTION ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:383:7: ^( 'finally' ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:384:2: ( ^( 'finally' ACTION ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:384:7: ^( 'finally' ACTION )
 			{
 			match(input,FINALLY,FOLLOW_FINALLY_in_finallyClause980); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
@@ -1933,7 +1934,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "element"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:386:1: element : ( ^( ROOT element ) | ^( BANG element ) | atom[null] | ^( NOT element ) | ^( RANGE atom[null] atom[null] ) | ^( CHAR_RANGE atom[null] atom[null] ) | ^( ASSIGN id= ID el= element ) | ^( PLUS_ASSIGN id2= ID a2= element ) | ebnf | tree_ | ^( SYNPRED block ) |act= ACTION |act2= FORCED_ACTION | SEMPRED | SYN_SEMPRED | ^( BACKTRACK_SEMPRED ( . )* ) | GATED_SEMPRED | EPSILON );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:387:1: element : ( ^( ROOT element ) | ^( BANG element ) | atom[null] | ^( NOT element ) | ^( RANGE atom[null] atom[null] ) | ^( CHAR_RANGE atom[null] atom[null] ) | ^( ASSIGN id= ID el= element ) | ^( PLUS_ASSIGN id2= ID a2= element ) | ebnf | tree_ | ^( SYNPRED block ) |act= ACTION |act2= FORCED_ACTION | SEMPRED | SYN_SEMPRED | ^( BACKTRACK_SEMPRED ( . )* ) | GATED_SEMPRED | EPSILON );
 	public final DefineGrammarItemsWalker.element_return element() throws RecognitionException {
 		DefineGrammarItemsWalker.element_return retval = new DefineGrammarItemsWalker.element_return();
 		retval.start = input.LT(1);
@@ -1948,7 +1949,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 		TreeRuleReturnScope a2 =null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:387:2: ( ^( ROOT element ) | ^( BANG element ) | atom[null] | ^( NOT element ) | ^( RANGE atom[null] atom[null] ) | ^( CHAR_RANGE atom[null] atom[null] ) | ^( ASSIGN id= ID el= element ) | ^( PLUS_ASSIGN id2= ID a2= element ) | ebnf | tree_ | ^( SYNPRED block ) |act= ACTION |act2= FORCED_ACTION | SEMPRED | SYN_SEMPRED | ^( BACKTRACK_SEMPRED ( . )* ) | GATED_SEMPRED | EPSILON )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:388:2: ( ^( ROOT element ) | ^( BANG element ) | atom[null] | ^( NOT element ) | ^( RANGE atom[null] atom[null] ) | ^( CHAR_RANGE atom[null] atom[null] ) | ^( ASSIGN id= ID el= element ) | ^( PLUS_ASSIGN id2= ID a2= element ) | ebnf | tree_ | ^( SYNPRED block ) |act= ACTION |act2= FORCED_ACTION | SEMPRED | SYN_SEMPRED | ^( BACKTRACK_SEMPRED ( . )* ) | GATED_SEMPRED | EPSILON )
 			int alt37=18;
 			switch ( input.LA(1) ) {
 			case ROOT:
@@ -2057,7 +2058,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt37) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:387:6: ^( ROOT element )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:388:6: ^( ROOT element )
 					{
 					match(input,ROOT,FOLLOW_ROOT_in_element999); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2070,7 +2071,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:388:6: ^( BANG element )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:389:6: ^( BANG element )
 					{
 					match(input,BANG,FOLLOW_BANG_in_element1010); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2083,7 +2084,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:389:6: atom[null]
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:390:6: atom[null]
 					{
 					pushFollow(FOLLOW_atom_in_element1020);
 					atom(null);
@@ -2092,7 +2093,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 4 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:390:6: ^( NOT element )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:391:6: ^( NOT element )
 					{
 					match(input,NOT,FOLLOW_NOT_in_element1029); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2105,7 +2106,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 5 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:391:6: ^( RANGE atom[null] atom[null] )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:392:6: ^( RANGE atom[null] atom[null] )
 					{
 					match(input,RANGE,FOLLOW_RANGE_in_element1040); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2122,7 +2123,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 6 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:392:6: ^( CHAR_RANGE atom[null] atom[null] )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:393:6: ^( CHAR_RANGE atom[null] atom[null] )
 					{
 					match(input,CHAR_RANGE,FOLLOW_CHAR_RANGE_in_element1055); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2139,7 +2140,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 7 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:393:4: ^( ASSIGN id= ID el= element )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:394:4: ^( ASSIGN id= ID el= element )
 					{
 					match(input,ASSIGN,FOLLOW_ASSIGN_in_element1069); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2172,7 +2173,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 8 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:413:4: ^( PLUS_ASSIGN id2= ID a2= element )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:414:4: ^( PLUS_ASSIGN id2= ID a2= element )
 					{
 					match(input,PLUS_ASSIGN,FOLLOW_PLUS_ASSIGN_in_element1090); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2205,7 +2206,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 9 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:434:6: ebnf
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:435:6: ebnf
 					{
 					pushFollow(FOLLOW_ebnf_in_element1115);
 					ebnf();
@@ -2214,7 +2215,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 10 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:435:6: tree_
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:436:6: tree_
 					{
 					pushFollow(FOLLOW_tree__in_element1122);
 					tree_();
@@ -2223,7 +2224,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 11 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:436:6: ^( SYNPRED block )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:437:6: ^( SYNPRED block )
 					{
 					match(input,SYNPRED,FOLLOW_SYNPRED_in_element1131); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2236,7 +2237,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 12 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:437:6: act= ACTION
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:438:6: act= ACTION
 					{
 					act=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_element1144); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {
@@ -2246,7 +2247,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 13 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:442:6: act2= FORCED_ACTION
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:443:6: act2= FORCED_ACTION
 					{
 					act2=(GrammarAST)match(input,FORCED_ACTION,FOLLOW_FORCED_ACTION_in_element1157); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {
@@ -2256,7 +2257,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 14 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:447:6: SEMPRED
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:448:6: SEMPRED
 					{
 					SEMPRED9=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_element1168); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {
@@ -2266,18 +2267,18 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 15 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:452:6: SYN_SEMPRED
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:453:6: SYN_SEMPRED
 					{
 					match(input,SYN_SEMPRED,FOLLOW_SYN_SEMPRED_in_element1179); if (state.failed) return retval;
 					}
 					break;
 				case 16 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:453:6: ^( BACKTRACK_SEMPRED ( . )* )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:454:6: ^( BACKTRACK_SEMPRED ( . )* )
 					{
 					match(input,BACKTRACK_SEMPRED,FOLLOW_BACKTRACK_SEMPRED_in_element1187); if (state.failed) return retval;
 					if ( input.LA(1)==Token.DOWN ) {
 						match(input, Token.DOWN, null); if (state.failed) return retval;
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:453:26: ( . )*
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:454:26: ( . )*
 						loop36:
 						while (true) {
 							int alt36=2;
@@ -2291,7 +2292,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 							switch (alt36) {
 							case 1 :
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:453:26: .
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:454:26: .
 								{
 								matchAny(input); if (state.failed) return retval;
 								}
@@ -2308,7 +2309,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 17 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:454:6: GATED_SEMPRED
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:455:6: GATED_SEMPRED
 					{
 					GATED_SEMPRED10=(GrammarAST)match(input,GATED_SEMPRED,FOLLOW_GATED_SEMPRED_in_element1198); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {
@@ -2318,7 +2319,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 18 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:459:6: EPSILON
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:460:6: EPSILON
 					{
 					match(input,EPSILON,FOLLOW_EPSILON_in_element1209); if (state.failed) return retval;
 					}
@@ -2340,10 +2341,10 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "ebnf"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:462:1: ebnf : ( ( dotLoop )=> dotLoop | block | ^( OPTIONAL block ) | ^( CLOSURE block ) | ^( POSITIVE_CLOSURE block ) );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:463:1: ebnf : ( ( dotLoop )=> dotLoop | block | ^( OPTIONAL block ) | ^( CLOSURE block ) | ^( POSITIVE_CLOSURE block ) );
 	public final void ebnf() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:463:2: ( ( dotLoop )=> dotLoop | block | ^( OPTIONAL block ) | ^( CLOSURE block ) | ^( POSITIVE_CLOSURE block ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:464:2: ( ( dotLoop )=> dotLoop | block | ^( OPTIONAL block ) | ^( CLOSURE block ) | ^( POSITIVE_CLOSURE block ) )
 			int alt38=5;
 			switch ( input.LA(1) ) {
 			case CLOSURE:
@@ -2826,7 +2827,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt38) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:463:4: ( dotLoop )=> dotLoop
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:464:4: ( dotLoop )=> dotLoop
 					{
 					pushFollow(FOLLOW_dotLoop_in_ebnf1227);
 					dotLoop();
@@ -2835,7 +2836,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:464:4: block
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:465:4: block
 					{
 					pushFollow(FOLLOW_block_in_ebnf1233);
 					block();
@@ -2844,7 +2845,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:465:4: ^( OPTIONAL block )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:466:4: ^( OPTIONAL block )
 					{
 					match(input,OPTIONAL,FOLLOW_OPTIONAL_in_ebnf1240); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -2857,7 +2858,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 4 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:466:4: ^( CLOSURE block )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:467:4: ^( CLOSURE block )
 					{
 					match(input,CLOSURE,FOLLOW_CLOSURE_in_ebnf1251); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -2870,7 +2871,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 5 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:467:4: ^( POSITIVE_CLOSURE block )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:468:4: ^( POSITIVE_CLOSURE block )
 					{
 					match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_ebnf1262); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -2901,16 +2902,16 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "dotLoop"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:472:1: dotLoop : ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:473:1: dotLoop : ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) ) ;
 	public final DefineGrammarItemsWalker.dotLoop_return dotLoop() throws RecognitionException {
 		DefineGrammarItemsWalker.dotLoop_return retval = new DefineGrammarItemsWalker.dotLoop_return();
 		retval.start = input.LT(1);
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:473:2: ( ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:473:4: ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:474:2: ( ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:474:4: ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) )
 			{
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:473:4: ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:474:4: ( ^( CLOSURE dotBlock ) | ^( POSITIVE_CLOSURE dotBlock ) )
 			int alt39=2;
 			int LA39_0 = input.LA(1);
 			if ( (LA39_0==CLOSURE) ) {
@@ -2929,7 +2930,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			switch (alt39) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:473:6: ^( CLOSURE dotBlock )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:474:6: ^( CLOSURE dotBlock )
 					{
 					match(input,CLOSURE,FOLLOW_CLOSURE_in_dotLoop1283); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2942,7 +2943,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:474:5: ^( POSITIVE_CLOSURE dotBlock )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:475:5: ^( POSITIVE_CLOSURE dotBlock )
 					{
 					match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_dotLoop1295); if (state.failed) return retval;
 					match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -2986,11 +2987,11 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "dotBlock"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:490:1: dotBlock : ^( BLOCK ^( ALT WILDCARD EOA ) EOB ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:491:1: dotBlock : ^( BLOCK ^( ALT WILDCARD EOA ) EOB ) ;
 	public final void dotBlock() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:491:2: ( ^( BLOCK ^( ALT WILDCARD EOA ) EOB ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:491:4: ^( BLOCK ^( ALT WILDCARD EOA ) EOB )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:492:2: ( ^( BLOCK ^( ALT WILDCARD EOA ) EOB ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:492:4: ^( BLOCK ^( ALT WILDCARD EOA ) EOB )
 			{
 			match(input,BLOCK,FOLLOW_BLOCK_in_dotBlock1320); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
@@ -3019,15 +3020,15 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "tree_"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:494:1: tree_ : ^( TREE_BEGIN ( element )+ ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:495:1: tree_ : ^( TREE_BEGIN ( element )+ ) ;
 	public final void tree_() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:495:2: ( ^( TREE_BEGIN ( element )+ ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:495:4: ^( TREE_BEGIN ( element )+ )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:496:2: ( ^( TREE_BEGIN ( element )+ ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:496:4: ^( TREE_BEGIN ( element )+ )
 			{
 			match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_tree_1346); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:495:17: ( element )+
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:496:17: ( element )+
 			int cnt40=0;
 			loop40:
 			while (true) {
@@ -3039,7 +3040,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt40) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:495:17: element
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:496:17: element
 					{
 					pushFollow(FOLLOW_element_in_tree_1348);
 					element();
@@ -3075,7 +3076,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "atom"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:498:1: atom[GrammarAST scope_] : ( ^(rr= RULE_REF (rarg= ARG_ACTION )? ) | ^(t= TOKEN_REF (targ= ARG_ACTION )? ) |c= CHAR_LITERAL |s= STRING_LITERAL | WILDCARD | ^( DOT ID atom[$ID] ) );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:499:1: atom[GrammarAST scope_] : ( ^(rr= RULE_REF (rarg= ARG_ACTION )? ) | ^(t= TOKEN_REF (targ= ARG_ACTION )? ) |c= CHAR_LITERAL |s= STRING_LITERAL | WILDCARD | ^( DOT ID atom[$ID] ) );
 	public final void atom(GrammarAST scope_) throws RecognitionException {
 		GrammarAST rr=null;
 		GrammarAST rarg=null;
@@ -3086,7 +3087,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 		GrammarAST ID11=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:499:2: ( ^(rr= RULE_REF (rarg= ARG_ACTION )? ) | ^(t= TOKEN_REF (targ= ARG_ACTION )? ) |c= CHAR_LITERAL |s= STRING_LITERAL | WILDCARD | ^( DOT ID atom[$ID] ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:500:2: ( ^(rr= RULE_REF (rarg= ARG_ACTION )? ) | ^(t= TOKEN_REF (targ= ARG_ACTION )? ) |c= CHAR_LITERAL |s= STRING_LITERAL | WILDCARD | ^( DOT ID atom[$ID] ) )
 			int alt43=6;
 			switch ( input.LA(1) ) {
 			case RULE_REF:
@@ -3127,12 +3128,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt43) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:499:4: ^(rr= RULE_REF (rarg= ARG_ACTION )? )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:500:4: ^(rr= RULE_REF (rarg= ARG_ACTION )? )
 					{
 					rr=(GrammarAST)match(input,RULE_REF,FOLLOW_RULE_REF_in_atom1366); if (state.failed) return;
 					if ( input.LA(1)==Token.DOWN ) {
 						match(input, Token.DOWN, null); if (state.failed) return;
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:499:19: (rarg= ARG_ACTION )?
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:500:19: (rarg= ARG_ACTION )?
 						int alt41=2;
 						int LA41_0 = input.LA(1);
 						if ( (LA41_0==ARG_ACTION) ) {
@@ -3140,7 +3141,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 						}
 						switch (alt41) {
 							case 1 :
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:499:20: rarg= ARG_ACTION
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:500:20: rarg= ARG_ACTION
 								{
 								rarg=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_atom1371); if (state.failed) return;
 								}
@@ -3162,12 +3163,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:508:4: ^(t= TOKEN_REF (targ= ARG_ACTION )? )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:509:4: ^(t= TOKEN_REF (targ= ARG_ACTION )? )
 					{
 					t=(GrammarAST)match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_atom1388); if (state.failed) return;
 					if ( input.LA(1)==Token.DOWN ) {
 						match(input, Token.DOWN, null); if (state.failed) return;
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:508:19: (targ= ARG_ACTION )?
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:509:19: (targ= ARG_ACTION )?
 						int alt42=2;
 						int LA42_0 = input.LA(1);
 						if ( (LA42_0==ARG_ACTION) ) {
@@ -3175,7 +3176,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 						}
 						switch (alt42) {
 							case 1 :
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:508:20: targ= ARG_ACTION
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:509:20: targ= ARG_ACTION
 								{
 								targ=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_atom1393); if (state.failed) return;
 								}
@@ -3204,7 +3205,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:524:4: c= CHAR_LITERAL
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:525:4: c= CHAR_LITERAL
 					{
 					c=(GrammarAST)match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_atom1409); if (state.failed) return;
 					if ( state.backtracking==0 ) {
@@ -3218,7 +3219,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 4 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:533:4: s= STRING_LITERAL
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:534:4: s= STRING_LITERAL
 					{
 					s=(GrammarAST)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_atom1420); if (state.failed) return;
 					if ( state.backtracking==0 ) {
@@ -3232,13 +3233,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 5 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:542:4: WILDCARD
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:543:4: WILDCARD
 					{
 					match(input,WILDCARD,FOLLOW_WILDCARD_in_atom1430); if (state.failed) return;
 					}
 					break;
 				case 6 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:543:4: ^( DOT ID atom[$ID] )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:544:4: ^( DOT ID atom[$ID] )
 					{
 					match(input,DOT,FOLLOW_DOT_in_atom1436); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -3267,10 +3268,10 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "ast_suffix"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:546:1: ast_suffix : ( ROOT | BANG );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:547:1: ast_suffix : ( ROOT | BANG );
 	public final void ast_suffix() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:547:2: ( ROOT | BANG )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:548:2: ( ROOT | BANG )
 			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:
 			{
 			if ( input.LA(1)==BANG||input.LA(1)==ROOT ) {
@@ -3302,7 +3303,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:551:1: rewrite : ( ^( REWRITES ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )* ) |);
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:552:1: rewrite : ( ^( REWRITES ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )* ) |);
 	public final DefineGrammarItemsWalker.rewrite_return rewrite() throws RecognitionException {
 		DefineGrammarItemsWalker.rewrite_return retval = new DefineGrammarItemsWalker.rewrite_return();
 		retval.start = input.LT(1);
@@ -3315,11 +3316,11 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			if ( state.backtracking == 0 )
 			{
 				if ( grammar.buildAST() )
-					currentRewriteRule.rewriteRefsDeep = new HashSet<GrammarAST>();
+					currentRewriteRule.rewriteRefsDeep = new LinkedHashSet<GrammarAST>();
 			}
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:562:2: ( ^( REWRITES ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )* ) |)
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:563:2: ( ^( REWRITES ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )* ) |)
 			int alt46=2;
 			int LA46_0 = input.LA(1);
 			if ( (LA46_0==REWRITES) ) {
@@ -3338,12 +3339,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			switch (alt46) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:562:4: ^( REWRITES ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )* )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:563:4: ^( REWRITES ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )* )
 					{
 					match(input,REWRITES,FOLLOW_REWRITES_in_rewrite1477); if (state.failed) return retval;
 					if ( input.LA(1)==Token.DOWN ) {
 						match(input, Token.DOWN, null); if (state.failed) return retval;
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:563:4: ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )*
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:564:4: ( ^( REWRITE (pred= SEMPRED )? rewrite_alternative ) )*
 						loop45:
 						while (true) {
 							int alt45=2;
@@ -3354,11 +3355,11 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 							switch (alt45) {
 							case 1 :
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:563:6: ^( REWRITE (pred= SEMPRED )? rewrite_alternative )
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:564:6: ^( REWRITE (pred= SEMPRED )? rewrite_alternative )
 								{
 								match(input,REWRITE,FOLLOW_REWRITE_in_rewrite1486); if (state.failed) return retval;
 								match(input, Token.DOWN, null); if (state.failed) return retval;
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:563:17: (pred= SEMPRED )?
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:564:17: (pred= SEMPRED )?
 								int alt44=2;
 								int LA44_0 = input.LA(1);
 								if ( (LA44_0==SEMPRED) ) {
@@ -3366,7 +3367,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 								}
 								switch (alt44) {
 									case 1 :
-										// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:563:18: pred= SEMPRED
+										// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:564:18: pred= SEMPRED
 										{
 										pred=(GrammarAST)match(input,SEMPRED,FOLLOW_SEMPRED_in_rewrite1491); if (state.failed) return retval;
 										}
@@ -3401,7 +3402,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:575:2: 
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:576:2: 
 					{
 					}
 					break;
@@ -3425,7 +3426,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite_block"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:577:1: rewrite_block : ^( BLOCK rewrite_alternative EOB ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:578:1: rewrite_block : ^( BLOCK rewrite_alternative EOB ) ;
 	public final DefineGrammarItemsWalker.rewrite_block_return rewrite_block() throws RecognitionException {
 		DefineGrammarItemsWalker.rewrite_block_return retval = new DefineGrammarItemsWalker.rewrite_block_return();
 		retval.start = input.LT(1);
@@ -3436,13 +3437,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			{
 				// don't do if guessing
 				currentRewriteBlock=((GrammarAST)retval.start); // pts to BLOCK node
-				currentRewriteBlock.rewriteRefsShallow = new HashSet<GrammarAST>();
-				currentRewriteBlock.rewriteRefsDeep = new HashSet<GrammarAST>();
+				currentRewriteBlock.rewriteRefsShallow = new LinkedHashSet<GrammarAST>();
+				currentRewriteBlock.rewriteRefsDeep = new LinkedHashSet<GrammarAST>();
 			}
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:589:2: ( ^( BLOCK rewrite_alternative EOB ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:589:6: ^( BLOCK rewrite_alternative EOB )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:590:2: ( ^( BLOCK rewrite_alternative EOB ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:590:6: ^( BLOCK rewrite_alternative EOB )
 			{
 			match(input,BLOCK,FOLLOW_BLOCK_in_rewrite_block1539); if (state.failed) return retval;
 			match(input, Token.DOWN, null); if (state.failed) return retval;
@@ -3480,12 +3481,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite_alternative"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:603:1: rewrite_alternative : ({...}? => ^(a= ALT ( ( rewrite_element )+ | EPSILON ) EOA ) |{...}? => rewrite_template | ETC {...}?);
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:1: rewrite_alternative : ({...}? => ^(a= ALT ( ( rewrite_element )+ | EPSILON ) EOA ) |{...}? => rewrite_template | ETC {...}?);
 	public final void rewrite_alternative() throws RecognitionException {
 		GrammarAST a=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:2: ({...}? => ^(a= ALT ( ( rewrite_element )+ | EPSILON ) EOA ) |{...}? => rewrite_template | ETC {...}?)
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:2: ({...}? => ^(a= ALT ( ( rewrite_element )+ | EPSILON ) EOA ) |{...}? => rewrite_template | ETC {...}?)
 			int alt49=3;
 			int LA49_0 = input.LA(1);
 			if ( (LA49_0==ALT) && (((grammar.buildTemplate())||(grammar.buildAST())))) {
@@ -3548,7 +3549,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 			switch (alt49) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:4: {...}? => ^(a= ALT ( ( rewrite_element )+ | EPSILON ) EOA )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:4: {...}? => ^(a= ALT ( ( rewrite_element )+ | EPSILON ) EOA )
 					{
 					if ( !((grammar.buildAST())) ) {
 						if (state.backtracking>0) {state.failed=true; return;}
@@ -3556,7 +3557,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					a=(GrammarAST)match(input,ALT,FOLLOW_ALT_in_rewrite_alternative1575); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:38: ( ( rewrite_element )+ | EPSILON )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:38: ( ( rewrite_element )+ | EPSILON )
 					int alt48=2;
 					int LA48_0 = input.LA(1);
 					if ( (LA48_0==ACTION||LA48_0==CHAR_LITERAL||LA48_0==CLOSURE||LA48_0==LABEL||LA48_0==OPTIONAL||LA48_0==POSITIVE_CLOSURE||LA48_0==RULE_REF||LA48_0==STRING_LITERAL||LA48_0==TOKEN_REF||LA48_0==TREE_BEGIN) ) {
@@ -3575,9 +3576,9 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 					switch (alt48) {
 						case 1 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:40: ( rewrite_element )+
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:40: ( rewrite_element )+
 							{
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:40: ( rewrite_element )+
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:40: ( rewrite_element )+
 							int cnt47=0;
 							loop47:
 							while (true) {
@@ -3589,7 +3590,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 								switch (alt47) {
 								case 1 :
-									// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:42: rewrite_element
+									// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:42: rewrite_element
 									{
 									pushFollow(FOLLOW_rewrite_element_in_rewrite_alternative1581);
 									rewrite_element();
@@ -3610,7 +3611,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 							}
 							break;
 						case 2 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:604:63: EPSILON
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:63: EPSILON
 							{
 							match(input,EPSILON,FOLLOW_EPSILON_in_rewrite_alternative1588); if (state.failed) return;
 							}
@@ -3624,7 +3625,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:605:4: {...}? => rewrite_template
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:606:4: {...}? => rewrite_template
 					{
 					if ( !((grammar.buildTemplate())) ) {
 						if (state.backtracking>0) {state.failed=true; return;}
@@ -3637,7 +3638,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:606:4: ETC {...}?
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:607:4: ETC {...}?
 					{
 					match(input,ETC,FOLLOW_ETC_in_rewrite_alternative1608); if (state.failed) return;
 					if ( !((this.blockLevel==1)) ) {
@@ -3662,10 +3663,10 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite_element"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:609:1: rewrite_element : ( rewrite_atom | rewrite_ebnf | rewrite_tree );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:610:1: rewrite_element : ( rewrite_atom | rewrite_ebnf | rewrite_tree );
 	public final void rewrite_element() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:610:2: ( rewrite_atom | rewrite_ebnf | rewrite_tree )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:611:2: ( rewrite_atom | rewrite_ebnf | rewrite_tree )
 			int alt50=3;
 			switch ( input.LA(1) ) {
 			case ACTION:
@@ -3698,7 +3699,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt50) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:610:4: rewrite_atom
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:611:4: rewrite_atom
 					{
 					pushFollow(FOLLOW_rewrite_atom_in_rewrite_element1622);
 					rewrite_atom();
@@ -3707,7 +3708,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:611:4: rewrite_ebnf
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:612:4: rewrite_ebnf
 					{
 					pushFollow(FOLLOW_rewrite_ebnf_in_rewrite_element1627);
 					rewrite_ebnf();
@@ -3716,7 +3717,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:612:4: rewrite_tree
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:613:4: rewrite_tree
 					{
 					pushFollow(FOLLOW_rewrite_tree_in_rewrite_element1632);
 					rewrite_tree();
@@ -3740,10 +3741,10 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite_ebnf"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:615:1: rewrite_ebnf : ( ^( OPTIONAL rewrite_block ) | ^( CLOSURE rewrite_block ) | ^( POSITIVE_CLOSURE rewrite_block ) );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:616:1: rewrite_ebnf : ( ^( OPTIONAL rewrite_block ) | ^( CLOSURE rewrite_block ) | ^( POSITIVE_CLOSURE rewrite_block ) );
 	public final void rewrite_ebnf() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:616:2: ( ^( OPTIONAL rewrite_block ) | ^( CLOSURE rewrite_block ) | ^( POSITIVE_CLOSURE rewrite_block ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:617:2: ( ^( OPTIONAL rewrite_block ) | ^( CLOSURE rewrite_block ) | ^( POSITIVE_CLOSURE rewrite_block ) )
 			int alt51=3;
 			switch ( input.LA(1) ) {
 			case OPTIONAL:
@@ -3769,7 +3770,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt51) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:616:4: ^( OPTIONAL rewrite_block )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:617:4: ^( OPTIONAL rewrite_block )
 					{
 					match(input,OPTIONAL,FOLLOW_OPTIONAL_in_rewrite_ebnf1645); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -3782,7 +3783,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:617:4: ^( CLOSURE rewrite_block )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:618:4: ^( CLOSURE rewrite_block )
 					{
 					match(input,CLOSURE,FOLLOW_CLOSURE_in_rewrite_ebnf1656); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -3795,7 +3796,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:618:4: ^( POSITIVE_CLOSURE rewrite_block )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:619:4: ^( POSITIVE_CLOSURE rewrite_block )
 					{
 					match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_rewrite_ebnf1667); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -3823,11 +3824,11 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite_tree"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:621:1: rewrite_tree : ^( TREE_BEGIN rewrite_atom ( rewrite_element )* ) ;
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:622:1: rewrite_tree : ^( TREE_BEGIN rewrite_atom ( rewrite_element )* ) ;
 	public final void rewrite_tree() throws RecognitionException {
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:622:2: ( ^( TREE_BEGIN rewrite_atom ( rewrite_element )* ) )
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:622:6: ^( TREE_BEGIN rewrite_atom ( rewrite_element )* )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:623:2: ( ^( TREE_BEGIN rewrite_atom ( rewrite_element )* ) )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:623:6: ^( TREE_BEGIN rewrite_atom ( rewrite_element )* )
 			{
 			match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_rewrite_tree1686); if (state.failed) return;
 			match(input, Token.DOWN, null); if (state.failed) return;
@@ -3835,7 +3836,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			rewrite_atom();
 			state._fsp--;
 			if (state.failed) return;
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:622:33: ( rewrite_element )*
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:623:33: ( rewrite_element )*
 			loop52:
 			while (true) {
 				int alt52=2;
@@ -3846,7 +3847,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 				switch (alt52) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:622:35: rewrite_element
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:623:35: rewrite_element
 					{
 					pushFollow(FOLLOW_rewrite_element_in_rewrite_tree1692);
 					rewrite_element();
@@ -3881,7 +3882,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite_atom"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:625:1: rewrite_atom : ( RULE_REF | ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL ) | LABEL | ACTION );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:626:1: rewrite_atom : ( RULE_REF | ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL ) | LABEL | ACTION );
 	public final DefineGrammarItemsWalker.rewrite_atom_return rewrite_atom() throws RecognitionException {
 		DefineGrammarItemsWalker.rewrite_atom_return retval = new DefineGrammarItemsWalker.rewrite_atom_return();
 		retval.start = input.LT(1);
@@ -3917,7 +3918,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:654:2: ( RULE_REF | ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL ) | LABEL | ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:655:2: ( RULE_REF | ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL ) | LABEL | ACTION )
 			int alt55=4;
 			switch ( input.LA(1) ) {
 			case RULE_REF:
@@ -3950,15 +3951,15 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt55) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:654:4: RULE_REF
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:655:4: RULE_REF
 					{
 					match(input,RULE_REF,FOLLOW_RULE_REF_in_rewrite_atom1713); if (state.failed) return retval;
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:655:4: ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:656:4: ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL )
 					{
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:655:4: ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:656:4: ( ^( TOKEN_REF ( ARG_ACTION )? ) | CHAR_LITERAL | STRING_LITERAL )
 					int alt54=3;
 					switch ( input.LA(1) ) {
 					case TOKEN_REF:
@@ -3984,12 +3985,12 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					switch (alt54) {
 						case 1 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:655:6: ^( TOKEN_REF ( ARG_ACTION )? )
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:656:6: ^( TOKEN_REF ( ARG_ACTION )? )
 							{
 							match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewrite_atom1723); if (state.failed) return retval;
 							if ( input.LA(1)==Token.DOWN ) {
 								match(input, Token.DOWN, null); if (state.failed) return retval;
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:656:5: ( ARG_ACTION )?
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:657:5: ( ARG_ACTION )?
 								int alt53=2;
 								int LA53_0 = input.LA(1);
 								if ( (LA53_0==ARG_ACTION) ) {
@@ -3997,7 +3998,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 								}
 								switch (alt53) {
 									case 1 :
-										// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:656:7: ARG_ACTION
+										// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:657:7: ARG_ACTION
 										{
 										ARG_ACTION12=(GrammarAST)match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rewrite_atom1731); if (state.failed) return retval;
 										if ( state.backtracking==0 ) {
@@ -4015,13 +4016,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 							}
 							break;
 						case 2 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:663:5: CHAR_LITERAL
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:664:5: CHAR_LITERAL
 							{
 							match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_rewrite_atom1756); if (state.failed) return retval;
 							}
 							break;
 						case 3 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:664:5: STRING_LITERAL
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:665:5: STRING_LITERAL
 							{
 							match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_rewrite_atom1762); if (state.failed) return retval;
 							}
@@ -4032,13 +4033,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:666:4: LABEL
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:667:4: LABEL
 					{
 					match(input,LABEL,FOLLOW_LABEL_in_rewrite_atom1771); if (state.failed) return retval;
 					}
 					break;
 				case 4 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:667:4: ACTION
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:668:4: ACTION
 					{
 					ACTION13=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_rewrite_atom1776); if (state.failed) return retval;
 					if ( state.backtracking==0 ) {
@@ -4064,7 +4065,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 
 	// $ANTLR start "rewrite_template"
-	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:674:1: rewrite_template : ( ^( ALT EPSILON EOA ) | ^( TEMPLATE (id= ID |ind= ACTION ) ^( ARGLIST ( ^( ARG arg= ID a= ACTION ) )* ) ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )? ) |act= ACTION );
+	// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:675:1: rewrite_template : ( ^( ALT EPSILON EOA ) | ^( TEMPLATE (id= ID |ind= ACTION ) ^( ARGLIST ( ^( ARG arg= ID a= ACTION ) )* ) ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )? ) |act= ACTION );
 	public final void rewrite_template() throws RecognitionException {
 		GrammarAST id=null;
 		GrammarAST ind=null;
@@ -4073,7 +4074,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 		GrammarAST act=null;
 
 		try {
-			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:675:2: ( ^( ALT EPSILON EOA ) | ^( TEMPLATE (id= ID |ind= ACTION ) ^( ARGLIST ( ^( ARG arg= ID a= ACTION ) )* ) ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )? ) |act= ACTION )
+			// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:676:2: ( ^( ALT EPSILON EOA ) | ^( TEMPLATE (id= ID |ind= ACTION ) ^( ARGLIST ( ^( ARG arg= ID a= ACTION ) )* ) ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )? ) |act= ACTION )
 			int alt59=3;
 			switch ( input.LA(1) ) {
 			case ALT:
@@ -4099,7 +4100,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 			}
 			switch (alt59) {
 				case 1 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:675:4: ^( ALT EPSILON EOA )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:676:4: ^( ALT EPSILON EOA )
 					{
 					match(input,ALT,FOLLOW_ALT_in_rewrite_template1793); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
@@ -4110,11 +4111,11 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 2 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:676:4: ^( TEMPLATE (id= ID |ind= ACTION ) ^( ARGLIST ( ^( ARG arg= ID a= ACTION ) )* ) ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )? )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:677:4: ^( TEMPLATE (id= ID |ind= ACTION ) ^( ARGLIST ( ^( ARG arg= ID a= ACTION ) )* ) ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )? )
 					{
 					match(input,TEMPLATE,FOLLOW_TEMPLATE_in_rewrite_template1806); if (state.failed) return;
 					match(input, Token.DOWN, null); if (state.failed) return;
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:676:16: (id= ID |ind= ACTION )
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:677:16: (id= ID |ind= ACTION )
 					int alt56=2;
 					int LA56_0 = input.LA(1);
 					if ( (LA56_0==ID) ) {
@@ -4133,13 +4134,13 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 					switch (alt56) {
 						case 1 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:676:17: id= ID
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:677:17: id= ID
 							{
 							id=(GrammarAST)match(input,ID,FOLLOW_ID_in_rewrite_template1811); if (state.failed) return;
 							}
 							break;
 						case 2 :
-							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:676:23: ind= ACTION
+							// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:677:23: ind= ACTION
 							{
 							ind=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_rewrite_template1815); if (state.failed) return;
 							}
@@ -4150,7 +4151,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					match(input,ARGLIST,FOLLOW_ARGLIST_in_rewrite_template1823); if (state.failed) return;
 					if ( input.LA(1)==Token.DOWN ) {
 						match(input, Token.DOWN, null); if (state.failed) return;
-						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:678:5: ( ^( ARG arg= ID a= ACTION ) )*
+						// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:679:5: ( ^( ARG arg= ID a= ACTION ) )*
 						loop57:
 						while (true) {
 							int alt57=2;
@@ -4161,7 +4162,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 							switch (alt57) {
 							case 1 :
-								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:678:7: ^( ARG arg= ID a= ACTION )
+								// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:679:7: ^( ARG arg= ID a= ACTION )
 								{
 								match(input,ARG,FOLLOW_ARG_in_rewrite_template1833); if (state.failed) return;
 								match(input, Token.DOWN, null); if (state.failed) return;
@@ -4191,7 +4192,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 										trackInlineAction(ind);
 									}
 								}
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:692:4: ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )?
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:693:4: ( DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL )?
 					int alt58=2;
 					int LA58_0 = input.LA(1);
 					if ( ((LA58_0 >= DOUBLE_ANGLE_STRING_LITERAL && LA58_0 <= DOUBLE_QUOTE_STRING_LITERAL)) ) {
@@ -4221,7 +4222,7 @@ public class DefineGrammarItemsWalker extends TreeParser {
 					}
 					break;
 				case 3 :
-					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:696:4: act= ACTION
+					// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:697:4: act= ACTION
 					{
 					act=(GrammarAST)match(input,ACTION,FOLLOW_ACTION_in_rewrite_template1898); if (state.failed) return;
 					if ( state.backtracking==0 ) {
@@ -4245,8 +4246,8 @@ public class DefineGrammarItemsWalker extends TreeParser {
 
 	// $ANTLR start synpred1_DefineGrammarItemsWalker
 	public final void synpred1_DefineGrammarItemsWalker_fragment() throws RecognitionException {
-		// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:463:4: ( dotLoop )
-		// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:463:5: dotLoop
+		// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:464:4: ( dotLoop )
+		// org/antlr/grammar/v3/DefineGrammarItemsWalker.g:464:5: dotLoop
 		{
 		pushFollow(FOLLOW_dotLoop_in_synpred1_DefineGrammarItemsWalker1222);
 		dotLoop();
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/LeftRecursiveRuleWalker.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/LeftRecursiveRuleWalker.java
index b164d74..d367fef 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/LeftRecursiveRuleWalker.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/LeftRecursiveRuleWalker.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/LeftRecursiveRuleWalker.g 2015-07-21 19:37:10
+// $ANTLR 3.5 org/antlr/grammar/v3/LeftRecursiveRuleWalker.g 2015-09-07 14:14:35
 
 package org.antlr.grammar.v3;
 
diff --git a/debian/generated-sources/antlr3/org/antlr/grammar/v3/TreeToNFAConverter.java b/debian/generated-sources/antlr3/org/antlr/grammar/v3/TreeToNFAConverter.java
index c38a5f8..45b5d71 100644
--- a/debian/generated-sources/antlr3/org/antlr/grammar/v3/TreeToNFAConverter.java
+++ b/debian/generated-sources/antlr3/org/antlr/grammar/v3/TreeToNFAConverter.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.5 org/antlr/grammar/v3/TreeToNFAConverter.g 2015-07-21 19:37:11
+// $ANTLR 3.5 org/antlr/grammar/v3/TreeToNFAConverter.g 2015-09-07 14:14:36
 
 package org.antlr.grammar.v3;
 
diff --git a/debian/patches/05-reproducible-parsers.patch b/debian/patches/05-reproducible-parsers.patch
new file mode 100644
index 0000000..a06bcaf
--- /dev/null
+++ b/debian/patches/05-reproducible-parsers.patch
@@ -0,0 +1,42 @@
+Description: Replace the HashSets with LinkedHashSets to make the generated parsers reproducible
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/tool/src/main/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.g
++++ b/tool/src/main/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.g
+@@ -45,6 +45,7 @@
+ package org.antlr.grammar.v3;
+ import org.antlr.tool.*;
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Set;
+ }
+ 
+@@ -279,7 +280,7 @@
+ throwsSpec returns [HashSet<String> exceptions]
+ @init
+ {
+-	$exceptions = new HashSet<String>();
++	$exceptions = new LinkedHashSet<String>();
+ }
+ 	:	^('throws' (ID {$exceptions.add($ID.text);})+ )
+ 	;
+@@ -556,7 +557,7 @@
+ 	if ( state.backtracking == 0 )
+ 	{
+ 		if ( grammar.buildAST() )
+-			currentRewriteRule.rewriteRefsDeep = new HashSet<GrammarAST>();
++			currentRewriteRule.rewriteRefsDeep = new LinkedHashSet<GrammarAST>();
+ 	}
+ }
+ 	:	^(	REWRITES
+@@ -582,8 +583,8 @@
+ 	{
+ 		// don't do if guessing
+ 		currentRewriteBlock=$start; // pts to BLOCK node
+-		currentRewriteBlock.rewriteRefsShallow = new HashSet<GrammarAST>();
+-		currentRewriteBlock.rewriteRefsDeep = new HashSet<GrammarAST>();
++		currentRewriteBlock.rewriteRefsShallow = new LinkedHashSet<GrammarAST>();
++		currentRewriteBlock.rewriteRefsDeep = new LinkedHashSet<GrammarAST>();
+ 	}
+ }
+ 	:   ^( BLOCK rewrite_alternative EOB )
diff --git a/debian/patches/series b/debian/patches/series
index 74d4fd6..a2e7107 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 02-increase-default-conversion-timeout.patch
 03-fix-c-template.patch
 04-backward-compatibility.patch
+05-reproducible-parsers.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/antlr3.git



More information about the pkg-java-commits mailing list