JastAdd - an aspect-oriented compiler construction system

被引:82
作者
Hedin, G [1 ]
Magnusson, E [1 ]
机构
[1] Lund Univ, Dept Comp Sci, S-22100 Lund, Sweden
关键词
reference attributed grammars; aspect-oriented programming; compiler construction; visitor pattern; !text type='Java']Java[!/text;
D O I
10.1016/S0167-6423(02)00109-0
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We describe JastAdd, a Java-based system for compiler construction. JastAdd is centered around an object-oriented representation of the abstract syntax tree where reference variables can be used to link together different parts of the tree. JastAdd supports the combination of declarative techniques (using Reference Attributed Grammars) and imperative techniques (using ordinary Java code) in implementing the compiler. The behavior can be modularized into different aspects, e.g. name analysis, type checking, code generation, etc., that are woven together into classes using aspect-oriented programming techniques, providing a safer and more powerful alternative to the Visitor pattern. The JastAdd system is independent of the underlying parsing technology and supports any noncircular dependencies between computations, thereby allowing general multi-pass compilation. The attribute evaluator (optimal recursive evaluation) is implemented very conveniently using Java classes, interfaces, and virtual methods. (C) 2002 Elsevier Science B.V. All rights reserved.
引用
收藏
页码:37 / 58
页数:22
相关论文
共 21 条
[1]  
Bjarnason E., 1999, Nordic Journal of Computing, V6, P36
[2]  
Boyland John T, 1996, Ph.D. Dissertation
[3]  
DEMOOR O, 1999, S LECT NOTES COMPUTE, V1799, P121
[4]  
GAGNON EM, 1998, P TOOLS 26 US 98 IEE
[5]  
GAMMA E, 1995, DESIGN PATTERNS
[6]  
HARRISON W, 1993, SIGPLAN NOTICES, V28, P411, DOI 10.1145/167962.165932
[7]  
Hedin G., 1989, ECOOP '89. Proceedings of the 1989 European Conference on Object-Oriented Programming, P329
[8]  
Hedin G., 2000, Informatica, V24, P301
[9]  
JALILI F, 1983, ACM SIGPLAN NOTICES, V18, P35
[10]  
JOURDAN M, 1984, LECT NOTES COMPUT SC, V167, P167