[antlr-interest] rewrites to capture tree structure and original text

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Sat Oct 8 02:54:11 PDT 2011


On 10/7/11 11:12 PM, "Jim Idle" <jimi at temporal-wave.com> wrote:

> You don't need to do this. If you want the text that makes up that part of
> the tree, you can use the start and end tokens in the tree parser and
> write a few lines of java that will give you the text. Placing it in the
> tree is just duplicating it.

Hi Jim,
Hi Terence,

Actually I want only underline point I already have expressed before.

I think, that ANTLR should include such utility methods.
Users of ANTLR should not invent each time such "simple" algs.

Set of this algs can be and should be official and fixed and documented and
be consistent for all targets

Java

String  JointTextOfTokens(
    Token inStartToken,
    Token inEndToken )
{

}



c:

pANTLR3_STRING  JointTextOfTokens(
    Token* inStartToken,
    Token* inEndToken )
{

}



This can save many hours to users of your product.



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the antlr-interest mailing list