forked from jasder/antlr
Fix parser tokens in generated Go tests
This commit is contained in:
parent
29eaba44b0
commit
40b7e1bf12
|
@ -227,6 +227,8 @@ RuleInvocationStack() ::= "GetRuleInvocationStackAsString()"
|
|||
|
||||
LL_EXACT_AMBIG_DETECTION() ::= <<Interpreter.PredictionMode = PredictionMode.LlExactAmbigDetection;>>
|
||||
|
||||
ParserToken(parser, token) ::= <%<parser>.<token>%>
|
||||
|
||||
ParserPropertyMember() ::= <<
|
||||
@members {
|
||||
bool Property() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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' ;
|
||||
|
|
Loading…
Reference in New Issue