Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1167473.1167491acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Declarative, formal, and extensible syntax definition for aspectJ

Published: 16 October 2006 Publication History

Abstract

Aspect-Oriented Programming (AOP) is attracting attention from both research and industry, as illustrated by the ever-growing popularity of AspectJ, the de facto standard AOP extension of Java. From a compiler construction perspective AspectJ is interesting as it is a typical example of compositional language, ie a language composed of a number of separate languages with different syntactical styles: in addition to plain Java, AspectJ includes a language for defining pointcuts and one for defining advices. Language composition represents a non-trivial challenge for conventional parsing techniques. First, combining several languages with different lexical syntax leads to considerable complexity in the lexical states to processed. Second, as new language features for AOP are being explored, many research proposals are concerned with further extending the AspectJ language, resulting in a need for an extensible syntax definition.This paper shows how scannerless parsing elegantly addresses the issues encountered by conventional techniques when parsing AspectJ . We present the design of a modular, extensible, and formal definition of the lexical and context-free aspects of the AspectJ syntax in the Syntax Definition Formalism SDF, which is implemented by a scannerless, generalized-LR parser (SGLR). We introduce grammar mixins as a novel application of SDF's modularity features, which allows the declarative definition of different keyword policies and combination of extensions. We illustrate the modular extensibility of our definition with syntax extensions taken from current research on aspect languages. Finally, benchmarks show the reasonable performance of scannerless generalized-LR parsing for this grammar.

References

