1 research outputs found

    Creating Textual Language Dialects Using Aspect-like Techniques

    No full text
    We present a work aimed on efficiently creating textual language dialects and supporting tools for them (e.g. compiler front-ends, IDE support, prettyprinters, etc.). A dialect is a language which may be described with a (relatively small) set of changes to some other language. For example we can consider SQL dialects used in DB-management systems. The need in creating dialects is witnessed by existence of extensible languages like LISP and many more [1,2,3,4]. There also are special tools supporting dialect development for C [5] and Java [6]. These approaches allow extending languages efficiently, but it took a lot of work to make it possible for each single language. The problem we are addressing here is how can we do it for arbitrary languages with not so much effort? If we need only a syntax checker for a language, creating dialects for it is easy. We have a grammar describing the language syntax and all we need is to modify this grammar. This can be done easily by a transformation which may be formulated in terms of aspect application (analogous to AOP [7]), we call such transformations syntactical aspects. By pattern matching aspects identify places in the source grammar that we need to modify and provide instructions for such modifications: insert something before or after the specified point, or replace the object with some other one. For example, assume we have a grammar for arithmetical expressions for real numbers: sum: mult (’+ ’ mult)*; mult: factor (’* ’ factor)*; factor: REAL: ’( ’ sum ’)’ We may want to replace reals with integers and introduce variables in this grammar, this could be done by modifying rules for factor as follows: facto
    corecore