
org.antlr.v4.test.runtime.templates.SemPredEvalParser.PredicateDependentOnArg.stg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of runtime-testsuite Show documentation
Show all versions of runtime-testsuite Show documentation
A collection of tests for ANTLR 4 Runtime libraries.
The newest version!
/**
* In this case, we're passing a parameter into a rule that uses that
* information to predict the alternatives. This is the special case
* where we know exactly which context we are in. The context stack
* is empty and we have not dipped into the outer context to make a decision.
*/
TestType() ::= "Parser"
Options ::= [
"Debug": false
]
Grammar ::= [
"T": {}
]
Input() ::= "a b"
Rule() ::= "s"
Output() ::= <<
alt 2
alt 1<\n>
>>
Errors() ::= ""
grammar(grammarName) ::= <<
grammar ;
@parser::members {}
s : a[2] a[1];
a[ i]
: {}? ID {}
| {}? ID {}
;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') -> skip ;
>>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy