Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Symbol(Is there documentation on the notion of symbol?)
Symbol [message #1745602] Thu, 13 October 2016 05:56 Go to next message
Yves LEDUC is currently offline Yves LEDUCFriend
Messages: 56
Registered: May 2015
Member
Eclipse Xtext concept symbol
Is there documentation on the notion of symbol?
That is to say where I found this:

Name returns Symbol:
ValidID
;

Ref:
{SymbolRef} symbol=[Symbol]
;


how is he using?
Is it possible to extend this to:
SymbolVar
SymbolConst
SymbolData
SymbolModule
...
besides Symbol so as to select the symbols used.
Re: Symbol [message #1745603 is a reply to message #1745602] Thu, 13 October 2016 06:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
hi i dont get this question. can you please elaborate? do you mean enumerations?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Symbol [message #1745605 is a reply to message #1745603] Thu, 13 October 2016 08:04 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
Hi Yves (just my 2 cent):
in your example, you have a rule "Name" which creates the class "Symbol".

Name returns Symbol:
ValidID
;

With your rule "Ref" you allow only instances of the class "Symbol" on this place.

Ref:
{SymbolRef} symbol=[Symbol]
;

So in your DSL, the name of an alredy defined ValidID is expected.

HIH, Uli
Re: Symbol [message #1745640 is a reply to message #1745605] Thu, 13 October 2016 17:03 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
maybe you mean

Model:
definitions+=Definition*
usages+=Usage*;

Definition: name= ValidID;

Usage: "use" def=[Definition|ValidID]

;

=> in your case

Name returns Symbol:
name=ValidID
;

SymbolRef} symbol=[Symbol|ValidID]
;

( symbol=[Symbol] is short for symbol=[Symbol|ID] so this works only for names that are IDs but ValidID may contain more than ID


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Odd problem with terminal ID
Next Topic:try-with-resource in Xbase
Goto Forum:
  


Current Time: Fri Apr 26 21:18:03 GMT 2024

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

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

Back to the top