Acta Informatica

, Volume 51, Issue 7, pp 419–447

On the incremental growth and shrinkage of LR goto-graphs

Original Article

DOI: 10.1007/s00236-014-0201-2

Cite this article as:
Cazzola, W. & Vacchi, E. Acta Informatica (2014) 51: 419. doi:10.1007/s00236-014-0201-2

Abstract

The LR(0) goto-graph is the basis for the construction of parsers for several interesting grammar classes such as LALR and GLR. Early work has shown that even when a grammar is an extension to another, the goto-graph of the first is not necessarily a subgraph of the second. Some authors presented algorithms to grow and shrink these graphs incrementally, but the formal proof of the existence of a particular relation between a given goto-graph and a grown or shrunk counterpart seems to be still missing in literature as of today. In this paper we use the recursive projection of paths of limited length to prove the existence of one such relation, when the sets of productions are in a subset relation. We also use this relation to present two algorithms (Grow and Shrink) that transform the goto-graph of a given grammar into the goto-graph of an extension or a restriction to that grammar. We implemented these algorithms in a dynamically updatable LALR parser generator called DEXTER (the Dynamically EXTEnsible Recognizer) that we are now shipping with our current implementation of the Neverlang framework for programming language development.

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  1. 1.Università degli Studi di MilanoMilanItaly

Personalised recommendations