nitcc: introduce nitcc
[nit.git] / contrib / nitcc / t / lexer-c-comment.sablecc
1 Grammar re;
2 Lexer
3
4         notst = Any - '*';
5         notstsl = notst - '/';
6
7         com1 = '/*' (notst | '*'+ notstsl)* '*'+ '/';
8         com2 = '/*' notst* ('*' (notstsl notst*)?)* '*/'; //alt1 //alt2 //alt3 //alt4
9         //alt1 com2 = Shortest ('/*' Any* '*/');
10         //alt2 com2 = '/*' (Any* - '*/') '*/';
11         //alt3 com2 = '/*' (('' Lookahead Not '*/') Any)* '*/';
12         //alt4 com2 = '/*' (Any* Except (Any* '*/' Any*)) '*/';
13
14         dummy = notst | notstsl;
15
16 Parser
17
18 p = com1 | com2 | dummy;
19