6 parse('builtins','DATA');
11 $x= new IO::File $_,'r';
17 while (defined($_= $f->getline)) {
18 chomp; s/^\s+//; s/\s+$//;
21 s/\t/ ' 'x(8-(length $`) % 8) /eg;
24 $this_indent= length $&;
25 while (@i && $this_indent < $i[0]) { shift @i; }
26 if ($this_indent && (!@i || $this_indent > $i[0])) {
27 unshift @i, $this_indent;
30 if (@i==0 && m/^Table\s+(\w+)$/) {
33 } elsif (@i==1 && m/^([a-z]\w*)$/ && defined $c_table) {
35 $tables{$c_table}{$c_entry}{A} = [ ];
36 } elsif (@i==2 && m/^(?:\?)?([a-z]\w*)\s.*(\S.*)/
37 && defined $c_entry) {
38 push @{ $tables{$c_table}{$c_entry}{A} }, [ $2, $3, $1 eq '?' ];
39 } elsif (@i==2 && m/^\=\>\s.*(\S.*)/ && defined $c_entry) {
40 $tables{$c_table}{$c_entry}{R}= $1;
41 } elsif (@i==2 && m/^\.\.\.$/ && defined $c_entry) {
42 $tables{$c_table}{$c_entry}{V}= 1;
43 } elsif (@i==0 && s/^Type\s+$//) {
45 ($typename,$_)= ($1,$2);
46 $_ .= '@' unless m/\@/;
47 $types{$typename}= $_;
49 badsyntax($wh,$., sprintf
50 "bad directive (indent level %d)", scalar @i);
57 print Dumper(\%tables),"\n";
58 print Dumper(\%types),"\n";
61 die "$_[0]:$_[1]: $_[2]\n";