[antlr-interest] Implementing 'include' directive and giving coherent filenames when parsing

amartinez at atc.ugr.es amartinez at atc.ugr.es
Mon Jun 25 08:39:56 PDT 2007


Hello,
I'm implementing the include directive for a simple assembler using ANTLR V3.

Everything goes right except that I don't know how to calculate at the
parser, which filename (from include "filename") gives the error.

At the Parser level, I know how to work with the line, column, StartIndex
and StopIndex (of a IToken) attributes for every parsing error. How could
I retrieve the filename?

Note:
I had successfull when translating into C# the Terence sample:
http://www.antlr.org/wiki/pages/viewpage.action?pageId=557057
I'm interested on this ANTLR target.

Regards.

--
Antonio Martínez


More information about the antlr-interest mailing list