skip to main content
research-article

Xbase: implementing domain-specific languages for Java

Published:26 September 2012Publication History
Skip Abstract Section

Abstract

Xtext is an open-source framework for implementing external, textual domain-specific languages (DSLs). So far, most DSLs implemented with Xtext and similar tools focus on structural aspects such as service specifications and entities. Because behavioral aspects are significantly more complicated to implement, they are often delegated to general-purpose programming languages. This approach introduces complex integration patterns and the DSL's high level of abstraction is compromised.

We present Xbase as part of Xtext, an expression language that can be reused via language inheritance in any DSL implementation based on Xtext. Xbase expressions provide both control structures and program expressions in a uniform way. Xbase is statically typed and tightly integrated with the Java type system. Languages extending Xbase inherit the syntax of a Java-like expression language as well as language infrastructure components, including a parser, an unparser, a linker, a compiler and an interpreter. Furthermore, the framework provides integration into the Eclipse IDE including debug and refactoring support.

The application of Xbase is presented by means of a domain model language which serves as a tutorial example and by the implementation of the programming language Xtend. Xtend is a functional and object-oriented general purpose language for the Java Virtual Machine (JVM). It is built on top of Xbase which is the reusable expression language that is the foundation of Xtend.

References

  1. Hassan Chafi, Zach DeVito, Adriaan Moors, Tiark Rompf, Arvind Sujeeth, Pat Hanrahan, Martin Odersky, and Kunle Olukotun. Language Virtualization for Heterogeneous Parallel Computing. Technical report, EPFL, 2010.Google ScholarGoogle Scholar
  2. E. F. Codd. A relational model of data for large shared data banks. Commun. ACM, 13: 377--387, June 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Sven Efftinge, Moritz Eysholdt, Jan Köhnlein, Sebastian Zarnekow, and Contributors. Xtext 2.2 Documentation, December 2011.Google ScholarGoogle Scholar
  4. Sven Efftinge, Sören Frey, Wilhelm Hasselbring, and Jan Köhnlein. Einsatz domänenspezifischer Sprachen zur Migration von Datenbankanwendungen. In Datenbanksysteme für Business, Technologie und Web (BTW 2011), volume P-180 of Lecture Notes in Informatics, pages 554--573, Kaiserslautern, March 2011.Google ScholarGoogle Scholar
  5. Eugene Burmako, Martin Odersky, Christopher Vogt, Stefan Zeiger, Adriaan Moors. Self Cleaning Macros (SIP 16), March 2012.Google ScholarGoogle Scholar
  6. M. Eysholdt and J. Rupprecht. Migrating a large modeling environment from XML/UML to Xtext/GMF. In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion, pages 97--104. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Martin Fowler. Domain Specific Languages. Addison-Wesley Professional, 1st edition, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Debasish Ghosh. DSLs in Action. Manning Publications, pap/psc edition, December 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Wolfgang Goerigk, Reinhard von Hanxleden, Wilhelm Hasselbring, Gregor Hennings, Reiner Jung, Holger Neustock, Heiko Schaefer, Christian Schneider, Elferik Schultz, Thomas Stahl, Steffen Weik, and Stefan Zeug. Entwurf einer domänenspezifischen Sprache für elektronische Stellwerke. In Software Engineering 2012, volume P-198 of Lecture Notes in Informatics (LNI), pages 119--130. GI, March 2012.Google ScholarGoogle Scholar
  10. Peter Henderson. Functional geometry. In Symposium on LISP and Functional Programming, pages 179--187, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. Hudak. Describing and interpreting music in Haskell. In J. Gibbons and O. de Moor, editors, The Fun of Programming, pages 61--78. Palgrave Macmillan, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  12. J. Hughes. Why functional programming matters. In D. A. Turner, editor, Research Topics in Functional Programming, pages 17--42. Addison Wesley, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Java Community Process. Lambda Specification (Early Draft Review #1), November 2011.Google ScholarGoogle Scholar
  14. Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench. Rules for declarative specification of languages and IDEs. In Martin Rinard, editor, Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 444--463, October 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Olaf Kindel and Mario Friedrich. Softwareentwicklung mit AUTOSAR. dpunkt.verlag, 2009.Google ScholarGoogle Scholar
  16. Dierk Koenig, Andrew Glover, Paul King, Guillaume Laforge, and Jon Skeet. Groovy in Action. Manning Publications Co., 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Holger Krahn, Bernhard Rumpe, and Steven Völkel. MontiCore: a Framework for Compositional Development of Domain Specific Languages. International Journal on Software Tools for Technology Transfer (STTT), 12: 353--372, September 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. L. Peyton Jones and J.-M. Eber. How to write a financial contract. In J. Gibbons and O. de Moor, editors, The Fun of Programming, pages 105--129. Palgrave Macmillan, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  19. Dhanji R. Prasanna. Dependency Injection. Manning Publications Co., 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Markus Voelter and Konstantin Solomatov. Language modularization and composition with projectional language workbenches illustrated with MPS. In Mark van den Brand, Brian Malloy, and Steffen Staab, editors, Software Language Engineering, Third International Conference, SLE 2010, Lecture Notes in Computer Science. Springer, 2010.Google ScholarGoogle Scholar
  21. P. Wadler. A prettier printer. In J. Gibbons and O. de Moor, editors, The Fun of Programming, pages 223--243. Palgrave Macmillan, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  22. Niklaus Wirth. What can we do about the unnecessary diversity of notation for syntactic definitions? Commun. ACM, 20: 822--823, November 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Xbase: implementing domain-specific languages for Java

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              • Published in

                cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 48, Issue 3
                GPCE '12
                March 2013
                140 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/2480361
                Issue’s Table of Contents
                • cover image ACM Conferences
                  GPCE '12: Proceedings of the 11th International Conference on Generative Programming and Component Engineering
                  September 2012
                  148 pages
                  ISBN:9781450311298
                  DOI:10.1145/2371401

                Copyright © 2012 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 26 September 2012

                Check for updates

                Qualifiers

                • research-article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!