Formalization and correctness of predictive shift-reduce parsers for graph grammars based on hyperedge replacement

https://doi.org/10.1016/j.jlamp.2018.12.006Get rights and content
Under an Elsevier user license
open archive

Highlights

  • Describes a predictive shift-reduce (PSR) parsing algorithm for a subclass of hyperedge replacement graph grammars.

  • Includes a correctness proof of the parsing algorithm.

  • PSR parsing needs worst case linear space and time and requires preprocessing that needs expected or worst case linear time.

  • PSR parsing has been implemented in the Grappa parser generator tool, available at www.unibw.de/inf2/grappa.

Abstract

Hyperedge replacement (HR) grammars can generate NP-complete graph languages, which makes parsing hard even for fixed HR languages. Therefore, we study predictive shift-reduce (PSR) parsing that yields efficient parsers for a subclass of HR grammars, by generalizing the concepts of SLR(1) string parsing to graphs. We formalize the construction of PSR parsers and show that it is correct. PSR parsers run in linear space and time, and are more efficient than the predictive top-down (PTD ) parsers recently developed by the authors.

Keywords

Hyperedge replacement grammar
Graph parsing
Grammar analysis

Cited by (0)

This paper formalizes the concepts described in [14] and provides detailed correctness proofs for them.