<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Automata Based Method for Domain-specific Languages Definition</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ulyana Tikhonova</string-name>
          <email>ulyana.tihonova@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Supervisor: Fedor Novikov St. Petersburg State Polytechnical University, Applied Mathematics Dept.</institution>
          ,
          <addr-line>Politekhnicheskaya 29., 195251 St. Petersburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We outline a research proposal which goal is to contribute to methods of new Domain-Specific Languages (DSLs) definition and implementation. We propose the automata based method for DSLs definition that allows specifying new languages with various notations in such a way that the language definition can be treated as a ready-to-use language implementation already. The automata based method allows defining language by three components: language metamodel (which includes an abstract syntax), concrete syntax and operational semantics. We use Unified Modeling Language (UML) as description formalism for all three components. Namely, language metamodel is defined using class diagrams. Concrete syntax is defined as parser using state machine diagrams. Semantics is defined as metamodel interpreter using state machine diagrams as well.</p>
      </abstract>
      <kwd-group>
        <kwd>DSL</kwd>
        <kwd>metamodel</kwd>
        <kwd>concrete syntax</kwd>
        <kwd>operational semantics</kwd>
        <kwd>UML</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Domain-specific Languages (DSLs) are considered to be very effective in software
engineering. They raise the level of abstraction, provide common domain notation,
and improve development process therefore. Per se, DSLs allow describing a problem
solution in terms of the field of the problem, rather than in terms of computer. The
most critical part of the whole software development process in the context of
language oriented programming paradigm is definition and implementation of a new
DSL [14]. All approaches to solve this problem could be divided into those, which
use traditional grammars, and those, which are based on modeling in context of
Model Driven Engineering (MDE) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. The former approach allows defining
programming language as combination of its structure and textual syntax. The latter
implies definition of language metamodel mostly in terms of MOF and subsequent
usage of the model for code generation, model transformation, etc. In this case,
concrete syntax is usually graphical or even undefined.
      </p>
      <p>
        However, these two styles of language definition do not differ in essence. As was
noticed in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] the program in any DSL is an abstract structure, and for its
editing, storage and execution various representations might be used: text, diagrams,
tables, formulas, sounds, etc. Therefore, a single method for definition of different
notations is desirable.
      </p>
      <p>
        Another issue is specification of language semantics. The brief overview of
methods of semantics definition is given in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. They vary from complicated formulas
of axiomatic semantics to rewriting rules of translation semantics. We consider that
usage of the same formalism for concrete syntax definition and for semantics
definition would simplify the process of new DSL creation, which is rather
complicated now.
      </p>
      <p>At last, specification of new DSL should be sufficient for receiving its
implementation automatically.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Brief Overview of Related Work</title>
      <p>
        A number of language workbenches, which support development of DSLs with not
only textual notation, were worked out recently. One of them is MetaEdit+ tool [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]
that allows creation of graphical DSLs with facility to specify generation of various
sorts of target data from DSL diagrams. MetaEdit+ uses its own model of DSL
abstract syntax – the metamodeling language GOPPRR
(Graph-Object-Property-PortRole-Relationship).
      </p>
      <p>
        Another one, AMMA [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], is a model based framework that supports DSL
development with metamodel definition language KM3 [11], language for specifying
textual concrete syntaxes TCS and model transformation language ATL. This project
is based on MOF formalism and supports graphical syntax through class diagrams of
models. The common approach is implemented in MOFLON [10] project. In addition
the latter uses Story Driven Modeling (SDM) paradigm for definition of the dynamic
semantics of a DSL.
      </p>
      <p>We appeal for possibility to define various notations using single technique and for
possibility to define both concrete syntax and semantics using the same specification
(meta)language.</p>
    </sec>
    <sec id="sec-3">
      <title>3 Proposed Solution</title>
      <p>
        In this work, we propose just another DSL definition method based on model driven
