2022-09-19 11:57:16 +02:00

12 lines
191 B
ANTLR

grammar ITE;
prog: stmt EOF;
stmt : ifStmt | ID ;
ifStmt : 'if' ID 'then' thenstmt=stmt ('else' elsestmt=stmt)?;
ID : [a-zA-Z]+;
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines