Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » terminal ID with prefix!(Xtext)
terminal ID with prefix! [message #915694] Mon, 17 September 2012 19:32 Go to next message
Stefan Kreisberg is currently offline Stefan KreisbergFriend
Messages: 5
Registered: August 2012
Junior Member
Hi,

I'm very fond of the defaults with QualifiedNames, references etc. that Xtext offers out of the box.

But I have one problem/issue:

I have a type "Config" with a name = ID that are referenced throughout my DSL.
The language I am trying to model however allows for such and ID to be "negated", i.e. as if it were a bool. So a config with name = MY_SYMBOL can be referenced from other parts as !MY_SYMBOL.

How can I go about parsing that? If I create a new terminal for this, I suppose I loose my QualifiedNames etc. ???

Any hints will (as always) be greatly appreciated Smile
Re: terminal ID with prefix! [message #915697 is a reply to message #915694] Mon, 17 September 2012 19:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

why dont you simply do something like

Stuff: '!' ref=[MyType]

????


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: terminal ID with prefix! [message #986052 is a reply to message #915697] Sat, 17 November 2012 21:34 Go to previous messageGo to next message
Stefan Kreisberg is currently offline Stefan KreisbergFriend
Messages: 5
Registered: August 2012
Junior Member
Doh! Thx. Dunno why I didn't get that to work in the first place. U R ofcourse right. Smile
Re: terminal ID with prefix! [message #986152 is a reply to message #986052] Mon, 19 November 2012 08:36 Go to previous message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 112
Registered: July 2009
Senior Member
You can use ?= to create a boolean attribute for that

Stuff: (negated ?= '!')? ref=[MyType]
Previous Topic:Help with simple grammar
Next Topic:Functions with parameter types
Goto Forum:
  


Current Time: Thu Mar 28 14:45:10 GMT 2024

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

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

Back to the top