Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Modelling GLL Parser Implementations

  • Conference paper
Software Language Engineering (SLE 2010)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6563))

Included in the following conference series:

Abstract

We describe the development of space-efficient implementations of GLL parsers, and the process by which we refine a set-theoretic model of the algorithm into a practical parser generator that creates practical parsers. GLL parsers are recursive descent-like, in that the structure of the parser’s code closely mirrors the grammar rules, and so grammars (and their parsers) may be debugged by tracing the running parser in a debugger. While GLL recognisers are straightforward to describe, full GLL parsers present technical traps and challenges for the unwary. In particular, naïve implementations based closely on the theoretical description of GLL can result in data structures that are not practical for grammars for real programming language grammars such as ANSI-C. We develop an equivalent formulation of the algorithm as a high-level set-theoretic model supported by table-based indices, in order to then explore a set of alternative implementations which trade space for time in ways which preserve the cubic bound.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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.

Similar content being viewed by others

References

  1. Gnu Bison home page (2003), http://www.gnu.org/software/bison

  2. Earley, J.: An efficient context-free parsing algorithm. Communications of the ACM 13(2), 94–102 (1970)

    Article  MATH  Google Scholar 

  3. Knuth, D.E.: On the translation of languages from left to right. Information and Control 8(6), 607–639 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  4. Nozohoor-Farshi, R.: GLR parsing for ε-grammars. In: Tomita, M. (ed.) Generalized LR Parsing, pp. 60–75. Kluwer Academic Publishers, The Netherlands (1991)

    Google Scholar 

  5. Scott, E., Johnstone, A.: Generalised bottom up parsers with reduced stack activity. The Computer Journal 48(5), 565–587 (2005)

    Article  Google Scholar 

  6. Scott, E., Johnstone, A.: GLL parsing. Electronic Notes in Theoretical Computer Science (2009)

    Google Scholar 

  7. Scott, E., Johnstone, A., Economopoulos, G.: A cubic Tomita style GLR parsing algorithm. Acta Informatica 44, 427–461 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  8. Tomita, M.: Efficient parsing for natural language. Kluwer Academic Publishers, Boston (1986)

    Book  Google Scholar 

  9. van den Brand, M.G.J., Heering, J., Klint, P., Olivier, P.A.: Compiling language definitions: the ASF+SDF compiler. ACM Transactions on Programming Languages and Systems 24(4), 334–368 (2002)

    Article  Google Scholar 

  10. Younger, D.H.: Recognition of context-free languages in time n 3. Inform. Control 10(2), 189–208 (1967)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Johnstone, A., Scott, E. (2011). Modelling GLL Parser Implementations. In: Malloy, B., Staab, S., van den Brand, M. (eds) Software Language Engineering. SLE 2010. Lecture Notes in Computer Science, vol 6563. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-19440-5_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-19440-5_4

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-19439-9

  • Online ISBN: 978-3-642-19440-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics