Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Enhancing Xtext for General Purpose Languages

832 views

Published on

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.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Enhancing Xtext for General Purpose Languages

  1. 1. Enhancing Xtext for General Purpose Languages Adolfo Sánchez-Barbudo Herrera asbh500@york.ac.uk
  2. 2. Outline ★ EngD Project ○ Context ○ Motivation ○ Scope ★ Research ○ Problems ○ Directions ○ Evaluation ★ Current Status
  3. 3. EngD Project Context New impl. OCL / QVT Eclipse OCL Eclipse QVTo 2005 2007 2010 2013 Alignment Extension Classic 3/13
  4. 4. EngD Project Motivation ● New QVTo implementation o Xtext-based parsers and editors o Extending “new” OCL implementation ● Problem o Xtext provides strong support for textual DSLs o 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
  5. 5. EngD Project Scope ● Restriction o Xtext as a language workbench. ● Other language workbenches not considered Spoofax 5/13
  6. 6. Research Problem (I) ● Gap between fixed CS and AS Bridge 6/13
  7. 7. Research Problem (II) ● Name Resolution ● o Qualified access o Nested scopes o Inheritance o i.e. Name visibility rules 7/13
  8. 8. Research Problem (III) ● Syntax rewrites o 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
  9. 9. Research Directions (I) ● Higher level of abstraction DSLs 9/13 o Name resolution o Syntax rewrites (CS2AS bridge, disambiguation, etc.)
  10. 10. Research Directions (II) ● Activities dependency analysis CS 2 AS Name Resolution Disambiguation 10/13
  11. 11. Research Evaluation ● Compare amount of LOC for manual artefacts o Measurements of LOC for hand-written java code o Measurements of LOC for equivalent DSL instances ● Compare execution times of test cases o Measurements based on current Eclipse OCL impl. o Measurements based on future Eclipse OCL impl. o Backed up by: Theoretical algorithm analysis 11/13
  12. 12. Current Status (I) ● OCL Documents as intermediate artefacts 12/13 o High expressiveness + Eclipse OCL2Java generator o OCL descriptions as part of OMG specifications
  13. 13. Current Status (II) 13/13 ● DSLs still need to be researched
  14. 14. Questions & Discussion ? e-mail: asbh500@york.ac.uk twitter: @adolfosbh
  15. 15. Discussion - Related Work ● Spoofax o NaBL (name resolution) & Stratego (syntax rewrites) ● JastAdd (& JastEMF) o Attribute grammars: name resol. & syntax rewrites ● Gra2Mol o DSTL to bridge CS and AS ● Xsemantics o A DSL for writing semantic rules for Xtext languages
  16. 16. Discussion - Future Work ● Finish source code generators o Syntax rewrites and name resolution descriptions o From Complete OCL documents to Java code o Improve generated source code based on activities dependency analysis ● DSLs o Design high level of abstraction DSLs o Implement generators (to generate Complete OCL) ● Evaluate research project contributions
  17. 17. Discussions - Dep. Analysis 14/14
  18. 18. Acknowledgements Prof. Richard F. Paige from University of York Dr. Edward Willink from Willink Transformations Engineering & Physical Sciences Research Council ES group colleagues Anonymous reviewers
  19. 19. 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] Torbj•orn Ekman and G•orel Hedin. Modular name analysis for Java using JastAdd. In Generative and Transformational Techniques in SE. Springer, 2006. [9] Christoff B•urger, 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.

×