#!/usr/local/bin/perl -w # Generate test data for a recursive-descent interpreter. # # $0 section >outputfile # # The section argument is used in the generated test data. # The Perl program is available for free download from www.perl.hip.com # -IAN! idallen@freenet.carleton.ca die("Missing section argument\n ") unless $section = shift; $anum = ord("a"); $a = "a$section" x 64 . "_END"; $b = "b$section" x 64 . "_END"; $c = "c$section" x 64 . "_END"; print "\nSimple_Identifier_Length_Testing = AOK___________________ ; \n\n"; print "SectionA$section=$a;\n"; print "SectionB$section=$b;\n"; print "SectionC$section=$c;\n"; print "\nAdvanced_Identifier_Length_Testing = AOK___________________ ; \n\n"; for ( $i=0; $i < 26; $i++ ) { $count = $i + $anum; $let = chr($count); $str = $count x $count; print "${let}_${count} =\n ${let}_${count}_${str}_${let}_END ;\n"; } for ( $i=25; $i >= 0; $i-- ) { $count = $i + $anum; $let = chr($count); $str = $count x $count; print "${let}_${count} =\n ${let}_${count}_${str}_${let}_END ;\n"; } print "\nNested_Parentheses_Testing = AOK___________________ ; \n\n"; for ( $i=0; $i < 26; $i++ ) { $count = $i + $anum; $let = chr($count); $str1 = "\n ( $a + " x $count; $str2 = "$b )\n * " x $count; print "${let}_${count} = $str1$str2$c ;\n"; } print "\nSimple_Identifier_Length_Testing = AOK___________________ ; \n\n"; print "$a=1;\n"; print "$b=2;\n"; print "$c=3;\n"; print "SectionA$section=$a;\n"; print "SectionB$section=$b;\n"; print "SectionC$section=$c;\n"; print "\nEnd_Of_Testing = AOK___________________ ; \n\n";