-
Notifications
You must be signed in to change notification settings - Fork 0
/
astout
166 lines (166 loc) · 3.74 KB
/
astout
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
CompUnit (#line 10) {
FunDef (#line 10) {
Type (#line 10) {
void
} $Type
print
Field (#line 2) {
Type (#line 2) {
int
} $Type
ArrayVar (#line 2) {
a
IntExpr (#line 2) {
eval: 1
10
} $IntExpr
} $ArrayVar
} $Field
Block (#line 3) {
VarDecl (#line 3) {
Type (#line 3) {
int
} $Type
InitVarDef (#line 3) {
SimpleVar (#line 3) {
i
} $SimpleVar
IntExpr (#line 3) {
eval: 1
0
} $IntExpr
} $InitVarDef
} $VarDecl
VarDecl (#line 4) {
Type (#line 4) {
float
} $Type
VarDef (#line 4) {
SimpleVar (#line 4) {
f
} $SimpleVar
} $VarDef
} $VarDecl
ExprList (#line 5) {
Assign (#line 5) {
SimpleVar (#line 5) {
f
} $SimpleVar
BiExpr (#line 5) {
eval: 1
IntExpr (#line 5) {
eval: 1
1
} $IntExpr
+ opcode = 0
FloatExpr (#line 5) {
eval: 1
0.4
} $FloatExpr
} $BiExpr
} $Assign
} $ExprList
For (#line 8) {
Assign (#line 6) {
SimpleVar (#line 6) {
i
} $SimpleVar
IntExpr (#line 6) {
eval: 1
0
} $IntExpr
} $Assign
BiExpr (#line 6) {
eval: 1
SimpleVar (#line 6) {
i
} $SimpleVar
< opcode = 8
IntExpr (#line 6) {
eval: 1
11
} $IntExpr
} $BiExpr
Assign (#line 6) {
SimpleVar (#line 6) {
i
} $SimpleVar
BiExpr (#line 6) {
eval: 1
SimpleVar (#line 6) {
i
} $SimpleVar
+ opcode = 0
IntExpr (#line 6) {
eval: 1
1
} $IntExpr
} $BiExpr
} $Assign
Block (#line 7) {
ExprList (#line 7) {
Call (#line 7) {
printf
ExprList (#line 7) {
StringExpr (#line 7) {
eval: 1
"%d "
} $StringExpr
ArrayVar (#line 7) {
a
SimpleVar (#line 7) {
i
} $SimpleVar
} $ArrayVar
} $ExprList
} $Call
} $ExprList
} $Block
} $For
ExprList (#line 9) {
Call (#line 9) {
printf
ExprList (#line 9) {
StringExpr (#line 9) {
eval: 1
"\n"
} $StringExpr
} $ExprList
} $Call
} $ExprList
} $Block
} $FunDef
FunDef (#line 14) {
Type (#line 11) {
int
} $Type
main
Block (#line 12) {
VarDecl (#line 12) {
Type (#line 12) {
int
} $Type
InitArrayDef (#line 12) {
ArrayVar (#line 12) {
a
IntExpr (#line 12) {
eval: 1
10
} $IntExpr
} $ArrayVar
} $InitArrayDef
} $VarDecl
ExprList (#line 13) {
Call (#line 13) {
print
ExprList (#line 13) {
SimpleVar (#line 13) {
a
} $SimpleVar
} $ExprList
} $Call
} $ExprList
} $Block
} $FunDef
} $CompUnit
PASS