Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Add eObject to the parse tree programaticaly
icon4.gif  Add eObject to the parse tree programaticaly [message #1419898] Tue, 09 September 2014 08:24 Go to next message
Yeganeh Moghaddam is currently offline Yeganeh MoghaddamFriend
Messages: 1
Registered: September 2014
Junior Member
Here is a snapshot of my grammar:

Sort:
 name=ID 
;
Variable
 name=ID ':' type=[Sort]


My requirement is to have a predefined Sort let's call it Loc. There is no need for the user to define this sort, thus when a Variable is defined with a Loc type, Xtext should automatically reference it to my predefined Sort. How can I initiate the program so that at the beginning a Sort instance is generated? I already used the Factory method 'CreateSort' in my validator class, but no use. any idea?
Re: Add eObject to the parse tree programaticaly [message #1420223 is a reply to message #1419898] Tue, 09 September 2014 17:49 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
one possibility could be to use an iderivedstatecomputer or to hook into globalscopeprovider

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Xtext: Cross-Referenzce + JvmTypeReference
Next Topic:Insert Comment with ALT+SHIFT+J
Goto Forum:
  


Current Time: Thu Apr 25 18:55:25 GMT 2024

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

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

Back to the top