[antlr-interest] ANTLR & Testing: Experiences and Practices?

Matthew Ford Matthew.Ford at forward.com.au
Wed Nov 6 09:24:11 PST 2002


Hi micheal,
Here is V1.1 of CodeSections which will allow you to handle multiple
versions of the code in the same file.
I use it for multiple versions tree walkers and for private/public versions
of C code.  I also use it to optionally add debugging code.

There are two version of CodeSections.  A commandline version and an Ant
version (both in the same src file ofcourse)  See the CodeSections.cs file
for details.


regards
matthew

Mods:
V1.1 27th October 2002 allow alternate names for same code section (see
testin.cs for examples)
V1.0 26th October 2002 initial release


--------------------------
Input File Format
--------------------------
alternative code sections start with
<<id>>=
starting in col1 and followed by alternative code seciton ids or whitespace
and is termimated by a newline
where id is  $ alpha or underscore followed by $ alpha,underscore or digits
(a Java identifier)
spaces are NOT allowed within id or between << id and >>=

sections continue until next section or EOF

<<*>>=
is the default section that is always output

To output other code sections list the id's of the sections to be output in
the arguments

java -jar CodeSections inputFile outFile [ids]*

If there are no ids listed just the <<*>>= sections will be output.

If you ask for an id that does not exist in the input file a warning is
printed on
System.out

See this file and the testin.cs for examples



----- Original Message -----
From: "micheal_jor" <open.zone at virgin.net>
To: <antlr-interest at yahoogroups.com>
Sent: Thursday, November 07, 2002 3:44 AM
Subject: [antlr-interest] ANTLR & Testing: Experiences and Practices?


> Hi,
>
> I'm trying to think (and hack) my way to a coherent *automatic*
> testing regime/harness for ANTLR-generated parsers and the C# codegen
> (separately of course). We have parsers in all the languages
> supported by ANTLR - C++, C# and Java.
>
> If you have found a testing solution that works for you - perhaps
> using xUnit and/or Bogdan Mitu's tester.zip - I'll be grateful for a
> description of the solution and perhaps a sample that demonstrates
> how you make it all work for you.
>
> Thanks,
>
> Micheal
>
> PS    What other tools/techniques have you found that make working
> with ANTLR (and parser generators or compiler development in general)
> more fun/efficient/productive?
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CodeSectionsV1_1.zip
Type: application/x-zip-compressed
Size: 13670 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20021107/349c1795/CodeSectionsV1_1.bin


More information about the antlr-interest mailing list