WIPIVERSE All articles

ECLR-attributed grammar

ECLR-attributed grammars are a special type of attribute grammars. They are a variant of LR-attributed grammars where an equivalence relation on inherited attributes is used to optimize attribute evaluation. The acronym EC stands for "equivalence class."

ECLR-attributed grammars are a superset of LR-attributed grammars. They were introduced as a practical class of attribute grammars suitable for use with LR parsing, aiming to achieve time and space efficiency competitive with hand-written compilers, particularly in the context of one-pass compilation.

The key idea behind ECLR-attributed grammars is that inherited attributes belonging to the same equivalence class can be evaluated and managed together, reducing the overhead of attribute evaluation during parsing.

The compiler generator Rie, first developed in 1985 by M. Sassa, H. Ishizuka, and I. Nakata at the Tokyo Institute of Technology, was based on ECLR-attributed grammars.

References

  • M. Sassa, H. Ishizuka and I. Nakata: "ECLR-attributed grammars: a practical class of LR-attributed grammars." Information Processing Letters 24 (1987), 31–41.
  • M. Sassa, H. Ishizuka and I. Nakata: "Rie, a Compiler Generator Based on a One-pass-type Attribute Grammar." Software—Practice and Experience 25:3 (March 1995), 229–250.
  • Deransart, Pierre; Jourdan, Martin; Lorho, Bernard (1988). Attribute Grammars: Definitions, Systems, and Bibliography. Lecture Notes in Computer Science. Vol. 323. Springer-Verlag. p. 149.

Categories: Formal languages, Compiler construction

Browse

More topics to explore

    Browse all articles