Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2724525.2724572acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

JavaRAG: a Java library for reference attribute grammars

Published: 16 March 2015 Publication History

Abstract

Reference attribute grammars (RAGs) is a powerful formalism for developing modular extensible compilers and program analysis tools. This paper presents JavaRAG, an implementation of RAGs as a Java library that is independent of the abstract syntax tree structure. This makes it possible to extend legacy compilers implemented in Java with RAG computations. We have evaluated the approach by integrating with EMF, ANTLR, and hand-built abstract syntax trees, and we compare performance and specification size with JastAdd and Kiama which are other RAG-based tools. Our JavaRAG library is open source and is used in a compiler for the dataflow language CAL.

References

[1]
J. Åkesson, T. Ekman, and G. Hedin. Implementation of a Modelica compiler using JastAdd attribute grammars. Science of Computer Programming, 75(1-2):21–38, Jan. 2010.
[2]
S. Apel, S. Kolesnikov, J. Liebig, C. Kästner, M. Kuhlemann, and T. Leich. Access control in feature-oriented programming. Science of Computer Programming, 77(3):174–187, 2012.
[3]
M. Appeltauer, R. Hirschfeld, M. Haupt, and H. Masuhara. ContextJ: Context-oriented programming with Java. Information and Media Technologies, 6(2):399–419, 2011.
[4]
U. Aßmann, A. Bartho, C. Bürger, S. Cech, B. Demuth, F. Heidenreich, J. Johannes, S. Karol, J. Polowinski, J. Reimann, J. Schroeter, M. Seifert, M. Thiele, C. Wende, and C. Wilke. Dropsbox: the Dresden open software toolbox. Software & Systems Modeling, 13(1):133––169, 2014.
[5]
P. Avgustinov, T. Ekman, and J. Tibble. Modularity first: a case for mixing AOP and attribute grammars. In 7th Int. Conf. on Aspect-Oriented Software Development (AOSD’08), pages 25–35. ACM, 2008.
[6]
S. M. Blackburn, K. S. McKinley, R. Garner, C. Hoffmann, A. M. Khan, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. L. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanovic, T. VanDrunen, D. von Dincklage, and B. Wiedermann. Wake up and smell the coffee: evaluation methodology for the 21st century. Communications of the ACM, 51(8):83–89, 2008.
[7]
E. Bodden, E. Tanter, and M. Inostroza. Join point interfaces for safe and flexible decoupling of aspects. ACM Trans. Softw. Eng. Methodol., 23(1):7:1–7:41, Feb. 2014. ISSN 1049-331X.
[8]
J. T. Boyland. Descriptional Composition of Compiler Components. PhD thesis, University of California, Berkeley, Sep 1996.
[9]
F. Budinsky. Eclipse modeling framework: a developer’s guide. Addison-Wesley Professional, 2004.
[10]
C. Bürger. RACR: A Scheme library for reference attribute grammar controlled rewriting. Technical Report TUD-Fl12-09, Lehrstuhl Softwaretechnologie, Technische Universität Dresden, Dec. 2012.
[11]
C. Bürger, S. Karol, C. Wende, and U. Aßmann. Reference attribute grammars for metamodel semantics. In Software Language Engineering, volume 6563 of LNCS, pages 22–41. Springer, 2011.
[12]
G. Cedersjö and J. W. Janneck. Actor classification using actor machines. In 2013 Conference Record of the Forty Seventh Asilomar Conference on Signals, Systems and Computers, pages 1801–1804. IEEE, 2013.
[13]
G. Cedersjö and J. W. Janneck. Software code generation for dynamic dataflow programs. In Proc. 17th Int. Workshop on Software and Compilers for Embedded Systems, pages 31–39. ACM, 2014.
[14]
R. Dyer, H. Rajan, and Y. Cai. An exploratory study of the design impact of language features for aspect-oriented interfaces. In Proceedings of AOSD 2012. ACM, 2012.
[15]
J. Eker and J. Janneck. CAL language report. University of California at Berkeley, Tech. Rep. UCB/ERL M, 3, 2003.
[16]
T. Ekman and G. Hedin. Rewritable Reference Attributed Grammars. In Proceedings of ECOOP 2004, volume 3086 of Lecture Notes in Computer Science. Springer-Verlag, 2004.
[17]
T. Ekman and G. Hedin. Modular name analysis for Java using JastAdd. In Generative and Transformational Techniques in Software Engineering, International Summer School (GTTSE 2005), volume 4143 of LNCS, pages 422–436. Springer, 2006.
[18]
T. Ekman and G. Hedin. The JastAdd system - modular extensible compiler construction. Science of Computer Programming, 69(1-3): 14–26, 2007.
[19]
T. Ekman and G. Hedin. The Jastadd Extensible Java Compiler. In OOPSLA 2007, pages 1–18. ACM, 2007.
[20]
R. Farrow. Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars. In SIGPLAN ’86: Proceedings of the 1986 SIGPLAN symposium on Compiler construction, pages 85–98. ACM, 1986.
[21]
G. Hedin. Reference Attributed Grammars. In Informatica (Slovenia), 24(3), pages 301–317, 2000.
[22]
G. Hedin. An introductory tutorial on JastAdd attribute grammars. In Generative and Transformational Techniques in Software Engineering III, volume 6491 of LNCS, pages 166–200. Springer, 2011.
[23]
E. Hogeman. Extending JastAddJ to Java 8. Technical report, Department of Computer Science, Lund University, Sweden, 2014.
[24]
Master’s Thesis. LU-CS-EX 2014-14.
[25]
P. Hudak. Building domain-specific embedded languages. ACM Computing Surveys, 28(4es):196, 1996.
[26]
A. Ibrahim, Y. Jiao, E. Tilevich, and W. R. Cook. Remote batch invocation for compositional object services. In ECOOP 2009 - Object-Oriented Programming, 23rd European Conference, volume 5653 of LNCS, pages 595–617. Springer, 2009.
[27]
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In ECOOP 2001 - Object-Oriented Programming, 15th European Conference, volume 2072 of LNCS, pages 327–353. Springer, 2001.
[28]
D. E. Knuth. Semantics of Context-free Languages. Math. Sys. Theory, 2(2):127–145, 1968. Correction: Math. Sys. Theory 5(1):95–96, 1971.
[29]
E. Magnusson and G. Hedin. Circular Reference Attributed Grammars - Their Evaluation and Applications. Science of Computer Programming, 68(1):21–37, 2007.
[30]
E. Magnusson, T. Ekman, and G. Hedin. Demand-driven evaluation of collection attributes. Automated Software Engineering, 16(2):291–322, 2009.
[31]
J. Öqvist and G. Hedin. Extending the JastAdd extensible Java compiler to Java 7. In Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools, Stuttgart, Germany, September 11-13, 2013, pages 147–152, 2013.
[32]
F. Ortin, P. Conde, D. Fernandez-Lanvin, and R. Izquierdo. The runtime performance of invokedynamic: An evaluation with a Java library. IEEE Software, 31(4):82–90, July 2014.
[33]
T. Parr. The definitive ANTLR reference: building domain-specific languages. Pragmatic Bookshelf, 2007.
[34]
M. Schäfer, T. Ekman, and O. de Moor. Sound and Extensible Renaming for Java. In G. Kiczales, editor, 23rd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2008). ACM Press, 2008.
[35]
I. Sergey and D. Clarke. Gradual ownership types. In Programming Languages and Systems - 21st European Symposium on Programming, ESOP 2012, volume 7211 of Lecture Notes in Computer Science, pages 579–599. Springer, 2012.
[36]
A. M. Sloane, L. C. Kats, and E. Visser. A pure embedding of attribute grammars. Science of Computer Programming, 78(10):1752 – 1769, 2013.
[37]
A. M. Sloane, M. Roberts, and L. G. Hamey. Respect your parents: How attribution and rewriting can get along. In Software Language Engineering, volume 8706 of LNCS, pages 191–210. Springer, 2014.
[38]
E. Söderberg, T. Ekman, G. Hedin, and E. Magnusson. Extensible intraprocedural flow analysis at the abstract syntax tree level. Sci. Comput. Program., 78(10):1809–1827, 2013.
[39]
E. Van Wyk, O. de Moor, K. Backhouse, and P. Kwiatkowski. Forwarding in attribute grammars for modular language design. In R. Horspool, editor, Compiler Construction, volume 2304 of LNCS, pages 128–142. Springer, 2002.
[40]
E. Van Wyk, D. Bodin, J. Gao, and L. Krishnan. Silver: An extensible attribute grammar system. Science of Computer Programming, 75(1-2): 39–54, 2010.
[41]
M. Viera, S. D. Swierstra, and W. Swierstra. Attribute grammars fly first-class: How to do aspect oriented programming in Haskell. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, ICFP ’09, pages 245–256. ACM, 2009.
[42]
E. Visser. Program Transformation with Stratego/XT: Rules, Strategies, Tools, and Systems in Stratego/XT 0.9. In Domain-Specific Program Generation, International Seminar, Dagstuhl Castle, Germany, March 23-28, 2003, Revised Papers, volume 3016 of Lecture Notes in Computer Science, pages 216–238. Springer, 2003.
[43]
H. Vogt, S. D. Swierstra, and M. F. Kuiper. Higher-order attribute grammars. In PLDI, pages 131–145, 1989.

