Grammar partitioning and modular deterministic parsing11Work supported by CNR-CESTIA, ESPRIT P6333 IDEA and by Politecnico di Milano-Progetto Prometeus.

  • Authors:
  • Stefano Crespi Reghizzi;Giuseppe Psaila

  • Affiliations:
  • Politecnico di Milano, Dipartimento Elettronica e Informazione, Piazza Leonardo da Vinci 32, I-20133, Milano, Italy;Politecnico di Milano, Dipartimento Elettronica e Informazione, Piazza Leonardo da Vinci 32, I-20133, Milano, Italy

  • Venue:
  • Computer Languages
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Complex languages are often modularized into sublanguages and the compiler is accordingly organized as a set of separate modules. Modularization (called federalization) is beneficial for beating complexity, for maintenance, and for reuse. Focusing on syntax analysis, we consider the decomposition of a grammar into deterministic subgrammars. We study three conditions for determinism in grammar partitioning: first using homogeneous modules of the LR(1) or LL(1) kind; then using heterogeneous modules (LR(1) or LL(1)). Federalization slightly decreases the generality of LR(1) parsers, but not of LL(1) ones, and it allows to handle some grammars which are not LALR(1). Experimental results show that LR(1) federal automata have fewer (up to 60%) states than monolithic LR(1) automata. Criteria for modularization, practical experiences and hints to semantic decomposition issues conclude the paper.