[antlr-interest] Printing parser rule names

Jono Juggler jono at mail2Juggler.com
Sun Jan 28 13:50:54 PST 2007


Hello,

I need a way to count the number of function calls, if statements, etc
in source code. I am using several languages, but I am starting with the
java.g grammar. If DumpASTVisitor printed the names of the parser rules
instead of the token type, that would be fine.

I know I can edit the grammar file to add print statements into each
rule, but I would rather not since I am going to be using more then one
language.

I have done the getting started tutorial, and taken a quick look at the
API, but I have not found a way to print the names of the rules.

Any ideas?
Thanks.



FHA Home Loan Rates, Compare Rates
Refinance your FHA home loan today. Get 4 quotes from leading lenders!
<http://tagline.bidsystem.com/fc/MhtXpK1Q3oPXyfCgKIX5RyVPFbOH2LnBL8ZVU/>


<span id=m2wTl><p><font face="Arial, Helvetica, sans-serif" size="2" style="font-size:13.5px">_______________________________________________________________<BR>Get the Free email that has everyone talking at <a href=http://www.mail2world.com target=new>http://www.mail2world.com</a><br>  <font color=#999999>Unlimited Email Storage &#150; POP3 &#150; Calendar &#150; SMS &#150; Translator &#150; Much More!</font></font></span>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070128/34376d8d/attachment.html 


More information about the antlr-interest mailing list