Cited By

View all
  • (2019)Deciding Equivalence of Separated Non-nested Attribute Systems in Polynomial TimeFoundations of Software Science and Computation Structures10.1007/978-3-030-17127-8_28(488-504)Online publication date: 5-Apr-2019
  • (2018)Continuous model validation using reference attribute grammarsProceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3276604.3276616(70-82)Online publication date: 24-Oct-2018
  • (2017)Concurrent circular reference attribute grammarsProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136032(151-162)Online publication date: 23-Oct-2017
  • Show More Cited By

Index Terms

  1. JavaRAG: a Java library for reference attribute grammars

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    MODULARITY 2015: Proceedings of the 14th International Conference on Modularity
    March 2015
    145 pages
    ISBN:9781450332491
    DOI:10.1145/2724525
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 16 March 2015

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Java
    2. Modularity
    3. compilers
    4. embedded language
    5. extensibility
    6. library
    7. reference attribute grammars
    8. reflection

    Qualifiers

    • Research-article

    Conference

    Modularity '15
    Modularity '15: 14th International Conference on Modularity
    March 16 - 19, 2015
    CO, Fort Collins, USA

    Acceptance Rates

    Overall Acceptance Rate 41 of 139 submissions, 29%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)9
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 04 Oct 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2019)Deciding Equivalence of Separated Non-nested Attribute Systems in Polynomial TimeFoundations of Software Science and Computation Structures10.1007/978-3-030-17127-8_28(488-504)Online publication date: 5-Apr-2019
    • (2018)Continuous model validation using reference attribute grammarsProceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3276604.3276616(70-82)Online publication date: 24-Oct-2018
    • (2017)Concurrent circular reference attribute grammarsProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136032(151-162)Online publication date: 23-Oct-2017
    • (2017)Generalising tree traversals and tree transformations to DAGs: Exploiting sharing without the painScience of Computer Programming10.1016/j.scico.2016.03.006137(63-97)Online publication date: Apr-2017
    • (2016)Architecture for Hybrid Language Systems2016 IEEE International Conference on Computer and Information Technology (CIT)10.1109/CIT.2016.84(134-139)Online publication date: Dec-2016

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media