|
Revision 7, 482 bytes
(checked in by oren, 8 months ago)
|
|
April 06, 2008 draft.
Implemented by YamlReference? 0.9.
Contains new productions, new examples, all the changes collected throughout
the last 3 years, and of course JSON compatibility.
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #!/usr/bin/perl -w |
|---|
| 2 | |
|---|
| 3 | use strict; |
|---|
| 4 | |
|---|
| 5 | my $lino = 0; |
|---|
| 6 | my $production = 0; |
|---|
| 7 | my $bad_productions = 0; |
|---|
| 8 | while (my $line = <>) { |
|---|
| 9 | $lino++; |
|---|
| 10 | if ($line =~ /<production id="(.*)"/) { |
|---|
| 11 | $production = $1; |
|---|
| 12 | next; |
|---|
| 13 | } |
|---|
| 14 | if ($line =~ /<lhs>(.*)<\/lhs>/) { |
|---|
| 15 | my $lhs = $1; |
|---|
| 16 | next if ($lhs eq $production); |
|---|
| 17 | warn "Line $lino: Production $production != lhs $lhs\n"; |
|---|
| 18 | $bad_productions++; |
|---|
| 19 | } |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | die("There were production/lhs mismatches\n") if ($bad_productions > 0); |
|---|