Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1007/11877028_10guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

MetaBorg in action: examples of domain-specific language embedding and assimilation using Stratego/XT

Published: 04 July 2005 Publication History

Abstract

General-purpose programming languages provide limited facilities for expressing domain-specific concepts in a natural manner. All domain concepts need to be captured using the same generic syntactic and semantic constructs. Generative programming methods and program transformation techniques can be used to overcome this lack of abstraction in general-purpose languages.
In this tutorial we describe the MetaBorg method for embedding domain-specific languages, tailored syntactically and semantically to the application domain at hand, in a general-purpose language. MetaBorg is based on Stratego/XT, a language and toolset for the implementation of program transformation systems, which is used for the definition of syntactic embeddings and assimilation of the embedded constructs into the surrounding code.
We illustrate MetaBorg with three examples. JavaSwul is a custom designed language for implementing graphical user-interfaces, which provides high-level abstractions for component composition and event-handling. JavaRegex is a new embedding of regular expression matching and string rewriting. JavaJava is an embedding of Java in Java for generating Java code. For these cases we show how Java programs in these domains become dramatically more readable, and we give an impression of the implementation of the language embeddings.

References

[1]
J. Baker and W. Hsieh. Maya: multiple-dispatch syntax extension in java. In PLDI '02: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pages 270-281. ACM Press, 2002.
[2]
D. Batory, B. Lofaso, and Y. Smaragdakis. JTS: tools for implementing domain-specific languages. In Proceedings Fifth International Conference on Software Reuse (ICSR'98), pages 143-153. IEEE Computer Society, June 1998.
[3]
C. Brabrand and M. I. Schwartzbach. Growing languages with metamorphic syntax macros. In Proceedings of the 2002 ACM SIGPLAN Workshop on Partial Evaluation and Semanticsbased Program Manipulation (PEPM'02), pages 31-40. ACM Press, 2002.
[4]
M. G. J. van den Brand, J. Scheerder, J. J. Vinju, and E. Visser. Disambiguation filters for scannerless generalized LR parsers. In N. Horspool, editor, Compiler Construction (CC'02), volume 2304 of LNCS, pages 143-158, Grenoble, France, April 2002. Springer-Verlag.
[5]
M. Bravenboer, R. Vermaas, J. J. Vinju, and E. Visser. Generalized type-based disambiguation of meta programs with concrete object syntax. In R. Glück and M. Lowry, editors, Proceedings of the Fourth International Conference on Generative Programming and Component Engineering (GPCE'05), volume 3676 of LNCS, pages 157-172, Tallinn, Estonia, September 2005. Springer.
[6]
M. Bravenboer and E. Visser. Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In D. C. Schmidt, editor, Proceedings of the 19th ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA'04), pages 365-383, Vancouver, Canada, October 2004. ACM Press.
[7]
C. Gould, Z. Su, and P. Devanbu. JDBC checker: A static analysis tool for SQL/JDBC applications. In ICSE '04: Proceedings of the 26th International Conference on Software Engineering, pages 697-698, Washington, DC, USA, 2004. IEEE Computer Society.
[8]
B. M. Leavenworth. Syntax macros and extended translation. Communications of the ACM, 9(11):790-793, November 1966.
[9]
Z. Su and G.Wassermann. The essence of command injection attacks in web applications. In POPL'06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 372-382, New York, NY, USA, 2006. ACM Press.
[10]
J. J. Vinju. Analysis and Transformation of Source Code by Parsing and Rewriting. PhD thesis, University of Amsterdam, November 2005.
[11]
E. Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997.
[12]
E. Visser. Meta-programming with concrete object syntax. In D. Batory, C. Consel, and W. Taha, editors, Generative Programming and Component Engineering (GPCE'02), volume 2487 of LNCS, pages 299-315, Pittsburgh, PA, USA, October 2002. Springer-Verlag.
[13]
E. Visser. Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. In C. Lengauer et al., editors, Domain-Specific Program Generation, volume 3016 of LNCS, pages 216-238. Spinger-Verlag, June 2004.
[14]
D. Zook, S. S. Huang, and Y. Smaragdakis. Generating AspectJ programs with Meta-AspectJ. In G. Karsai and E. Visser, editors, Generative Programming and Component Engineering: Third International Conference, GPCE 2004, volume 3286 of LNCS, pages 1-19, Vancouver, Canada, October 2004. Springer.

Cited By

View all
  1. MetaBorg in action: examples of domain-specific language embedding and assimilation using Stratego/XT

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image Guide Proceedings
      GTTSE'05: Proceedings of the 2005 international conference on Generative and Transformational Techniques in Software Engineering
      July 2005
      471 pages
      ISBN:354045778X
      • Editors:
      • Ralf Lämmel,
      • João Saraiva,
      • Joost Visser

      Sponsors

      • Luso-American Foundation: Luso-American Foundation
      • Microsoft: Microsoft
      • Fundação para a Ciência e a Tecnologia
      • Fundação Oriente
      • Centro de Ciências e Tecnologias de Computação Enabler: Centro de Ciências e Tecnologias de Computação Enabler

      Publisher

      Springer-Verlag

      Berlin, Heidelberg

      Publication History

      Published: 04 July 2005

      Qualifiers

      • Article

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)0
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 13 Feb 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2013)Implementing Java-like languages in Xtext with XsemanticsProceedings of the 28th Annual ACM Symposium on Applied Computing10.1145/2480362.2480654(1559-1564)Online publication date: 18-Mar-2013
      • (2013)TraitRecordJScience of Computer Programming10.1016/j.scico.2011.06.00778:5(521-541)Online publication date: 1-May-2013
      • (2011)A DSL for writing type systems for Xtext languagesProceedings of the 9th International Conference on Principles and Practice of Programming in Java10.1145/2093157.2093163(31-40)Online publication date: 24-Aug-2011
      • (2010)JGroovy - an extensible Java programming language with GroovyProceedings of the 12th international conference on Advanced communication technology10.5555/1833006.1833048(1139-1144)Online publication date: 7-Feb-2010
      • (2009)Generating safe template languagesACM SIGPLAN Notices10.1145/1837852.162162445:2(99-108)Online publication date: 4-Oct-2009
      • (2009)Generating safe template languagesProceedings of the eighth international conference on Generative programming and component engineering10.1145/1621607.1621624(99-108)Online publication date: 4-Oct-2009
      • (2008)Stratego/XT 0.17. A language and toolset for program transformationScience of Computer Programming10.1016/j.scico.2007.11.00372:1-2(52-70)Online publication date: 1-Jun-2008
      • (2007)Can programming be liberated from the two-level styleACM SIGPLAN Notices10.1145/1297105.129704442:10(229-244)Online publication date: 21-Oct-2007
      • (2007)Can programming be liberated from the two-level styleProceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applications10.1145/1297027.1297044(229-244)Online publication date: 21-Oct-2007
      • (2007)RepleoProceedings of the 6th international conference on Generative programming and component engineering10.1145/1289971.1289977(25-32)Online publication date: 1-Oct-2007
      • Show More Cited By

      View Options

      View options

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media