Adding Dimension Analysis to Java as a Composable Language Extension

(Extended Abstract)
  • Eric Van Wyk
  • Yogesh Mali
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5235)


In this paper we describe a language extension that adds dimension analysis to Java. Dimension analysis can be used to check that values that represent physical measurements such as length and mass are not used inconsistently. What distinguishes this work from previous work that adds dimension analysis to programming languages is that here the extension is implemented as a composable language extension. This means that it can easily be combined with other extensions, possibly developed by other parties, to create an extended implementation of Java with new features that address concerns from several different domains.


Dimension Analysis Dimension Type Type Representation Type Expression Concrete Syntax 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 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. 2.
    Allen, E., Chase, D., Luchangco, V., Maessen, J.-W., Guy, J., Steele, L.: Object-oriented units of measurement. In: Proc. Conf. on Object-oriented programming, systems, languages, and applications (OOPSLA), pp. 384–403. ACM, New York (2004)Google Scholar
  3. 3.
    Boyland, J.T.: Remote attribute grammars. J. ACM 52(4), 627–687 (2005)CrossRefMathSciNetzbMATHGoogle Scholar
  4. 4.
    Bravenboer, M., Visser, E.: Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions. In: Proc. ACM Conf. on Object-oriented programming, systems, languages, and applications (OOPSLA), pp. 365–383. ACM, New York (2004)Google Scholar
  5. 5.
    Delft, A.V.: A java extension with support for dimensions. Software-Practice and Experience 29(7), 605–616 (1999)CrossRefGoogle Scholar
  6. 6.
    Ekman, T., Hedin, G.: The Jastadd extensible Java compiler. In: Proc. Conf. on Object oriented programming systems and applications (OOPSLA), pp. 1–18. ACM, New York (2007)Google Scholar
  7. 7.
    Farrow, R., Marlowe, T.J., Yellin, D.M.: Composable attribute grammars. In: 19th ACM Symp. on Prin. of Programming. Languages, pp. 223–234 (1992)Google Scholar
  8. 8.
    Ganzinger, H.: Increasing modularity and language-independency in automatically generated compilers. Science of Computer Programing 3(3), 223–278 (1983)CrossRefMathSciNetzbMATHGoogle Scholar
  9. 9.
    House, R.T.: A proposal for an extended form of type checking of expressions. The Computer Journal 26(4), 366–374 (1983)CrossRefzbMATHGoogle Scholar
  10. 10.
    Kastens, U., Waite, W.M.: Modularity and reusability in attribute grammars. Acta Informatica 31, 601–627 (1994)CrossRefzbMATHGoogle Scholar
  11. 11.
    Kennedy, A.: Dimension types. In: Sannella, D. (ed.) ESOP 1994. LNCS, vol. 788, pp. 348–362. Springer, Heidelberg (1994)CrossRefGoogle Scholar
  12. 12.
    D. E. Knuth. Semantics of context-free languages. Mathematical Systems Theory, 2(2):127–145, 1968; Corrections in 5, 95–96 (1971)CrossRefMathSciNetzbMATHGoogle Scholar
  13. 13.
    NASA. Mars climate orbiter - mishap investigation report. Technical report (November 1999),
  14. 14.
    Saraiva, J., Swierstra, D.: Generic Attribute Grammars. In: 2nd Workshop on Attribute Grammars and their Applications, pp. 185–204 (1999)Google Scholar
  15. 15.
    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
  16. 16.
    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. LNCS, vol. 2304, pp. 128–142. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  17. 17.
    Van Wyk, E., Krishnan, L., Schwerdfeger, A., Bodin, D.: Attribute grammar-based language extensions for Java. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 575–599. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  18. 18.
    Van Wyk, E., Schwerdfeger, A.: Context-aware scanning for parsing extensible languages. In: Intl. Conf. on Generative Programming and Component Engineering (GPCE). ACM Press, New York (2007)Google Scholar
  19. 19.
    Vogt, H., Swierstra, S.D., Kuiper, M.F.: Higher-order attribute grammars. In: ACM Conf. on Programming Language Design and Implementation (PLDI), pp. 131–145 (1990)Google Scholar
  20. 20.
    Wand, M., O’Keefe, P.: Automatic dimensional inference. In: Computational Logic - Essays in Honor of Alan Robinson, pp. 479–483 (1991)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Eric Van Wyk
    • 1
  • Yogesh Mali
    • 1
  1. 1.Department of Computer Science and EngineeringUniversity of MinnesotaMinneapolisUSA

Personalised recommendations