@mike-lischke/antlr-tgen
Version:
A generator for antlr-ng runtime test cases
33 lines (26 loc) • 475 B
Plain Text
[this compiles; see https://github.com/antlr/antlr4/issues/2016
[ ]
Parser
[ ]
grammar Test;
expression
@after {
<AssertIsList("$args")>
}
: op=NOT args+=expression
| args+=expression (op=AND args+=expression)+
| args+=expression (op=OR args+=expression)+
| IDENTIFIER
;
AND : 'and' ;
OR : 'or' ;
NOT : 'not' ;
IDENTIFIER : [a-zA-Z_][a-zA-Z0-9_]* ;
WS : [ \t\r\n]+ -> skip ;
[ ]
expression
[ ]
a and b
[ ]
PHP
]
Checks that