[antlr-interest] Line number in C#

Micheal J open.zone at virgin.net
Wed Aug 24 10:25:21 PDT 2005


What does "except it's not coming back on the other end" mean?
 
What is the other end. Once you get your tree back from the parser, use the
ideas from the ASTFrame sample (or a debugger) to convince your self that
the AST really does have the line number.
 
For ASTFrame use, you might need to override ToString() to show line numbers
too.
 
Cheers,
 
Micheal
ANTLR/C#

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Ipemail at aol.com
Sent: 24 August 2005 13:49
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Line number in C#


> public class LineNumberAST : CommonAST
> {
>    private int _line;
>    private int _col;
<snip>

Thank you.

I'm sure it's something I'm doing but it's still returning the default
values at the end. Changing initialize(Token tok) to initialize(IToken tok)
made the compiler happy and _line = tok.getLine(); sets the correct line
number, except it's not coming back on the other end. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050824/19ff327b/attachment.html


More information about the antlr-interest mailing list