[antlr-interest] Re: woohoo! ParseTrees for free, Debugging f or me!
Terence Parr
parrt at cs.usfca.edu
Tue Dec 2 08:31:55 PST 2003
On Tuesday, December 2, 2003, at 07:01 AM, mzukowski at yci.com wrote:
> 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.
Sure...I'll combine with my TokenStreamTracker (next little goodie to
release, which is an extension / simplification of the "preserving
token order with trees" article).
> 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).
That is more functional that unit testing...unit testing in *addition*
could be good so we can more precisely identify where the problem is.
The functional testing would test more of the translation rather than
the parsing....good to have both. :)
Ter
>
> 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/
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com link sharing, pure-n-simple
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list