CAP/TP02/demo_files/exo6/Exercice6.g4
2024-10-08 08:25:14 +02:00

19 lines
294 B
ANTLR

//define a lexical analyser called Exercice6
grammar Exercice6;
full_expr: expr ';' EOF ;
expr:
| LBRA expr RBRA expr
| LPAR expr RPAR expr
|
;
LPAR: '(' ;
RPAR: ')' ;
LBRA: '[' ;
RBRA: ']' ;
CHARS: ~[()[\]] -> skip;
WS: [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines