Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Jvm Model Inferrer]Creating a field from a CrossReference
[Jvm Model Inferrer]Creating a field from a CrossReference [message #758976] Fri, 25 November 2011 12:47 Go to next message
Kardo  is currently offline Kardo Friend
Messages: 3
Registered: July 2011
Junior Member
Hi,

I have a question about Jvm Model Inference.
I have a grammar which includes cross references.

Model:
	greetings+=Greeting*
	jim=JimMorrison?
;
	
	
Greeting:
	'Hello' name=ID '!';


terminal Ilove:
	"ILoveYou"
;


JimMorrison:
	greet=[Greeting] Ilove
;


I would like to generate from the following mydsl code:

Hello Jasmine !

Jasmine ILoveYou


two classes "Jasmine" and "JimMorrison".
I'd like to have a field in JimMorrison class as

Jasmine greet;


How can I do this with JvmModelInferer? It may be very straightforward, I just got stuck for some reason...

Thanks in advance,

Kardo

[Updated on: Fri, 25 November 2011 13:24]

Report message to a moderator

Re: [Jvm Model Inferrer]Creating a field from a CrossReference [message #759068 is a reply to message #758976] Fri, 25 November 2011 21:59 Go to previous messageGo to next message
Kardo  is currently offline Kardo Friend
Messages: 3
Registered: July 2011
Junior Member
Anyone?
Re: [Jvm Model Inferrer]Creating a field from a CrossReference [message #759100 is a reply to message #759068] Sat, 26 November 2011 11:20 Go to previous messageGo to next message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
This isn't really a job for the JvmModelInferer because your model has nothing to do with Xbase or JVM types. This is a job for Xtend(2)'s rich strings, i.e. regular code generation.

Re: [Jvm Model Inferrer]Creating a field from a CrossReference [message #759128 is a reply to message #759100] Sat, 26 November 2011 16:06 Go to previous message
Kardo  is currently offline Kardo Friend
Messages: 3
Registered: July 2011
Junior Member
Thanks a lot, I'll just do it that way then...
Previous Topic:Combining the IJvmModelInferrer with custom code generation
Next Topic:Android 4.0
Goto Forum:
  


Current Time: Wed Mar 03 03:44:01 GMT 2021

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

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

Back to the top