jpl tweak
[p5sagit/p5-mst-13.2.git] / opcode.pl
index f2b876d..8eadbe7 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -1,7 +1,8 @@
 #!/usr/bin/perl
 
-unlink "opcode.h";
+unlink "opcode.h", "opnames.h";
 open(OC, ">opcode.h") || die "Can't create opcode.h: $!\n";
+open(ON, ">opnames.h") || die "Can't create opnames.h: $!\n";
 select OC;
 
 # Read data.
@@ -39,14 +40,23 @@ print <<"END";
 #define Perl_pp_i_postinc Perl_pp_postinc
 #define Perl_pp_i_postdec Perl_pp_postdec
 
-typedef enum {
 END
+
+print ON <<"END";
+/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
+   This file is built by opcode.pl from its data.  Any changes made here
+   will be lost!
+*/
+
+typedef enum opcode {
+END
+
 for (@ops) {
-    print "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
+    print ON "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
 }
-print "\t", &tab(3,"OP_max"), "\n";
-print "} opcode;\n";
-print "\n#define MAXO ", scalar @ops, "\n\n"; 
+print ON "\t", &tab(3,"OP_max"), "\n";
+print ON "} opcode;\n";
+print ON "\n#define MAXO ", scalar @ops, "\n\n"; 
 
 # Emit op names and descriptions.
 
@@ -214,6 +224,7 @@ END_EXTERN_C
 END
 
 close OC or die "Error closing opcode.h: $!";
+close ON or die "Error closing opnames.h: $!";
 
 unlink "pp_proto.h";
 unlink "pp.sym";
@@ -497,7 +508,7 @@ hslice              hash slice              ck_null         m@      H L
 unpack         unpack                  ck_fun          @       S S
 pack           pack                    ck_fun          mst@    S L
 split          split                   ck_split        t@      S S S
-join           join                    ck_fun          msT@    S L
+join           join                    ck_join         msT@    S L
 
 # List operators.
 
@@ -530,14 +541,15 @@ flop              range (or flop)         ck_null         1
 
 and            logical and             ck_null         |       
 or             logical or              ck_null         |       
-xor            logical xor             ck_null         fs|     S S     
+xor            logical xor             ck_null         fs2     S S     
 cond_expr      conditional expression  ck_null         d|      
 andassign      logical and assignment  ck_null         s|      
 orassign       logical or assignment   ck_null         s|      
 
-method         method lookup           ck_null         d1
+method         method lookup           ck_method       d1
 entersub       subroutine entry        ck_subr         dmt1    L
 leavesub       subroutine exit         ck_null         1       
+leavesublv     lvalue subroutine exit  ck_null         1       
 caller         caller                  ck_fun          t%      S?
 warn           warn                    ck_fun          imst@   L
 die            die                     ck_fun          dimst@  L
@@ -568,7 +580,7 @@ exit                exit                    ck_fun          ds%     S?
 
 # I/O.
 
-open           open                    ck_fun          ist@    F S?
+open           open                    ck_fun          ist@    F S? S?
 close          close                   ck_fun          is%     F?
 pipe_op                pipe                    ck_fun          is@     F F
 
@@ -781,3 +793,4 @@ threadsv    per-thread variable     ck_null         ds0
 
 # Control (contd.)
 setstate       set statement info      ck_null         s;
+method_named   method with known name  ck_null         d$