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-operator" expr 12 8 | expr "SUB-operator" expr 13 9 | expr "MUL-operator" expr 14 10 | expr "DIV-operator" expr 15 11 | expr "MOD-operator" expr 16 12 | expr "AND-operator" expr 17 13 | expr '|' expr 18 14 | "SUB-operator" 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-operator" 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-operator" . expr (14) 62 63 "SUB-operator" 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-operator" reduce 15 85 "SUB-operator" reduce 15 86 "MUL-operator" reduce 15 87 "DIV-operator" reduce 15 88 "MOD-operator" reduce 15 89 "AND-operator" reduce 15 90 '|' reduce 15 91 '\n' reduce 15 92 93 94 state 6 95 expr : '(' . expr ')' (6) 96 97 "SUB-operator" 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-operator" expr (7) 117 expr : expr . "SUB-operator" expr (8) 118 expr : expr . "MUL-operator" expr (9) 119 expr : expr . "DIV-operator" expr (10) 120 expr : expr . "MOD-operator" expr (11) 121 expr : expr . "AND-operator" expr (12) 122 expr : expr . '|' expr (13) 123 124 "ADD-operator" shift 16 125 "SUB-operator" shift 17 126 "MUL-operator" shift 18 127 "DIV-operator" shift 19 128 "MOD-operator" shift 20 129 "AND-operator" 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-operator" reduce 16 140 "SUB-operator" reduce 16 141 "MUL-operator" reduce 16 142 "DIV-operator" reduce 16 143 "MOD-operator" reduce 16 144 "AND-operator" 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-operator" 163 12: shift/reduce conflict (shift 17, reduce 14) on "SUB-operator" 164 12: shift/reduce conflict (shift 18, reduce 14) on "MUL-operator" 165 12: shift/reduce conflict (shift 19, reduce 14) on "DIV-operator" 166 12: shift/reduce conflict (shift 20, reduce 14) on "MOD-operator" 167 12: shift/reduce conflict (shift 21, reduce 14) on "AND-operator" 168 state 12 169 expr : expr . "ADD-operator" expr (7) 170 expr : expr . "SUB-operator" expr (8) 171 expr : expr . "MUL-operator" expr (9) 172 expr : expr . "DIV-operator" expr (10) 173 expr : expr . "MOD-operator" expr (11) 174 expr : expr . "AND-operator" expr (12) 175 expr : expr . '|' expr (13) 176 expr : "SUB-operator" expr . (14) 177 178 "ADD-operator" shift 16 179 "SUB-operator" shift 17 180 "MUL-operator" shift 18 181 "DIV-operator" shift 19 182 "MOD-operator" shift 20 183 "AND-operator" 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-operator" 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-operator" expr (7) 205 expr : expr . "SUB-operator" expr (8) 206 expr : expr . "MUL-operator" expr (9) 207 expr : expr . "DIV-operator" expr (10) 208 expr : expr . "MOD-operator" expr (11) 209 expr : expr . "AND-operator" expr (12) 210 expr : expr . '|' expr (13) 211 212 "ADD-operator" shift 16 213 "SUB-operator" shift 17 214 "MUL-operator" shift 18 215 "DIV-operator" shift 19 216 "MOD-operator" shift 20 217 "AND-operator" 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-operator" . expr (7) 231 232 "SUB-operator" 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-operator" . expr (8) 244 245 "SUB-operator" 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-operator" . expr (9) 257 258 "SUB-operator" 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-operator" . expr (10) 270 271 "SUB-operator" 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-operator" . expr (11) 283 284 "SUB-operator" 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-operator" . expr (12) 296 297 "SUB-operator" 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-operator" 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-operator" expr (7) 329 expr : expr . "SUB-operator" expr (8) 330 expr : expr . "MUL-operator" expr (9) 331 expr : expr . "DIV-operator" expr (10) 332 expr : expr . "MOD-operator" expr (11) 333 expr : expr . "AND-operator" expr (12) 334 expr : expr . '|' expr (13) 335 336 "ADD-operator" shift 16 337 "SUB-operator" shift 17 338 "MUL-operator" shift 18 339 "DIV-operator" shift 19 340 "MOD-operator" shift 20 341 "AND-operator" 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-operator" 353 26: shift/reduce conflict (shift 17, reduce 7) on "SUB-operator" 354 26: shift/reduce conflict (shift 18, reduce 7) on "MUL-operator" 355 26: shift/reduce conflict (shift 19, reduce 7) on "DIV-operator" 356 26: shift/reduce conflict (shift 20, reduce 7) on "MOD-operator" 357 26: shift/reduce conflict (shift 21, reduce 7) on "AND-operator" 358 26: shift/reduce conflict (shift 22, reduce 7) on '|' 359 state 26 360 expr : expr . "ADD-operator" expr (7) 361 expr : expr "ADD-operator" expr . (7) 362 expr : expr . "SUB-operator" expr (8) 363 expr : expr . "MUL-operator" expr (9) 364 expr : expr . "DIV-operator" expr (10) 365 expr : expr . "MOD-operator" expr (11) 366 expr : expr . "AND-operator" expr (12) 367 expr : expr . '|' expr (13) 368 369 "ADD-operator" shift 16 370 "SUB-operator" shift 17 371 "MUL-operator" shift 18 372 "DIV-operator" shift 19 373 "MOD-operator" shift 20 374 "AND-operator" 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-operator" 381 27: shift/reduce conflict (shift 17, reduce 8) on "SUB-operator" 382 27: shift/reduce conflict (shift 18, reduce 8) on "MUL-operator" 383 27: shift/reduce conflict (shift 19, reduce 8) on "DIV-operator" 384 27: shift/reduce conflict (shift 20, reduce 8) on "MOD-operator" 385 27: shift/reduce conflict (shift 21, reduce 8) on "AND-operator" 386 27: shift/reduce conflict (shift 22, reduce 8) on '|' 387 state 27 388 expr : expr . "ADD-operator" expr (7) 389 expr : expr . "SUB-operator" expr (8) 390 expr : expr "SUB-operator" expr . (8) 391 expr : expr . "MUL-operator" expr (9) 392 expr : expr . "DIV-operator" expr (10) 393 expr : expr . "MOD-operator" expr (11) 394 expr : expr . "AND-operator" expr (12) 395 expr : expr . '|' expr (13) 396 397 "ADD-operator" shift 16 398 "SUB-operator" shift 17 399 "MUL-operator" shift 18 400 "DIV-operator" shift 19 401 "MOD-operator" shift 20 402 "AND-operator" 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-operator" 409 28: shift/reduce conflict (shift 17, reduce 9) on "SUB-operator" 410 28: shift/reduce conflict (shift 18, reduce 9) on "MUL-operator" 411 28: shift/reduce conflict (shift 19, reduce 9) on "DIV-operator" 412 28: shift/reduce conflict (shift 20, reduce 9) on "MOD-operator" 413 28: shift/reduce conflict (shift 21, reduce 9) on "AND-operator" 414 28: shift/reduce conflict (shift 22, reduce 9) on '|' 415 state 28 416 expr : expr . "ADD-operator" expr (7) 417 expr : expr . "SUB-operator" expr (8) 418 expr : expr . "MUL-operator" expr (9) 419 expr : expr "MUL-operator" expr . (9) 420 expr : expr . "DIV-operator" expr (10) 421 expr : expr . "MOD-operator" expr (11) 422 expr : expr . "AND-operator" expr (12) 423 expr : expr . '|' expr (13) 424 425 "ADD-operator" shift 16 426 "SUB-operator" shift 17 427 "MUL-operator" shift 18 428 "DIV-operator" shift 19 429 "MOD-operator" shift 20 430 "AND-operator" 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-operator" 437 29: shift/reduce conflict (shift 17, reduce 10) on "SUB-operator" 438 29: shift/reduce conflict (shift 18, reduce 10) on "MUL-operator" 439 29: shift/reduce conflict (shift 19, reduce 10) on "DIV-operator" 440 29: shift/reduce conflict (shift 20, reduce 10) on "MOD-operator" 441 29: shift/reduce conflict (shift 21, reduce 10) on "AND-operator" 442 29: shift/reduce conflict (shift 22, reduce 10) on '|' 443 state 29 444 expr : expr . "ADD-operator" expr (7) 445 expr : expr . "SUB-operator" expr (8) 446 expr : expr . "MUL-operator" expr (9) 447 expr : expr . "DIV-operator" expr (10) 448 expr : expr "DIV-operator" expr . (10) 449 expr : expr . "MOD-operator" expr (11) 450 expr : expr . "AND-operator" expr (12) 451 expr : expr . '|' expr (13) 452 453 "ADD-operator" shift 16 454 "SUB-operator" shift 17 455 "MUL-operator" shift 18 456 "DIV-operator" shift 19 457 "MOD-operator" shift 20 458 "AND-operator" 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-operator" 465 30: shift/reduce conflict (shift 17, reduce 11) on "SUB-operator" 466 30: shift/reduce conflict (shift 18, reduce 11) on "MUL-operator" 467 30: shift/reduce conflict (shift 19, reduce 11) on "DIV-operator" 468 30: shift/reduce conflict (shift 20, reduce 11) on "MOD-operator" 469 30: shift/reduce conflict (shift 21, reduce 11) on "AND-operator" 470 30: shift/reduce conflict (shift 22, reduce 11) on '|' 471 state 30 472 expr : expr . "ADD-operator" expr (7) 473 expr : expr . "SUB-operator" expr (8) 474 expr : expr . "MUL-operator" expr (9) 475 expr : expr . "DIV-operator" expr (10) 476 expr : expr . "MOD-operator" expr (11) 477 expr : expr "MOD-operator" expr . (11) 478 expr : expr . "AND-operator" expr (12) 479 expr : expr . '|' expr (13) 480 481 "ADD-operator" shift 16 482 "SUB-operator" shift 17 483 "MUL-operator" shift 18 484 "DIV-operator" shift 19 485 "MOD-operator" shift 20 486 "AND-operator" 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-operator" 493 31: shift/reduce conflict (shift 17, reduce 12) on "SUB-operator" 494 31: shift/reduce conflict (shift 18, reduce 12) on "MUL-operator" 495 31: shift/reduce conflict (shift 19, reduce 12) on "DIV-operator" 496 31: shift/reduce conflict (shift 20, reduce 12) on "MOD-operator" 497 31: shift/reduce conflict (shift 21, reduce 12) on "AND-operator" 498 31: shift/reduce conflict (shift 22, reduce 12) on '|' 499 state 31 500 expr : expr . "ADD-operator" expr (7) 501 expr : expr . "SUB-operator" expr (8) 502 expr : expr . "MUL-operator" expr (9) 503 expr : expr . "DIV-operator" expr (10) 504 expr : expr . "MOD-operator" expr (11) 505 expr : expr . "AND-operator" expr (12) 506 expr : expr "AND-operator" expr . (12) 507 expr : expr . '|' expr (13) 508 509 "ADD-operator" shift 16 510 "SUB-operator" shift 17 511 "MUL-operator" shift 18 512 "DIV-operator" shift 19 513 "MOD-operator" shift 20 514 "AND-operator" 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-operator" 521 32: shift/reduce conflict (shift 17, reduce 13) on "SUB-operator" 522 32: shift/reduce conflict (shift 18, reduce 13) on "MUL-operator" 523 32: shift/reduce conflict (shift 19, reduce 13) on "DIV-operator" 524 32: shift/reduce conflict (shift 20, reduce 13) on "MOD-operator" 525 32: shift/reduce conflict (shift 21, reduce 13) on "AND-operator" 526 state 32 527 expr : expr . "ADD-operator" expr (7) 528 expr : expr . "SUB-operator" expr (8) 529 expr : expr . "MUL-operator" expr (9) 530 expr : expr . "DIV-operator" expr (10) 531 expr : expr . "MOD-operator" expr (11) 532 expr : expr . "AND-operator" expr (12) 533 expr : expr . '|' expr (13) 534 expr : expr '|' expr . (13) 535 536 "ADD-operator" shift 16 537 "SUB-operator" shift 17 538 "MUL-operator" shift 18 539 "DIV-operator" shift 19 540 "MOD-operator" shift 20 541 "AND-operator" 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 560 grammar parser grammar 561 symbol# value# symbol 562 0 0 $end 563 1 256 error 564 2 257 OP_ADD 565 3 258 "ADD-operator" 566 4 259 OP_SUB 567 5 260 "SUB-operator" 568 6 261 OP_MUL 569 7 262 "MUL-operator" 570 8 263 OP_DIV 571 9 264 "DIV-operator" 572 10 265 OP_MOD 573 11 266 "MOD-operator" 574 12 267 OP_AND 575 13 268 "AND-operator" 576 14 269 DIGIT 577 15 270 LETTER 578 16 124 '|' 579 17 38 '&' 580 18 43 '+' 581 19 45 '-' 582 20 42 '*' 583 21 47 '/' 584 22 37 '%' 585 23 271 UMINUS 586 24 10 '\n' 587 25 61 '=' 588 26 40 '(' 589 27 41 ')' 590 28 272 $accept 591 29 273 list 592 30 274 stat 593 31 275 expr 594 32 276 number 595