nitcc: introduce nitcc
[nit.git] / contrib / nitcc / t / inf5000-06-grammaire2-polygone.sablecc
1 Grammar polygones;
2 Lexer
3   num = ('0'..'9')+;
4   blank = ' ' | #9 | #10 | #13;
5
6 Parser
7   Ignored blank;
8   polygone = '(' (point Separator ',')* ')' ;
9   point =
10     {cart:} '(' num 'x' ',' num 'y' ')' |
11     {pol:} '(' num ',' num 'deg' ')' ;