annotate udis86-1.4/libudis86/mnemonics.pl @ 1:4a9dcbd9e54f

-files of 0.13 beta -fixes so that it now compiles with the current dmd version
author marton@basel.hu
date Tue, 05 Apr 2011 20:44:01 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
1 #!/usr/bin/perl
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
2 #
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
3 # mnemonics.pl - generates mnemonic{.h,.c} from mnemonics.dat
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
4 #
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
5 # Copyright (c) 2002, 2003, 2004 Vivek Mohan <vivek@sig9.com>
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
6 # All rights reserved.
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
7 # See (LICENSE)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
8 #
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
9 #
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
10
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
11
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
12 open(mnm_c,">mnemonics.c") || die "Couldn't create mnemonics.c.";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
13 open(mnm_h,">mnemonics.h") || die "Couldn't create mnemonics.h.";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
14
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
15 print mnm_c "/* Do not edit, generated by mnemonics.pl */ \n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
16 print mnm_c "const char* ud_mnemonics[] = \n{\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
17
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
18 print mnm_h "/* Do not edit, Generated by mnemonics.pl */ \n\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
19 print mnm_h "#ifndef UD_MNEMONICS_H\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
20 print mnm_h "#define UD_MNEMONICS_H\n\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
21 print mnm_h "extern const char* ud_mnemonics[];\n\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
22 print mnm_h "enum ud_mnemonic_code \n{ \n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
23
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
24 while($mnm = <STDIN>) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
25 chop($mnm);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
26 print mnm_c " \"$mnm\",\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
27 print mnm_h " UD_I$mnm,\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
28 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
29
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
30 print mnm_c " \"I3vil\",\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
31 print mnm_h " UD_I3vil\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
32
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
33 print mnm_c "};\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
34 print mnm_h "};\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
35 print mnm_h "#endif\n";
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
36
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
37 close(mnm_c);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
38 close(mnm_h);