We are happy to announce that the following paper has been accepted
for publication at the 24th Annual ACM Symposium on Applied Computing
(SAC 2009) that will take place at Waikiki Beach, Honolulu, Hawaii,
USA, on March 8 - 12, 2009:
Akim Demaille (1), Roland Levillain (1,2), and Benoît Sigoure (1)
TWEAST: A Simple and Effective Technique to Implement
Concrete-Syntax AST Rewriting Using Partial Parsing
http://publis.lrde.epita.fr/200903-SAC
(1) EPITA Research and Development Laboratory (LRDE)
(2) Université Paris-Est, LABINFO-IGM, UMR CNRS 8049, A2SI-ESIEE
ASTs are commonly used to represent an input/output program in
compilers and language processing tools. Many of the tasks of these
tools consist in generating and rewriting ASTs. Such an approach can
become tedious and hard to maintain for complex operations, namely
program transformation, optimization, instrumentation, etc. On the
other hand, concrete syntax provides a natural and simpler
representation of programs, but it is not usually available as a
direct feature of the aforementioned tools. We propose a simple
technique to implement AST generation and rewriting in general purpose
languages using concrete syntax. Our approach relies on extensions
made in the scanner and the parser and the use of objects supporting
partial parsing called Text With Embedded Abstract Syntax Trees
(TWEASTS). A compiler for a simple language (Tiger) written in C++
serves as an example, featuring transformations in concrete syntax:
syntactic desugaring, optimization, code instrumentation such as
bounds-checking, etc. Extensions of this technique to provide a
full-fledged concrete-syntax rewriting framework are presented as
well.
--
Roland Levillain - LRDE/EPITA - A2SI/ESIEE/UMLV-Paris Est
Laboratoire de Recherche et de Développement de l'EPITA (LRDE)
14-16, rue Voltaire - FR-94276 Le Kremlin-Bicêtre Cedex - France
Tél. : 01 53 14 59 45 - Fax : 01 53 14 59 22 -
www.lrde.epita.fr