Home | History | Annotate | Line # | Download | only in yacc
      1    0  $accept : list $end
      2 
      3    1  list :
      4    2       | list stat '\n'
      5    3       | list error '\n'
      6 
      7    4  stat : expr
      8    5       | LETTER '=' expr
      9 
     10    6  expr : '(' expr ')'
     11    7       | expr "ADD" expr
     12    8       | expr "SUB" expr
     13    9       | expr "MUL" expr
     14   10       | expr "DIV" expr
     15   11       | expr "MOD" expr
     16   12       | expr "AND" expr
     17   13       | expr '|' expr
     18   14       | "SUB" expr
     19   15       | LETTER
     20   16       | number
     21 
     22   17  number : DIGIT
     23   18         | number DIGIT
     24 
     26 state 0
     27 	$accept : . list $end  (0)
     28 	list : .  (1)
     29 
     30 	.  reduce 1
     31 
     32 	list  goto 1
     33 
     34 
     35 state 1
     36 	$accept : list . $end  (0)
     37 	list : list . stat '\n'  (2)
     38 	list : list . error '\n'  (3)
     39 
     40 	$end  accept
     41 	error  shift 2
     42 	"SUB"  shift 3
     43 	DIGIT  shift 4
     44 	LETTER  shift 5
     45 	'('  shift 6
     46 	.  error
     47 
     48 	stat  goto 7
     49 	expr  goto 8
     50 	number  goto 9
     51 
     52 
     53 state 2
     54 	list : list error . '\n'  (3)
     55 
     56 	'\n'  shift 10
     57 	.  error
     58 
     59 
     60 state 3
     61 	expr : "SUB" . expr  (14)
     62 
     63 	"SUB"  shift 3
     64 	DIGIT  shift 4
     65 	LETTER  shift 11
     66 	'('  shift 6
     67 	.  error
     68 
     69 	expr  goto 12
     70 	number  goto 9
     71 
     72 
     73 state 4
     74 	number : DIGIT .  (17)
     75 
     76 	.  reduce 17
     77 
     78 
     79 state 5
     80 	stat : LETTER . '=' expr  (5)
     81 	expr : LETTER .  (15)
     82 
     83 	'='  shift 13
     84 	"ADD"  reduce 15
     85 	"SUB"  reduce 15
     86 	"MUL"  reduce 15
     87 	"DIV"  reduce 15
     88 	"MOD"  reduce 15
     89 	"AND"  reduce 15
     90 	'|'  reduce 15
     91 	'\n'  reduce 15
     92 
     93 
     94 state 6
     95 	expr : '(' . expr ')'  (6)
     96 
     97 	"SUB"  shift 3
     98 	DIGIT  shift 4
     99 	LETTER  shift 11
    100 	'('  shift 6
    101 	.  error
    102 
    103 	expr  goto 14
    104 	number  goto 9
    105 
    106 
    107 state 7
    108 	list : list stat . '\n'  (2)
    109 
    110 	'\n'  shift 15
    111 	.  error
    112 
    113 
    114 state 8
    115 	stat : expr .  (4)
    116 	expr : expr . "ADD" expr  (7)
    117 	expr : expr . "SUB" expr  (8)
    118 	expr : expr . "MUL" expr  (9)
    119 	expr : expr . "DIV" expr  (10)
    120 	expr : expr . "MOD" expr  (11)
    121 	expr : expr . "AND" expr  (12)
    122 	expr : expr . '|' expr  (13)
    123 
    124 	"ADD"  shift 16
    125 	"SUB"  shift 17
    126 	"MUL"  shift 18
    127 	"DIV"  shift 19
    128 	"MOD"  shift 20
    129 	"AND"  shift 21
    130 	'|'  shift 22
    131 	'\n'  reduce 4
    132 
    133 
    134 state 9
    135 	expr : number .  (16)
    136 	number : number . DIGIT  (18)
    137 
    138 	DIGIT  shift 23
    139 	"ADD"  reduce 16
    140 	"SUB"  reduce 16
    141 	"MUL"  reduce 16
    142 	"DIV"  reduce 16
    143 	"MOD"  reduce 16
    144 	"AND"  reduce 16
    145 	'|'  reduce 16
    146 	'\n'  reduce 16
    147 	')'  reduce 16
    148 
    149 
    150 state 10
    151 	list : list error '\n' .  (3)
    152 
    153 	.  reduce 3
    154 
    155 
    156 state 11
    157 	expr : LETTER .  (15)
    158 
    159 	.  reduce 15
    160 
    161 
    162 12: shift/reduce conflict (shift 16, reduce 14) on "ADD"
    163 12: shift/reduce conflict (shift 17, reduce 14) on "SUB"
    164 12: shift/reduce conflict (shift 18, reduce 14) on "MUL"
    165 12: shift/reduce conflict (shift 19, reduce 14) on "DIV"
    166 12: shift/reduce conflict (shift 20, reduce 14) on "MOD"
    167 12: shift/reduce conflict (shift 21, reduce 14) on "AND"
    168 state 12
    169 	expr : expr . "ADD" expr  (7)
    170 	expr : expr . "SUB" expr  (8)
    171 	expr : expr . "MUL" expr  (9)
    172 	expr : expr . "DIV" expr  (10)
    173 	expr : expr . "MOD" expr  (11)
    174 	expr : expr . "AND" expr  (12)
    175 	expr : expr . '|' expr  (13)
    176 	expr : "SUB" expr .  (14)
    177 
    178 	"ADD"  shift 16
    179 	"SUB"  shift 17
    180 	"MUL"  shift 18
    181 	"DIV"  shift 19
    182 	"MOD"  shift 20
    183 	"AND"  shift 21
    184 	'|'  reduce 14
    185 	'\n'  reduce 14
    186 	')'  reduce 14
    187 
    188 
    189 state 13
    190 	stat : LETTER '=' . expr  (5)
    191 
    192 	"SUB"  shift 3
    193 	DIGIT  shift 4
    194 	LETTER  shift 11
    195 	'('  shift 6
    196 	.  error
    197 
    198 	expr  goto 24
    199 	number  goto 9
    200 
    201 
    202 state 14
    203 	expr : '(' expr . ')'  (6)
    204 	expr : expr . "ADD" expr  (7)
    205 	expr : expr . "SUB" expr  (8)
    206 	expr : expr . "MUL" expr  (9)
    207 	expr : expr . "DIV" expr  (10)
    208 	expr : expr . "MOD" expr  (11)
    209 	expr : expr . "AND" expr  (12)
    210 	expr : expr . '|' expr  (13)
    211 
    212 	"ADD"  shift 16
    213 	"SUB"  shift 17
    214 	"MUL"  shift 18
    215 	"DIV"  shift 19
    216 	"MOD"  shift 20
    217 	"AND"  shift 21
    218 	'|'  shift 22
    219 	')'  shift 25
    220 	.  error
    221 
    222 
    223 state 15
    224 	list : list stat '\n' .  (2)
    225 
    226 	.  reduce 2
    227 
    228 
    229 state 16
    230 	expr : expr "ADD" . expr  (7)
    231 
    232 	"SUB"  shift 3
    233 	DIGIT  shift 4
    234 	LETTER  shift 11
    235 	'('  shift 6
    236 	.  error
    237 
    238 	expr  goto 26
    239 	number  goto 9
    240 
    241 
    242 state 17
    243 	expr : expr "SUB" . expr  (8)
    244 
    245 	"SUB"  shift 3
    246 	DIGIT  shift 4
    247 	LETTER  shift 11
    248 	'('  shift 6
    249 	.  error
    250 
    251 	expr  goto 27
    252 	number  goto 9
    253 
    254 
    255 state 18
    256 	expr : expr "MUL" . expr  (9)
    257 
    258 	"SUB"  shift 3
    259 	DIGIT  shift 4
    260 	LETTER  shift 11
    261 	'('  shift 6
    262 	.  error
    263 
    264 	expr  goto 28
    265 	number  goto 9
    266 
    267 
    268 state 19
    269 	expr : expr "DIV" . expr  (10)
    270 
    271 	"SUB"  shift 3
    272 	DIGIT  shift 4
    273 	LETTER  shift 11
    274 	'('  shift 6
    275 	.  error
    276 
    277 	expr  goto 29
    278 	number  goto 9
    279 
    280 
    281 state 20
    282 	expr : expr "MOD" . expr  (11)
    283 
    284 	"SUB"  shift 3
    285 	DIGIT  shift 4
    286 	LETTER  shift 11
    287 	'('  shift 6
    288 	.  error
    289 
    290 	expr  goto 30
    291 	number  goto 9
    292 
    293 
    294 state 21
    295 	expr : expr "AND" . expr  (12)
    296 
    297 	"SUB"  shift 3
    298 	DIGIT  shift 4
    299 	LETTER  shift 11
    300 	'('  shift 6
    301 	.  error
    302 
    303 	expr  goto 31
    304 	number  goto 9
    305 
    306 
    307 state 22
    308 	expr : expr '|' . expr  (13)
    309 
    310 	"SUB"  shift 3
    311 	DIGIT  shift 4
    312 	LETTER  shift 11
    313 	'('  shift 6
    314 	.  error
    315 
    316 	expr  goto 32
    317 	number  goto 9
    318 
    319 
    320 state 23
    321 	number : number DIGIT .  (18)
    322 
    323 	.  reduce 18
    324 
    325 
    326 state 24
    327 	stat : LETTER '=' expr .  (5)
    328 	expr : expr . "ADD" expr  (7)
    329 	expr : expr . "SUB" expr  (8)
    330 	expr : expr . "MUL" expr  (9)
    331 	expr : expr . "DIV" expr  (10)
    332 	expr : expr . "MOD" expr  (11)
    333 	expr : expr . "AND" expr  (12)
    334 	expr : expr . '|' expr  (13)
    335 
    336 	"ADD"  shift 16
    337 	"SUB"  shift 17
    338 	"MUL"  shift 18
    339 	"DIV"  shift 19
    340 	"MOD"  shift 20
    341 	"AND"  shift 21
    342 	'|'  shift 22
    343 	'\n'  reduce 5
    344 
    345 
    346 state 25
    347 	expr : '(' expr ')' .  (6)
    348 
    349 	.  reduce 6
    350 
    351 
    352 26: shift/reduce conflict (shift 16, reduce 7) on "ADD"
    353 26: shift/reduce conflict (shift 17, reduce 7) on "SUB"
    354 26: shift/reduce conflict (shift 18, reduce 7) on "MUL"
    355 26: shift/reduce conflict (shift 19, reduce 7) on "DIV"
    356 26: shift/reduce conflict (shift 20, reduce 7) on "MOD"
    357 26: shift/reduce conflict (shift 21, reduce 7) on "AND"
    358 26: shift/reduce conflict (shift 22, reduce 7) on '|'
    359 state 26
    360 	expr : expr . "ADD" expr  (7)
    361 	expr : expr "ADD" expr .  (7)
    362 	expr : expr . "SUB" expr  (8)
    363 	expr : expr . "MUL" expr  (9)
    364 	expr : expr . "DIV" expr  (10)
    365 	expr : expr . "MOD" expr  (11)
    366 	expr : expr . "AND" expr  (12)
    367 	expr : expr . '|' expr  (13)
    368 
    369 	"ADD"  shift 16
    370 	"SUB"  shift 17
    371 	"MUL"  shift 18
    372 	"DIV"  shift 19
    373 	"MOD"  shift 20
    374 	"AND"  shift 21
    375 	'|'  shift 22
    376 	'\n'  reduce 7
    377 	')'  reduce 7
    378 
    379 
    380 27: shift/reduce conflict (shift 16, reduce 8) on "ADD"
    381 27: shift/reduce conflict (shift 17, reduce 8) on "SUB"
    382 27: shift/reduce conflict (shift 18, reduce 8) on "MUL"
    383 27: shift/reduce conflict (shift 19, reduce 8) on "DIV"
    384 27: shift/reduce conflict (shift 20, reduce 8) on "MOD"
    385 27: shift/reduce conflict (shift 21, reduce 8) on "AND"
    386 27: shift/reduce conflict (shift 22, reduce 8) on '|'
    387 state 27
    388 	expr : expr . "ADD" expr  (7)
    389 	expr : expr . "SUB" expr  (8)
    390 	expr : expr "SUB" expr .  (8)
    391 	expr : expr . "MUL" expr  (9)
    392 	expr : expr . "DIV" expr  (10)
    393 	expr : expr . "MOD" expr  (11)
    394 	expr : expr . "AND" expr  (12)
    395 	expr : expr . '|' expr  (13)
    396 
    397 	"ADD"  shift 16
    398 	"SUB"  shift 17
    399 	"MUL"  shift 18
    400 	"DIV"  shift 19
    401 	"MOD"  shift 20
    402 	"AND"  shift 21
    403 	'|'  shift 22
    404 	'\n'  reduce 8
    405 	')'  reduce 8
    406 
    407 
    408 28: shift/reduce conflict (shift 16, reduce 9) on "ADD"
    409 28: shift/reduce conflict (shift 17, reduce 9) on "SUB"
    410 28: shift/reduce conflict (shift 18, reduce 9) on "MUL"
    411 28: shift/reduce conflict (shift 19, reduce 9) on "DIV"
    412 28: shift/reduce conflict (shift 20, reduce 9) on "MOD"
    413 28: shift/reduce conflict (shift 21, reduce 9) on "AND"
    414 28: shift/reduce conflict (shift 22, reduce 9) on '|'
    415 state 28
    416 	expr : expr . "ADD" expr  (7)
    417 	expr : expr . "SUB" expr  (8)
    418 	expr : expr . "MUL" expr  (9)
    419 	expr : expr "MUL" expr .  (9)
    420 	expr : expr . "DIV" expr  (10)
    421 	expr : expr . "MOD" expr  (11)
    422 	expr : expr . "AND" expr  (12)
    423 	expr : expr . '|' expr  (13)
    424 
    425 	"ADD"  shift 16
    426 	"SUB"  shift 17
    427 	"MUL"  shift 18
    428 	"DIV"  shift 19
    429 	"MOD"  shift 20
    430 	"AND"  shift 21
    431 	'|'  shift 22
    432 	'\n'  reduce 9
    433 	')'  reduce 9
    434 
    435 
    436 29: shift/reduce conflict (shift 16, reduce 10) on "ADD"
    437 29: shift/reduce conflict (shift 17, reduce 10) on "SUB"
    438 29: shift/reduce conflict (shift 18, reduce 10) on "MUL"
    439 29: shift/reduce conflict (shift 19, reduce 10) on "DIV"
    440 29: shift/reduce conflict (shift 20, reduce 10) on "MOD"
    441 29: shift/reduce conflict (shift 21, reduce 10) on "AND"
    442 29: shift/reduce conflict (shift 22, reduce 10) on '|'
    443 state 29
    444 	expr : expr . "ADD" expr  (7)
    445 	expr : expr . "SUB" expr  (8)
    446 	expr : expr . "MUL" expr  (9)
    447 	expr : expr . "DIV" expr  (10)
    448 	expr : expr "DIV" expr .  (10)
    449 	expr : expr . "MOD" expr  (11)
    450 	expr : expr . "AND" expr  (12)
    451 	expr : expr . '|' expr  (13)
    452 
    453 	"ADD"  shift 16
    454 	"SUB"  shift 17
    455 	"MUL"  shift 18
    456 	"DIV"  shift 19
    457 	"MOD"  shift 20
    458 	"AND"  shift 21
    459 	'|'  shift 22
    460 	'\n'  reduce 10
    461 	')'  reduce 10
    462 
    463 
    464 30: shift/reduce conflict (shift 16, reduce 11) on "ADD"
    465 30: shift/reduce conflict (shift 17, reduce 11) on "SUB"
    466 30: shift/reduce conflict (shift 18, reduce 11) on "MUL"
    467 30: shift/reduce conflict (shift 19, reduce 11) on "DIV"
    468 30: shift/reduce conflict (shift 20, reduce 11) on "MOD"
    469 30: shift/reduce conflict (shift 21, reduce 11) on "AND"
    470 30: shift/reduce conflict (shift 22, reduce 11) on '|'
    471 state 30
    472 	expr : expr . "ADD" expr  (7)
    473 	expr : expr . "SUB" expr  (8)
    474 	expr : expr . "MUL" expr  (9)
    475 	expr : expr . "DIV" expr  (10)
    476 	expr : expr . "MOD" expr  (11)
    477 	expr : expr "MOD" expr .  (11)
    478 	expr : expr . "AND" expr  (12)
    479 	expr : expr . '|' expr  (13)
    480 
    481 	"ADD"  shift 16
    482 	"SUB"  shift 17
    483 	"MUL"  shift 18
    484 	"DIV"  shift 19
    485 	"MOD"  shift 20
    486 	"AND"  shift 21
    487 	'|'  shift 22
    488 	'\n'  reduce 11
    489 	')'  reduce 11
    490 
    491 
    492 31: shift/reduce conflict (shift 16, reduce 12) on "ADD"
    493 31: shift/reduce conflict (shift 17, reduce 12) on "SUB"
    494 31: shift/reduce conflict (shift 18, reduce 12) on "MUL"
    495 31: shift/reduce conflict (shift 19, reduce 12) on "DIV"
    496 31: shift/reduce conflict (shift 20, reduce 12) on "MOD"
    497 31: shift/reduce conflict (shift 21, reduce 12) on "AND"
    498 31: shift/reduce conflict (shift 22, reduce 12) on '|'
    499 state 31
    500 	expr : expr . "ADD" expr  (7)
    501 	expr : expr . "SUB" expr  (8)
    502 	expr : expr . "MUL" expr  (9)
    503 	expr : expr . "DIV" expr  (10)
    504 	expr : expr . "MOD" expr  (11)
    505 	expr : expr . "AND" expr  (12)
    506 	expr : expr "AND" expr .  (12)
    507 	expr : expr . '|' expr  (13)
    508 
    509 	"ADD"  shift 16
    510 	"SUB"  shift 17
    511 	"MUL"  shift 18
    512 	"DIV"  shift 19
    513 	"MOD"  shift 20
    514 	"AND"  shift 21
    515 	'|'  shift 22
    516 	'\n'  reduce 12
    517 	')'  reduce 12
    518 
    519 
    520 32: shift/reduce conflict (shift 16, reduce 13) on "ADD"
    521 32: shift/reduce conflict (shift 17, reduce 13) on "SUB"
    522 32: shift/reduce conflict (shift 18, reduce 13) on "MUL"
    523 32: shift/reduce conflict (shift 19, reduce 13) on "DIV"
    524 32: shift/reduce conflict (shift 20, reduce 13) on "MOD"
    525 32: shift/reduce conflict (shift 21, reduce 13) on "AND"
    526 state 32
    527 	expr : expr . "ADD" expr  (7)
    528 	expr : expr . "SUB" expr  (8)
    529 	expr : expr . "MUL" expr  (9)
    530 	expr : expr . "DIV" expr  (10)
    531 	expr : expr . "MOD" expr  (11)
    532 	expr : expr . "AND" expr  (12)
    533 	expr : expr . '|' expr  (13)
    534 	expr : expr '|' expr .  (13)
    535 
    536 	"ADD"  shift 16
    537 	"SUB"  shift 17
    538 	"MUL"  shift 18
    539 	"DIV"  shift 19
    540 	"MOD"  shift 20
    541 	"AND"  shift 21
    542 	'|'  reduce 13
    543 	'\n'  reduce 13
    544 	')'  reduce 13
    545 
    546 
    547 State 12 contains 6 shift/reduce conflicts.
    548 State 26 contains 7 shift/reduce conflicts.
    549 State 27 contains 7 shift/reduce conflicts.
    550 State 28 contains 7 shift/reduce conflicts.
    551 State 29 contains 7 shift/reduce conflicts.
    552 State 30 contains 7 shift/reduce conflicts.
    553 State 31 contains 7 shift/reduce conflicts.
    554 State 32 contains 6 shift/reduce conflicts.
    555 
    556 
    557 28 terminals, 5 nonterminals
    558 19 grammar rules, 33 states
    559