-
Notifications
You must be signed in to change notification settings - Fork 7
/
PG.lgr
74 lines (40 loc) · 1.43 KB
/
PG.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// LRSTAR Lexical Grammar.
<eof> -> \z
<alpha> -> alpha
<lexical> -> '<' alpha '>'
<semantic> -> '{' alpha '}'
alpha -> (letter|'_') (letter|digit|'_')*
<integer> -> digit+
<literal> -> ''' lchar+ '''
lchar -> '\' '''
-> '\' '"'
-> '\' '\'
-> '\' letter
-> '\' digit
-> lany
lany -> { 33..255 - ''' - '\' }
<string> -> '"' '"'
-> '"' schar+ '"'
schar -> '\' '''
-> '\' '"'
-> '\' '\'
-> '\' letter
-> '\' digit
-> sany
sany -> { ' '..255 - '"' - '\' }
{whitespace} -> ( \t | \n | \r | ' ' )+
{commentline} -> '/' '/' neol*
{commentblock} -> '/' '*' na* '*'+ (nans na* '*'+)* '/' // Allows inside comments.
nrb -> { any - '}' } // not asterisk
npc -> { any - '%' } // not asterisk
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
letter -> { 'a'..'z' | 'A'..'Z' }
digit -> { '0'..'9' }
\t -> 9
\n -> 10
\r -> 13
\z -> 26
/* End of Lexical Grammar. */