org.antlr.v4.test.runtime.templates.SemPredEvalParser.ToLeftWithVaryingPredicate.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.
/** In this case, we use predicates that depend on global information
* like we would do for a symbol table. We simply execute
* the predicates assuming that all necessary information is available.
* The i++ action is done outside of the prediction and so it is executed.
*/
TestType() ::= "Parser"
Options ::= [
"Debug": false
]
Grammar ::= [
"T": {}
]
Input() ::= "x x y"
Rule() ::= "s"
Output() ::= <<
i=1
alt 2
i=2
alt 1
i=3
alt 2<\n>
>>
Errors() ::= ""
grammar(grammarName) ::= <<
grammar ;
@parser::members {}
s : ({
} a)+ ;
a : {}? ID {}
| {}? ID {}
;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') -> skip ;
>>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy