Abstract
Traditionally, LR parsers are implemented as table interpreters. A parser generator creates tables whose entries are interpreted by the parser driver. Recent research shows that much faster LR parsers can be obtained by converting the table entries into directly executed code.
This paper introduces new techniques for optimizing directly executable parsers. The optimization methods proposed here are based on the analysis of the characteristical properties of large programming language grammars. They include a new structure for the parsing algorithm, an adaptation of the classical chain rule optimization and a systematic approach to stack access minimization. A parser generator based on these techniques was developed. It generates directly executable LR parsers running up to seven times faster than comparable table interpreting parsers.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
7 References
Dencker, P., Durre, K. and Heuft, J., Optimization of Parser Tables for Portable Compilers, ACM Trans. on Prog. Lang. and Systems, 6 (1984), 546–572.
Horspool, R. N. and Whitney, M., Even faster LR Parsing, Software — Practice and Experience (to appear) (1990).
Johnson, S. C., Yacc — yet another compiler compiler, Computing Science Technical Report 32, AT&T Bell Labs, Murray Hill, N.Y. (1975).
Pennello, T. J., Very fast LR Parsing, Proc. 1986 Symp. on Compiler Construction, ACM SIGPLAN Notices 21 (1986), 145–151.
Röhrich, J., Methods for the automatic Construction of Error Correcting Parsers, Acta Informatica 13 (1980), 115–139.
Waite, W. M., The cost of lexical analysis, Software — Practice and Experience 15(1986), 473–488.
Waite, W. M. and Goos, G., Compiler Construction, Springer-Verlag, 1984.
Whitney, M. and Horspool, R. N., Extremely Rapid LR Parsing, Proc. Workshop on Compiler-Compiler and High-Speed Compilation, Berlin G.D.R. (1988).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pfahler, P. (1991). Optimizing directly executable LR parsers. In: Hammer, D. (eds) Compiler Compilers. CC 1990. Lecture Notes in Computer Science, vol 477. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-53669-8_82
Download citation
DOI: https://doi.org/10.1007/3-540-53669-8_82
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53669-7
Online ISBN: 978-3-540-46953-7
eBook Packages: Springer Book Archive