Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] programatically creating rules and Graphs

Hi.

that is very easy. You can use the HenshinFactory to create rules etc. at runtime. It would look like this:

Rule rule = HenshinFactory.eINSTANCE.createRule();
...

After you have created your rules or units, you can directly apply them using the interpreter (see the interpreter wiki and the source code in the examples).

Another way to create a rule (or transformation unit etc.) is using higher-order (HO) transformations. Here the idea is to create or modify a rule or unit using a transformation. We currently have two examples of HO-transformations on our website. This one here is good starting point:

http://www.eclipse.org/modeling/emft/henshin/examples.php?example=combpattern

There a rule which matches a comb-like pattern of variable width is created using a HO-order transformation (see section "Generating and matching the comb pattern").

I hope this helps.

Cheers,
Christian



On 07/11/2012 05:54 PM, ? wrote:
hi all,
I want to programatically create a Rule in a transformation system. I want to create rules programatically and then programatically combine their left and right hand side. Is there a way to create Graph, Rule programatically?

Best

_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



Back to the top