@mike-lischke/antlr-tgen
Version:
A generator for antlr-ng runtime test cases
45 lines (35 loc) • 569 B
Plain Text
[notes]
Loopback doesn't eval predicate at start of alt
[type]
Parser
[grammar]
grammar T;
file_
@after {<ToStringTree("$ctx"):writeln()>}
: para para EOF ;
para: paraContent NL NL ;
paraContent : ('s'|'x'|{<LANotEquals("2",{T<ParserToken("Parser", "NL")>})>}? NL)+ ;
NL : '\n' ;
s : 's' ;
X : 'x' ;
[start]
file_
[input]
"""s
x
"""
[output]
"""(file_ (para (paraContent s) \n \n) (para (paraContent \n x \n)) <EOF>)
"""
[errors]
"""line 5:0 mismatched input '<EOF>' expecting {'s', '\n', 'x'}
"""
[skip]
Cpp
CSharp
Dart
Go
JavaScript
TypeScript
PHP
Python3