Generating a Modelica Compiler from Natural Semantics Specifications
1998 (English)Conference paper (Refereed)
The implementation of compilers and interpreters for non-trivial languages is a complex and error prone process, if done by hand. Therefore, formalisms and generator tools have been developed that allow automatic generation of compilers and interpreters from formal specifications. This offers two major advantages: • High level descriptions of language properties, rather than detailed programming of the translation process • High degree of correctness of generated implementations. The high level specifications are more concise and easier to read than a detailed implementation in some programming language Modelica is an object-oriented language for modeling of physical systems for the purpose of efficient simulation. The language unifies and generalizes previous object-oriented modeling languages. A Modelica model is defined in terms of classes containing equations and definitions. The semantics, i.e. the meaning of such a model is defined via translation of classes, instances and connections into a flat set of constants, variables and equations. This paper describes and defines a formal semantics for Modelica expressed in a high-level specification notation called natural semantics. A compiler generation system called RML produces a a Modelica translator from such a language specification. The generated translator is produced in ANSI C and has comparable performance as hand-written translators. The RML tool has also been used to produce compilers for Java, Pascal and few other languages. MODELICA OVERVIEW Modelica (Modelica 1998) is an object-oriented language for modeling of physical systems for the purpose of efficient simulation. The language unifies and generalizes previous object-oriented modeling languages.
Place, publisher, year, edition, pages
Electrical Engineering, Electronic Engineering, Information Engineering
IdentifiersURN: urn:nbn:se:liu:diva-110161OAI: oai:DiVA.org:liu-110161DiVA: diva2:743212
1998 Summer Computer Simulation Conference (SCSC’98), Reno, Nevada, July 19-22