4 name -> male | 300#female | 500#expobj COMMA Experimental object
5 male -> title first mid last post
6 female -> titlef firstf mid lastf post
7 expobj -> firstf mid lastf | first mid last
8 first -> Joachim | Maledictus | Octavianus | Marcus | Greebo | Graham | John | Stanislaw | Bastian Baltazar | Pedro | Alfred | Gonzales 'Speedy' | Karl | Anthony | Lobsang | Niemand | Siegfried | Magdulan | Ulthen | Siricitan | Quido | Vasilij | Diabetes
9 firstf -> Jacquelinne | Melinda | Pythia | Catherine | Magrat | Granny | Esmeralda | Mona
10 last -> 5000#lastu | Trestivec | Larva | Sodny | Draselny | Melitus | Hydrogenes
11 lastf -> 5000#lastu | Trestivcova | Larvova | Sodna | Draselna | Melita | Hydrogena | Ogg | Weatherwax | Lisa
12 lastu -> Aurelius | Woshtepp | von Draczek | Portius | Simon | de Ath | Faust | Bux | Jimenez | de la Cruz | Mosquitto | Thorndyke | Smith | Marx | Crowley | O'Body | Rondevald | Umwald | Sleedill | Morbispictus
13 title -> 3000#Mgr. | 2000#Dr. | Prof. | 2000#Mg. | Sir | PUDr. | 3000#
14 titlef -> 3000#Mgr. | 2000#Dr. | Prof. | 2000#Mg. | Lady | JUDr. | 3000#
15 post -> COMMA Dr. h. c. | COMMA Laureate of Nobel Prize | COMMA Certified Idiot | COMMA Archmage | COMMA Polyhistor | 3000#
16 secretary -> firstf mid lastf sec | 100#first mid last sec
17 sec -> COMMA Secretary
18 chief -> Prof. first mid last COMMA Director of the Laboratory
19 mid -> A. | B. | C. | D. | E. | F. | G. | H. | I. | J. | K. | L. | M. | N. | O. | P. | Q. | R. | S. | T. | U. | V. | W. | X. | Y. | Z. | 26000#
23 print generate('chief'), "\n";
25 for($e=0; $e<$ee; $e++) { print generate('secretary'), "\n"; }
27 for($e=0; $e<$ee; $e++) { print generate('name'), "\n"; }
38 for $a (split(/\n/, $l)) {
39 ($a =~ /^(\w+) -> (.*)$/) || die "Invalid rule: $a";
47 my $t, $z, $r, $a, $i;
49 if ($w !~ /^\s*([.'a-zA-Z0-9_-]+)(.*)$/) {
55 if (!defined $gr{$t}) {
56 # print "Terminal <$t>\n";
61 foreach $a (split(/\|/,$r)) {
62 $z += ($a =~ /^(.*)#/) ? $1 : 1000;
66 foreach $a (split(/\|/,$r)) {
67 $z += ($a =~ /^(.*)#/) ? $1 : 1000;
68 if ($i < $z) { $A=$a; last; }
71 # print "Expanding <$t> -> <$A>\n";