to-model transformations have been defined. The first
one produces a model for a JavaCC parser generator.
The second one produces a model for a Cup
6
parser
generator.
The generator model is based upon a concrete kind
of context-free grammar: LL, LALR, etc. For in-
stance, JavaCC requires a LL grammar. Cup, on the
other side, requires a LALR grammar.
4.4 Code Generation: Parser
Construction
Code generation is performed in two steps. First,
from the generator model, a textual specification for
the parser generator is produced. Second, the parser
generator takes this textual specification and gener-
ates the parser. The aim of the parser is to parse docu-
ments written in the target language and to build their
corresponding AST. This AST is an instance of the
abstract syntax model.
5 CONCLUSION
Many development tools make an intensive use of
abstract syntax trees. This is the case of refactors,
code formatters, or content assistants, among others.
Such AST is usually an instance of an object oriented
model which represents the language’s abstract syn-
tax. In this paper we have proposed a Language En-
gineering methodology which is focused on this ab-
stract syntax model. We choose UML as the abstract
syntax metamodel because UML tools provide code
generators for different programming languages for
model implementation. Furthermore, UML is the de
facto standard for object oriented modeling.
We have proposed to stereotype the abstract syn-
tax model by means of a UML profile, called Con-
crete Syntax, aimed at concrete syntax specification.
This stereotyped abstract syntax model avoids the
synchronization between abstract and concrete syn-
tax. From this stereotyped abstract syntax model sev-
eral development artifacts can be automatically gener-
ated by means of applying MDE practices. We have
given an overview of the generation of a common de-
velopment component: a parser for AST construction.
6
Cup: LALR parser generator for Java
(http://www2.cs.tum.edu/projects/cup/)
ACKNOWLEDGEMENTS
This work has been partially supported by MCyT
TIN2005-08943-C02-02 and URJC-CM-2006-CET-
0603.
REFERENCES
Alanen, M. and Porres, I. (2003). A relation between
context-free grammars and meta object facility meta-
models.
Antoniol, G., Penta, M. D., and Merlo, E. (2003). Yaab
(yet another ast browser): Using ocl to navigate asts.
In IWPC ’03: Proceedings of the 11th IEEE In-
ternational Workshop on Program Comprehension,
page 13, Washington, DC, USA. IEEE Computer So-
ciety.
Blasband, D. (2001). Parsing in a hostile world. In Proceed-
ings of the Eighth Working Conference on Reverse En-
gineering (WCRE’01), page 291. IEEE Computer So-
ciety.
Bloch, J. (2006). How to design a good api and why
it matters. In OOPSLA ’06: Companion to the
21st ACM SIGPLAN conference on Object-oriented
programming languages, systems, and applications,
pages 506–507. ACM Press.
Boshernitsan, M. (2001). Harmonia: A flexible framework
for constructing interactive. Technical report.
Clark, T., Evans, A., Sammut, P., and Willians, J. (2004).
Applied Metamodelling: A Foundation for Language
Driven Development. Xactium.
Favre, J.-M. (2004). Towards a basic theory to model
model driven engineering. In 3rd Workshop in Soft-
ware Model Engineering (WiSME 2004).
Fondement, F., Schnekenburger, R., G
´
erard, S., and Muller,
P.-A. (2006). Metamodel-Aware Textual Concrete
Syntax Specification. Technical report.
Gort
´
azar, F., Duarte, A., and Gallego, M. (2007). Rep-
resenting languages in UML. In Proceedings of the
2nd Conference on Evaluation of Novel Approaches
to Software Engineering.
Hedin, G. and Magnusson, E. (2003). Jastadd: an aspect-
oriented compiler construction system. Sci. Comput.
Program., 47(1):37–58.
Herranz, A. and Nogueira, P. (2005). More than parsing. In
Lpez Fraguas, F. J., editor, Spanish V Conference on
Programming and Languages (PROLE 2005), pages
193–202. Thomson Paraninfo.
Jones, J. (2003). Abstract syntax tree implementation id-
ioms. In Proceedings of the 10th Conference on Pat-
tern Languages of Programs (PLoP’03).
Lieberherr, K. J. (2005). Object-oriented programming with
class dictionaries. LISP and Symbolic Computation,
1:185–212.
A MDE APPROACH FOR LANGUAGE ENGINEERING
85