Abstract
This paper presents a construct for mapping arbitrary non-left recursive context-free grammars into recursive descent parsers that: handle ambiguous grammars correctly; perform with LL(1) efficiency on LL(1) grammars; allow straightforward implementation of both inherited and synthesized attributes; and allow semantic actions to be added at any point in the grammar. We describe both the basic algorithm and a tool, GRDP, which generates parsers which use this technique. Modifications of the basic algorithm to improve efficiency lead to a discussion of follow-determinism, a fundamental property that gives insights into the behaviour of both LL and LR parsers.
Chapter PDF
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.
References
Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: principles techniques and tools. Addison-Wesley, 1986.
Alfred V. Aho and Jeffrey D. Ullman. The Theory of Parsing, Translation and Compiling, volume 1 (Parsing). Prentice-Hall Inc., 1972.
Peter T. Breuer and Jonathan P. Bowen. A PREttier Compiler-Compiler: Generating higher-order parsers in C. Software Practice and Experience, 25(11):1263–1297, November 1995.
Adrian Johnstone. RDP-a recursive descent compiler compiler. Technical Report TR-95-10, Royal Holloway, University of London, Computer Science Department, March 1995.
Adrian Johnstone and Elizabeth Scott. Generalised recursive descent. Part 1: language design and parsing. Technical Report TR-97-18, Royal Holloway, University of London, Computer Science Department, October 1997.
Adrian Johnstone and Elizabeth Scott. Generalised recursive descent. Part 2: some underlying theory. Technical Report TR-97-19, Royal Holloway, University of London, Computer Science Department, October 1997.
Terence John Parr. Obtaining Practical Variants of LL(k) and LR(k) for k > 1 By Splitting the Atomic k-Tuple. PhD thesis, Purdue University, August 1993.
Terence J. Parr and Russell W. Quong. LL and LR translators need k > 1 lookahead. ACM Sigplan Notices, 31(2):27–34, February 1996.
Georg Sander. VCG Visualisation of Compiler Graphs. Universität des Saarlaudes, 66041 Saarbrüken, Germany, February 1995.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Johnstone, A., Scott, E. (1998). Generalised recursive descent parsing and follow-determinism. In: Koskimies, K. (eds) Compiler Construction. CC 1998. Lecture Notes in Computer Science, vol 1383. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0026420
Download citation
DOI: https://doi.org/10.1007/BFb0026420
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64304-3
Online ISBN: 978-3-540-69724-4
eBook Packages: Springer Book Archive