Skip to main content

Attribute Grammar-Based Language Extensions for Java

  • Conference paper
ECOOP 2007 – Object-Oriented Programming (ECOOP 2007)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4609))

Included in the following conference series:

Abstract

This paper describes the ableJ extensible language framework, a tool that allows one to create new domain-adapted languages by importing domain-specific language extensions into an extensible implementation of Java 1.4. Language extensions may define the syntax, semantic analysis, and optimizations of new language constructs. Java and the language extensions are specified as higher-order attribute grammars.

We describe several language extensions and their implementation in the framework. For example, one extension embeds the SQL database query language into Java and statically checks for syntax and type errors in SQL queries. The tool supports the modular specification of composable language extensions so that programmers can import into Java the unique set of extensions that they desire. When extensions follow certain restrictions, they can be composed without requiring any implementation-level knowledge of the language extensions. The tools automatically compose the selected extensions and the Java host language specification.

This work is partially funded by NSF CAREER Award #0347860, NSF CCF Award #0429640, and the McKnight Foundation.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Adams, S.R.: Modular Grammars for Programming Language Prototyping. PhD thesis, University of Southampton, Department of Elec. and Comp. Sci. UK (1993)

    Google Scholar 

  2. Batory, D., Lofaso, D., Smaragdakis, Y.: JTS: tools for implementing domain-specific languages. In: Proc. 5th Intl. Conf. on Software Reuse, pp. 2–5. IEEE Computer Society Press, Los Alamitos (1998)

    Google Scholar 

  3. Boyland, J.T.: Remote attribute grammars. J. ACM 52(4), 627–687 (2005)

    Article  MathSciNet  Google Scholar 

  4. Bravenboer, M., Visser, E.: Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions. In: Proc. of OOPSLA ’04 Conf. pp. 365–383 (2004)

    Google Scholar 

  5. Eisenberg, A.D., Kiczales, G.: Expressive programs through presentation extension. In: AOSD ’07. Proc. of the 6th Intl. Conf. on Aspect-oriented Software Development, pp. 73–84 (2007)

    Google Scholar 

  6. Ekman, T.: Extensible Compiler Construction. PhD thesis, Lund University, Lund, Sweden (2006)

    Google Scholar 

  7. Ekman, T., Hedin, G.: Rewritable reference attributed grammars. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 144–169. Springer, Heidelberg (2004)

    Google Scholar 

  8. Farrow, R., Marlowe, T.J., Yellin, D.M.: Composable attribute grammars. In: 19th ACM Symp. on Prin. of Prog. Lang., pp. 223–234. ACM Press, New York (1992)

    Google Scholar 

  9. Ganzinger, H.: Increasing modularity and language-independency in automatically generated compilers. Science of Computer Programing 3(3), 223–278 (1983)

    Article  MATH  MathSciNet  Google Scholar 

  10. Gray, R.W., Heuring, V.P., Levi, S.P., Sloane, A.M., Waite, W.M.: Eli: A complete, flexible compiler construction system. CACM 35, 121–131 (1992)

    Google Scholar 

  11. Hedin, G.: Reference attribute grammars. Informatica 24(3), 301–317 (2000)

    MATH  Google Scholar 

  12. Hudak, P.: Building domain-specific embedded languages. ACM Computing Surveys, 28(4es) (1996)

    Google Scholar 

  13. Johnson, S.: Yacc - yet another compiler compiler. Technical Report 32, Bell Laboratories (July 1975)

    Google Scholar 

  14. Kastens, U., Waite, W.M.: Modularity and reusability in attribute grammars. Acta Informatica 31, 601–627 (1994)

    Article  MATH  Google Scholar 

  15. Knuth, D.E.: Semantics of context-free languages. Mathematical Systems Theory, 2(2) 127–145 (1968) Corrections in 5, 95–96 (1971)

    Google Scholar 

  16. Kuiper, M., J., S.: LRC — a generator for incremental language-oriented tools. In: Koskimies, K. (ed.) CC 1998 and ETAPS 1998. LNCS, vol. 1383, pp. 298–301. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  17. Nystrom, N., Clarkson, M.R., Myer, A.C.: Polyglot: An extensible compiler framework for Java. In: Hedin, G. (ed.) CC 2003 and ETAPS 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003)

    Google Scholar 

  18. Odersky, M., Wadler, P.: Pizza into Java: translating theory into practice. In: Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 146–159. ACM Press, New York (1997)

    Chapter  Google Scholar 

  19. Olmos, K., Visser, E.: Composing source-to-source data-flow transformations with rewriting strategies and dependent dynamic rewrite rules. In: Bodik, R. (ed.) CC 2005. LNCS, vol. 3443, pp. 204–220. Springer, Heidelberg (2005)

    Google Scholar 

  20. Saraiva, J., Swierstra, D.: Generic Attribute Grammars. In: 2nd Workshop on Attribute Grammars and their Applications, pp. 185–204 (1999)

    Google Scholar 

  21. Simonyi, C., Christerson, M., Clifford, S.: Intentional software. SIGPLAN Not. 41(10), 451–464 (2006)

    Article  Google Scholar 

  22. Thompson, J.M., Heimdahl, M.P., Miller, S.P.: Specification based prototyping for embedded systems. In: Nierstrasz, O., Lemoine, M. (eds.) Software Engineering - ESEC/FSE ’99. LNCS, vol. 1687, Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  23. van den Brand, M., Scheerder, J., Vinju, J., Visser, E.: Disambiguation filters for scannerless generalized LR parsers. In: Horspool, R.N. (ed.) CC 2002 and ETAPS 2002. LNCS, vol. 2304, pp. 143–158. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  24. Van Wyk, E., Bodin, D., Huntington, P.: Adding syntax and static analysis to libraries via extensible compilers and language extensions. In: Proc. of LCSD 2006, Library-Centric Software Design (2006)

    Google Scholar 

  25. Van Wyk, E., Bodin, D., Krishnan, L., Gao, J.: Silver: an extensible attribute grammar system. In: Proc. of LDTA 2007, 7th Workshop on Language Descriptions, Tools, and Analysis (2007)

    Google Scholar 

  26. Van Wyk, E., de Moor, O., Backhouse, K., Kwiatkowski, P.: Forwarding in attribute grammars for modular language design. In: Horspool, R.N. (ed.) CC 2002 and ETAPS 2002. LNCS, vol. 2304, pp. 128–142. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  27. Van Wyk, E., Johnson, E.: Composable language extensions for computational geometry: a case study. In: Proc. 40th Hawaii Intl’ Conf. on System Sciences (2007)

    Google Scholar 

  28. Van Wyk, E., Krishnan, L.: Using verified data-flow analysis-based optimizations in attribute grammars. In: Proc. Intl. Workshop on Compiler Optimization Meets Compiler Verification (COCV) (April 2006)

    Google Scholar 

  29. Van Wyk, E., Schwerdfeger, A.: Context-aware scanning: Specification, implementation, and applications. Technical Report 07-012, Univ. of Minnesota (April 2007), Available at http://www.cs.umn.edu

  30. Visser, E.: Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam (1997)

    Google Scholar 

  31. Visser, E.: Program transformation with Stratego XT: Rules, strategies, tools, and systems in Stratego/XT-0.9. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)

    Google Scholar 

  32. Vogt, H., Swierstra, S.D., Kuiper, M.F.: Higher-order attribute grammars. In: ACM PLDI Conf., pp. 131–145. ACM Press, New York (1990)

    Google Scholar 

  33. Weise, D., Crew, R.: Programmable syntax macros. ACM SIGPLAN Notices 28(6) (1993)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Erik Ernst

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Van Wyk, E., Krishnan, L., Bodin, D., Schwerdfeger, A. (2007). Attribute Grammar-Based Language Extensions for Java. In: Ernst, E. (eds) ECOOP 2007 – Object-Oriented Programming. ECOOP 2007. Lecture Notes in Computer Science, vol 4609. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-73589-2_27

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-73589-2_27

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-73588-5

  • Online ISBN: 978-3-540-73589-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics