examples: annotate examples
[nit.git] / contrib / nitcc / examples / blob.sablecc
1 /* Special lexer that will be hijacked. See blob.nit */
2 Grammar blob;
3
4 Lexer
5 // These tokens are recognized by the genuine lexer
6 d = '0'..'9';
7 int = d+;
8 white = #9..#13 | ' ';
9 // Need to name this token, we will use it to change context
10 endmark = '}}}';
11
12 // Special token that the genuine lexer is expect to not recognize.
13 // But that muse be known by the parser or the application.
14 // TODO: Maybe add a special keyword?
15 //       blob = Phony;
16 blob = #0;
17
18 Parser
19 Ignored white;
20 ps = p*;
21 // Parser do not know that `blob` is phony.
22 p = blob | '{{{' int endmark;