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

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

There is a newer version: 4.9.0
Show newest version
TestType() ::= "Parser"

Options ::= [
	"Debug": false
]

Grammar ::= [
	"T": {}
]

Input() ::= "x ; y"

Rule() ::= "s"

Output() ::= <<
>>

Errors() ::= <<
line 1:0 no viable alternative at input 'x'
line 1:4 no viable alternative at input 'y'<\n>
>>

grammar(grammarName) ::= <<
grammar ;
s : a ';' a;
// ';' helps us to resynchronize without consuming
// 2nd 'a' reference. We our testing that the DFA also
// throws an exception if the validating predicate fails
a : {}? ID  {}
  | {}?  INT {}
  ;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') -> skip ;
>>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy