Abstract
Recursive descent parsing is restricted to languages whose grammars are LL(1), i.e., which can be parsed top-down with a single lookahead symbol. Unfortunately, many languages such as Java, C++, or C# are not LL(1). Therefore recursive descent parsing cannot be used or the parser has to make its decisions based on semantic information or a multi-symbol lookahead.
In this paper we suggest a systematic technique for resolving LL(1) conflicts in recursive descent parsing and show how to integrate it into a compiler generator (Coco/R). The idea is to evaluate user-defined boolean expressions, in order to allow the parser to make its parsing decisions where a one symbol lookahead does not suffice.
Using our extended compiler generator we implemented a compiler front end for C# that can be used as a framework for implementing a variety of tools.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aho, A.V., Ullman, J.D.: Principles of Compiler Design. Addison-Wesley, Reading (1977)
ANTLR (ANother Tool for Language Recognition), http://www.antlr.org
Coco Tools Project at the Rotor Community Site, http://cocotools.sscli.net
JavaCCTM (Java Compiler Compiler), The Java Parser Generator, http://www.experimentalstuff.com/Technologies/JavaCC
Knuth, D.E.: On the Translation of Languages from Left to Right. Information and Control 6, 607–639 (1965)
Knuth, D.E.: Semantics of Context-free Languages. Mathematical Systems Theory 2, 127–145 (1968)
Löberbauer, M.: Ein Werkzeug für den White-Box-Test. Diploma thesis, Institute of Practical Computer Science, University of Linz, Austria (February 2003)
Mössenböck, H.: A Generator for Production Quality Compilers. In: Hammer, D. (ed.) CC 1990. LNCS, vol. 477, pp. 42–55. Springer, Heidelberg (1991)
Mössenböck, H.: Coco/R for various languages – Online Documentation, http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/
Parr, T.: Language Translation Using PCCTS and C++. Automata Publishing Company (1993)
Rotor: The Microsoft Rotor Project, http://research.microsoft.com/collaboration/university/europe/rotor/
Standard ECMA-334, C# Language Specification (December 2001), http://www.ecma-international.org/publications/standards/ecma-334.htm
Steineder, K.H.: Optimization Hint Tool. Diploma thesis, Institute for Practical Computer Science, University of Linz, Austria (August 2003)
Terry, P.: Compilers and Compiler Generators – An Introduction Using C++. International Thomson Computer Press (1997)
Wirth, N.: What Can We Do about the Unnecessary Diversity of Notation for Syntactic Definitions? Communications of the ACM (November 1977)
Wirth, N.: Compiler Construction. Addison-Wesley, Reading (1996)
Wöß, A., Löberbauer, M.: SSCLI-Project: Compiler Generation Tools for C#, http://dotnet.jku.at/Projects/Rotor/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Wöß, A., Löberbauer, M., Mössenböck, H. (2003). LL(1) Conflict Resolution in a Recursive Descent Compiler Generator. In: Böszörményi, L., Schojer, P. (eds) Modular Programming Languages. JMLC 2003. Lecture Notes in Computer Science, vol 2789. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45213-3_25
Download citation
DOI: https://doi.org/10.1007/978-3-540-45213-3_25
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40796-6
Online ISBN: 978-3-540-45213-3
eBook Packages: Springer Book Archive