Skip to main content

LL(1) Conflict Resolution in a Recursive Descent Compiler Generator

  • Conference paper
Modular Programming Languages (JMLC 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2789))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A.V., Ullman, J.D.: Principles of Compiler Design. Addison-Wesley, Reading (1977)

    Google Scholar 

  2. ANTLR (ANother Tool for Language Recognition), http://www.antlr.org

  3. Coco Tools Project at the Rotor Community Site, http://cocotools.sscli.net

  4. JavaCCTM (Java Compiler Compiler), The Java Parser Generator, http://www.experimentalstuff.com/Technologies/JavaCC

  5. Knuth, D.E.: On the Translation of Languages from Left to Right. Information and Control 6, 607–639 (1965)

    Article  MathSciNet  Google Scholar 

  6. Knuth, D.E.: Semantics of Context-free Languages. Mathematical Systems Theory 2, 127–145 (1968)

    Article  MATH  MathSciNet  Google Scholar 

  7. Löberbauer, M.: Ein Werkzeug für den White-Box-Test. Diploma thesis, Institute of Practical Computer Science, University of Linz, Austria (February 2003)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. Mössenböck, H.: Coco/R for various languages – Online Documentation, http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/

  10. Parr, T.: Language Translation Using PCCTS and C++. Automata Publishing Company (1993)

    Google Scholar 

  11. Rotor: The Microsoft Rotor Project, http://research.microsoft.com/collaboration/university/europe/rotor/

  12. Standard ECMA-334, C# Language Specification (December 2001), http://www.ecma-international.org/publications/standards/ecma-334.htm

  13. Steineder, K.H.: Optimization Hint Tool. Diploma thesis, Institute for Practical Computer Science, University of Linz, Austria (August 2003)

    Google Scholar 

  14. Terry, P.: Compilers and Compiler Generators – An Introduction Using C++. International Thomson Computer Press (1997)

    Google Scholar 

  15. Wirth, N.: What Can We Do about the Unnecessary Diversity of Notation for Syntactic Definitions? Communications of the ACM (November 1977)

    Google Scholar 

  16. Wirth, N.: Compiler Construction. Addison-Wesley, Reading (1996)

    Google Scholar 

  17. Wöß, A., Löberbauer, M.: SSCLI-Project: Compiler Generation Tools for C#, http://dotnet.jku.at/Projects/Rotor/

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics