1 / 10

Towards Modular Code Generators Using Symmetric Language-Aware Aspects

Towards Modular Code Generators Using Symmetric Language-Aware Aspects. Steffen Zschaler , Awais Rashid FREECO’11 Lancaster, 26 July 2011. Motivation. Code generators can become quite complex Generate code related to a number of different concerns / features

ishi
Download Presentation

Towards Modular Code Generators Using Symmetric Language-Aware Aspects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Towards Modular Code Generators Using SymmetricLanguage-Aware Aspects Steffen Zschaler, Awais Rashid FREECO’11 Lancaster, 26 July 2011

  2. Motivation Code generators can become quite complex • Generate code related to a number of different concerns / features • Different model elements (global-to-local transformation) • Additional technical concerns (e.g., persistence annotations) • Flexibly combine generation pipeline depending on features required (c) Steffen Zschaler

  3. Configuring Code Generators Application Model GUI Generator Java Data Model Generator EMF Generator Business Logic Generator plugin.xml Java Code (c) Steffen Zschaler

  4. Existing Modularity Techniques • Templates • Typically one template per target file • May produce more than one file • Generation Rules • Allow hierarchy similar to operations • Good for capturing common design rules • Import of module templates • Allow reuse of rules • Asymmetric Aspects • Explicitly address tangling • BUT... (c) Steffen Zschaler

  5. Drawbacks of Asymmetric AO • Need for a base template • Need for scaffolding • No explicit support for weaving context • Not language aware (c) Steffen Zschaler

  6. Registration + Weaving = Symmetric AO for Code Generation Code Slice Registry CG Template 1 Output Files CG Template 2 Code Slice Weaver ... CG Template n (c) Steffen Zschaler

  7. Text Merging • 2-way vs 3-way • We can only support 2-way merging • State-based vs change-based • We can only support state-based merging • Textual vs syntactic vs semantic • The more semantic the more powerful • But also the more configuration needed! based on Tom Mens’ classification (c) Steffen Zschaler

  8. Prototype • Extends Epsilon Generation Language (EGL) • New workflow tasks: eglRegister – generate from a template, but store result in registry eglMerge – merge registry contents for specific files • Can be configured with different text merging algorithms • Distribution uses FeatureHouse • Available from EpsilonLabs: https://sourceforge.net/apps/mediawiki/epsilonlabs/ (c) Steffen Zschaler

  9. Conclusions & Outlook • Asymmetric aspects can address some modularity issues in code generation • Presented a prototype • Larger comparative study of modularity properties currently under way (c) Steffen Zschaler

  10. Thank you for your Attention! (c) Steffen Zschaler

More Related