Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81319 / golang2html_code_fold / parser.output
blob: 8722eaf265f9fab595f79010e3306bd2bbfac0e8 (plain) (blame)
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
State 13 conflicts: 8 shift/reduce


Grammar

    0 $accept: input $end

    1 input: /* empty */
    2      | expr_list

    3 expr_list: expr expr_list
    4          | expr

    5 expr: token_sequence
    6     | LCURLY expr_list RCURLY
    7     | LCURLY RCURLY

    8 token_sequence: token_sequence token
    9               | token

   10 token: NUMBER
   11      | KEYWORD
   12      | STRING
   13      | STRING_DQ
   14      | IDENTIFIER
   15      | OPERATOR
   16      | MISC
   17      | UNRECOGNIZED


Terminals, with rules where they appear

$end (0) 0
error (256)
NUMBER (258) 10
KEYWORD (259) 11
STRING (260) 12
STRING_DQ (261) 13
IDENTIFIER (262) 14
OPERATOR (263) 15
MISC (264) 16
UNRECOGNIZED (265) 17
LCURLY (266) 6 7
RCURLY (267) 6 7


Nonterminals, with rules where they appear

$accept (13)
    on left: 0
input (14)
    on left: 1 2, on right: 0
expr_list (15)
    on left: 3 4, on right: 2 3 6
expr (16)
    on left: 5 6 7, on right: 3 4
token_sequence (17)
    on left: 8 9, on right: 5 8
token (18)
    on left: 10 11 12 13 14 15 16 17, on right: 8 9


state 0

    0 $accept: . input $end

    NUMBER        shift, and go to state 1
    KEYWORD       shift, and go to state 2
    STRING        shift, and go to state 3
    STRING_DQ     shift, and go to state 4
    IDENTIFIER    shift, and go to state 5
    OPERATOR      shift, and go to state 6
    MISC          shift, and go to state 7
    UNRECOGNIZED  shift, and go to state 8
    LCURLY        shift, and go to state 9

    $default  reduce using rule 1 (input)

    input           go to state 10
    expr_list       go to state 11
    expr            go to state 12
    token_sequence  go to state 13
    token           go to state 14


state 1

   10 token: NUMBER .

    $default  reduce using rule 10 (token)


state 2

   11 token: KEYWORD .

    $default  reduce using rule 11 (token)


state 3

   12 token: STRING .

    $default  reduce using rule 12 (token)


state 4

   13 token: STRING_DQ .

    $default  reduce using rule 13 (token)


state 5

   14 token: IDENTIFIER .

    $default  reduce using rule 14 (token)


state 6

   15 token: OPERATOR .

    $default  reduce using rule 15 (token)


state 7

   16 token: MISC .

    $default  reduce using rule 16 (token)


state 8

   17 token: UNRECOGNIZED .

    $default  reduce using rule 17 (token)


state 9

    6 expr: LCURLY . expr_list RCURLY
    7     | LCURLY . RCURLY

    NUMBER        shift, and go to state 1
    KEYWORD       shift, and go to state 2
    STRING        shift, and go to state 3
    STRING_DQ     shift, and go to state 4
    IDENTIFIER    shift, and go to state 5
    OPERATOR      shift, and go to state 6
    MISC          shift, and go to state 7
    UNRECOGNIZED  shift, and go to state 8
    LCURLY        shift, and go to state 9
    RCURLY        shift, and go to state 15

    expr_list       go to state 16
    expr            go to state 12
    token_sequence  go to state 13
    token           go to state 14


state 10

    0 $accept: input . $end

    $end  shift, and go to state 17


state 11

    2 input: expr_list .

    $default  reduce using rule 2 (input)


state 12

    3 expr_list: expr . expr_list
    4          | expr .

    NUMBER        shift, and go to state 1
    KEYWORD       shift, and go to state 2
    STRING        shift, and go to state 3
    STRING_DQ     shift, and go to state 4
    IDENTIFIER    shift, and go to state 5
    OPERATOR      shift, and go to state 6
    MISC          shift, and go to state 7
    UNRECOGNIZED  shift, and go to state 8
    LCURLY        shift, and go to state 9

    $default  reduce using rule 4 (expr_list)

    expr_list       go to state 18
    expr            go to state 12
    token_sequence  go to state 13
    token           go to state 14


state 13

    5 expr: token_sequence .
    8 token_sequence: token_sequence . token

    NUMBER        shift, and go to state 1
    KEYWORD       shift, and go to state 2
    STRING        shift, and go to state 3
    STRING_DQ     shift, and go to state 4
    IDENTIFIER    shift, and go to state 5
    OPERATOR      shift, and go to state 6
    MISC          shift, and go to state 7
    UNRECOGNIZED  shift, and go to state 8

    NUMBER        [reduce using rule 5 (expr)]
    KEYWORD       [reduce using rule 5 (expr)]
    STRING        [reduce using rule 5 (expr)]
    STRING_DQ     [reduce using rule 5 (expr)]
    IDENTIFIER    [reduce using rule 5 (expr)]
    OPERATOR      [reduce using rule 5 (expr)]
    MISC          [reduce using rule 5 (expr)]
    UNRECOGNIZED  [reduce using rule 5 (expr)]
    $default      reduce using rule 5 (expr)

    token  go to state 19


state 14

    9 token_sequence: token .

    $default  reduce using rule 9 (token_sequence)


state 15

    7 expr: LCURLY RCURLY .

    $default  reduce using rule 7 (expr)


state 16

    6 expr: LCURLY expr_list . RCURLY

    RCURLY  shift, and go to state 20


state 17

    0 $accept: input $end .

    $default  accept


state 18

    3 expr_list: expr expr_list .

    $default  reduce using rule 3 (expr_list)


state 19

    8 token_sequence: token_sequence token .

    $default  reduce using rule 8 (token_sequence)


state 20

    6 expr: LCURLY expr_list RCURLY .

    $default  reduce using rule 6 (expr)