8 if (/^\s*\#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)\s+(.*\S)\s*/) {
12 if (exists $names{$opcode}) {
13 $names{$opcode} .= "/$name";
15 $names{$opcode} .= $name;
20 print "#include <stdlib.h>\n";
21 print "#include <biff-types.h>\n";
23 print "const char *\n";
24 print "biff_opcode_name (unsigned int opcode)\n";
26 print " switch (opcode) {\n";
27 foreach my $opcode (sort keys %names) {
28 my $name = $names{$opcode};
29 print " case $opcode: return \"$name\";\n";
31 print " default: return NULL;\n";