Using grammatical aspects in language engineering

Andrey Breslav

University of Tartu and St Petersburg State University ITMO

Thursday, 5 November 2009, 14:00
Cybernetica Bldg (Akadeemia tee 21), room B101

Slides from the talk [pdf]

Abstract: Language Engineering is an interdisciplinary area addressing many problems related to computer languages. Parsing and translation are the most widely known ones, but there are many more such as typing and other static analyses, creating IDEs, which includes syntax highlighting, building outlines, code navigation, completion and refactoring. Many of such problems are solved in a generative fashion: we write high-level specifications (like grammars with embedded semantic actions for parsing) and generate code from them.

Now if we come up with a language (which is an everyday practice if you consider DSLs) we have to specify many things for it. The problem is that specification languages are built upon a grammar of the language in question (e.g. for parsing we embed semantic actions into grammar rules, other languages work the same way) and if we specify many solutions separately, we have to duplicate the grammar. The alternative approach is to attach all the specifications to the same grammar which leads to huge tangled specifications.

We propose a solution for this problem based on usage of a pointcut-advice language inspired by AspectJ to attach specifications to a grammar without mixing them together. This language was successfully applied to specify attributed translation, IDE features and grammar transformations. Our approach can be generalized to all structure definition languages.

Tarmo Uustalu
Last update 7 November 2009