#!/usr/bin/perl
+chmod 0666, "opcode.h", "opnames.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";
$i = 0;
print <<"END";
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by opcode.pl from its data. Any changes made here
will be lost!
*/
END
print ON <<"END";
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by opcode.pl from its data. Any changes made here
will be lost!
*/
}
print ON "\t", &tab(3,"OP_max"), "\n";
print ON "} opcode;\n";
-print ON "\n#define MAXO ", scalar @ops, "\n\n";
+print ON "\n#define MAXO ", scalar @ops, "\n";
+print ON "#define OP_phoney_INPUT_ONLY -1\n";
+print ON "#define OP_phoney_OUTPUT_ONLY -2\n\n";
# Emit op names and descriptions.
for (@ops) {
my($safe_desc) = $desc{$_};
- # Have to escape double quotes and escape characters.
+ # Have to escape double quotes and escape characters.
$safe_desc =~ s/(^|[^\\])([\\"])/$1\\$2/g;
print qq(\t"$safe_desc",\n);
open PPSYM, '>pp.sym' or die "Error creating pp.sym: $!";
print PP <<"END";
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by opcode.pl from its data. Any changes made here
will be lost!
*/
print PPSYM <<"END";
#
-# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is built by opcode.pl from its data. Any changes made here
# will be lost!
#
# String stuff.
length length ck_lengthconst isTu% S?
-substr substr ck_fun st@ S S S? S?
+substr substr ck_substr st@ S S S? S?
vec vec ck_fun ist@ S S S
index index ck_index isT@ S S S?
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
+leavesublv lvalue subroutine return ck_null 1
caller caller ck_fun t% S?
warn warn ck_fun imst@ L
die die ck_fun dimst@ L
iter foreach loop iterator ck_null 0
enterloop loop entry ck_null d{
leaveloop loop exit ck_null 2
-return return ck_null dm@ L
+return return ck_return dm@ L
last last ck_null ds}
next next ck_null ds}
redo redo ck_null ds}
# I/O.
-open open ck_open ist@ F S? L
+open open ck_open ismt@ F S? L
close close ck_fun is% F?
pipe_op pipe ck_fun is@ F F