[antlr-interest] Re: Compiler design workflow - any suggestions?

lgcraymer lgc at mail1.jpl.nasa.gov
Tue May 4 17:05:48 PDT 2004


--- In antlr-interest at yahoogroups.com, Monty Zukowski <monty at c...> wrote:
... 
> The other day I realized that I could write a program to run my test 
> files through the program built with -trace turned on and collect which 
> rules were hit by which program into a database.  Then I know when I'm 
> working on a particular rule I should run those particular tests for 
> sure.
> 
> Ter's idea of using the parse tree has some merit but I would find it 
> cumbersome.  Building trees usually requires splitting rules apart 
> which would make you change your unit tests for that rule.  Actually 
> any refactoring could change the parse tree.  When I'm developing a 
> grammar I don't necessarily know where I'm going.  I know how it should 
> act on a complete program but not at the rule level, so that's how I 
> like to test.

Actually, what Ter's parse tree approach provides is stepwise
derivation output.  It's an elegant way of getting canonical output
which is useful for analysis.  I've extended it to tree grammars and
am pretty pleased with the results.  It is true that refactoring will
change the output, but that could be fixed with a comparison tool;
manual analysis is less cumbersome than you would think.  Also,
derivation output is a good step in determining line coverage for
grammars.  We need to devise some support tools, but I really do
believe that we have finally hit upon the right path for grammar testing.

--Loring



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list