print <<END;
#ifndef DOINIT
-EXT char *op_name[];
+EXT char *PL_op_name[];
#else
-EXT char *op_name[] = {
+EXT char *PL_op_name[] = {
END
for (@ops) {
print <<END;
#ifndef DOINIT
-EXT char *op_desc[];
+EXT char *PL_op_desc[];
#else
-EXT char *op_desc[] = {
+EXT char *PL_op_desc[] = {
END
for (@ops) {
};
#endif
+#ifndef PERL_OBJECT
START_EXTERN_C
-END
+#undef PERL_CKDEF
+#undef PERL_PPDEF
+#define PERL_CKDEF(s) OP *s _((OP *o));
+#define PERL_PPDEF(s) OP *s _((ARGSproto));
-# Emit function declarations.
+#include "pp_proto.h"
-for (sort keys %ckname) {
- print "OP *\t", &tab(3,$_),"_((OP* o));\n";
-}
+END
-print "\n";
+# Emit function declarations.
-for (@ops) {
- print "OP *\t", &tab(3, "pp_$_"), "_((ARGSproto));\n";
-}
+#for (sort keys %ckname) {
+# print "OP *\t", &tab(3,$_),"_((OP* o));\n";
+#}
+#
+#print "\n";
+#
+#for (@ops) {
+# print "OP *\t", &tab(3, "pp_$_"), "_((ARGSproto));\n";
+#}
# Emit ppcode switch array.
print <<END;
END_EXTERN_C
+#endif /* PERL_OBJECT */
#ifndef DOINIT
-EXT OP * (*ppaddr[])(ARGSproto);
+EXT OP * (CPERLscope(*PL_ppaddr)[])(ARGSproto);
#else
-EXT OP * (*ppaddr[])(ARGSproto) = {
+EXT OP * (CPERLscope(*PL_ppaddr)[])(ARGSproto) = {
END
for (@ops) {
print <<END;
#ifndef DOINIT
-EXT OP * (*check[]) _((OP *op));
+EXT OP * (CPERLscope(*PL_check)[]) _((OP *op));
#else
-EXT OP * (*check[]) _((OP *op)) = {
+EXT OP * (CPERLscope(*PL_check)[]) _((OP *op)) = {
END
for (@ops) {
print <<END;
#ifndef DOINIT
-EXT U32 opargs[];
+EXT U32 PL_opargs[];
#else
-EXT U32 opargs[] = {
+EXT U32 PL_opargs[] = {
END
%argnum = (
$argsum |= 64 if $flags =~ /d/; # danger, unknown side effects
$argsum |= 128 if $flags =~ /u/; # defaults to $_
- $flags =~ /([^a-zA-Z])/ or die qq[Opcode "$_" has no class indicator];
+ $flags =~ /([\W\d_])/ or die qq[Opcode "$_" has no class indicator];
$argsum |= $opclass{$1} << 8;
$mul = 4096; # 2 ^ OASHIFT
for $arg (split(' ',$args{$_})) {
#endif
END
+close OC or die "Error closing opcode.h: $!";
+
+unlink "pp_proto.h";
+unlink "pp.sym";
+open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
+open PPSYM, '>pp.sym' or die "Error creating pp.sym: $!";
+
+for (sort keys %ckname) {
+ print PP "PERL_CKDEF($_)\n";
+#OP *\t", &tab(3,$_),"_((OP* o));\n";
+}
+
+print PP "\n\n";
+
+for (@ops) {
+ next if /^i_(pre|post)(inc|dec)$/;
+ print PP "PERL_PPDEF(pp_$_)\n";
+ print PPSYM "pp_$_\n";
+}
+
+close PP or die "Error closing pp_proto.h: $!";
+close PPSYM or die "Error closing pp.sym: $!";
+
###########################################################################
sub tab {
local($l, $t) = @_;
padhv private hash ck_null d0
padany private something ck_null d0
-pushre push regexp ck_null /
+pushre push regexp ck_null d/
# References and stuff.
rv2cv subroutine deref ck_rvconst d1
anoncode anonymous subroutine ck_anoncode $
prototype subroutine prototype ck_null s% S
-refgen reference constructor ck_spair m0 L
-srefgen scalar ref constructor ck_null fs0 S
+refgen reference constructor ck_spair m1 L
+srefgen scalar ref constructor ck_null fs1 S
ref reference-type operator ck_fun stu% S?
bless bless ck_fun s@ S S?
# Bindable operators.
regcmaybe regexp comp once ck_fun s1 S
+regcreset regexp reset interpolation flag ck_fun s1 S
regcomp regexp compilation ck_null s| S
match pattern match ck_match d/
+qr pattern quote ck_match s/
subst substitution ck_null dis/ S
substcont substitution cont ck_null dis|
trans character translation ck_null is" S
# String stuff.
length length ck_lengthconst istu% S?
-substr substr ck_fun st@ S S S?
+substr substr ck_fun st@ S S S? S?
vec vec ck_fun ist@ S S S
index index ck_index ist@ S S S?
splice splice ck_fun m@ A S? S? L
push push ck_fun imst@ A L
-pop pop ck_shift si% A
+pop pop ck_shift s% A
shift shift ck_shift s% A
unshift unshift ck_fun imst@ A L
sort sort ck_sort m@ C? L
sysopen sysopen ck_fun s@ F S S S?
sysseek sysseek ck_fun s@ F S S
sysread sysread ck_fun imst@ F R S S?
-syswrite syswrite ck_fun imst@ F S S S?
+syswrite syswrite ck_fun imst@ F S S? S?
send send ck_fun imst@ F S S S?
recv recv ck_fun imst@ F R S S
# For multi-threading
lock lock ck_rfun s% S
-specific thread-specific ck_null ds0
+threadsv per-thread variable ck_null ds0