[antlr-interest] Re: Automated testing of lexer/parser rules
Bharath S
payasam79 at yahoo.com
Wed Apr 7 06:27:30 PDT 2004
Hi Anar,
Thanks much for your reply. I am not generating ASTs
yet, just toying with grammar but your solution will
be valuable to me few weeks from now, for sure.
Thanks.
B.
--- anakreonmejdi <anakreonmejdi at yahoo.gr> wrote:
> --- In antlr-interest at yahoogroups.com, Bharath S
> <payasam79 at y...>
> wrote:
> > Hi Grp,
> >
> > Can somebody provide information on how to
> automate
> > the testing of lexer/parser rules? I usually put
> my
> > test cases in a text file and feed it to my main
> > program using the direction operator. I am using
> Antlr
> > in Eclipse IDE and would like to automate testing
> > using JUnit. Can someone shed some light on this?
> >
> > Thanks!
> I have developed a method for my project.
> The concept is to store the AST in a XML format, and
> test if the AST
> generated in an other time when the gramma
> definition has changed is
> the
> same as that stored in the XML format.
> The XML format looks like this:
> <ast name="METHOD_CALL" text="abs">
> <ast name="ARGLIST_VALUES">
> <ast name="IDENTIFIER" text="some_var" />
> </ast>
> </ast>
> There is one class which extends TestCase from JUnit
> which performes
> the comparasion between the AST defined in the XML
> format, and the AST
> the gramma produced from an input file.
>
> With this methodology I can test the Parsers and
> TreeParsers I've
> writen, but Lexers however are not tested directly.
>
>
>
>
>
> Yahoo! Groups Links
>
>
> antlr-interest-unsubscribe at yahoogroups.com
>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
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