[antlr-interest] Re: line number counter reset

Ric Klaren klaren at cs.utwente.nl
Tue Feb 18 01:59:56 PST 2003


Hi,

On Mon, Feb 17, 2003 at 09:53:13PM -0000, tdknghi <nk.truong at student.qut.edu.au> wrote:
> Thanks a lot for your response. However, I don't think copy the line 
> number of the modifier to the type token would be appropriate. As if the 
> students type varaible declaration like below. The line number will not 
> be correct:
>    int
>        i = 5;
> 
> Do you have any further suggestions?

In some way you have to get the right line number in the right place, e.g.
by passing some extra stuff or by returning some extra values. It depends
on the rules what is easiest.

Some people adopted a strategy with an extra tree walker to number nodes
that where unitialized line number wise. Search the list archive for
details.

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
     Human beings, who are almost unique in having the ability to learn
   from the experience of others, are also remarkable for their apparent
         disinclination to do so. --- Douglas Adams, Last Chance to See


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list