This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Extending Languages by Leveraging Compilers: From Modelica to Optimica
May/June 2011 (vol. 28 no. 3)
pp. 68-74
Görel Hedin, Lund University, Sweden
Johan Åkesson, Lund University, Sweden
Combining attribute grammars with object-oriented programming supports a new kind of declarative programming, letting developers build compilers in a highly extensible manner. By leveraging a base compiler, extended languages can be supported at a relatively low cost. Recent work shows the applicability of the technique to general-purpose programming languages such as Java. In this article, the authors illustrate the approach using a case study for domain-specific languages. They built an extensible compiler for the physical systems modeling language Modelica and leveraged it to support a new extended language, Optimica.

1. D.E. Knuth, "Semantics of Context-Free Languages," Mathematical Systems Theory, vol. 2, no. 2, 1968, pp. 127–145.
2. D.E. Knuth, "Semantics of Context-Free Languages, Correction," Mathematical Systems Theory, vol. 5, no. 1, 1971, pp. 95–96.
3. T. Reps and T. Teitelbaum, "The Synthesizer Generator," Proc. ACM Sigsoft/Sigplan Symp. Practical Software Development Environments, ACM Press, 1984, pp. 42–48.
4. J. Paakki, "Attribute Grammar Paradigms: A High-Level Methodology in Language Implementation," ACM Computing Surveys, vol. 27, no. 2, 1995, pp. 196–255.
5. G. Hedin, "Reference Attributed Grammars," Informatica (Slovenia), vol. 24, no. 3, 2000, pp. 301–317.
6. T. Ekman and G. Hedin, "The Jastadd Extensible Java Compiler," Proc. ACM Ann. Conf. Object-Oriented Programming, Systems, Languages & Applications (OOPSLA 07), ACM Press, 2007, pp. 1–18.
7. E. Van Wyk et al., "Attribute Grammar-Based Language Extensions for Java," Proc. European Conf. Object-Oriented Programming (ECOOP 07), LNCS 4609, Springer, 2007, pp. 575–599.
8. L.C.L. Kats, A.M. Sloane, and E. Visser, "Decorated Attribute Grammars: Attribute Evaluation Meets Strategic Programming," Proc. 18th Int'l Conf. Compiler Construction (CC 2009), LNCS 5501, Springer, 2009, pp. 142–157.
9. M. Mernik, J. Heering, and A.M. Sloane, "When and How to Develop Domain-Specific Languages," ACM Computing Surveys, vol. 37, no. 4, 2005, pp. 316–344.
10. A. van Deursen, P. Klint, and J. Visser, "Domain-Specific Languages: An Annotated Bibliography," Sigplan Notices, vol. 35, no. 6, 2000, pp. 26–36.
11. "Modelica: A Unified Object-Oriented Language for Physical Systems Modeling, Language Specification," version 3.1, tech. report, Modelica Assoc., 2009.
12. H. Vogt, S.D. Swierstra, and M.F. Kuiper, "Higher Order Attribute Grammars," Proc. Programming Language Design and Implementation (PLDI 89), ACM Press, 1989, pp. 131–145.
13. G. Kiczales et al., "An Overview of AspectJ," Proc. European Conf. Object-Oriented Programming (ECOOP 2001), LNCS 2072, Springer, 2001, pp. 327–355.
14. J. Åkesson, T. Ekman, and G. Hedin, "Implementation of a Modelica Compiler Using JastAdd Attribute Grammars," Science of Computer Programming, vol. 75, nos. 1–2, 2010, pp. 21–38.

Index Terms:
reusable software, design tools, design techniques, formal definitions, formal theory, processors
Citation:
Görel Hedin, Johan Åkesson, Torbjorn Ekman, "Extending Languages by Leveraging Compilers: From Modelica to Optimica," IEEE Software, vol. 28, no. 3, pp. 68-74, May-June 2011, doi:10.1109/MS.2010.62
Usage of this product signifies your acceptance of the Terms of Use.