Abstract
Non-backtracking recursive descent parsers are easy to create but suffer from the disadvantage that they are limited to the relatively small LL(κ) class of grammars. Recursive ascent parsers can be built for the much larger LR(κ) class of grammars, but they are likely be too large to be useful and manual insertion of semantic action code into the parsers would require considerable skill. A composite approach, dubbed ‘recursive ascent-descent parsing’ or XLC(1) parsing, and which is related to left-corner parsing, solves all the problems. The parser has two parts — a top-down part and a bottom-up part. Either or both parts may be implemented as a collection of recursive functions or by a table-driven parsing algorithm. When a table-driven implementation of the bottom-up part is used, any syntax error recovery scheme applicable to LR parsers can be employed. Small, fast, implementations of the parsers are possible.
Chapter PDF
References
Aho, A.V., Sethi, R., and Ullman, J.D. Compilers: Principles, Techniques and Tools. Addison-Wesley, Reading, MA (1985).
Aretz, F.E.J.K. On a Recursive Ascent Parser. Information Processing Letters, 29, 3 (Nov. 1988), pp. 201–206.
Barnard, D.T., and Cordy, J.R. SL Parses the LR Languages. Computer Languages 13, 2 (1988), pp. 65–74.
Chapman, N.P. LR Parsing: Theory and Practice. Cambridge University Press, Cambridge, U.K. (1987).
Demers, A.J. Generalized Left Corner Parsing. Proc. 4th Symposium on Principles of Programming Languages (1977), pp. 170–182.
Fischer, C.N., and LeBlanc R.J. Jr., Crafting A Compiler. Benjamin/Cummings, Menlo Park, CA (1988).
Purdom, P., and Brown, C.A. Semantic Routines and LR(k) Parsers. Acta Informatica, 14 (1980), pp. 299–315.
Roberts, G.H. Recursive Ascent: An LR Analog to Recursive Descent. ACM SIGPLAN Notices, 23, 8 (Aug. 1988), pp. 23–29.
Roberts, G.H. Another Note on Recursive Ascent. To appear in Information Processing Letters (1989).
Röhrich, J. Methods for the Automatic Construction of Error Correcting Parsers. Acta Informatica, 13,2 (1980), pp. 115–139.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Horspool, R.N. (1991). Recursive ascent-descent 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_70
Download citation
DOI: https://doi.org/10.1007/3-540-53669-8_70
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