Modelling GLL Parser Implementations

  • Adrian Johnstone
  • Elizabeth Scott
Conference paper

DOI: 10.1007/978-3-642-19440-5_4

Part of the Lecture Notes in Computer Science book series (LNCS, volume 6563)
Cite this paper as:
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

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.

Keywords

GLL parsing general context-free parsing implementation spaces time-space tradeoffs 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Adrian Johnstone
    • 1
  • Elizabeth Scott
    • 1
  1. 1.Royal HollowayUniversity of LondonEghamUK

Personalised recommendations