Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Infer questions (Some useful questions about JvmModelInferrer)
icon5.gif  Infer questions [message #996507] Wed, 02 January 2013 03:50 Go to previous message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 110
Registered: March 2012
Location: Italy
Senior Member

Happy new year everyone!

I'm going to write an inferrer for my dsl and I have some questions that I could not solve with only the help of documentation.

First one:
I need to create static void main() from a feature: how can I add static with .toMethod()?

Second one:
Suppose I have a rule in my dsl like this:
Sequence:
	'SEQ' name=ID '{'
		statements+=Statement*
	'}'
;


Where Statement:
Statement:
	Sequence | others...
;


Sequence must be mapped to a void method and the body of that method is composed from the traslation of statements.
But the problem is this: when inside a Sequence I'll find another Sequence I have to create a method for the new sequence and add a call in super sequence.

For example:
SEQ first {
   instructions...
   SEQ second {
      other instructions....
   }
   instructions...
}


Must generate:
void first(){
   instructions(translated)...
   second();
   instructions(translated)...
}
void second(){
   other instructions(translated)...
}


Is it possible to realize it?

Very thank you, and have a good new year!
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Using toIterable.FindFirst in Generator
Next Topic:Content Assist stops working
Goto Forum:
  


Current Time: Mon May 20 08:31:35 EDT 2013

Powered by FUDForum. Page generated in 0.01657 seconds