[antlr-interest] Re: Request enhancement ANTLR

Dennis Marsa drm at xilinx.com
Tue Jun 25 08:32:21 PDT 2002

Silvain Piree wrote:
> > Since the filename will be available from the Token itself
> > (via the new getFilename method), why pass the filename
> > as the second argument at all?  NoViableAltException can
> > retrieve it from the token on its own.
> But the suggestion was to make the getFilename() method
> an "empty" method that is optionally implemented in a
> derived Token class.
> So, you have no guarantee that the getFilename() returns
> something usefull.
> Silvain

But that's OK, isn't it?

NoViableAltException also calls Token's getLine() and
getColumn() methods which also have empty default
implementations (i.e. they return 0).

You're right that getFilename() may not return something
useful, but it could return something indicating that the
filename is not there, either an empty string, or "<no file>",
or something.



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

More information about the antlr-interest mailing list