Move "metadata" methods to top of generated parser

This commit is contained in:
Sam Harwell 2012-02-20 17:21:44 -06:00
parent a81b1a17eb
commit ca0b1d399c
1 changed files with 7 additions and 4 deletions

View File

@ -128,21 +128,24 @@ public class <parser.name> extends <superclass> {
public static final String[] ruleNames = {
<parser.ruleNames:{r | "<r>"}; separator=", ", wrap, anchor>
};
<namedActions.members>
<extras>
<parser:(ctor)()>
<funcs; separator="\n">
@Override
public String getGrammarFileName() { return "<parser.grammarFileName>"; }
@Override
public String[] getTokenNames() { return tokenNames; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public ATN getATN() { return _ATN; }
<namedActions.members>
<extras>
<parser:(ctor)()>
<funcs; separator="\n">
<if(sempredFuncs)>
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch ( ruleIndex ) {