-
Notifications
You must be signed in to change notification settings - Fork 5
/
LexicalAnalyzer-Result.txt
107 lines (107 loc) · 1.63 KB
/
LexicalAnalyzer-Result.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
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
1: void main(void){
1: Reserved Word: void
1: ID, name= main
1: (
1: Reserved Word: void
1: )
1: {
2: int i#; int j; int k; int n;
2: Reserved Word: int
2: ID, name= i
2: ERROR: #
2: ;
2: Reserved Word: int
2: ID, name= j
2: ;
2: Reserved Word: int
2: ID, name= k
2: ;
2: Reserved Word: int
2: ID, name= n
2: ;
3: while (n < 100){
3: Reserved Word: while
3: (
3: ID, name= n
3: <
3: NUM:, val= 100
3: )
3: {
4: i = n / 100;
4: ID, name= i
4: =
4: ID, name= n
4: /
4: NUM:, val= 100
4: ;
5: j = n / 100 - n/100/10*10; /* n/100 mod 10 */
5: ID, name= j
5: =
5: ID, name= n
5: /
5: NUM:, val= 100
5: -
5: ID, name= n
5: /
5: NUM:, val= 100
5: /
5: NUM:, val= 10
5: *
5: NUM:, val= 10
5: ;
6: k = n - n/10*10; /* n mod 10 */
6: ID, name= k
6: =
6: ID, name= n
6: -
6: ID, name= n
6: /
6: NUM:, val= 10
6: *
6: NUM:, val= 10
6: ;
7: if(i*100+j*10+k == i*i*i+j*j*j+k*k*k){
7: Reserved Word: if
7: (
7: ID, name= i
7: *
7: NUM:, val= 100
7: +
7: ID, name= j
7: *
7: NUM:, val= 10
7: +
7: ID, name= k
7: ==
7: ID, name= i
7: *
7: ID, name= i
7: *
7: ID, name= i
7: +
7: ID, name= j
7: *
7: ID, name= j
7: *
7: ID, name= j
7: +
7: ID, name= k
7: *
7: ID, name= k
7: *
7: ID, name= k
7: )
7: {
8: output(n);
8: ID, name= output
8: (
8: ID, name= n
8: )
8: ;
9: }
9: }
10: }
10: }
11: }
11: }
11: EOF