-
Notifications
You must be signed in to change notification settings - Fork 7
/
LG.lgr
46 lines (33 loc) · 1.24 KB
/
LG.lgr
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
/* LRSTAR Lexical-Grammar Tokens. */
<eof> -> \z
<alpha> -> alpha
<lexical> -> '<' alpha '>'
<ignore> -> '{' alpha '}'
<escape> -> '\' letter
alpha -> (letter|'_') (letter|digit|'_')*
<integer> -> digit+
<literal> -> ''' ''' '''
-> ''' ' ' '''
-> ''' nonquote+ '''
nonquote -> { 33..254 - ''' }
<string> -> '"' '"' '"'
-> '"' ' ' '"'
-> '"' nondquote+ '"'
nondquote -> { 33..254 - '"' }
letter -> { 'a'..'z' | 'A'..'Z' }
digit -> { '0'..'9' }
hexdigit -> { digit | 'a'..'f' | 'A'..'Z' }
{whitespace} -> ( \t | \n | \r | ' ' )+
{commentline} -> '/' '/' neol*
{commentblock} -> '/' '*' na* '*'+ (nans na* '*'+)* '/'
na -> { any - '*' } // not asterisk
nans -> { any - '*' - '/' } // not asterisk not slash
neol -> { any - \n } // not end of line
any -> { 0..255 - \z } // any character except end of file
\t -> 9 // tab
\n -> 10 // newline
\v -> 11 // vertical feed
\f -> 12 // form feed
\r -> 13 // return
\z -> 26 // end of file
/* End of Lexical Grammar. */