|
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
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked 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
|
Chris Allan , Pavel Avgustinov , Aske Simon Christensen , Laurie Hendren , Sascha Kuzins , Ondřej Lhoták , Oege de Moor , Damien Sereni , Ganesh Sittampalam , Julian Tibble, Adding trace matching with free variables to AspectJ, Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, October 16-20, 2005, San Diego, CA, USA
|
 |
5
|
Pavel Avgustinov , Aske Simon Christensen , Laurie Hendren , Sascha Kuzins , Jennifer Lhoták , Ondřej Lhoták , Oege de Moor , Damien Sereni , Ganesh Sittampalam , Julian Tibble, abc: an extensible AspectJ compiler, Proceedings of the 4th international conference on Aspect-oriented software development, p.87-98, March 14-18, 2005, Chicago, Illinois
[doi> 10.1145/1052898.1052906]
|
| |
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
|
|
| |
8
|
|
| |
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
|
|
| |
11
|
E. Bodden and V. Stolz. J-LO, the Java Logical Observer. http://www-i2.informatik.rwth-aachen.de/Research/RV/JLO/.
|
 |
12
|
|
| |
13
|
G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. GJ specification, May 1998.
|
| |
14
|
|
| |
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
|
Martin Bravenboer , Eelco Visser, Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions, Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 24-28, 2004, Vancouver, BC, Canada
|
| |
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
|
|
 |
20
|
|
| |
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
|
|
| |
24
|
Gregor Kiczales , Erik Hilsdale , Jim Hugunin , Mik Kersten , Jeffrey Palm , William G. Griswold, An Overview of AspectJ, Proceedings of the 15th European Conference on Object-Oriented Programming, p.327-353, June 18-22, 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
|
Neil Ongkingco , Pavel Avgustinov , Julian Tibble , Laurie Hendren , Oege de Moor , Ganesh Sittampalam, Adding open modules to AspectJ, Proceedings of the 5th international conference on Aspect-oriented software development, March 20-24, 2006, Bonn, Germany
[doi> 10.1145/1119655.1119664]
|
| |
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
|
Kouhei Sakurai , Hidehiko Masuhara , Naoyasu Ubayashi , Saeko Matsuura , Seiichi Komiya, Association aspects, Proceedings of the 3rd international conference on Aspect-oriented software development, p.16-25, March 22-24, 2004, Lancaster, UK
[doi> 10.1145/976270.976275]
|
 |
33
|
|
| |
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
|
|
| |
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
|
|
| |
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 9
|
|
|
|
|
|
|
|
Pavel Avgustinov , Elnar Hajiyev , Neil Ongkingco , Oege de Moor , Damien Sereni , Julian Tibble , Mathieu Verbaere, Semantics of static pointcuts in aspectJ, ACM SIGPLAN Notices, v.42 n.1, January 2007
|
|
|
Johan Fabry , Éric Tanter , Theo D'Hondt, ReLAx: implementing KALA over the reflex AOP kernel, Proceedings of the 2nd workshop on Domain specific aspect languages, p.3-es, March 12-12, 2007, Vancouver, British Columbia, Canada
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vladimir Oliveira Di Iorio , Leonardo Vieira dos Santos Reis , Roberto da Silva Bigonha , Mariza Andrade da Silva Bigonha, A proposal for extensible AspectJ, Proceedings of the 4th workshop on Domain-specific aspect languages, March 03-03, 2009, Charlottesville, Virginia, USA
|
|