[antlr-interest] Testing ANTLR grammar as a whole.
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
> grammar and I feed the input as a test.pas file, I want the parser to
> 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
> 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,
> 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.
ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit --
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the antlr-interest