The C programming language
Theory and Practice of Compiler Writing
Theory and Practice of Compiler Writing
Compilers: Principles, Techniques, and Tools (2nd Edition)
Compilers: Principles, Techniques, and Tools (2nd Edition)
Hi-index | 0.00 |
In this note, the shift-reduce conflicts of LR(1) and LR(0) are compared. It is concluded that, if LR(1) has no shift-reduce conflicts, or, if the LR(1) shift-reduce conflicts are resolved in favor of the shift, then all shift-reduce conflicts of the corresponding LR(0) can be correctly resolved by the simple rule: resolve in favor of the shift. With this resolution, LR(0) is adequate for parsing the C grammar.