[antlr-interest] Testing ANTLR grammar as a whole.

Anthony Youngman Anthony.Youngman at ECA-International.com
Thu May 6 01:31:18 PDT 2004


Hi Monty,

Sounds like DATABASIC :-) as used by AREV :-)

Dunno about AREV, but most modern implementations allow you write
"one-liners" that you shove in a DICTionary entry.

Cheers,
Wol 

-----Original Message-----
From: Bharath S [mailto:bharath at starthis.com] 
Sent: 05 May 2004 16:45
To: antlr-interest at yahoogroups.com
Subject: RE: [antlr-interest] Testing ANTLR grammar as a whole.



Hi Monty,

I am writing a compiler for a language that does not have single entry
point
as such. It just contains statements which get used within function
bodies
or program bodies. 

As an example, in a java application, you need to have a class
definition
and a main function in atleast one of your java files. There is no such
requirement in this language and it can be treated as a language used to
write macros or small blocks of code.

Thanks much,

Bharath.
 

-----Original Message-----
From: Monty Zukowski [mailto:monty at codetransform.com] 
Sent: Wednesday, May 05, 2004 10:28 AM
To: antlr-interest at yahoogroups.com
Cc: Monty Zukowski
Subject: Re: [antlr-interest] Testing ANTLR grammar as a whole.

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



 





 
Yahoo! Groups Links



 





****************************************************************************

This transmission is intended for the named recipient only. It may contain private and confidential information. If this has come to you in error you must not act on anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, or show it to anyone. Please e-mail the sender to inform us of the transmission error or telephone ECA International immediately and delete the e-mail from your information system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2 9911 7799, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

****************************************************************************



 
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