Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting user types ID
Getting user types ID [message #1829358] Wed, 01 July 2020 22:05 Go to next message
df nas is currently offline df nasFriend
Messages: 1
Registered: July 2020
Junior Member
Is it possible to get the value of a typed varibale.
for example

   



Model:
   entitys += Entity* news += NewClass* ;

otherpramRun: 'run2';


ClassSetAtributes: 'simul' | 'space' | 'field' | 'event' 
	| 'fiber' | 'solid'
	| 'bead'
;

Entity :
    'Set' name=ClassSetAtributes | 'Set' name=ClassSetAtributes UserParameter=ID'{'
	fields += Field*
	'}'
;



Field:
 'field' name=ID
;


NewClass:
	'new' name=UserParameter '{'
	values += Value*
'}'
;


Value:
 'value' name=ID
;





I want to be able to get the value of UserParameter which is in the entity class. Then be able to compare that to the new class. So when the user types in anything other than what is in the UserParameter from the entity class a error pops up.
Re: Getting user types ID [message #1829365 is a reply to message #1829358] Thu, 02 July 2020 05:13 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
Hi, did you explore the Concepts of Cross References and Scoping?
Your sample grammar misses the UserParameter class so I can only guess


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Formatter in whitespace aware language
Next Topic:Providing quick fixes when IMarker are not created using Xtext's API
Goto Forum:
  


Current Time: Fri Jan 15 21:27:14 GMT 2021

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

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

Back to the top