Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting hidden tokens for a model element(Getting hidden tokens for a model element)
Getting hidden tokens for a model element [message #1287123] Mon, 07 April 2014 12:34 Go to next message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
Hello guys,
my grammar defines different hidden nodes per model element. Since it is not handled well by the serializer I need to map from model element to hidden nodes defined for it. I'm sure there's an API for this - just wasn't able to find it. Any help?

Cheers,
Paweł
Re: Getting hidden tokens for a model element [message #1287180 is a reply to message #1287123] Mon, 07 April 2014 13:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
I Am not sure if i got your problem/usecase but maybe a look at
HiddenTokenSequencer
will help

On 2014-04-07 12:34:28 +0000, Pawel Pogorzelski said:

> Hello guys,
> my grammar defines different hidden nodes per model element. Since it
> is not handled well by the serializer I need to map from model element
> to hidden nodes defined for it. I'm sure there's an API for this - just
> wasn't able to find it. Any help?
>
> Cheers,
> Paweł


--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting hidden tokens for a model element [message #1287185 is a reply to message #1287123] Mon, 07 April 2014 13:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
And simply for accessing the node model reading wise: NodeModelUtil

On 2014-04-07 12:34:28 +0000, Pawel Pogorzelski said:

> Hello guys,
> my grammar defines different hidden nodes per model element. Since it
> is not handled well by the serializer I need to map from model element
> to hidden nodes defined for it. I'm sure there's an API for this - just
> wasn't able to find it. Any help?
>
> Cheers,
> Paweł


--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting hidden tokens for a model element [message #1287305 is a reply to message #1287185] Mon, 07 April 2014 16:43 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
and maybe (if you talk about the grammar) org.eclipse.xtext.ParserRule.getHiddenTokens()

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting hidden tokens for a model element [message #1288115 is a reply to message #1287305] Tue, 08 April 2014 09:39 Go to previous messageGo to next message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
Christian,
I meant my grammar redefines hidden nodes in a few places so WS is not always considered hidden. The Seriazlier I'm using doesn't take this into account though. So I was looking for something like ParserRule.getHiddenTokens() to hack the Serializer but this method always returns an empty list.

I'm using Xtext 2.3.1 and looks like there were some changes in this area in subsequent releases. So I'll browse more code, thanks for the pointers.

Thanks,
Pawel
Re: Getting hidden tokens for a model element [message #1288173 is a reply to message #1288115] Tue, 08 April 2014 10:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Sorry have no Further ideas ob that. Which serialzer so you use (the
old - parsetree* -or the new one)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting hidden tokens for a model element [message #1288212 is a reply to message #1288173] Tue, 08 April 2014 11:17 Go to previous message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
I'm using the new Serializer but have customized it.

Anyways, just found the problem with ParserRule.getHiddenTokens(), now it works fine. Thanks Christian, that was exactly what I was looking for.

Pawel
Previous Topic:Xtend scripts written for 2.3 developed in 2.4
Next Topic:xtext version: IDE vs target platform
Goto Forum:
  


Current Time: Thu Mar 28 19:45:42 GMT 2024

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

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

Back to the top