-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathXcoreLexer.g4
56 lines (46 loc) · 998 Bytes
/
XcoreLexer.g4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
lexer grammar XcoreLexer;
channels { WS_CHANNEL }
WS:[t]+ -> channel(WS_CHANNEL);
NL:('rn' | 'r' | 'n');
Package:'package';
Abstract:'abstract';
Class:'class';
Interface:'interface';
Extends:'extends';
Comma:',';
Dot:'.';
CurlyBraceOpen:'{';
CurlyBraceClose:'}';
AngleBraceOpen:'<';
AngleBraceClose:'>';
Unordered:'unordered';
Unique:'unique';
Readonly:'readonly';
Transient:'transient';
Unsettable:'unsettable';
Volatile:'volatile';
Derived:'derived';
Idattr:'id';
Contains:'contains';
Refers:'refers';
Opposite:'opposite';
Operation:'op';
Void:'void';
BraceOpen:'(';
BraceClose:')';
Throws:'throws';
SquareBraceOpen:'[';
SquareBraceClose:']';
Questionmark:'?';
Star:'*';
Plus:'+';
Minus:'-';
Dotdot:'..';
Ampersand:'&';
Enum:'enum';
As:'as';
Equal:'=';
ID:'^'?('a'..'z'|'A'..'Z'|'_')('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
INT:('0'..'9')+;
STRING:'"' ( '\\'('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\\') | ~('\\'|'"') )* '"';
//"'" ( '\\'('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\') | !('\\'|"'") )* "'";