Generalized Type Based Disambiguation Of Meta Programs With Concrete Object Syntax
M. Bravenboer, R. Vermaas, J. Vinju, and E. Visser. Generalized Type-Based Disambiguation of Meta Programs with Concrete Object Syntax.
In R. Glück and M. Lowry, editors, Proceedings of the Fourth International Conference on Generative Programming and Component Engineering (GPCE 2005), Lecture Notes in Computer Science, Tallin, Estonia, September 2005. Springer.
In meta-programming with concrete object syntax, object-level
programs are composed from fragments written in concrete
syntax. The use of small program fragments in such quotations
and the use of meta-level expressions within these fragments
(anti-quotation) often lead to ambiguities. This problem is
usually solved through explicit disambiguation, resulting in
considerable syntactic overhead. A few systems manage to
reduce this overhead by using type information during
parsing. Since this is hard to achieve with traditional
parsing technology, these systems provide specific
combinations of meta- and object-languages, and their
implementations are difficult to reuse.
In this paper, we generalize these approaches and present a
method for introducing concrete
object syntax without explicit disambiguation. The method
uses scannerless generalized-LR parsing to parse meta-programs
with embedded object-level fragments, which produces a forest
of all possible parses. This forest is reduced to a tree by a
disambiguating typechecker for the meta-language. To validate
our method we have developed embeddings of several object
languages in Java, including AspectJ and Java itself.
Failed to include URL http://www.cs.uu.nl/~visser/visser/BVVV05.bib
Bravenboer, Vinju and Visser in Vancouver where the project was conceived