-
Notifications
You must be signed in to change notification settings - Fork 0
/
patito.interp
96 lines (92 loc) · 9.36 KB
/
patito.interp
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
token literal names:
null
'program'
';'
'main'
'end'
'var'
','
':'
'int'
'float'
'void'
'('
')'
'['
']'
'{'
'}'
'='
'>'
'<'
'!='
'+'
'-'
'*'
'/'
'if'
'else'
'while'
'do'
'print'
null
null
null
null
null
token symbolic names:
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
Id
Cte_int
Cte_float
Cte_string
WS
rule names:
startRule
programa
vars
type
funcs
body
statement
assign
expression
exp
termino
factor
cte
condition
cycle
f_call
print
atn:
[4, 1, 34, 292, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 44, 8, 1, 1, 1, 5, 1, 47, 8, 1, 10, 1, 12, 1, 50, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 67, 8, 2, 10, 2, 12, 2, 70, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 4, 2, 78, 8, 2, 11, 2, 12, 2, 79, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 100, 8, 4, 10, 4, 12, 4, 103, 9, 4, 5, 4, 105, 8, 4, 10, 4, 12, 4, 108, 9, 4, 1, 4, 1, 4, 1, 4, 3, 4, 113, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 5, 5, 123, 8, 5, 10, 5, 12, 5, 126, 9, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 135, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 153, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8, 158, 8, 8, 10, 8, 12, 8, 161, 9, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 169, 8, 9, 1, 9, 1, 9, 1, 9, 5, 9, 174, 8, 9, 10, 9, 12, 9, 177, 9, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 185, 8, 10, 1, 10, 1, 10, 1, 10, 5, 10, 190, 8, 10, 10, 10, 12, 10, 193, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 206, 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 211, 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 216, 8, 11, 3, 11, 218, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 227, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 238, 8, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 259, 8, 15, 10, 15, 12, 15, 262, 9, 15, 3, 15, 264, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 275, 8, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 281, 8, 16, 5, 16, 283, 8, 16, 10, 16, 12, 16, 286, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 0, 0, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 0, 1, 1, 0, 8, 9, 306, 0, 34, 1, 0, 0, 0, 2, 37, 1, 0, 0, 0, 4, 59, 1, 0, 0, 0, 6, 81, 1, 0, 0, 0, 8, 83, 1, 0, 0, 0, 10, 120, 1, 0, 0, 0, 12, 134, 1, 0, 0, 0, 14, 136, 1, 0, 0, 0, 16, 144, 1, 0, 0, 0, 18, 162, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 217, 1, 0, 0, 0, 24, 226, 1, 0, 0, 0, 26, 228, 1, 0, 0, 0, 28, 242, 1, 0, 0, 0, 30, 253, 1, 0, 0, 0, 32, 268, 1, 0, 0, 0, 34, 35, 3, 2, 1, 0, 35, 36, 5, 0, 0, 1, 36, 1, 1, 0, 0, 0, 37, 38, 5, 1, 0, 0, 38, 39, 6, 1, -1, 0, 39, 40, 5, 30, 0, 0, 40, 41, 6, 1, -1, 0, 41, 43, 5, 2, 0, 0, 42, 44, 3, 4, 2, 0, 43, 42, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 48, 1, 0, 0, 0, 45, 47, 3, 8, 4, 0, 46, 45, 1, 0, 0, 0, 47, 50, 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 51, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 51, 52, 5, 3, 0, 0, 52, 53, 6, 1, -1, 0, 53, 54, 6, 1, -1, 0, 54, 55, 3, 10, 5, 0, 55, 56, 6, 1, -1, 0, 56, 57, 5, 4, 0, 0, 57, 58, 6, 1, -1, 0, 58, 3, 1, 0, 0, 0, 59, 60, 6, 2, -1, 0, 60, 77, 5, 5, 0, 0, 61, 62, 5, 30, 0, 0, 62, 68, 6, 2, -1, 0, 63, 64, 5, 6, 0, 0, 64, 65, 5, 30, 0, 0, 65, 67, 6, 2, -1, 0, 66, 63, 1, 0, 0, 0, 67, 70, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 71, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 71, 72, 5, 7, 0, 0, 72, 73, 3, 6, 3, 0, 73, 74, 6, 2, -1, 0, 74, 75, 5, 2, 0, 0, 75, 76, 6, 2, -1, 0, 76, 78, 1, 0, 0, 0, 77, 61, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 5, 1, 0, 0, 0, 81, 82, 7, 0, 0, 0, 82, 7, 1, 0, 0, 0, 83, 84, 6, 4, -1, 0, 84, 85, 5, 10, 0, 0, 85, 86, 6, 4, -1, 0, 86, 87, 5, 30, 0, 0, 87, 88, 6, 4, -1, 0, 88, 106, 5, 11, 0, 0, 89, 90, 5, 30, 0, 0, 90, 91, 5, 7, 0, 0, 91, 92, 3, 6, 3, 0, 92, 101, 6, 4, -1, 0, 93, 94, 5, 6, 0, 0, 94, 95, 5, 30, 0, 0, 95, 96, 5, 7, 0, 0, 96, 97, 3, 6, 3, 0, 97, 98, 6, 4, -1, 0, 98, 100, 1, 0, 0, 0, 99, 93, 1, 0, 0, 0, 100, 103, 1, 0, 0, 0, 101, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 105, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 104, 89, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 12, 0, 0, 110, 112, 5, 13, 0, 0, 111, 113, 3, 4, 2, 0, 112, 111, 1, 0, 0, 0, 112, 113, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 115, 3, 10, 5, 0, 115, 116, 5, 14, 0, 0, 116, 117, 5, 2, 0, 0, 117, 118, 6, 4, -1, 0, 118, 119, 6, 4, -1, 0, 119, 9, 1, 0, 0, 0, 120, 124, 5, 15, 0, 0, 121, 123, 3, 12, 6, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 16, 0, 0, 128, 11, 1, 0, 0, 0, 129, 135, 3, 14, 7, 0, 130, 135, 3, 26, 13, 0, 131, 135, 3, 28, 14, 0, 132, 135, 3, 30, 15, 0, 133, 135, 3, 32, 16, 0, 134, 129, 1, 0, 0, 0, 134, 130, 1, 0, 0, 0, 134, 131, 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 134, 133, 1, 0, 0, 0, 135, 13, 1, 0, 0, 0, 136, 137, 5, 30, 0, 0, 137, 138, 6, 7, -1, 0, 138, 139, 5, 17, 0, 0, 139, 140, 6, 7, -1, 0, 140, 141, 3, 16, 8, 0, 141, 142, 6, 7, -1, 0, 142, 143, 5, 2, 0, 0, 143, 15, 1, 0, 0, 0, 144, 145, 3, 18, 9, 0, 145, 159, 6, 8, -1, 0, 146, 147, 5, 18, 0, 0, 147, 153, 6, 8, -1, 0, 148, 149, 5, 19, 0, 0, 149, 153, 6, 8, -1, 0, 150, 151, 5, 20, 0, 0, 151, 153, 6, 8, -1, 0, 152, 146, 1, 0, 0, 0, 152, 148, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 3, 18, 9, 0, 155, 156, 6, 8, -1, 0, 156, 158, 1, 0, 0, 0, 157, 152, 1, 0, 0, 0, 158, 161, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 17, 1, 0, 0, 0, 161, 159, 1, 0, 0, 0, 162, 163, 3, 20, 10, 0, 163, 175, 6, 9, -1, 0, 164, 165, 5, 21, 0, 0, 165, 169, 6, 9, -1, 0, 166, 167, 5, 22, 0, 0, 167, 169, 6, 9, -1, 0, 168, 164, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 171, 3, 20, 10, 0, 171, 172, 6, 9, -1, 0, 172, 174, 1, 0, 0, 0, 173, 168, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 19, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 3, 22, 11, 0, 179, 191, 6, 10, -1, 0, 180, 181, 5, 23, 0, 0, 181, 185, 6, 10, -1, 0, 182, 183, 5, 24, 0, 0, 183, 185, 6, 10, -1, 0, 184, 180, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 187, 3, 22, 11, 0, 187, 188, 6, 10, -1, 0, 188, 190, 1, 0, 0, 0, 189, 184, 1, 0, 0, 0, 190, 193, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 21, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 194, 195, 5, 11, 0, 0, 195, 196, 6, 11, -1, 0, 196, 197, 3, 16, 8, 0, 197, 198, 5, 12, 0, 0, 198, 199, 6, 11, -1, 0, 199, 218, 1, 0, 0, 0, 200, 205, 6, 11, -1, 0, 201, 202, 5, 21, 0, 0, 202, 206, 6, 11, -1, 0, 203, 204, 5, 22, 0, 0, 204, 206, 6, 11, -1, 0, 205, 201, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 210, 1, 0, 0, 0, 207, 208, 5, 30, 0, 0, 208, 211, 6, 11, -1, 0, 209, 211, 3, 24, 12, 0, 210, 207, 1, 0, 0, 0, 210, 209, 1, 0, 0, 0, 211, 218, 1, 0, 0, 0, 212, 213, 5, 30, 0, 0, 213, 216, 6, 11, -1, 0, 214, 216, 3, 24, 12, 0, 215, 212, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 218, 1, 0, 0, 0, 217, 194, 1, 0, 0, 0, 217, 200, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 218, 23, 1, 0, 0, 0, 219, 220, 5, 31, 0, 0, 220, 221, 6, 12, -1, 0, 221, 227, 6, 12, -1, 0, 222, 223, 5, 32, 0, 0, 223, 227, 6, 12, -1, 0, 224, 225, 5, 33, 0, 0, 225, 227, 6, 12, -1, 0, 226, 219, 1, 0, 0, 0, 226, 222, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 227, 25, 1, 0, 0, 0, 228, 229, 5, 25, 0, 0, 229, 230, 5, 11, 0, 0, 230, 231, 3, 16, 8, 0, 231, 232, 5, 12, 0, 0, 232, 233, 6, 13, -1, 0, 233, 237, 3, 10, 5, 0, 234, 235, 5, 26, 0, 0, 235, 236, 6, 13, -1, 0, 236, 238, 3, 10, 5, 0, 237, 234, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 5, 2, 0, 0, 240, 241, 6, 13, -1, 0, 241, 27, 1, 0, 0, 0, 242, 243, 5, 27, 0, 0, 243, 244, 6, 14, -1, 0, 244, 245, 3, 10, 5, 0, 245, 246, 5, 28, 0, 0, 246, 247, 5, 11, 0, 0, 247, 248, 3, 16, 8, 0, 248, 249, 5, 12, 0, 0, 249, 250, 6, 14, -1, 0, 250, 251, 5, 2, 0, 0, 251, 252, 6, 14, -1, 0, 252, 29, 1, 0, 0, 0, 253, 254, 5, 30, 0, 0, 254, 263, 5, 11, 0, 0, 255, 260, 3, 16, 8, 0, 256, 257, 5, 6, 0, 0, 257, 259, 3, 16, 8, 0, 258, 256, 1, 0, 0, 0, 259, 262, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 255, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 5, 12, 0, 0, 266, 267, 5, 2, 0, 0, 267, 31, 1, 0, 0, 0, 268, 269, 5, 29, 0, 0, 269, 270, 6, 16, -1, 0, 270, 274, 5, 11, 0, 0, 271, 272, 5, 33, 0, 0, 272, 275, 6, 16, -1, 0, 273, 275, 3, 16, 8, 0, 274, 271, 1, 0, 0, 0, 274, 273, 1, 0, 0, 0, 275, 284, 1, 0, 0, 0, 276, 280, 5, 6, 0, 0, 277, 278, 5, 33, 0, 0, 278, 281, 6, 16, -1, 0, 279, 281, 3, 16, 8, 0, 280, 277, 1, 0, 0, 0, 280, 279, 1, 0, 0, 0, 281, 283, 1, 0, 0, 0, 282, 276, 1, 0, 0, 0, 283, 286, 1, 0, 0, 0, 284, 282, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 287, 1, 0, 0, 0, 286, 284, 1, 0, 0, 0, 287, 288, 5, 12, 0, 0, 288, 289, 6, 16, -1, 0, 289, 290, 5, 2, 0, 0, 290, 33, 1, 0, 0, 0, 26, 43, 48, 68, 79, 101, 106, 112, 124, 134, 152, 159, 168, 175, 184, 191, 205, 210, 215, 217, 226, 237, 260, 263, 274, 280, 284]