enhancing xtext for general purpose languages

Post on 26-Jan-2015

122 Views

Category:

Engineering

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Research work presented at MoDELS Doctoral Symposium (2014) focused on providing tools complementary to Xtext in order to reduce the amount of hand-written artifacts required to give support to General Purpose Languages. The research is focused on providing high level of abstraction languages to complement Xtext grammars, so that the current amount of hand written source code required to give support to General Purpose Languages is automatically generated from those higher level of abstraction languages. In particular, the aforementioned languages will capture information mostly related to: a) Name Resolution b) Syntax rewrites This research is contextualized on the OCL and QVT specifications. One of the goals is to provide Xtext-based high quality parsers and editors for the Eclipse OCL and Eclipse QVTo projects.

TRANSCRIPT

Enhancing Xtext for General Purpose

LanguagesAdolfo Sánchez-Barbudo Herrera

asbh500@york.ac.uk

Outline

★ EngD Project○ Context○ Motivation○ Scope

★ Research○ Problems○ Directions○ Evaluation

★ Current Status

EngD Project Context

New impl.

Eclipse OCL

Eclipse QVTo

2005 2007 2010 2013

Alignment

Extension

Classic

OCL / QVT

3/13

EngD Project Motivation

● New QVTo implementationo Xtext-based parsers and editorso Extending “new” OCL implementation

● Problemo Xtext provides strong support for textual DSLso Eclipse OCL required significant hand written

code● Main goal

o Enhancing Xtext grammars -> Reduce the need of hand written code for QVTo (and other languages)

4/13

EngD Project Scope

● Restrictiono Xtext as a language workbench.

● Other language workbenches not considered

Spoofax

5/13

Research Problem (I)

● Gap between fixed CS and AS

Bridge

6/13

Research Problem (II)

● Name Resolution● o Qualified accesso Nested scopeso Inheritanceo i.e. Name visibility rules

7/13

Research Problem (III)

● Syntax rewriteso Syntax sugar resolution, disambiguation rules, etc.

● Examples (OCL expression):o abc => NameExpCS

abc => VariableExp self.abc => PropertyCallExp

o self.aProp->size() aProp is single-valued ?

● implicit collection conversion => self.aProp.asSet()->size()

8/13

Research Directions (I)

● Higher level of abstraction DSLs o Name resolutiono Syntax rewrites (CS2AS bridge, disambiguation, etc.)

9/13

Research Directions (II)

● Activities dependency analysis

CS 2 AS

NameResolution Disambiguation

10/13

Research Evaluation

● Compare amount of LOC for manual artefactso Measurements of LOC for hand-written java codeo Measurements of LOC for equivalent DSL instances

● Compare execution times of test caseso Measurements based on current Eclipse OCL impl.o Measurements based on future Eclipse OCL impl.o Backed up by: Theoretical algorithm analysis

11/13

Current Status (I)● OCL Documents as intermediate artefacts

12/13

o High expressiveness + Eclipse OCL2Java generatoro OCL descriptions as part of OMG specifications

Current Status (II) 13/13

● DSLs still need to be researched

Questions & Discussion

?e-mail: asbh500@york.ac.uktwitter: @adolfosbh

Discussion - Related Work

● Spoofaxo NaBL (name resolution) & Stratego (syntax rewrites)

● JastAdd (& JastEMF)o Attribute grammars: name resol. & syntax rewrites

● Gra2Molo DSTL to bridge CS and AS

● Xsemanticso A DSL for writing semantic rules for Xtext languages

Discussion - Future Work

● Finish source code generatorso Syntax rewrites and name resolution descriptionso From Complete OCL documents to Java codeo Improve generated source code based on activities

dependency analysis● DSLs

o Design high level of abstraction DSLso Implement generators (to generate Complete OCL)

● Evaluate research project contributions

Discussions - Dep. Analysis 14/14

Acknowledgements

Prof. Richard F. Paige from University of YorkDr. Edward Willink from Willink TransformationsEngineering & Physical Sciences Research Council ES group colleaguesAnonymous reviewers

References[1] OMG. OCL, V2.4. http://www.omg.org/spec/OCL/2.4, January 2013[2] OMG. QVT, V1.2. http://www.omg.org/spec/QVT/1.2, May 2014.[3] M. Eysholdt and H. Behrens. Xtext: Implement your language faster than the quick and dirty way. In OOPSLA, 2010.[4] Edward D. Willink. Re-engineering Eclipse MDT/OCL for Xtext. Electronic Communications of the EASST, 2010.[5] Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman. Compilers: principles, techniques, & tools. Pearson Education Inc., 2007.[6] Gabriel Konat, Lennart Kats, Guido Wachsmuth, and Eelco Visser. Declarative name binding and scope rules. In Software Language Engineering, volume 7745. Springer Berlin Heidelberg, 2013.[7] Lennart Kats and Eelco Visser. The spoofax language workbench: rules for declarative specification of languages and IDEs. In ACM Sigplan Notices, volume 45, 2010.[8] Torbjorn Ekman and Gorel Hedin. Modular name analysis for Java using JastAdd. In Generative and � �Transformational Techniques in SE. Springer, 2006.[9] Christoff Burger, Sven Karol, and Christian Wende. Applying attribute grammars for metamodel semantics. In �Proceedings of the International Workshop on Formalization of Modeling Languages, 2010.[10] Javier Canovas Izquierdo and Jesus Garcia Molina. Extracting models from source code in software modernization. Software & Systems Modeling, 2012.

top related