Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Handwritten formatter?
Handwritten formatter? [message #759440] Mon, 28 November 2011 16:57 Go to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Hi,
I have a couple of requirements in the formatter for Geppetto that makes
me think I am best served by writing a formatter from scratch.

I want to be able to modify the formatting rules via preferences, and
the formatter needs to make decisions based on the length of lists, and
in some cases, the actual values of things.

Has someone implemented something similar somewhere that I could take a
peek at?

Any other general advice? The IFormatter interface looks suspiciously
simple :)

Regards
- henrik
Re: Handwritten formatter? [message #759637 is a reply to message #759440] Tue, 29 November 2011 12:27 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
I looked at code, and googled for info on the topic.

This message thread:
http://dev.eclipse.org/mhonarc/lists/xtext-dev/msg00888.html and the
issue that was logged as a result of that discussion:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=313289

The thread talks about the ParseTreeConstructor, and the complication
that when it calls the formatter, there is no node model. (The issue
also mentions this, and some other cases where there is no associated
node model).

I am wondering what you think regarding the evolution of the formatter.
Is it likely to stay more or less as it is, with the addition of also
passing the current semantic object through the pipeline, or do you see
it radically changing?

- henrik

On 2011-28-11 17:57, Henrik Lindberg wrote:
> Hi,
> I have a couple of requirements in the formatter for Geppetto that makes
> me think I am best served by writing a formatter from scratch.
>
> I want to be able to modify the formatting rules via preferences, and
> the formatter needs to make decisions based on the length of lists, and
> in some cases, the actual values of things.
>
> Has someone implemented something similar somewhere that I could take a
> peek at?
>
> Any other general advice? The IFormatter interface looks suspiciously
> simple :)
>
> Regards
> - henrik
Re: Handwritten formatter? [message #760088 is a reply to message #759637] Thu, 01 December 2011 09:42 Go to previous message
Moritz Eysholdt is currently offline Moritz EysholdtFriend
Messages: 161
Registered: July 2009
Location: Kiel, Germany
Senior Member
Hi Henrik,

I'm hoping to reimplement the formatter soon, but so far other things
had a higher priority. It's bothering us, too, the that old formatter
isn't powerful enough to handle the Xtend language.

A new formatter would have access to the node model, the semantic model
and would not be restricted to the old formatters "rule engine".
Furthermore, it would work with the new serializer, since the
ParseTreeConstructor is about to be phased out.

regards,
Moritz

On 29.11.11 13:27, Henrik Lindberg wrote:
> I looked at code, and googled for info on the topic.
>
> This message thread:
> http://dev.eclipse.org/mhonarc/lists/xtext-dev/msg00888.html and the
> issue that was logged as a result of that discussion:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=313289
>
> The thread talks about the ParseTreeConstructor, and the complication
> that when it calls the formatter, there is no node model. (The issue
> also mentions this, and some other cases where there is no associated
> node model).
>
> I am wondering what you think regarding the evolution of the formatter.
> Is it likely to stay more or less as it is, with the addition of also
> passing the current semantic object through the pipeline, or do you see
> it radically changing?
>
> - henrik
>
> On 2011-28-11 17:57, Henrik Lindberg wrote:
>> Hi,
>> I have a couple of requirements in the formatter for Geppetto that makes
>> me think I am best served by writing a formatter from scratch.
>>
>> I want to be able to modify the formatting rules via preferences, and
>> the formatter needs to make decisions based on the length of lists, and
>> in some cases, the actual values of things.
>>
>> Has someone implemented something similar somewhere that I could take a
>> peek at?
>>
>> Any other general advice? The IFormatter interface looks suspiciously
>> simple :)
>>
>> Regards
>> - henrik
>
Previous Topic:Grammar question
Next Topic:[xtext 2.0] protected region support?
Goto Forum:
  


Current Time: Fri Apr 03 02:23:53 GMT 2020

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

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

Back to the top