[1]
AspectJ documentation. http://www.eclipse.org/aspectj/docs.php. With links to the AspectJ Programming Guide and the AspectJ 5Developer's Notebook.
[2]
Proc. of the 5th Intl. Conference on Aspect-Oriented Software Development (AOSD 2006), Bonn, Germany, Mar. 2006. ACM Press.
[3]
J. Aldrich. Open modules: Modular reasoning about advice. In Proc. of the European Conference on Object-Oriented Programming (ECOOP'05), volume 3586 of LNCS, pages 144--168. Springer-Verlag, July 2005.
[4]
C. Allan, P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, O. Lhoták, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. Adding trace matching with free variables to AspectJ. In Proc. of the 20th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2005), pages 345--364, San Diego, California, USA, Oct. 2005. ACM Press. ACM SIGPLAN Notices, 40(11).
[5]
P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, J. Lhoták, O. Lhoták, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. abc: an extensible AspectJ compiler. In Proc. of the 4th Intl. Conference on Aspect-Oriented Software Development (AOSD'04), pages 87--98, New York, NY, USA, 2005. ACM Press.
[6]
P. Avgustinov, E. Hajiyev, N. Ongkingco, O. de Moor, D. Sereni, J. Tibble, and M. Verbaere. Semantics of static pointcuts in AspectJ. Technical Report abc-2006-3, Programming Tools Group, Oxford University, Oxford, United Kingdom, 2006.
[7]
J. Aycock and R. N. Horspool. Faster generalized lr parsing. In Proc. of 8th Intl. Conference on Compiler Construction (CC'99), volume 1575, pages 32--46, Amsterdam, March 1999. Springer-Verlag.
[8]
D. Batory, B. Lofaso, and Y. Smaragdakis. JTS: tools for implementing domain-specific languages. In Proc. Fifth Intl. Conference on Software Reuse (ICSR'98), pages 143--153. IEEE Computer Society, June 1998.
[9]
A. Begel and S. L. Graham. Language analysis and tools for input stream ambiguities. In Fourth Workshop on Language Descriptions, Tools and Applications (LDTA'04), Electronic Notes in Theoretical Computer Science, Barcelona, Spain, April 2004. Elsevier.
[10]
D. Blasband. Parsing in a hostile world. In Proc. of the Eighth Working Conference on Reverse Engineering (WCRE'01), page 291, Washington, DC, USA, 2001. IEEE Computer Society.
[11]
E. Bodden and V. Stolz. J-LO, the Java Logical Observer. http://www-i2.informatik.rwth-aachen.de/Research/RV/JLO/.
[12]
G. Bracha and W. Cook. Mixin-based inheritance. In OOPSLA/ECOOP'90, pages 303--311. ACM Press, 1990.
[13]
G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. GJ specification, May 1998.
[14]
M. 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. Springer-Verlag, April 2002.
[15]
M. Bravenboer, R. Vermaas, J. J. Vinju, and E. Visser. Generalized type-based disambiguation of meta programs with concrete object syntax. In Glück and Lowry {18}, pages 157--172.
[16]
M. Bravenboer and E. Visser. Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In D. C. Schmidt, editor, Proc. of the 19th ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA'04), pages 365--383. ACM Press, October 2004.
[17]
Eclipse Java Development Tools (JDT) website. http://www.eclipse.org/jdt/.
[18]
R. Glück and M. Lowry, editors. Proc. of the 4th ACM SIGPLAN/SIGSOFT Conference on Generative Programming and Component Engineering (GPCE 2005), volume 3676 of LNCS, Tallinn, Estonia, Sept./Oct. 2005. Springer-Verlag.
[19]
B. Harbulot and J. Gurd. A join point for loops in AspectJ. In Proc. of the 5th Intl. Conference on Aspect-Oriented Software Development (AOSD 2006) {2}.
[20]
J. Heering, P. R. H. Hendriks, P. Klint, and J. Rekers. The syntax definition formalism SDF - reference manual. SIGPLAN Notices, 24(11):43--75, 1989.
[21]
L. Hendren, O. de Moor, A. S. Christensen, and the abc team. The abc scanner and parser, including an LALR(1) grammar for AspectJ. Techrep, Programming Tools Group, Oxford University and the Sable research group, McGill University, September 2004.
[22]
G. Hutton. Higher-order functions for parsing. Journal of Functional Programming, (2(3)):323--343, July 1992.
[23]
C. L. Jeffery. Generating LR syntax error messages from examples. ACM Transactions on Programming Languages and Systems (TOPLAS), 25(5):631--640, September 2003.
[24]
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In J. Lindskov Knudsen, editor, ECOOP 2001: Object-Oriented Programming: 15th European Conference, volume 2072 of LNCS, pages 327--353. Springer-Verlag, June 2001.
[25]
M. M. Lehman. On understanding laws, evolution, and conservation in the large-program life cycle. Journal of Systems and Software, 1(3):213--231, 1980.
[26]
H. Masuhara and K. Kawauchi. Dataflow pointcut in aspect-oriented programming. In Proc. of the First Asian Symposium on Programming Languages and Systems (APLAS'03), volume 2895 of LNCS, pages 105--121. Springer-Verlag, Nov. 2003.
[27]
S. McPeak and G. C. Necula. Elkhound: A fast, practical GLR parser generator. In E. Duesterwald, editor, Proc. of 13th Intl. Conference on Compiler Construction (CC'04), volume 2985 of LNCS, pages 73--88, Berlin, April 2004. Springer-Verlag.
[28]
N. Nystrom, M. R. Clarkson, and A. C. Myers. Polyglot: An extensible compiler framework for Java. In Proc. of the 12th Intl. Conference on Compiler Construction, volume 2622 of LNCS, pages 138--152. Springer-Verlag, April 2003.
[29]
N. Ongkingco, P. Avgustinov, J. Tibble, L. Hendren, O. de Moor, and G. Sittampalam. Adding open modules to AspectJ. In Proc. of the 5th Intl. Conference on Aspect-Oriented Software Development (AOSD 2006) {2}.
[30]
T. Parr. ANTLR Parser Generator. http://www.antlr.org.
[31]
J. Rekers. Parser Generation for Interactive Environments. PhD thesis, University of Amsterdam, 1992.
[32]
K. Sakurai, H. Masuhara, N. Ubayashi, S. Matsuura, and S. Komiya. Association aspects. In K. Lieberherr, editor, Proc. of the 3rd Intl. Conference on Aspect-Oriented Software Development (AOSD 2004), pages 16--25, Lancaster, UK, Mar. 2004. ACM Press.
[33]
D. J. Salomon and G. V. Cormack. Scannerless NSLR(1) parsing of programming languages. ACM SIGPLAN Notices, 24(7):170--178, 1989. Proc. of the ACM SIGPLAN 1989 Conference on Programming Language Design and Implementation (PLDI'89).
[34]
D. J. Salomon and G. V. Cormack. The disambiguation and scannerless parsing of complete character-level grammars for programming languages. Technical Report 95/06, Department of Computer Science, University of Manitoba, Winnipeg, Canada, 1995.
[35]
E. Scott and A. Johnstone. Right nulled GLR parsers. ACM Transactions on Programming Languages and Systems (TOPLAS), 28(4):577--618, 2006.
[36]
É. Tanter, K. Gybels, M. Denker, and A. Bergel. Context-aware aspects. In Proc. of the 5th Intl. Symposium on Software Composition (SC 2006), LNCS, pages 227--249, Vienna, Austria, Mar. 2006. Springer-Verlag.
[37]
É. Tanter and J. Noyé. A versatile kernel for multi-language AOP. In Glück and Lowry {18}, pages 173--188.
[38]
M. Tomita. Efficient Parsing for Natural Languages. A Fast Algorithm for Practical Systems. Kluwer Academic Publishers, 1985.
[39]
E. Visser. Scannerless generalized-LR parsing. Technical Report P9707, Programming Research Group, University of Amsterdam, July 1997.
[40]
E. Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997.
[41]
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 (GPCE'04), volume 3286 of LNCS, pages 1--19. Springer, October 2004.

Cited By

View all
  • (2020)Multi-purpose Syntax Definition with SDF3Software Engineering and Formal Methods10.1007/978-3-030-58768-0_1(1-23)Online publication date: 8-Sep-2020
  • (2017)A symbol-based extension of parsing expression grammars and context-sensitive packrat parsingProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136025(26-37)Online publication date: 23-Oct-2017
  • (2016)A Declarative Extension of Parsing Expression Grammars for Recognizing Most Programming LanguagesJournal of Information Processing10.2197/ipsjjip.24.25624:2(256-264)Online publication date: 2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications
October 2006
514 pages
ISBN:1595933484
DOI:10.1145/1167473
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 41, Issue 10
    Proceedings of the 2006 OOPSLA Conference
    October 2006
    480 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1167515
    Issue’s Table of Contents
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 ACM 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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 16 October 2006

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. aspectJ
  2. generalized-LR parsing
  3. grammar mixins
  4. lexical syntax
  5. scannerless parsing
  6. syntax definition
  7. syntax extension

Qualifiers

  • Article

Conference

OOPSLA06
Sponsor:

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)0
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2020)Multi-purpose Syntax Definition with SDF3Software Engineering and Formal Methods10.1007/978-3-030-58768-0_1(1-23)Online publication date: 8-Sep-2020
  • (2017)A symbol-based extension of parsing expression grammars and context-sensitive packrat parsingProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136025(26-37)Online publication date: 23-Oct-2017
  • (2016)A Declarative Extension of Parsing Expression Grammars for Recognizing Most Programming LanguagesJournal of Information Processing10.2197/ipsjjip.24.25624:2(256-264)Online publication date: 2016
  • (2016)Nez: practical open grammar languageProceedings of the 2016 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/2986012.2986019(29-42)Online publication date: 20-Oct-2016
  • (2015)Lexical Parsing Expression Recognition SchemataProceedings of the 2015 24th Australasian Software Engineering Conference (ASWEC)10.1109/ASWEC.2015.27(165-174)Online publication date: 28-Sep-2015
  • (2015)Faster, Practical GLL ParsingCompiler Construction10.1007/978-3-662-46663-6_5(89-108)Online publication date: 2015
  • (2012)Natural and Flexible Error Recovery for Generated Modular Language EnvironmentsACM Transactions on Programming Languages and Systems10.1145/2400676.240067834:4(1-50)Online publication date: 1-Dec-2012
  • (2011)EventCJProceedings of the tenth international conference on Aspect-oriented software development10.1145/1960275.1960305(253-264)Online publication date: 21-Mar-2011
  • (2011)MetaLexerProceedings of the tenth international conference on Aspect-oriented software development10.1145/1960275.1960279(7-18)Online publication date: 21-Mar-2011
  • (2010)Pure and declarative syntax definitionACM SIGPLAN Notices10.1145/1932682.186953545:10(918-932)Online publication date: 17-Oct-2010
  • Show More Cited By

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