Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » hidden(WS) - but not always
hidden(WS) - but not always [message #683339] Mon, 13 June 2011 14:38 Go to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I'm working on a CSS-Grammer and while in most parts of the CSS-Syntax
the whitespace has no meaning in a certain area. I've for now turned off
the WS-hidden and added WS all over but that clutters my grammer and
makes less easy to read.

The grammer is found on my github repository [1] and the only area where
WS has a meaning is inside the selector-rule. I'd appreciate any
pointers on how to solve it.

Tom

[1]https://github.com/tomsontom/e-fx-clipse/blob/master/at.bestsolution.efxclipse.tooling.css/src/at/bestsolution/efxclipse/tooling/css/CssDsl.xtext
Re: hidden(WS) - but not always [message #683348 is a reply to message #683339] Mon, 13 June 2011 15:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

just setting a special hidden rule to the specific parser rule as described in the docs sesction Hidden Terminal Symbols does not work?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: hidden(WS) - but not always [message #683395 is a reply to message #683339] Mon, 13 June 2011 16:45 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Tom,

you can use the hidden-clause per rule, e.g.

grammar org.mycompany.Lang with ..common.Terminals

Model:
name=QualifiedName
..
;

QualifiedName hidden():
ID ('.' ID)*
;

Did you try that?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 13.06.11 16:38, schrieb Tom Schindl:
> Hi,
>
> I'm working on a CSS-Grammer and while in most parts of the CSS-Syntax
> the whitespace has no meaning in a certain area. I've for now turned off
> the WS-hidden and added WS all over but that clutters my grammer and
> makes less easy to read.
>
> The grammer is found on my github repository [1] and the only area where
> WS has a meaning is inside the selector-rule. I'd appreciate any
> pointers on how to solve it.
>
> Tom
>
> [1]https://github.com/tomsontom/e-fx-clipse/blob/master/at.bestsolution.efxclipse.tooling.css/src/at/bestsolution/efxclipse/tooling/css/CssDsl.xtext
Re: hidden(WS) - but not always [message #684423 is a reply to message #683395] Wed, 15 June 2011 14:48 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Sebastian,

Sometimes it's just so easy. It works perfect.

Tom

Am 13.06.11 18:45, schrieb Sebastian Zarnekow:
> Hi Tom,
>
> you can use the hidden-clause per rule, e.g.
>
> grammar org.mycompany.Lang with ..common.Terminals
>
> Model:
> name=QualifiedName
> ..
> ;
>
> QualifiedName hidden():
> ID ('.' ID)*
> ;
>
> Did you try that?
>
> Regards,
> Sebastian
Previous Topic:Syntax Coloring -- cannot set color to Black
Next Topic:EObject from global scope has less information
Goto Forum:
  


Current Time: Thu Apr 25 17:10:14 GMT 2024

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

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

Back to the top