Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » extending generator's method in runtime(extending generator's method in runtime)
extending generator's method in runtime [message #805141] Thu, 23 February 2012 11:34 Go to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Hello,
I am wondering, if it would be possible to extend generator in the runtime.

It means following:
Imagine simple grammar, where only entities are states and transitions.
Many states and transitions can be present in the project and every state can be reached by many ways from other states using some transition. It is no problem to write generator, which covers all transitions.
The problem is, that I need to allow developers to choose in each project different algorithm. E.g. sometimes I might want to generate the code only for transitions, which are targeting to state, which was not reached before. Other example, somebody might want to choose 20% of transitions randomly.

Because of this, I would need to specify algorithm for choosing transitions in the project. (There might be some default behavior implemented, but I need to be able to override it, e.g. in file with specified name in the project.)

Is there any way how to do this - i.e. change plugin's behavior during application run?
Thank you & Best regards,
Michal


Re: extending generator's method in runtime [message #805321 is a reply to message #805141] Thu, 23 February 2012 16:29 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
The short answer: You have to build custom UI for this.

Am 23.02.12 12:34, schrieb Michal S:
> Hello,
> I am wondering, if it would be possible to extend generator in the runtime.
>
> It means following:
> Imagine simple grammar, where only entities are states and transitions.
> Many states and transitions can be present in the project and every
> state can be reached by many ways from other states using some
> transition. It is no problem to write generator, which covers all
> transitions. The problem is, that I need to allow developers to choose
> in each project different algorithm. E.g. sometimes I might want to
> generate the code only for transitions, which are targeting to state,
> which was not reached before. Other example, somebody might want to
> choose 20% of transitions randomly.
>
> Because of this, I would need to specify algorithm for choosing
> transitions in the project. (There might be some default behavior
> implemented, but I need to be able to override it, e.g. in file with
> specified name in the project.)
>
> Is there any way how to do this - i.e. change plugin's behavior during
> application run?
> Thank you & Best regards,
> Michal
>
>
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Using Xtend without Xtext
Next Topic:How to retrieve all instances of given grammar class?
Goto Forum:
  


Current Time: Sat Mar 28 19:11:24 GMT 2020

Powered by FUDForum. Page generated in 0.02064 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top