background preloader

AST

Facebook Twitter

Gra2MoL. Gra2Mol (Grammar to Model Language) is a domain specific transformation language to define the relationships between grammar elements and metamodel elements. It is a rule based language like model transformation languages as RubyTL or ATL. In Gra2MoL you define the source element (grammar), the target element (metamodel) and some metamodel initialization sentences. The main difference with a model transformation language is that Gra2MoL is oriented to extract models from source programs.

Moreover, Gra2MoL defines a powerful language for traversing the syntax tress and for extracting information from the source code. A model-driven modernization process requires models to be extracted from legacy software and most software modernization scenarios involve dealing with source code written in some programming language. Thus, a bridge from grammarware to modelware technical spaces must be built to extract models from source code. The execution process of Gra2MoL is showed in this Figure: GRA2MOL - From programming grammars to modeling languages.

GRA2MOL is a specially tailored DSL for extracting models from source code developed by Javier Luis Cánovas and Jesús García Molina from the Modelum group in Spain. Most reverse engineering and software modernization processes require to extract some kind of models from the source code as a way to facilitate the understanding and/or manipulation of the legacy system.

Gra2MoL facilitates this task by simplifying the definition of code-to-model transformations from a grammar definition to a target metamodel. See the general schema of GRA2MOL: It has three main features: i) it is a rule-based language where each rule specifies a mapping between a grammar element and a metamodel element; ii) it incorporates a powerful query language to retrieve scattered information from the source code syntax tree, and iii) mappings between elements are defined by a special kind of assignment (binding) which is either locally resolved or triggers the execution of another rule. Lisp.js: a Lisp for node.js. How Do Annotations Work? Recently, I was giving an overview of Java to a bunch of C/C++ developers to help them bridge the gap. Mostly I ended up assuring them that they knew what they were doing and filled in very few gaps. I did enlighten them on some of the fun things like Collections and some confusing things like Date.

We covered lots of ground in those few hours of presentation and banter, but one question I couldn’t answer was about annotations. I had put a few code samples in my presentation that I’d pulled from a recent project. Stuff I knew worked, so I wouldn’t be surprised with any hastily thrown together code with style, format, or syntax errors. One of the classes was an annotated Spring class, with some code not too much unlike this snippet: @Autowire private SomeBean someBean; We went down a path of queries related to how to create new ones, which is a simple @interface declaration like the following. public @interface Foo{ } Then they wanted to know how to use them.

Public static. Morbok - Project Hosting on Google Code. Lombok-bean. Project Lombok.