Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to avoid format XBlockExpression in my DSL
How to avoid format XBlockExpression in my DSL [message #923705] Wed, 26 September 2012 05:56 Go to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Hi,

I create a grammar using XBlockExpression.
And I have own Formatter but I want to avoid my formatting rule to impact the text of XBlockExpression.
I want to keep it unchanged.

How can I do that?

Best wishes,
Oliver
Re: How to avoid format XBlockExpression in my DSL [message #926966 is a reply to message #923705] Sat, 29 September 2012 05:43 Go to previous messageGo to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Is it not supported, right?
Re: How to avoid format XBlockExpression in my DSL [message #927105 is a reply to message #926966] Sat, 29 September 2012 08:53 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-28-09 22:43, Oliver Zhou wrote:
> Is it not supported, right?
Basically no, that is not supported. You would have to create rules that
allow a flexible amount of space/linebreaks for the particular positions
in your grammar where you want the formatter to "accept text as it is".

It may be possible to override how things are fed to the formatter and
flip the "preserveWhitespace" flag while feeding the formatter the
section you want to be verbatim. (One difficulty being when the
serializer has no INode's (i.e. no source text), in which case you must
provide a default formatting.

If you are bit adventurous you could try the formatter I developed for
cloudsmith/geppetto @ github where this would be easy to achieve as it
provides both rule driven (CSS like) formatting and semantic formatting.

- henrik
Re: How to avoid format XBlockExpression in my DSL [message #930427 is a reply to message #927105] Tue, 02 October 2012 09:56 Go to previous message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Thanks for your information! Razz
Previous Topic:A warning on the performance of syntactic predicates in Xtext
Next Topic:Detect extern model changes
Goto Forum:
  


Current Time: Thu Mar 28 10:39:06 GMT 2024

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

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

Back to the top