Title
From object algebras to attribute grammars
Abstract
Oliveira and Cook (2012) and Oliveira et al. (2013) have recently introduced object algebras as a program structuring technique to improve the modularity and extensibility of programs. We analyze the relationship between object algebras and attribute grammars (AGs), a formalism to augment context-free grammars with attributes. We present an extension of the object algebra technique with which the full class of L-attributed grammars - an important class of AGs that corresponds to one-pass compilers - can be encoded in Scala. The encoding is modular (attributes can be defined and type-checked separately), scalable (the size of the encoding is linear in the size of the AG specification) and compositional (each AG artifact is represented as a semantic object of the host language). To evaluate these claims, we have formalized the encoding and re-implemented a one-pass compiler for a subset of C with our technique. We also discuss how advanced features of modern AG systems, such as higher-order and parameterized attributes, reference attributes, and forwarding can be supported.
Year
DOI
Venue
2014
10.1145/2660193.2660237
OOPSLA
Keywords
Field
DocType
church-encoding,formal definitions and theory,embedded domain-specific languages,visitor pattern,scala,object-oriented programming,modularity,object algebras,attribute grammars,one-pass compilers,church encoding
Tree-adjoining grammar,Rule-based machine translation,Parameterized complexity,Programming language,L-attributed grammar,Scala,Computer science,Theoretical computer science,Compiler,Church encoding,Modularity
Conference
Volume
Issue
ISSN
49
10
0362-1340
Citations 
PageRank 
References 
4
0.41
23
Authors
3
Name
Order
Citations
PageRank
Tillmann Rendel139216.15
Jonathan Immanuel Brachthäuser273.18
Klaus Ostermann345723.97