Attribute Grammar Extensions Higher Order Attribute Grammars And Views
Alexey
In my Master's thesis I rediscovered the concept of Composable Attribute Grammars (
Farrow et al). In this setting, some functionality of a compiler is written not in the AST of the language to be compiled, but in some simpler AST that has fewer constructs and nodes. Then, the compiler writer has to provide a mapping between these two ASTs to apply this functionality in the compiler.
The advantage of this approach is that by providing different mappings, we can reuse the abstracted functionality in compilers for different languages/ASTs.
In my view, the main contribution of my thesis is a new compilation technique of Attributed Views (or Composable Attribute Grammars) into a lazy evaluator. This new technique enables separate compilation of Attribute Grammars without the need for the Separability restriction that Farrow et al impose on Composable attribute grammars.
Software
A proof of concept prototype for Attribute Grammar Views exists. You can download it via CVS:
cvs -d :pserver:anonymous@cvs.cs.uu.nl:/data/cvs-rep login
cvs -d :pserver:anonymous@cvs.cs.uu.nl:/data/cvs-rep \
checkout -r ref-views-impl uust
The first command requires a password to login, you may ignore
this prompt and press enter. The next command checks out the uust
repository, including the sources of the UUAG system. The tag name
is a development branch where the AG Views prototype resides. You
will need the Glasgow Haskell Compiler to build the prototype.
The following commands from the root directory of the package build
the repository tools and libraries:
./configure
make
make install
You may need special privileges for the last command. However, it
is not necessary to install the package to test the tools. They
can be found in directory
build/bin.
The AG Views prototype
is in directory
tools/ag/dev. To build it type the command
make devel in that directory. Read the file
AGviews-README for an explanation on how to run the examples
presented in this thesis.
This prototype for Higher order attribute grammars may be checked out using the tag
ref-hoag-impl.
--
AlexeyRodriguez - 03 Aug 2006