- next unless s/^%(token|type)\s+<opval>\s+//;
- $tokens{$_} =1 for (split ' ', $_);
+ if (/(\$\d+)\s*=/) {
+ warn "$y_file:$.: dangerous assignment to $1: $_";
+ }
+
+ if (/__DEFAULT__/) {
+ m{(\w+) \s* ; \s* /\* \s* __DEFAULT__}x
+ or die "$y_file: can't parse __DEFAULT__ line: $_";
+ die "$y_file: duplicate __DEFAULT__ line: $_"
+ if defined $default_token;
+ $default_token = $1;
+ next;
+ }
+
+ next unless /^%(token|type)/;
+ s/^%(token|type)\s+<(\w+)>\s+//
+ or die "$y_file: unparseable token/type line: $_";
+ $tokens{$_} = $2 for (split ' ', $_);
+ $types{$2} = 1;