[antlr-interest] missing getTokenType(string) in ANTLR3C?

A Z asicaddress at gmail.com
Tue Feb 1 14:06:03 PST 2011


Hi Bastian,

  You may find these scripts useful. One creates a character array of all
the tokens, so you can index it with the token #define value to get the
string name. The second one post-processes the parser .c file to add a
rudimentary stack trace.  As Jim pointed out, you will need to move all
character strings from the parser rules to lexer rules or tokens in order to
get useful token names.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: insTree.pl
Type: application/x-perl
Size: 3360 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20110201/d0c3a201/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parseTok.pl
Type: application/x-perl
Size: 1350 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20110201/d0c3a201/attachment-0001.bin 


More information about the antlr-interest mailing list