[antlr-interest] Re: Token.getFilename and Token.setFilename are not virtual!

Rodrigo B. de Oliveira rodrigobamboo at hotmail.com
Sun Aug 3 17:43:40 PDT 2003

> I had a similar problem when developing my java project (with the
> charScanner; all java methods are virtual). Token.setFilename is
> neither called from the CharScanner on java mode. After asking in the
> forums, the answer I got was that setFilename wasn't invoked "because
> your tokens may not come from a file".

Funny. And why both the lexer and the parser hold a filename then? Just
it's called filename I hope it doesn't mean I'm not allowed to set it to
like <script> ou http://foo.bar/test.boo :-)

> This answer did not satisfy me; when I was going to modify ANTLR's
> sources, someone pointed that I could override CharScanner::makeToken
> (supposing that the java and C# classes use the same method names) and
> add the filename in my Lexer. I suppose you could do the same in C#.
> Even if the possibility exists, I'd like to see the filename set in
> makeToken.

Yes, me too. It belongs there.



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

More information about the antlr-interest mailing list