[antlr-interest] Testing ANTLR grammar as a whole.
Monty Zukowski
monty at codetransform.com
Wed May 5 08:28:22 PDT 2004
On May 5, 2004, at 8:18 AM, Bharath S wrote:
> If I wanted to test the antlr grammar as a whole instead of testing
> individual rules, should I rewrite my rules such that the first rule
> that I
> call is the combination of all other rules? For example, if I have a
> pascal
> grammar and I feed the input as a test.pas file, I want the parser to
> test
> the entire *.pas file for syntax instead of providing command line
> input to
> test each rule individually.
>
That's what I do.
> I saw the pascal grammar at antlr.org and it has one single rule called
> "program heading" which seems to be highest rule in the hierarchy. To
> follow
> the same approach, I have to rewrite my rules. Is there any other
> option by
> which I can test my entire program instead of just individual rules,
> without
> rewriting the existing grammar?
Most parsers I've worked with have one entry point for an entire
program. What kind of a grammar are you writing that has lots of
different entry points? What drives your parser? Is it what decides
which rule to call? If so, figure out a way to script it so it does
all the different rule calling.
Monty Zukowski
ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit --
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
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