architecture (MDA) and executable UML approach [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Definition of DSL using
MDA approach instead of traditional formal grammars advances software engineering
unification. This approach requires separation of language definition levels, which are
abstract syntax, concrete syntax and semantics. Therefore, the proposed method
consists in correlated definitions of DSL metamodel (which includes abstract syntax),
concrete syntax and operational semantics (Fig. 1). We use UML [12] as description
formalism and investigate definition methods that differ from those listed in part 2 for
all three steps of DSL specification process.
      </p>
      <p>We extend formalism used for language abstract syntax definition to UML class
diagram in comparison with widely spread MOF, as UML class diagram can express
more copious structures. We propose description both of concrete syntax and of
operational semantics as algorithms through UML state machine diagrams. Namely,
concrete syntax is defined as a parsing algorithm, which analyzes source program
representation and constructs abstract program. Operational semantics is defined as an
algorithm of abstract program interpretation.
One of the key features of the proposed method is unified view on different
language notations. Any abstract program representation is considered as chain of
events, which are processed by automata system defined in concrete syntax
specification. Each terminal representation is considered as an event sent by some
source of events. For example, events might be typographical characters in text,
geometrical figures in diagram, controls in dialogue window, cells in spreadsheet, or
sounds of spoken commands. Accordingly, any source of events is acceptable: a
lexical analyzer of text, a graphical editor of diagrams, an editor of formulas or a
dialogue window (Fig. 2).</p>
      <p>
        To achieve automatic receiving of DSL's implementation we use automata based
programming paradigm [
        <xref ref-type="bibr" rid="ref7">7, 13</xref>
        ]. According to this paradigm, every algorithm
described through UML state machine diagrams can be executed by an automata
programming virtual machine (Fig. 1).
      </p>
    </sec>
    <sec id="sec-4">
      <title>4 Research Method</title>
      <p>We have developed an initial candidate DSL meta-metamodel – the abstract syntax of
the proposed method (Fig. 3). This meta-metamodel accumulates expressiveness both
of grammar formalism and of UML class diagram. We are going to investigate it and
compare it with formal grammars to find out the kind of languages that could be
defined as instances of this meta-metamodel. Moreover, mapping between DSL
metametamodel and formal grammars could be useful for the reuse of already defined
languages. This mapping could be also useful for development of the algorithm of
generation of concrete syntax automata system from DSL metamodel.</p>
      <p>DSL
Metamodel
name : String</p>
      <p>Taxonomy
* 1
classification
specific 1..* 1 root
axiom Language
conce1pts concept</p>
      <p>* name : String</p>
      <p>*
component</p>
      <p>*</p>
      <p>Clause
alternative 1..*</p>
      <p>Definition
name : String</p>
      <p>Static
semantics</p>
      <p>Constraint
condition : bool
*
crossreference</p>
      <p>Relation</p>
      <p>Occurance
multiplicity: Num
role: String</p>
      <p>We have devised the automata model being used as formalism for definition of
both concrete syntax and semantics. Two little DSLs have been specified using this
model: nonlinear and graphical language of the chess position and the mini language
for manipulations with sets. Further, the automata programming virtual machine
should be developed to execute these specifications of DSLs. Definition of the
automata programming virtual machine with the means of the proposed method
would be the best use case. In other words, we are going to apply the idea of
bootstrapping.</p>
      <p>The proposed method for DSL definition allows defining different languages with
various concrete representations. DSL definition can be used as its software
implementation in terms of the automata based virtual machine.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bézivin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jouault</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kurtev</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valduriez</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Model-Based DSL Frameworks</article-title>
          .
          <article-title>In: 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications</article-title>
          , pp.
          <fpage>602</fpage>
          -
          <lpage>616</lpage>
          . ACM, New York (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Combemale</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crégut</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garoche</surname>
          </string-name>
          , P.-L.,
          <string-name>
            <surname>Thirioux</surname>
            ,
            <given-names>X.:</given-names>
          </string-name>
          <article-title>Essay on Semantics Definition in MDE - An Instrumented Approach for Model</article-title>
          .
          <source>In: Journal of Software</source>
          , Vol
          <volume>4</volume>
          , No 9, pp.
          <fpage>943</fpage>
          -
          <lpage>958</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Dmitriev</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Language Oriented Programming: The Next Programming Paradigm</article-title>
          , http://www.onboard.jetbrains.com/is1/articles/04/10/lop/index.html (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Estublier</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vega</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ionita</surname>
            ,
            <given-names>A.D.</given-names>
          </string-name>
          :
          <article-title>Composing Domain-Specific Languages for WideScope Software Engineering Applications</article-title>
          . In: Briand,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Williams</surname>
          </string-name>
          ,
          <string-name>
            <surname>C</surname>
          </string-name>
          . (Eds.)
          <source>International Conference on Model Driven Engineering Languages and Systems (MoDELS)</source>
          .
          <source>LNCS</source>
          vol.
          <volume>3713</volume>
          , pp.
          <fpage>69</fpage>
          -
          <lpage>83</lpage>
          . Springer-Verlag, Berlin Heidelberg (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Fowler</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Language Workbenches: The Killer-App for Domain Specific Languages?</article-title>
          , http://www.martinfowler.com/articles/languageWorkbench.html (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Frankel</surname>
            ,
            <given-names>D.S.</given-names>
          </string-name>
          :
          <article-title>Model Driven Architecture: Applying MDA to Enterprise Computing</article-title>
          . Wiley Publishing, Inc., Indianapolis, Indiana (
          <year>2003</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Gurov</surname>
            ,
            <given-names>V. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mazin</surname>
            ,
            <given-names>M. A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Narvsky</surname>
            ,
            <given-names>A. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shalyto</surname>
            ,
            <given-names>A. A.</given-names>
          </string-name>
          :
          <article-title>Tools for Support of AutomataBased Programming</article-title>
          .
          <source>J. Programming and Computer Software</source>
          , Vol.
          <volume>33</volume>
          , No.
          <issue>6</issue>
          , pp.
          <fpage>343</fpage>
          -
          <lpage>355</lpage>
          (
          <year>2007</year>
          ), http://is.ifmo.ru/articles_en/_ProCom6_07GurovLO.pdf
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Kelly</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tolvanen</surname>
            ,
            <given-names>J.-P.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Domain-Specific Modeling</surname>
          </string-name>
          . IEEE Computer Society Publications, New Jersey (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Meta</given-names>
            <surname>Programming</surname>
          </string-name>
          <string-name>
            <given-names>System</given-names>
            , http://www.jetbrains.com/mps/ 10.MOFLON project, http://www.moflon.org/ 11.Muller, P.-A.,
            <surname>Fleurey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Jézéquel</surname>
          </string-name>
          , J.-M.:
          <article-title>Weaving executability into object-oriented metalanguages</article-title>
          . In: Briand,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Williams</surname>
          </string-name>
          ,
          <string-name>
            <surname>C</surname>
          </string-name>
          . (Eds.)
          <source>International Conference on Model Driven Engineering Languages and Systems (MoDELS)</source>
          ,
          <source>LNCS</source>
          vol.
          <volume>3713</volume>
          , pp.
          <fpage>264</fpage>
          -
          <lpage>278</lpage>
          . SpringerVerlag, Berlin Heidelberg (
          <year>2005</year>
          )
          <article-title>12</article-title>
          .
          <article-title>OMG Unified Modeling Language (OMG UML)</article-title>
          ,
          <source>Superstructure, Version</source>
          <volume>2</volume>
          .2 (
          <issue>2009</issue>
          ), http://www.uml.
          <source>org 13</source>
          .
          <string-name>
            <surname>Paraschenko</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shalyto</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tsarev</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Modeling Technology for One Class of MultiAgent Systems with Automata Based Programming</article-title>
          .
          <source>In: IEEE International Conference on Computational Intelligence for Measurement Systems and Applications</source>
          , pp.
          <fpage>15</fpage>
          -
          <lpage>20</lpage>
          . IEEE Xplore, La
          <string-name>
            <surname>Coruna</surname>
          </string-name>
          (
          <year>2006</year>
          )
          <fpage>14</fpage>
          .
          <string-name>
            <surname>Ward</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Language Oriented Programming</article-title>
          .
          <source>In: Software - Concepts and Tools</source>
          , Springer Berlin / Heidelberg, Vol.
          <volume>15</volume>
          , No.
          <issue>4</issue>
          , pp.
          <fpage>147</fpage>
          -
          <lpage>161</lpage>
          (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>