nitlanguage
/
nit.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
nitc/ios: use a camel case version of app namespace for some version of XCode
[nit.git]
/
contrib
/
nitcc
/
tests
/
lexer-shortest-longest.sablecc
1
Grammar re;
2
Lexer
3
a = 'a';
4
ab = 'ab';
5
a_ab = a | ab;
6
//alb_ab = 'a' Lookahead Not 'b' | 'ab';
7
s = Shortest(a_ab);
8
l = Longest(a_ab);
9
dummy = 'x' (a|ab|s|l);
10
blank = #10 | #13 | #32;
11
12
Parser
13
Ignored blank;
14
p = t+;
15
t =
16
l | //alt1
17
//alt1 a | s |
18
//alt2 a |
19
dummy;
20