[NewCompiler] Comment, what do we want to see?

Marcus Denker denker at iam.unibe.ch
Tue Sep 26 09:55:34 UTC 2006


On 18.09.2006, at 04:42, Mathieu Suen wrote:

> Hi,
>
> Now I am close to give you a way of geting back comment.
> To do so I provide a linked list of token and a stream to navigate  
> through it.
>
> I have disscusse with Damien Pollet who is doing gutenberg and  
> Stephane. So we have thought about a
> interface on the RBNode:
>
> 1. A method to get back comment befor:
>
> 	"a comment for statementA"
> 	statementA
>
> 2. Amethod to get comment after:
>
> 	statementA. "comment for statementA"
> 	"this one belong to the next node"
>
> Do you see somthing else?

I don't think so...

>
> I have a difficulty:
>
> Suppose you have this:
> --
> methodeA: bob
>
> 	"ok for this one"
> 	^[] "can get this one"
> --
>
> The last comment is a bit difficult to catch beceause in the  
> statement above we don't have token
> inside. So we can't navigate through it.
>
> The only way I see to get back is to put first/last token at parse  
> time but do we really want this?
>
> (we have the same problem with RBArrayNode if you write: {})
>
> Thanks for any comments  :)
>

Maybe we could add a king of a Token (maybe even a node) representing  
"nothing" in this case?

     Marcus



More information about the Newcompiler mailing list