[Newcompiler] [AST] Comments from RBParser

Andrew Tween amtween at hotmail.com
Sat Aug 5 08:36:13 UTC 2006


I haven't studied the Dolphin Formatter, I just came across it while
investigating the comment problem. Its class name is RBConfigurableFormatter, so
it might be a standard RefactoringBrowser thing. I'll e-mail you some stuff so
you can check it out
Cheers,
Andy
----- Original Message ----- 
From: "Stéphane Ducasse" <stephane.ducasse at univ-savoie.fr>
To: "The New Compiler, AST, IRBuilder,Closures..."
<newcompiler at lists.squeakfoundation.org>
Sent: Saturday, August 05, 2006 9:09 AM
Subject: Re: [Newcompiler] [AST] Comments from RBParser


Hi andy

we have been discussing with damien recently to see how we could make
gutenberg
a bit more customizable. Do you have an idea of how they cusotmize it?

In Gutenberg right now I guess that the Builder does not have enough
context to be smart,
so the smart cusotmization should be done in the visitor. This is due
to the fact that the vocabulary used
to describe the boxes (vocabulary = set of method that the builder
understand) and that are invoked by the
visitor during the traversal is limited. So may be passing a context
object to the basic vocabulary would let the pretty printer be much
smarter.


On 4 août 06, at 23:03, Andrew Tween wrote:

> Hi,
> I've had a quick look at the RBParser in VisualWorks and Dolphin
> Smalltalk, and
> the RBParser implementation in AST is a bit different to
> (behind???) both of
> them. I don't think it will take much effort to improve the current
> AST RBParser
> to make it do what you want. Attached is a changeset which might
> improve things,
> although it hasn't been tested properly, and it certainly won't
> solve all
> problems. I think that by fixing things step-by-step eventually we
> will get the
> comment handling correct.

Yes!
Stepwise....but steadily our motto :)
>
> Incidently, Dolphin has a configurable formatter/pretty printer
> that uses the
> RBParser. If you have access to an MS Windows computer, you might
> want to get
> hold of the Dolphin Community edition and take a look at its options.
>
> Cheers,
> Andy
>
> ----- Original Message -----
> From: "Mathieu Suen" <mathieusuen at yahoo.fr>
> To: "The New Compiler, AST, IRBuilder,Closures..."
> <newcompiler at lists.squeakfoundation.org>
> Sent: Friday, August 04, 2006 4:04 PM
> Subject: Re : [Newcompiler] [AST] Comments from RBParser
>
>
>> Hi,
>>
>> It is really strange how RBParse store comments.
>> And to write test for the NewCompiler is not unrefined.
>>
>> Somebody know how it is done?
>> I mean,  dose someebody use them (e.g. for pretty print,
>> coloring....) and
> have trouble with it or not? And how you use it?
>>
>> For the time being I follow the way of RBParser to write test.
>>
>> More information:
>>
>> zork
>>     ["foo" :each | each]
>>     ["bar" :each | each]
>>     ^self
>>
>> "foo" are on the  RBMethodNode but "bar" is on the RBVariableNode
>> of the
> arguments of the RBBlockNode ??
>>
>>
>> Should I follow this or do it in a better way?
>>
>> Math
>>
>>
>>
>>
>>
>>
>> <RBParserCommentsFix.1.cs>




More information about the Newcompiler mailing list