Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Comment line rule in Xtext
Comment line rule in Xtext [message #63002] Sat, 25 July 2009 02:56 Go to next message
Eclipse UserFriend
Since Comment lines can appear anywhere, what is an ideal grammer to
include in the Model for accommodating this?

Should all Sections be apppended with a (COMMENT)* option?

Grammer would look too awkward if I do it like that. Any help

regards
Binu K Idicula
Re: Comment line rule in Xtext [message #63004 is a reply to message #63002] Sat, 25 July 2009 12:57 Go to previous messageGo to next message
Eclipse UserFriend
Idicula wrote:
> Since Comment lines can appear anywhere, what is an ideal grammer to
> include in the Model for accommodating this?

Xtext includes default terminals for single-line and multi-line comments
that are in the C-style.
http://www.eclipse.org/Xtext/documentation/latest/xtext.html #Defaulttokens

You can override these in your grammar by specifying a terminal rule
with the same name. If you make any terminal 'hidden', it's not
necessary to specify it in grammar rules as its token becomes hidden
from the parser.

>
> Should all Sections be apppended with a (COMMENT)* option?
>
> Grammer would look too awkward if I do it like that. Any help
>
> regards
> Binu K Idicula
>
Re: Comment line rule in Xtext [message #63006 is a reply to message #63002] Sat, 25 July 2009 12:58 Go to previous messageGo to next message
Eclipse UserFriend
Binu,

Comment lines are handled very nicely by default. See the Hidden
terminal symbols section in the docs and
http://www.eclipse.org/Xtext/documentation/0_7_0/xtext.html# Defaulttokens.

Were

you tying to customize the behavior?

Miles

On 2009-07-24 23:56:39 -0700, binu.idicula@wipro.com (Idicula ) said:

> Since Comment lines can appear anywhere, what is an ideal grammer to
> include in the Model for accommodating this?
>
> Should all Sections be apppended with a (COMMENT)* option?
>
> Grammer would look too awkward if I do it like that. Any help
>
> regards
> Binu K Idicula
Re: Comment line rule in Xtext [message #63017 is a reply to message #63002] Mon, 27 July 2009 03:13 Go to previous message
Eclipse UserFriend
Hi Idicula,

the default behaviour of Xtext for comments should work pretty fine
except from the case where you want line comments to be part of your
semantic model. If that is your use case, you should go with the
"awkward" grammar.

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

Am 25.07.2009 8:56 Uhr, schrieb Idicula:
> Since Comment lines can appear anywhere, what is an ideal grammer to
> include in the Model for accommodating this?
>
> Should all Sections be apppended with a (COMMENT)* option?
>
> Grammer would look too awkward if I do it like that. Any help
>
> regards
> Binu K Idicula
>
Previous Topic:Workflow for writing a value converter
Next Topic:Providing hover documentation
Goto Forum:
  


Current Time: Sat May 10 05:26:30 EDT 2025

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

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

Back to the top