Generalized type-based disambiguation of meta programs with concrete object syntax

  • Authors:
  • Martin Bravenboer;Rob Vermaas;Jurgen Vinju;Eelco Visser

  • Affiliations:
  • Department of Information and Computing Sciences, Universiteit Utrecht, Utrecht, The Netherlands;Department of Information and Computing Sciences, Universiteit Utrecht, Utrecht, The Netherlands;Centrum voor Wiskunde en Informatica (CWI), Amsterdam, The Netherlands;Department of Information and Computing Sciences, Universiteit Utrecht, Utrecht, The Netherlands

  • Venue:
  • GPCE'05 Proceedings of the 4th international conference on Generative Programming and Component Engineering
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 leads 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 language independent 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 type checker for the meta language. To validate our method we have developed embeddings of several object languages in Java, including AspectJ and Java itself.