Whitespace problem in comma separated list [message #756569] |
Mon, 14 November 2011 06:26  |
Eclipse User |
|
|
|
Dear xtexters,
I'm trying to specify the grammar for a comma separated list, like "[1, 2, 3]".
However, I cannot manage to solve the whitespace problem. My editor forces me to write "[1,2,3]". How do I enable some form of whitespace insensitivity?
Here is my grammar:
Array:
'[' values+=INT ((',' values+=INT)*)?']';
Thank you very much.
|
|
|
Re: Whitespace problem in comma separated list [message #756585 is a reply to message #756569] |
Mon, 14 November 2011 07:16   |
Eclipse User |
|
|
|
This is described in the documentation.
hidden(WS, SL_COMMENT, ML_COMMENT)
If you are using the default terminals, you get this out of the box. If
not, you have to make your terminals hidden (whatever you call the
hidden ones).
As an example, in my DSL, I have this:
grammar org.cloudsmith.geppetto.pp.dsl.PP hidden(WS, SL_COMMENT, ML_COMMENT)
Regards
- henrik
On 11/14/11 12:26 PM, steffen.schuette wrote:
> Dear xtexters,
>
> I'm trying to specify the grammar for a comma separated list, like "[1,
> 2, 3]".
> However, I cannot manage to solve the whitespace problem. My editor
> forces me to write "[1,2,3]". How do I enable some form of whitespace
> insensitivity?
>
> Here is my grammar:
>
> Array:
> '[' values+=INT ((',' values+=INT)*)?']';
>
>
>
> Thank you very much.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.22553 seconds