[antlr-interest] Line/char positions in C runtime

Stuart Watt SWatt at infobal.com
Tue Nov 27 07:32:03 PST 2007


Hiya,

I'm still in my early days of ANTLRing, but I've dug around the mailing
lists and can't find much help on this issue; any suggestions or pointers
very welcome.

Basically, I want to get line/character position information into the AST
when using the C runtime - and although I've found stuff on doing this in
Java, I'm not as clear about how to extend the C runtime architecture. I'm
using C so I can integrate the ANTLR parser into a Perl XS module - all this
works fine. I'm using gcc on Windows, MinGW and CDT under Eclipse. 

The good news is that all this works fine and I can get the AST into Perl
and process it there with no problems. The bad news is I have no idea how to
map the AST positioning back to the original text, which would be a big step
forward.

Any ideas or suggestions gratefully received
--Stuart


More information about the antlr-interest mailing list