Skip to main content



      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 08:34 Go to next message
Eclipse UserFriend
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 09:51 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Getting hidden tokens for a model element [message #1287185 is a reply to message #1287123] Mon, 07 April 2014 09:57 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Getting hidden tokens for a model element [message #1287305 is a reply to message #1287185] Mon, 07 April 2014 12:43 Go to previous messageGo to next message
Eclipse UserFriend
and maybe (if you talk about the grammar) org.eclipse.xtext.ParserRule.getHiddenTokens()
Re: Getting hidden tokens for a model element [message #1288115 is a reply to message #1287305] Tue, 08 April 2014 05:39 Go to previous messageGo to next message
Eclipse UserFriend
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 06:35 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Getting hidden tokens for a model element [message #1288212 is a reply to message #1288173] Tue, 08 April 2014 07:17 Go to previous message
Eclipse UserFriend
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: Mon Jul 14 20:12:52 EDT 2025

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

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

Back to the top