[antlr-interest] Debugging Tree Parser grammar using ANTLRWorks

Diehl, Matthew J matthew.j.diehl at intel.com
Fri Jun 15 17:48:57 PDT 2007


For now while the lexer debugger isn't in existence, what I have done to
help me a little bit is make a grammar with just the lexer rules.  Then
make a parser rule for each lexer rule, and then a rule with every other
rule in it.  All the extra rules are made so that when you click on the
token in the debug window, it will show you which parser (and since it's
only mapped to one lexer rule) rule it is:

 

everything

 : this

 | that

 | anotherOne

 | andThis

 | whitespace

 ;

 

this : THIS;

that : THAT;

anotherOne : ANOTHERONE;

andThis : ANDTHIS;

whitespace : WHITESPACE;

 

THIS : ....;

THAT: ....;

ANOTHERONE: ...;

ANDTHIS:...;

...etc.

 

Or something like that.  That helped me out when I was having problems.
It may not step through, but it'll tell you exactly what everything
converted to.

 

Matt

 

________________________________

From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Gavin Lambert
Sent: Friday, June 15, 2007 4:51 PM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Debugging Tree Parser grammar using
ANTLRWorks

 

At 23:13 15/06/2007, Chaudhari, Pranita, OPEE14 wrote:



I am new to ANTLRWorks need help !
 
When I am trying to debug Tree Parser Grammar, window pops up saying
"ANTLRWorks does not support debugging tree Parser Grammar". Does
AntlrWorks 1.0.2 supports it?


While on the subject of debugging wishlists, it'd be nice if AW could
debug through lexers as well.  That'd save having to write a throwaway
program to step through the generated lexer code :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070615/d3e2f106/attachment-0001.html 


More information about the antlr-interest mailing list