Fix parser tokens in generated Go tests

This commit is contained in:
Will Faught 2016-06-16 16:21:45 -07:00
parent 29eaba44b0
commit 40b7e1bf12
12 changed files with 22 additions and 2 deletions

View File

@ -227,6 +227,8 @@ RuleInvocationStack() ::= "GetRuleInvocationStackAsString()"
LL_EXACT_AMBIG_DETECTION() ::= <<Interpreter.PredictionMode = PredictionMode.LlExactAmbigDetection;>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
bool Property() {

View File

@ -229,6 +229,8 @@ RuleInvocationStack() ::= "p.GetRuleInvocationStack(nil)"
LL_EXACT_AMBIG_DETECTION() ::= <<p.Interpreter.SetPredictionMode(antlr.PredictionModeLLExactAmbigDetection);>>
ParserToken(parser, token) ::= <%<parser><token>%>
ParserPropertyMember() ::= <<
@members {
func Property() bool {

View File

@ -233,6 +233,8 @@ RuleInvocationStack() ::= "getRuleInvocationStack()"
LL_EXACT_AMBIG_DETECTION() ::= <<_interp.setPredictionMode(PredictionMode.LL_EXACT_AMBIG_DETECTION);>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
boolean Property() {

View File

@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac
LL_EXACT_AMBIG_DETECTION() ::= <<this._interp.predictionMode = antlr4.atn.PredictionMode.LL_EXACT_AMBIG_DETECTION;>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
this.Property = function() {

View File

@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac
LL_EXACT_AMBIG_DETECTION() ::= <<this._interp.predictionMode = antlr4.atn.PredictionMode.LL_EXACT_AMBIG_DETECTION;>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
this.Property = function() {

View File

@ -235,6 +235,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac
LL_EXACT_AMBIG_DETECTION() ::= <<this._interp.predictionMode = antlr4.atn.PredictionMode.LL_EXACT_AMBIG_DETECTION;>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
this.Property = function() {

View File

@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac
LL_EXACT_AMBIG_DETECTION() ::= <<this._interp.predictionMode = antlr4.atn.PredictionMode.LL_EXACT_AMBIG_DETECTION;>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
this.Property = function() {

View File

@ -233,6 +233,8 @@ RuleInvocationStack() ::= "antlr4.Utils.arrayToString(this.getRuleInvocationStac
LL_EXACT_AMBIG_DETECTION() ::= <<this._interp.predictionMode = antlr4.atn.PredictionMode.LL_EXACT_AMBIG_DETECTION;>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
this.Property = function() {

View File

@ -237,6 +237,8 @@ RuleInvocationStack() ::= "str_list(self.getRuleInvocationStack())"
LL_EXACT_AMBIG_DETECTION() ::= <<self._interp.predictionMode = PredictionMode.LL_EXACT_AMBIG_DETECTION>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
def Property(self):

View File

@ -239,6 +239,8 @@ RuleInvocationStack() ::= "str_list(self.getRuleInvocationStack())"
LL_EXACT_AMBIG_DETECTION() ::= <<self._interp.predictionMode = PredictionMode.LL_EXACT_AMBIG_DETECTION>>
ParserToken(parser, token) ::= <%<parser>.<token>%>
ParserPropertyMember() ::= <<
@members {
def Property(self):

View File

@ -25,7 +25,7 @@ grammar(grammarName) ::= <<
grammar <grammarName>;
s : stmt EOF ;
stmt : ifStmt | ID;
ifStmt : 'if' ID stmt ('else' stmt | { <LANotEquals("1", {<grammarName>Parser.ELSE})> }?);
ifStmt : 'if' ID stmt ('else' stmt | { <LANotEquals("1", {<grammarName><ParserToken("Parser", "ELSE")>})> }?);
ELSE : 'else';
ID : [a-zA-Z]+;
WS : [ \\n\\t]+ -> skip;

View File

@ -18,7 +18,7 @@ file_
@after {<ToStringTree("$ctx"):writeln()>}
: para para EOF ;
para: paraContent NL NL ;
paraContent : ('s'|'x'|{<LANotEquals("2",{<grammarName>Parser.NL})>}? NL)+ ;
paraContent : ('s'|'x'|{<LANotEquals("2",{<grammarName><ParserToken("Parser", "NL")>})>}? NL)+ ;
NL : '\n' ;
s : 's' ;
X : 'x' ;