nitcc: introduce nitcc
[nit.git] / contrib / nitcc / t / inf5000-06-grammaire2-grammaire2.sablecc
1 Grammar grammaire;
2 Lexer
3 id = ('a'..'z')+;
4 altid = '{' id ':}';
5 str = '\'' (Any* - '\'') '\'';
6 blank = ' ' | #9 | #10 | #13;
7
8 Parser
9 Ignored blank;
10 prods = prod+;
11 prod = id '=' (alt Separator '|')+ ';' ;
12 alt = altid? atom* ;
13 atom = {id:} id | {str:} str ;