[antlr-interest] Re: woohoo! ParseTrees for free, Debugging f or me!

mzukowski at yci.com mzukowski at yci.com
Tue Dec 2 07:01:11 PST 2003


This is really cool!  Any chance of getting the actual tokens matched by the
rule in that derivation?  That's the other thing I look at when using
-traceParser.  

As for a test harness--yeah, that's cool for just doing parsers, but my
preferred approach, a la the GCC toolkit
http://www.codetransform.com/gcc.html, is to go from source to source and
then make sure you've got the same thing (minus some whitespace).

Monty

-----Original Message-----
From: Terence Parr [mailto:parrt at cs.usfca.edu] 
Sent: Sunday, November 30, 2003 10:07 AM
To: antlr-interest at yahoogroups.com
Subject: Re: [antlr-interest] Re: woohoo! ParseTrees for free, Debugging for
me!



On Sunday, November 30, 2003, at 12:16  AM, lgcraymer wrote:

> --- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...>
> wrote:
>>
>> On Saturday, November 29, 2003, at 10:16  PM, lgcraymer wrote:
>>
>>> Ter--
>>>
>>> If I interpret this right, you're actually visualizing parse
> trees
>>> without generating them.
>>
>> Nope, i build parse trees and then rewalk them to get step i of 
>> derivation.  You can ask for any intermediate step or all of 'em :)
>
> That is impressive, then--you've discovered a whole new approach to 
> instrumenting ANTLR.  I assume that you've made the overrides user 
> programmable?

Well, for now it's just an "article" on the website with some sample 
code...later we'd have to allow people to specify their own parse tree 
nodes instead of my simple ones...  As for user programmable, for now, 
you can turn on or off by adding the overrides and turning on/off 
-traceParser.

>   It sounds like an approach that might support an
> ANTLR test harness for grammars.

Heh yeah!  That's a great idea, dude!  Sweet!  This way we can check to 
see if all derivation steps are identical.  Previously, testing parsers 
was really hard as it says yes or no depending on errors; that's all.   
  Answering "yes" is not much of a test as an empty main program gives 
the same answer. ;)  Yeah!  This is the testing harness I've been 
afraid would be extremely difficult!  We've got it, by jove!

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list