All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.antlr.v4.test.runtime.templates.SemPredEvalParser.ToLeftWithVaryingPredicate.stg Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version
/** 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