-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGRAMATICA.txt
63 lines (63 loc) · 1.07 KB
/
GRAMATICA.txt
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
SETS
LETRA = 'A'..'Z'+'a'..'z'+'_'
DIGITO = '0'..'9'
CHARSET = CHR(32)..CHR(254)
TOKENS
TOKEN 1= DIGITO DIGITO *
TOKEN 2='"' CHARSET '"'|''' CHARSET '''
TOKEN 4 = '='
TOKEN 5 = '<''>'
TOKEN 6 = '<'
TOKEN 7 = '>'
TOKEN 8 = '>''='
TOKEN 9 = '<''='
TOKEN 10 = '+'
TOKEN 11 = '-'
TOKEN 12 = 'O''R'
TOKEN 13 = '*'
TOKEN 14 = 'A''N''D'
TOKEN 15 = 'M''O''D'
TOKEN 16 = 'D''I''V'
TOKEN 17 = 'N''O''T'
TOKEN 40 = '(''*'
TOKEN 41 = '*'')'
TOKEN 42 = ';'
TOKEN 43 = '.'
TOKEN 44 = '{'
TOKEN 45 = '}'
TOKEN 46 = '('
TOKEN 47 = ')'
TOKEN 48 = '['
TOKEN 49 = ']'
TOKEN 50 = '.''.'
TOKEN 51 = ':'
TOKEN 52 = ','
TOKEN 53 = ':''='
TOKEN 3= LETRA ( LETRA | DIGITO )* { RESERVADAS() }
ACTIONS
RESERVADAS()
{
18 = 'PROGRAM'
19 = 'INCLUDE'
20 = 'CONST'
21 = 'TYPE'
22 = 'VAR'
23 = 'RECORD'
24 = 'ARRAY'
25 = 'OF'
26 = 'PROCEDURE'
27 = 'FUNCTION'
28 = 'IF'
29 = 'THEN'
30 = 'ELSE'
31 = 'FOR'
32 = 'TO'
33 = 'WHILE'
34 = 'DO'
35 = 'EXIT'
36 = 'END'
37 = 'CASE'
38 = 'BREAK'
39 = 'DOWNTO'
}
ERROR = 5