An efficient context-free parsing algorithm
Communications of the ACM
Communications of the ACM
A practical method for constructing LR (k) processors
Communications of the ACM
The theory of parsing, translation, and compiling
The theory of parsing, translation, and compiling
PRACTICAL TRANSLATORS FOR LR(K) LANGUAGES
PRACTICAL TRANSLATORS FOR LR(K) LANGUAGES
Journal of Computer and System Sciences
ACM Transactions on Programming Languages and Systems (TOPLAS)
Elimination of single productions from LR parsers in conjunction with the use of default reductions
POPL '77 Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Hi-index | 0.00 |
A chain production is a production of the form A→M where A is a nonterminal and M is either a terminal or nonterminal. Pager in [Pag5] has presented an algorithm which removes all chain reductions from LR(1) parsers after they have been constructed. In this paper, we present an algorithm for directly constructing LR(k) parsers with arbitrary subsets of the chain productions, called the useless chain productions, optimized out. If this subset is empty, the algorithm is a standard one [And 1, Kn]. If this subset consists of all chain productions, the result is a parser with all chain reductions optimized away. The algorithm, as in [Pag5], also eliminates from the parsers all nonterminals which occur as the left part of useless chain productions. This latter optimization along with the chain reduction optimization significantly decreases the storage space and execution times of the parsers. This provides an efficient solution of the open problem posed by Aho and Ullman [A&U2] for all LR(k) grammars.