diff options
-rw-r--r-- | Bugs/minmax | 12 | ||||
-rw-r--r-- | Bugs/misparse | 2 | ||||
-rw-r--r-- | Bugs/pagdir | 24 | ||||
-rw-r--r-- | Bugs/replacecase | 1 | ||||
-rw-r--r-- | Bugs/stuff | 64 | ||||
-rw-r--r-- | Changes | 65 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | Todo | 37 | ||||
-rwxr-xr-x | bar | 6 | ||||
-rw-r--r-- | config.sh | 4 | ||||
-rw-r--r-- | cop.h | 2 | ||||
-rw-r--r-- | doio.c | 8 | ||||
-rw-r--r-- | doop.c | 26 | ||||
-rw-r--r-- | dump.c | 101 | ||||
-rw-r--r-- | eg/uudecode | 15 | ||||
-rw-r--r-- | embed.h | 17 | ||||
-rwxr-xr-x | foo | 4 | ||||
-rw-r--r-- | global.var | 1 | ||||
-rw-r--r-- | gv.c | 130 | ||||
-rw-r--r-- | hv.c | 2 | ||||
-rw-r--r-- | hv.h | 2 | ||||
-rw-r--r-- | interp.var | 8 | ||||
-rw-r--r-- | keywords.h | 324 | ||||
-rw-r--r-- | lib/ctime.pl | 2 | ||||
-rw-r--r-- | lib/open3.pl | 105 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | make.out | 4 | ||||
-rw-r--r-- | makefile | 29 | ||||
-rw-r--r-- | mg.c | 186 | ||||
-rw-r--r-- | op.c | 350 | ||||
-rw-r--r-- | op.h | 2 | ||||
-rw-r--r-- | opcode.h | 668 | ||||
-rwxr-xr-x | opcode.pl | 26 | ||||
-rw-r--r-- | perl.c | 177 | ||||
-rw-r--r-- | perl.h | 60 | ||||
-rw-r--r-- | perly.c | 3678 | ||||
-rw-r--r-- | perly.c.byacc | 2295 | ||||
-rw-r--r-- | perly.c.diff | 170 | ||||
-rw-r--r-- | perly.c.yacc | 1767 | ||||
-rwxr-xr-x | perly.fixer | 7 | ||||
-rw-r--r-- | perly.h | 97 | ||||
-rw-r--r-- | perly.h.yacc | 56 | ||||
-rw-r--r-- | perly.y | 28 | ||||
-rw-r--r-- | pp.c | 585 | ||||
-rw-r--r-- | pp.h | 2 | ||||
-rw-r--r-- | predump | 41 | ||||
-rw-r--r-- | proto.h | 655 | ||||
-rw-r--r-- | regcomp.c | 10 | ||||
-rw-r--r-- | scope.c | 2 | ||||
-rw-r--r-- | sv.c | 100 | ||||
-rw-r--r-- | sv.h | 2 | ||||
-rw-r--r-- | sv_append_till | 39 | ||||
-rwxr-xr-x | t/cmd/subval.t | 32 | ||||
-rwxr-xr-x | t/foo | 8 | ||||
-rwxr-xr-x | t/op/local.t | 4 | ||||
-rwxr-xr-x | t/op/my.t | 46 | ||||
-rwxr-xr-x | t/op/ref.t | 4 | ||||
-rw-r--r-- | toke.c | 397 | ||||
-rwxr-xr-x | usub/tus | 488 | ||||
-rwxr-xr-x | usub/tuv | 161 | ||||
-rw-r--r-- | usub/typemap | 228 | ||||
-rw-r--r-- | util.c | 10 | ||||
-rwxr-xr-x | x2p/find2perl.SH | 6 |
63 files changed, 10178 insertions, 3207 deletions
diff --git a/Bugs/minmax b/Bugs/minmax deleted file mode 100644 index 4251f81587..0000000000 --- a/Bugs/minmax +++ /dev/null @@ -1,12 +0,0 @@ -#!./perl - -sub minmax { - eval '@_ = sort { $a '.shift().' $b } @_'; - (shift, pop(@_)); -} - -($x, $y) = &minmax('<=>', 2, 4, 1, 0, 3); -print "x = $x, y = $y\n"; -($x, $y) = &minmax('cmp', "foo", "bar", "zot", "xyzzy"); -print "x = $x, y = $y\n"; - diff --git a/Bugs/misparse b/Bugs/misparse deleted file mode 100644 index a76710cdce..0000000000 --- a/Bugs/misparse +++ /dev/null @@ -1,2 +0,0 @@ -print STDERR "Can't open $mib_name: $!\n" -&objviews'Exit; diff --git a/Bugs/pagdir b/Bugs/pagdir new file mode 100644 index 0000000000..7cc76f2b51 --- /dev/null +++ b/Bugs/pagdir @@ -0,0 +1,24 @@ +Article 433 of comp.os.386bsd.apps: +Path: netlabs!news.cerf.net!usc!howland.reston.ans.net!spool.mu.edu!bloom-beacon.mit.edu!ai-lab!life.ai.mit.edu!mycroft +From: mycroft@trinity.gnu.ai.mit.edu (Charles Hannum) +Newsgroups: comp.os.386bsd.apps +Subject: Re: Perl-4.036? +Date: 06 Sep 1993 19:01:10 GMT +Organization: MIT Artificial Intelligence Lab +Lines: 9 +Message-ID: <MYCROFT.93Sep6150110@trinity.gnu.ai.mit.edu> +References: <26fptu$1q1@terminator.rs.itd.umich.edu> <26fve4$ivf@homer.cs.mcgill.ca> +NNTP-Posting-Host: trinity.gnu.ai.mit.edu +In-reply-to: storm@cs.mcgill.ca's message of 6 Sep 1993 18:27:16 GMT + + + Perl 4.036 comipled without a single hitch under NetBSD 0.9 last + week. It failed the db test, but I suspect that is due to the new + db stuff under NetBSD and the like... + +Yes. The perl test seems to expect the database to be put in +`foo.pag' and `foo.dir', which isn't the case any more. I suspect +lwall will fix this soon. + + + diff --git a/Bugs/replacecase b/Bugs/replacecase new file mode 100644 index 0000000000..795ea9db46 --- /dev/null +++ b/Bugs/replacecase @@ -0,0 +1 @@ +s/\w/[\u$&\l$&]/gi; diff --git a/Bugs/stuff b/Bugs/stuff new file mode 100644 index 0000000000..3337af01e2 --- /dev/null +++ b/Bugs/stuff @@ -0,0 +1,64 @@ +Article 13355 of comp.lang.perl: +Newsgroups: comp.lang.perl +Path: netlabs!news.cerf.net!usc!cs.utexas.edu!uunet!fmrco!fmrco!asherman +From: asherman@fmrco.com (Aaron Sherman) +Subject: Re: perl 5a2 cannot "die" (plus current list o' bugs) +In-Reply-To: wjm@feenix.metronet.com's message of Fri, 20 Aug 1993 21:32:10 GMT +Message-ID: <ASHERMAN.93Aug23094250@uboat.fmrco.com> +Sender: news@fmrco.uucp +X-Quote: "...accepting is much harder than giving." -Mike Smith +Reply-To: asherman@fmrco.COM +Organization: I-Kinetics, 19 Bishop-Allen Dr., Cambridge, MA +References: <ASHERMAN.93Aug20102959@uboat.fmrco.com> <CC2uHM.6Hq@feenix.metronet.com> +Date: Mon, 23 Aug 1993 14:42:50 GMT +Lines: 47 + + +>>>>> wjm@feenix.metronet.com (Bill Middleton) said: + +wjm> asherman@fmrco.COM writes: + +>An interesting pair of bugs can be seen in the following output: + +wjm> I dont think so. Could be in the compilation or something. Did it +wjm> pass all tests? Each of the following work fine here on this HP. + +I tried compiling with Sun's native CC and GCC. Both worked fine, but +caused this problem. I'll try it with Larry's original version when I +get a chance. + +wjm> perl5 -e 'die "hello $. \n"; +wjm> hello + +Ah. But, note that the $. STILL isn't working. So only ONE of those +bugs did not show. + +This is my current list of bugs (not complete, but what I've had time +to note). Hope it helps: + +"perl -e die" will cause a seg-fault + +$. is not updated + +Memory leak for anonymous arrays: + while(1) { @a = (1, 2, 3, [4, 5], 6); @a = (); } + Will keep allocating and not freeing memory. + +"perl -e 'sub foo {print 1} foo'" should either complain or call foo, + but does neither. Or, did Larry not impliment the &-less + function calling that he was talking about? + +"perl -le 'sub foo {1} $a = \&foo; print &{$a}; print &{$a} + 1'" should + not fail to parse. + + + -AJS + +-- +Aaron Sherman I-Kinetics, Inc. +Systems Engineer "Open Systems Stepstones" +Voice: (617)661-8181 19 Bishop Allen Dr. +Fax: (617)661-8625 Cambridge, MA 02139 +Pager: (508)545-0584 asherman@i-kinetics.com + + @@ -1,18 +1,75 @@ - +Incompatibilities +----------------- s'$lhs'$rhs' now does no interpolation on either side. It used to interplolate $lhs but not $rhs. The second and third arguments of splice are now evaluated in scalar context (like the book says) rather than list context. - Saying shift @foo + 20 is now a semantic error. + Saying "shift @foo + 20" is now a semantic error because of precedence. + + "open FOO || die" is now incorrect. You need parens around the filehandle. The elements of argument lists for formats are now evaluated in list - context. + context. This means you can interpolate list values now. - You can't do a goto into a block that is optimized away. + You can't do a goto into a block that is optimized away. Darn. It is no longer syntactically legal to use whitespace as the name of a variable. Some error messages will be different. + + The caller function now a false value in a scalar context if there is + no caller. This lets library files determine if they're being required. + + m//g now attaches its state to the searched string rather than the + regular expression. + +New things +---------- + The -w switch is much more informative. + + References. See t/op/ref.t for examples. + + Objects. See t/op/ref.t for examples. + + => is now a synonym for comma. This is useful as documentation for + arguments that come in pairs, such as initializers for associative arrays, + or named arguments to a subroutine. + + All functions have been turned into list operators or unary operators, + meaning the parens are optional. Even subroutines may be called as + list operators if they've already been declared. + + More embeddible. See main.c and embed_h.SH. + + The interpreter is now flattened out. Compare Perl 4's eval.c with + the perl 5's pp.c. Compare Perl 4's 900 line interpreter loop in cmd.c + with Perl 5's 1 line interpreter loop in run.c. Eventually we'll make + everything non-blocking so we can interface nicely with a scheduler. + + eval is now treated more like a subroutine call. Among other things, + this means you can return from it. + + Format value lists may be spread over multiple lines by enclosing in + curlies. + + You may now define BEGIN and END subroutines for each package. The BEGIN + subroutine executes the moment it's parsed. The END subroutine executes + just before exiting. + + Flags on the #! line are interpreted even if the script wasn't + executed directly. (And even if the script was located by "perl -x"!) + + The ?: operator is now legal as an lvalue. + + List context now propagates to the right side of && and ||, as well + as the 2nd and 3rd arguments to ?:. + + The "defined" function can now take a general expression. + + Lexical scoping available via "my". eval can see the current lexical + variables. + + Saying "package;" requires explicit package name on global symbols. @@ -360,6 +360,7 @@ shlist: # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE $(obj) hv.o: @ echo "You haven't done a "'"make depend" yet!'; exit 1 + makedepend: makedepend.SH /bin/sh $(shellflags) makedepend.SH @@ -1,18 +1,31 @@ +POSIX compatibility +hash binding +pack(P) +fix gv refcnts + +/\Afoo/ (beginning of string, or where previous g match left off) +/foo\Z/ (end of string only) +Make specialized allocators +Optimize switch statements +Optimize foreach on array +Optimize foreach (1..1000000) Set KEEP on constant split -Optimize foreach on array. -Execute all BEGINs and ENDs. -Make a good way to determine if *.pl is being executed directly. -Make specialized allocators. -Optimize switches. -Do debugger -Cache eval tree -Implement eval once -Cache m//g state +Cache eval tree (unless lexical outer scope used (mark in &compiling?)) rcatmaybe -Fix length($&) -eval {} coredump +Cache method lookup +Shrink opcode tables via multiple implementations selected in peep +Straighten out the RS stuff in BEGIN +Make yyparse recursion longjmp() proof. +sub mysplice(@, $, $, ...)? +pretty function? (or is it, as I suspect, a lib routine?) +perlex function? +X Perl? Motif Perl? +give DOG $bone? +Nested destructors? make tr/// return histogram in list context? -Do anything with "hint"? +Implement eval once? (Unnecessary with cache?) When does split() go to @_? undef wantarray in void context? +goto &coroutine? +filehandle references? @@ -1 +1,5 @@ -############################################################################### +#!./perl + +sub foo; + +foo; @@ -233,8 +233,8 @@ medium='' large='' huge='' optimize='-g' -ccflags=' -I/usr/include/sun -I/usr/ucbinclude -DDEBUGGING' -cppflags=' -I/usr/include/sun -I/usr/ucbinclude -DDEBUGGING' +ccflags='-DDEBUGGING' +cppflags='-DDEBUGGING' ldflags='' cc='cc' nativegcc='' @@ -49,6 +49,7 @@ struct cop { struct ccop ccop; /* compound command */ struct scop scop; /* switch command */ } uop; + U32 cop_seq; /* parse sequence number */ short cop_slen; /* len of cop_short, if not null */ VOL short cop_flags; /* optimization flags--see above */ HV * cop_stash; /* package line was compiled in */ @@ -70,6 +71,7 @@ struct block_sub { GV * defgv; AV * savearray; AV * argarray; + AV * comppad; U16 olddepth; U8 hasargs; }; @@ -236,7 +236,7 @@ I32 len; } } if (!fp) { - if (dowarn && io->type == '<' && index(name, '\n')) + if (dowarn && io->type == '<' && strchr(name, '\n')) warn(warn_nl, "open"); Safefree(myname); goto say_false; @@ -909,7 +909,7 @@ dARGS sv_setpv(statname,SvPVn(sv)); laststype = OP_STAT; laststatval = stat(SvPVn(sv),&statcache); - if (laststatval < 0 && dowarn && index(SvPVn(sv), '\n')) + if (laststatval < 0 && dowarn && strchr(SvPVn(sv), '\n')) warn(warn_nl, "stat"); return laststatval; } @@ -941,7 +941,7 @@ dARGS #else laststatval = stat(SvPVn(sv),&statcache); #endif - if (laststatval < 0 && dowarn && index(SvPVn(sv), '\n')) + if (laststatval < 0 && dowarn && strchr(SvPVn(sv), '\n')) warn(warn_nl, "lstat"); return laststatval; } @@ -1033,7 +1033,7 @@ char *cmd; if (*s == '=') goto doshell; for (s = cmd; *s; s++) { - if (*s != ' ' && !isALPHA(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) { + if (*s != ' ' && !isALPHA(*s) && strchr("$&*(){}[]'\";\\|?<>~`\n",*s)) { if (*s == '\n' && !s[1]) { *s = '\0'; break; @@ -89,7 +89,7 @@ OP *arg; tbl = (short*) cPVOP->op_pv; s = SvPVn(sv); - send = s + SvCUR(sv); + send = s + SvCUROK(sv); if (!tbl || !s) fatal("panic: do_trans"); DEBUG_t( deb("2.TBL\n")); @@ -139,7 +139,7 @@ register SV **sp; register I32 items = sp - mark; register char *delim = SvPVn(del); register STRLEN len; - I32 delimlen = SvCUR(del); + I32 delimlen = SvCUROK(del); mark++; len = (items > 0 ? (delimlen * (items - 1) ) : 0); @@ -207,7 +207,7 @@ register SV **sarg; sv_setpv(sv,""); len--; /* don't count pattern string */ t = s = SvPVn(*sarg); - send = s + SvCUR(*sarg); + send = s + SvCUROK(*sarg); sarg++; for ( ; ; len--) { @@ -316,7 +316,7 @@ register SV **sarg; break; /* so handle simple cases */ } else if (f[1] == '-') { - char *mp = index(f, '.'); + char *mp = strchr(f, '.'); I32 min = atoi(f+2); if (mp) { @@ -330,7 +330,7 @@ register SV **sarg; break; } else if (isDIGIT(f[1])) { - char *mp = index(f, '.'); + char *mp = strchr(f, '.'); I32 min = atoi(f+1); if (mp) { @@ -438,7 +438,7 @@ register SV *sv; return; } tmps = SvPVn(sv); - if (tmps && SvCUR(sv)) { + if (tmps && SvCUROK(sv)) { tmps += SvCUR(sv) - 1; sv_setpvn(astr,tmps,1); /* remember last char */ *tmps = '\0'; /* wipe it out */ @@ -466,10 +466,10 @@ SV *right; register char *lc = SvPVn(left); register char *rc = SvPVn(right); register I32 len; + I32 leftlen = SvCUROK(left); + I32 rightlen = SvCUROK(right); - len = SvCUR(left); - if (len > SvCUR(right)) - len = SvCUR(right); + len = leftlen < rightlen ? leftlen : rightlen; if (SvTYPE(sv) < SVt_PV) sv_upgrade(sv, SVt_PV); if (SvCUR(sv) > len) @@ -545,10 +545,10 @@ SV *right; *dc++ = *lc++ | *rc++; mop_up: len = SvCUR(sv); - if (SvCUR(right) > len) - sv_catpvn(sv,SvPV(right)+len,SvCUR(right) - len); - else if (SvCUR(left) > len) - sv_catpvn(sv,SvPV(left)+len,SvCUR(left) - len); + if (rightlen > len) + sv_catpvn(sv, SvPV(right) + len, rightlen - len); + else if (leftlen > len) + sv_catpvn(sv, SvPV(left) + len, leftlen - len); break; } } @@ -29,45 +29,36 @@ static void dump(); void -dump_sequence(op) -register OP *op; +dump_all() { - extern I32 op_seq; + register I32 i; + register HE *entry; - for (; op; op = op->op_next) { - if (op->op_seq) - return; - op->op_seq = ++op_seq; + setlinebuf(stderr); + if (main_root) + dump_op(main_root); + for (i = 0; i <= 127; i++) { + for (entry = HvARRAY(defstash)[i]; entry; entry = entry->hent_next) + dump_sub((GV*)entry->hent_val); } } void -dump_all() +dump_sub(gv) +GV* gv; { - register I32 i; - register GV *gv; - register HE *entry; SV *sv = sv_mortalcopy(&sv_undef); - - setlinebuf(stderr); - dump_sequence(main_start); - dump_op(main_root); - for (i = 0; i <= 127; i++) { - for (entry = HvARRAY(defstash)[i]; entry; entry = entry->hent_next) { - gv = (GV*)entry->hent_val; - if (GvCV(gv)) { - gv_fullname(sv,gv); - dump("\nSUB %s = ", SvPV(sv)); - if (CvUSERSUB(GvCV(gv))) - dump("(usersub 0x%x %d)\n", - (long)CvUSERSUB(GvCV(gv)), - CvUSERINDEX(GvCV(gv))); - else { - dump_sequence(CvSTART(GvCV(gv))); - dump_op(CvROOT(GvCV(gv))); - } - } - } + if (GvCV(gv)) { + gv_fullname(sv,gv); + dump("\nSUB %s = ", SvPV(sv)); + if (CvUSERSUB(GvCV(gv))) + dump("(usersub 0x%x %d)\n", + (long)CvUSERSUB(GvCV(gv)), + CvUSERINDEX(GvCV(gv))); + else if (CvROOT(GvCV(gv))) + dump_op(CvROOT(GvCV(gv))); + else + dump("<undef>\n"); } } @@ -78,7 +69,6 @@ dump_eval() register GV *gv; register HE *entry; - dump_sequence(eval_start); dump_op(eval_root); } @@ -88,13 +78,18 @@ register OP *op; { SV *tmpsv; - if (!op->op_seq) - dump_sequence(op); dump("{\n"); - fprintf(stderr, "%-4d", op->op_seq); + if (op->op_seq) + fprintf(stderr, "%-4d", op->op_seq); + else + fprintf(stderr, " "); dump("TYPE = %s ===> ", op_name[op->op_type]); - if (op->op_next) - fprintf(stderr, "%d\n", op->op_next->op_seq); + if (op->op_next) { + if (op->op_seq) + fprintf(stderr, "%d\n", op->op_next->op_seq); + else + fprintf(stderr, "(%d)\n", op->op_next->op_seq); + } else fprintf(stderr, "DONE\n"); dumplvl++; @@ -121,8 +116,8 @@ register OP *op; (void)strcat(buf,"STACKED,"); if (op->op_flags & OPf_LVAL) (void)strcat(buf,"LVAL,"); - if (op->op_flags & OPf_LOCAL) - (void)strcat(buf,"LOCAL,"); + if (op->op_flags & OPf_INTRO) + (void)strcat(buf,"INTRO,"); if (op->op_flags & OPf_SPECIAL) (void)strcat(buf,"SPECIAL,"); if (*buf) @@ -170,6 +165,7 @@ register OP *op; } switch (op->op_type) { + case OP_GVSV: case OP_GV: if (cGVOP->op_gv) { tmpsv = NEWSV(0,0); @@ -183,7 +179,8 @@ register OP *op; case OP_CONST: dump("SV = %s\n", SvPEEK(cSVOP->op_sv)); break; - case OP_CURCOP: + case OP_NEXTSTATE: + case OP_DBSTATE: if (cCOP->cop_line) dump("LINE = %d\n",cCOP->cop_line); if (cCOP->cop_label) @@ -191,40 +188,30 @@ register OP *op; break; case OP_ENTERLOOP: dump("REDO ===> "); - if (cLOOP->op_redoop) { - dump_sequence(cLOOP->op_redoop); + if (cLOOP->op_redoop) fprintf(stderr, "%d\n", cLOOP->op_redoop->op_seq); - } else fprintf(stderr, "DONE\n"); dump("NEXT ===> "); - if (cLOOP->op_nextop) { - dump_sequence(cLOOP->op_nextop); + if (cLOOP->op_nextop) fprintf(stderr, "%d\n", cLOOP->op_nextop->op_seq); - } else fprintf(stderr, "DONE\n"); dump("LAST ===> "); - if (cLOOP->op_lastop) { - dump_sequence(cLOOP->op_lastop); + if (cLOOP->op_lastop) fprintf(stderr, "%d\n", cLOOP->op_lastop->op_seq); - } else fprintf(stderr, "DONE\n"); break; case OP_COND_EXPR: dump("TRUE ===> "); - if (cCONDOP->op_true) { - dump_sequence(cCONDOP->op_true); + if (cCONDOP->op_true) fprintf(stderr, "%d\n", cCONDOP->op_true->op_seq); - } else fprintf(stderr, "DONE\n"); dump("FALSE ===> "); - if (cCONDOP->op_false) { - dump_sequence(cCONDOP->op_false); + if (cCONDOP->op_false) fprintf(stderr, "%d\n", cCONDOP->op_false->op_seq); - } else fprintf(stderr, "DONE\n"); break; @@ -233,10 +220,8 @@ register OP *op; case OP_AND: case OP_METHOD: dump("OTHER ===> "); - if (cLOGOP->op_other) { - dump_sequence(cLOGOP->op_other); + if (cLOGOP->op_other) fprintf(stderr, "%d\n", cLOGOP->op_other->op_seq); - } else fprintf(stderr, "DONE\n"); break; diff --git a/eg/uudecode b/eg/uudecode new file mode 100644 index 0000000000..3b3cb60a23 --- /dev/null +++ b/eg/uudecode @@ -0,0 +1,15 @@ +#!/usr/bin/perl +while (<>) { + next unless ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/; + open(OUT,"> $file") || die "Can't create $file: $!\n"; + while (<>) { + last if /^end/; + next if /[a-z]/; + next unless int((((ord() - 32) & 077) + 2) / 3) == + int(length() / 4); + print OUT unpack("u", $_); + } + chmod oct($mode), $file; + eof() && die "Missing end: $file may be truncated.\n"; +} + @@ -49,7 +49,6 @@ #define oldoldbufptr PERLoldoldbufptr #define origalen PERLorigalen #define origenviron PERLorigenviron -#define pad PERLpad #define padix PERLpadix #define patleave PERLpatleave #define regbol PERLregbol @@ -102,6 +101,7 @@ #define argvoutgv (curinterp->Iargvoutgv) #define arybase (curinterp->Iarybase) #define basetime (curinterp->Ibasetime) +#define beginav (curinterp->Ibeginav) #define bodytarget (curinterp->Ibodytarget) #define cddir (curinterp->Icddir) #define chopset (curinterp->Ichopset) @@ -136,6 +136,7 @@ #define dumplvl (curinterp->Idumplvl) #define e_fp (curinterp->Ie_fp) #define e_tmpname (curinterp->Ie_tmpname) +#define endav (curinterp->Iendav) #define envgv (curinterp->Ienvgv) #define eval_root (curinterp->Ieval_root) #define eval_start (curinterp->Ieval_start) @@ -147,14 +148,10 @@ #define formtarget (curinterp->Iformtarget) #define freestrroot (curinterp->Ifreestrroot) #define gensym (curinterp->Igensym) -#define hint (curinterp->Ihint) #define in_eval (curinterp->Iin_eval) #define incgv (curinterp->Iincgv) #define inplace (curinterp->Iinplace) -#define last_elen (curinterp->Ilast_elen) -#define last_eval (curinterp->Ilast_eval) #define last_in_gv (curinterp->Ilast_in_gv) -#define last_root (curinterp->Ilast_root) #define lastfd (curinterp->Ilastfd) #define lastretstr (curinterp->Ilastretstr) #define lastscream (curinterp->Ilastscream) @@ -194,6 +191,8 @@ #define origfilename (curinterp->Iorigfilename) #define ors (curinterp->Iors) #define orslen (curinterp->Iorslen) +#define pad (curinterp->Ipad) +#define padname (curinterp->Ipadname) #define patchlevel (curinterp->Ipatchlevel) #define perldb (curinterp->Iperldb) #define pidstatus (curinterp->Ipidstatus) @@ -250,6 +249,7 @@ #define Iargvoutgv argvoutgv #define Iarybase arybase #define Ibasetime basetime +#define Ibeginav beginav #define Ibodytarget bodytarget #define Icddir cddir #define Ichopset chopset @@ -284,6 +284,7 @@ #define Idumplvl dumplvl #define Ie_fp e_fp #define Ie_tmpname e_tmpname +#define Iendav endav #define Ienvgv envgv #define Ieval_root eval_root #define Ieval_start eval_start @@ -295,14 +296,10 @@ #define Iformtarget formtarget #define Ifreestrroot freestrroot #define Igensym gensym -#define Ihint hint #define Iin_eval in_eval #define Iincgv incgv #define Iinplace inplace -#define Ilast_elen last_elen -#define Ilast_eval last_eval #define Ilast_in_gv last_in_gv -#define Ilast_root last_root #define Ilastfd lastfd #define Ilastretstr lastretstr #define Ilastscream lastscream @@ -342,6 +339,8 @@ #define Iorigfilename origfilename #define Iors ors #define Iorslen orslen +#define Ipad pad +#define Ipadname padname #define Ipatchlevel patchlevel #define Iperldb perldb #define Ipidstatus pidstatus @@ -0,0 +1,4 @@ +#!./perl + +BEGIN { $/ = "" } +print while <>; diff --git a/global.var b/global.var index 5593ace5c2..74dcac2a94 100644 --- a/global.var +++ b/global.var @@ -43,7 +43,6 @@ oldbufptr oldoldbufptr origalen origenviron -pad padix patleave regbol @@ -43,6 +43,8 @@ #include "EXTERN.h" #include "perl.h" +extern char* rcsid; + GV * gv_AVadd(gv) register GV *gv; @@ -72,7 +74,7 @@ char *name; gv = gv_fetchpv(tmpbuf, TRUE); sv_setpv(GvSV(gv), name); if (perldb) - (void)gv_HVadd(gv_AVadd(gv)); + hv_magic(GvHVn(gv_AVadd(gv)), gv, 'L'); return gv; } @@ -188,6 +190,8 @@ I32 add; name = sawquote+1; *sawquote = '\''; } + if (!stash) + fatal("Global symbol \"%s\" requires explicit package name", name); len = namend - name; gvp = (GV**)hv_fetch(stash,name,len,add); if (!gvp || *gvp == (GV*)&sv_undef) @@ -197,26 +201,112 @@ I32 add; SvMULTI_on(gv); return gv; } - else { - sv_upgrade(gv, SVt_PVGV); - if (SvLEN(gv)) - Safefree(SvPV(gv)); - Newz(602,gp, 1, GP); - GvGP(gv) = gp; - GvREFCNT(gv) = 1; - GvSV(gv) = NEWSV(72,0); - GvLINE(gv) = curcop->cop_line; - GvEGV(gv) = gv; - sv_magic((SV*)gv, (SV*)gv, '*', name, len); - GvSTASH(gv) = stash; - GvNAME(gv) = nsavestr(name, len); - GvNAMELEN(gv) = len; - if (isDIGIT(*name) && *name != '0') - sv_magic(GvSV(gv), (SV*)gv, 0, name, len); - if (add & 2) - SvMULTI_on(gv); - return gv; + + /* Adding a new symbol */ + + sv_upgrade(gv, SVt_PVGV); + if (SvLEN(gv)) + Safefree(SvPV(gv)); + Newz(602,gp, 1, GP); + GvGP(gv) = gp; + GvREFCNT(gv) = 1; + GvSV(gv) = NEWSV(72,0); + GvLINE(gv) = curcop->cop_line; + GvEGV(gv) = gv; + sv_magic((SV*)gv, (SV*)gv, '*', name, len); + GvSTASH(gv) = stash; + GvNAME(gv) = nsavestr(name, len); + GvNAMELEN(gv) = len; + if (isDIGIT(*name) && *name != '0') + sv_magic(GvSV(gv), (SV*)gv, 0, name, len); + if (add & 2) + SvMULTI_on(gv); + + /* set up magic where warranted */ + switch (*name) { + case 'S': + if (strEQ(name, "SIG")) { + HV *hv; + siggv = gv; + SvMULTI_on(siggv); + hv = GvHVn(siggv); + hv_magic(hv, siggv, 'S'); + + /* initialize signal stack */ + signalstack = newAV(); + av_store(signalstack, 32, Nullsv); + av_clear(signalstack); + AvREAL_off(signalstack); + } + break; + + case '&': + ampergv = gv; + sawampersand = TRUE; + goto magicalize; + + case '`': + leftgv = gv; + sawampersand = TRUE; + goto magicalize; + + case '\'': + rightgv = gv; + sawampersand = TRUE; + goto magicalize; + + case ':': + sv_setpv(GvSV(gv),chopset); + goto magicalize; + + case '!': + case '#': + case '?': + case '^': + case '~': + case '=': + case '-': + case '%': + case '.': + case '+': + case '*': + case '(': + case ')': + case '<': + case '>': + case ',': + case '\\': + case '/': + case '[': + case '|': + case '\004': + case '\t': + case '\020': + case '\024': + case '\027': + case '\006': + magicalize: + sv_magic(GvSV(gv), (SV*)gv, 0, name, 1); + break; + + case '\014': + sv_setpv(GvSV(gv),"\f"); + formfeed = GvSV(gv); + break; + case ';': + sv_setpv(GvSV(gv),"\034"); + break; + case ']': { + SV *sv; + sv = GvSV(gv); + sv_upgrade(sv, SVt_PVNV); + sv_setpv(sv,rcsid); + SvNV(sv) = atof(patchlevel); + SvNOK_on(sv); + } + break; } + return gv; } void @@ -119,7 +119,7 @@ HV *hv; char *key; U32 klen; SV *val; -register I32 hash; +register U32 hash; { register XPVHV* xhv; register char *s; @@ -31,7 +31,7 @@ struct he { HE *hent_next; char *hent_key; SV *hent_val; - I32 hent_hash; + U32 hent_hash; I32 hent_klen; }; diff --git a/interp.var b/interp.var index c81990251c..299e6469f2 100644 --- a/interp.var +++ b/interp.var @@ -12,6 +12,7 @@ argvgv argvoutgv arybase basetime +beginav bodytarget cddir chopset @@ -46,6 +47,7 @@ dowarn dumplvl e_fp e_tmpname +endav envgv eval_root eval_start @@ -57,14 +59,10 @@ formfeed formtarget freestrroot gensym -hint in_eval incgv inplace -last_elen -last_eval last_in_gv -last_root lastfd lastretstr lastscream @@ -104,6 +102,8 @@ origargv origfilename ors orslen +pad +padname patchlevel perldb pidstatus diff --git a/keywords.h b/keywords.h index fed561be84..c659dc6904 100644 --- a/keywords.h +++ b/keywords.h @@ -56,163 +56,167 @@ #define KEY_GT 55 #define KEY_ge 56 #define KEY_GE 57 -#define KEY_grep 58 -#define KEY_goto 59 -#define KEY_gmtime 60 -#define KEY_getc 61 -#define KEY_getppid 62 -#define KEY_getpgrp 63 -#define KEY_getpriority 64 -#define KEY_getprotobyname 65 -#define KEY_getprotobynumber 66 -#define KEY_getprotoent 67 -#define KEY_getpwent 68 -#define KEY_getpwnam 69 -#define KEY_getpwuid 70 -#define KEY_getpeername 71 -#define KEY_gethostbyname 72 -#define KEY_gethostbyaddr 73 -#define KEY_gethostent 74 -#define KEY_getnetbyname 75 -#define KEY_getnetbyaddr 76 -#define KEY_getnetent 77 -#define KEY_getservbyname 78 -#define KEY_getservbyport 79 -#define KEY_getservent 80 -#define KEY_getsockname 81 -#define KEY_getsockopt 82 -#define KEY_getgrent 83 -#define KEY_getgrnam 84 -#define KEY_getgrgid 85 -#define KEY_getlogin 86 -#define KEY_hex 87 -#define KEY_if 88 -#define KEY_index 89 -#define KEY_int 90 -#define KEY_ioctl 91 -#define KEY_join 92 -#define KEY_keys 93 -#define KEY_kill 94 -#define KEY_last 95 -#define KEY_lc 96 -#define KEY_lcfirst 97 -#define KEY_local 98 -#define KEY_length 99 -#define KEY_lt 100 -#define KEY_LT 101 -#define KEY_le 102 -#define KEY_LE 103 -#define KEY_localtime 104 -#define KEY_log 105 -#define KEY_link 106 -#define KEY_listen 107 -#define KEY_lstat 108 -#define KEY_m 109 -#define KEY_mkdir 110 -#define KEY_msgctl 111 -#define KEY_msgget 112 -#define KEY_msgrcv 113 -#define KEY_msgsnd 114 -#define KEY_next 115 -#define KEY_ne 116 -#define KEY_NE 117 -#define KEY_open 118 -#define KEY_ord 119 -#define KEY_oct 120 -#define KEY_opendir 121 -#define KEY_print 122 -#define KEY_printf 123 -#define KEY_push 124 -#define KEY_pop 125 -#define KEY_pack 126 -#define KEY_package 127 -#define KEY_pipe 128 -#define KEY_q 129 -#define KEY_qq 130 -#define KEY_qx 131 -#define KEY_return 132 -#define KEY_require 133 -#define KEY_reset 134 -#define KEY_redo 135 -#define KEY_rename 136 -#define KEY_rand 137 -#define KEY_rmdir 138 -#define KEY_rindex 139 -#define KEY_ref 140 -#define KEY_read 141 -#define KEY_readdir 142 -#define KEY_rewinddir 143 -#define KEY_recv 144 -#define KEY_reverse 145 -#define KEY_readlink 146 -#define KEY_s 147 -#define KEY_scalar 148 -#define KEY_select 149 -#define KEY_seek 150 -#define KEY_semctl 151 -#define KEY_semget 152 -#define KEY_semop 153 -#define KEY_send 154 -#define KEY_setpgrp 155 -#define KEY_setpriority 156 -#define KEY_sethostent 157 -#define KEY_setnetent 158 -#define KEY_setservent 159 -#define KEY_setprotoent 160 -#define KEY_setpwent 161 -#define KEY_setgrent 162 -#define KEY_seekdir 163 -#define KEY_setsockopt 164 -#define KEY_shift 165 -#define KEY_shmctl 166 -#define KEY_shmget 167 -#define KEY_shmread 168 -#define KEY_shmwrite 169 -#define KEY_shutdown 170 -#define KEY_sin 171 -#define KEY_sleep 172 -#define KEY_socket 173 -#define KEY_socketpair 174 -#define KEY_sort 175 -#define KEY_split 176 -#define KEY_sprintf 177 -#define KEY_splice 178 -#define KEY_sqrt 179 -#define KEY_srand 180 -#define KEY_stat 181 -#define KEY_study 182 -#define KEY_substr 183 -#define KEY_sub 184 -#define KEY_system 185 -#define KEY_symlink 186 -#define KEY_syscall 187 -#define KEY_sysread 188 -#define KEY_syswrite 189 -#define KEY_tr 190 -#define KEY_tell 191 -#define KEY_telldir 192 -#define KEY_time 193 -#define KEY_times 194 -#define KEY_truncate 195 -#define KEY_uc 196 -#define KEY_ucfirst 197 -#define KEY_until 198 -#define KEY_unless 199 -#define KEY_unlink 200 -#define KEY_undef 201 -#define KEY_unpack 202 -#define KEY_utime 203 -#define KEY_umask 204 -#define KEY_unshift 205 -#define KEY_values 206 -#define KEY_vec 207 -#define KEY_while 208 -#define KEY_warn 209 -#define KEY_wait 210 -#define KEY_waitpid 211 -#define KEY_wantarray 212 -#define KEY_write 213 -#define KEY_x 214 -#define KEY_y 215 -#define KEY_BEGIN 216 -#define KEY_END 217 +#define KEY_glob 58 +#define KEY_grep 59 +#define KEY_goto 60 +#define KEY_gmtime 61 +#define KEY_getc 62 +#define KEY_getppid 63 +#define KEY_getpgrp 64 +#define KEY_getpriority 65 +#define KEY_getprotobyname 66 +#define KEY_getprotobynumber 67 +#define KEY_getprotoent 68 +#define KEY_getpwent 69 +#define KEY_getpwnam 70 +#define KEY_getpwuid 71 +#define KEY_getpeername 72 +#define KEY_gethostbyname 73 +#define KEY_gethostbyaddr 74 +#define KEY_gethostent 75 +#define KEY_getnetbyname 76 +#define KEY_getnetbyaddr 77 +#define KEY_getnetent 78 +#define KEY_getservbyname 79 +#define KEY_getservbyport 80 +#define KEY_getservent 81 +#define KEY_getsockname 82 +#define KEY_getsockopt 83 +#define KEY_getgrent 84 +#define KEY_getgrnam 85 +#define KEY_getgrgid 86 +#define KEY_getlogin 87 +#define KEY_hex 88 +#define KEY_if 89 +#define KEY_index 90 +#define KEY_int 91 +#define KEY_ioctl 92 +#define KEY_join 93 +#define KEY_keys 94 +#define KEY_kill 95 +#define KEY_last 96 +#define KEY_lc 97 +#define KEY_lcfirst 98 +#define KEY_local 99 +#define KEY_length 100 +#define KEY_lt 101 +#define KEY_LT 102 +#define KEY_le 103 +#define KEY_LE 104 +#define KEY_localtime 105 +#define KEY_log 106 +#define KEY_link 107 +#define KEY_listen 108 +#define KEY_lstat 109 +#define KEY_m 110 +#define KEY_mkdir 111 +#define KEY_msgctl 112 +#define KEY_msgget 113 +#define KEY_msgrcv 114 +#define KEY_msgsnd 115 +#define KEY_my 116 +#define KEY_next 117 +#define KEY_ne 118 +#define KEY_NE 119 +#define KEY_open 120 +#define KEY_ord 121 +#define KEY_oct 122 +#define KEY_opendir 123 +#define KEY_print 124 +#define KEY_printf 125 +#define KEY_push 126 +#define KEY_pop 127 +#define KEY_pack 128 +#define KEY_package 129 +#define KEY_pipe 130 +#define KEY_q 131 +#define KEY_qq 132 +#define KEY_qx 133 +#define KEY_return 134 +#define KEY_require 135 +#define KEY_reset 136 +#define KEY_redo 137 +#define KEY_rename 138 +#define KEY_rand 139 +#define KEY_rmdir 140 +#define KEY_rindex 141 +#define KEY_ref 142 +#define KEY_read 143 +#define KEY_readdir 144 +#define KEY_rewinddir 145 +#define KEY_recv 146 +#define KEY_reverse 147 +#define KEY_readline 148 +#define KEY_readlink 149 +#define KEY_readpipe 150 +#define KEY_s 151 +#define KEY_scalar 152 +#define KEY_select 153 +#define KEY_seek 154 +#define KEY_semctl 155 +#define KEY_semget 156 +#define KEY_semop 157 +#define KEY_send 158 +#define KEY_setpgrp 159 +#define KEY_setpriority 160 +#define KEY_sethostent 161 +#define KEY_setnetent 162 +#define KEY_setservent 163 +#define KEY_setprotoent 164 +#define KEY_setpwent 165 +#define KEY_setgrent 166 +#define KEY_seekdir 167 +#define KEY_setsockopt 168 +#define KEY_shift 169 +#define KEY_shmctl 170 +#define KEY_shmget 171 +#define KEY_shmread 172 +#define KEY_shmwrite 173 +#define KEY_shutdown 174 +#define KEY_sin 175 +#define KEY_sleep 176 +#define KEY_socket 177 +#define KEY_socketpair 178 +#define KEY_sort 179 +#define KEY_split 180 +#define KEY_sprintf 181 +#define KEY_splice 182 +#define KEY_sqrt 183 +#define KEY_srand 184 +#define KEY_stat 185 +#define KEY_study 186 +#define KEY_substr 187 +#define KEY_sub 188 +#define KEY_system 189 +#define KEY_symlink 190 +#define KEY_syscall 191 +#define KEY_sysread 192 +#define KEY_syswrite 193 +#define KEY_tr 194 +#define KEY_tell 195 +#define KEY_telldir 196 +#define KEY_time 197 +#define KEY_times 198 +#define KEY_truncate 199 +#define KEY_uc 200 +#define KEY_ucfirst 201 +#define KEY_until 202 +#define KEY_unless 203 +#define KEY_unlink 204 +#define KEY_undef 205 +#define KEY_unpack 206 +#define KEY_utime 207 +#define KEY_umask 208 +#define KEY_unshift 209 +#define KEY_values 210 +#define KEY_vec 211 +#define KEY_while 212 +#define KEY_warn 213 +#define KEY_wait 214 +#define KEY_waitpid 215 +#define KEY_wantarray 216 +#define KEY_write 217 +#define KEY_x 218 +#define KEY_y 219 +#define KEY_BEGIN 220 +#define KEY_END 221 diff --git a/lib/ctime.pl b/lib/ctime.pl index 2d5ee65e36..14e122adda 100644 --- a/lib/ctime.pl +++ b/lib/ctime.pl @@ -44,7 +44,7 @@ sub ctime { } $TZ .= ' ' unless $TZ eq ''; - $year += ($year < 70) ? 2000 : 1900; + $year += 1900; sprintf("%s %s %2d %2d:%02d:%02d %s%4d\n", $DoW[$wday], $MoY[$mon], $mday, $hour, $min, $sec, $TZ, $year); } diff --git a/lib/open3.pl b/lib/open3.pl new file mode 100644 index 0000000000..f3d8138879 --- /dev/null +++ b/lib/open3.pl @@ -0,0 +1,105 @@ +# &open3: Marc Horowitz <marc@mit.edu> +# derived mostly from &open2 by tom christiansen, <tchrist@convex.com> +# +# usage: $pid = open3('wtr', 'rdr', 'err' 'some cmd and args', 'optarg', ...); +# +# spawn the given $cmd and connect rdr for +# reading, wtr for writing, and err for errors. +# if err is '', or the same as rdr, then stdout and +# stderr of the child are on the same fh. returns pid +# of child, or 0 on failure. + + +# if wtr begins with '>&', then wtr will be closed in the parent, and +# the child will read from it directly. if rdr or err begins with +# '>&', then the child will send output directly to that fd. In both +# cases, there will be a dup() instead of a pipe() made. + + +# WARNING: this is dangerous, as you may block forever +# unless you are very careful. +# +# $wtr is left unbuffered. +# +# abort program if +# rdr or wtr are null +# pipe or fork or exec fails + +package open3; + +$fh = 'FHOPEN000'; # package static in case called more than once + +sub main'open3 { + local($kidpid); + local($dad_wtr, $dad_rdr, $dad_err, @cmd) = @_; + local($dup_wtr, $dup_rdr, $dup_err); + + $dad_wtr || die "open3: wtr should not be null"; + $dad_rdr || die "open3: rdr should not be null"; + $dad_err = $dad_rdr if ($dad_err eq ''); + + $dup_wtr = ($dad_wtr =~ s/^\>\&//); + $dup_rdr = ($dad_rdr =~ s/^\>\&//); + $dup_err = ($dad_err =~ s/^\>\&//); + + # force unqualified filehandles into callers' package + local($package) = caller; + $dad_wtr =~ s/^[^']+$/$package'$&/; + $dad_rdr =~ s/^[^']+$/$package'$&/; + $dad_err =~ s/^[^']+$/$package'$&/; + + local($kid_rdr) = ++$fh; + local($kid_wtr) = ++$fh; + local($kid_err) = ++$fh; + + if (!$dup_wtr) { + pipe($kid_rdr, $dad_wtr) || die "open3: pipe 1 (stdin) failed: $!"; + } + if (!$dup_rdr) { + pipe($dad_rdr, $kid_wtr) || die "open3: pipe 2 (stdout) failed: $!"; + } + if ($dad_err ne $dad_rdr && !$dup_err) { + pipe($dad_err, $kid_err) || die "open3: pipe 3 (stderr) failed: $!"; + } + + if (($kidpid = fork) < 0) { + die "open2: fork failed: $!"; + } elsif ($kidpid == 0) { + if ($dup_wtr) { + open(STDIN, ">&$dad_wtr") if (fileno(STDIN) != fileno($dad_wtr)); + } else { + close($dad_wtr); + open(STDIN, ">&$kid_rdr"); + } + if ($dup_rdr) { + open(STDOUT, ">&$dad_rdr") if (fileno(STDOUT) != fileno($dad_rdr)); + } else { + close($dad_rdr); + open(STDOUT, ">&$kid_wtr"); + } + if ($dad_rdr ne $dad_err) { + if ($dup_err) { + open(STDERR, ">&$dad_err") + if (fileno(STDERR) != fileno($dad_err)); + } else { + close($dad_err); + open(STDERR, ">&$kid_err"); + } + } else { + open(STDERR, ">&STDOUT") if (fileno(STDERR) != fileno(STDOUT)); + } + exec @cmd; + + local($")=(" "); + die "open2: exec of @cmd failed"; + } + + close $kid_rdr; close $kid_wtr; close $kid_err; + if ($dup_wtr) { + close($dad_wtr); + } + + select((select($dad_wtr), $| = 1)[0]); # unbuffer pipe + $kidpid; +} +1; # so require is happy @@ -7,7 +7,7 @@ char **argv; char **env; { int exitstatus; - Interpreter *my_perl; + PerlInterpreter *my_perl; my_perl = perl_alloc(); if (!my_perl) @@ -1,6 +1,6 @@ make: Warning: Both `makefile' and `Makefile' exists -`sh cflags perl.o` perl.c - CCCMD = cc -c -I/usr/include/sun -I/usr/ucbinclude -DDEBUGGING -g +`sh cflags op.o` op.c + CCCMD = cc -c -DDEBUGGING -g cc -Bstatic main.o perly.o perl.o av.o scope.o op.o doop.o doio.o dolist.o dump.o malloc.o mg.o pp.o regcomp.o regexec.o gv.o sv.o toke.o util.o deb.o run.o hv.o usersub.o -ldbm -lm -lposix -o perl echo "" @@ -26,8 +26,10 @@ # # +# I now supply perly.c with the kits, so don't remake perly.c without byacc +YACC = ../perl-byacc1.8.2/byacc + CC = cc -YACC = /bin/yacc bin = /usr/local/bin scriptdir = /usr/local/bin privlib = /usr/local/lib/perl @@ -302,11 +304,11 @@ perly.h: perly.c embed.h: embed_h.SH global.var interp.var sh embed_h.SH -perly.c: perly.y perly.fixer +perly.c: @ \ case "$(YACC)" in \ - *bison*) echo 'Expect' 25 shift/reduce and 53 reduce/reduce conflicts;; \ - *) echo 'Expect' 27 shift/reduce and 51 reduce/reduce conflicts;; \ + *bison*) echo 'Expect' 19 shift/reduce and 58 reduce/reduce conflicts;; \ + *) echo 'Expect' 21 shift/reduce and 56 reduce/reduce conflicts;; \ esac $(YACC) -d perly.y sh $(shellflags) ./perly.fixer y.tab.c perly.c @@ -1504,6 +1506,25 @@ usersub.o: sv.h usersub.o: unixish.h usersub.o: usersub.c usersub.o: util.h +mg.o: EXTERN.h +mg.o: av.h +mg.o: config.h +mg.o: cop.h +mg.o: embed.h +mg.o: form.h +mg.o: gv.h +mg.o: handy.h +mg.o: mg.c +mg.o: hv.h +mg.o: op.h +mg.o: opcode.h +mg.o: perl.h +mg.o: pp.h +mg.o: proto.h +mg.o: regexp.h +mg.o: sv.h +mg.o: unixish.h +mg.o: util.h Makefile: Makefile.SH config.sh ; /bin/sh Makefile.SH makedepend: makedepend.SH config.sh ; /bin/sh makedepend.SH h2ph: h2ph.SH config.sh ; /bin/sh h2ph.SH @@ -47,6 +47,7 @@ SV* sv; if (vtbl && vtbl->svt_len) return (*vtbl->svt_len)(sv, mg); } + mg_get(sv); if (!SvPOK(sv) && SvNIOK(sv)) sv_2pv(sv); if (SvPOK(sv)) @@ -67,6 +68,20 @@ SV* sv; return 0; } +MAGIC* +mg_find(sv, type) +SV* sv; +char type; +{ + MAGIC* mg; + MAGIC** mgp = &SvMAGIC(sv); + for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) { + if (mg->mg_type == type) + return mg; + } + return 0; +} + int mg_free(sv, type) SV* sv; @@ -80,7 +95,7 @@ char type; *mgp = mg->mg_moremagic; if (vtbl && vtbl->svt_free) (*vtbl->svt_free)(sv, mg); - if (mg->mg_ptr) + if (mg->mg_ptr && mg->mg_type != 'g') Safefree(mg->mg_ptr); Safefree(mg); } @@ -101,7 +116,7 @@ SV* sv; moremagic = mg->mg_moremagic; if (vtbl && vtbl->svt_free) (*vtbl->svt_free)(sv, mg); - if (mg->mg_ptr) + if (mg->mg_ptr && mg->mg_type != 'g') Safefree(mg->mg_ptr); Safefree(mg); } @@ -121,6 +136,77 @@ SV* sv; static handlertype sighandler(); +U32 +magic_len(sv, mg) +SV *sv; +MAGIC *mg; +{ + register I32 paren; + register char *s; + register I32 i; + + switch (*mg->mg_ptr) { + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': case '&': + if (curpm) { + paren = atoi(mg->mg_ptr); + getparen: + if (curpm->op_pmregexp && + paren <= curpm->op_pmregexp->nparens && + (s = curpm->op_pmregexp->startp[paren]) ) { + i = curpm->op_pmregexp->endp[paren] - s; + if (i >= 0) + return i; + else + return 0; + } + else + return 0; + } + break; + case '+': + if (curpm) { + paren = curpm->op_pmregexp->lastparen; + goto getparen; + } + break; + case '`': + if (curpm) { + if (curpm->op_pmregexp && + (s = curpm->op_pmregexp->subbeg) ) { + i = curpm->op_pmregexp->startp[0] - s; + if (i >= 0) + return i; + else + return 0; + } + else + return 0; + } + break; + case '\'': + if (curpm) { + if (curpm->op_pmregexp && + (s = curpm->op_pmregexp->endp[0]) ) { + return (STRLEN) (curpm->op_pmregexp->subend - s); + } + else + return 0; + } + break; + case ',': + return (STRLEN)ofslen; + case '\\': + return (STRLEN)orslen; + } + magic_get(sv,mg); + if (!SvPOK(sv) && SvNIOK(sv)) + sv_2pv(sv); + if (SvPOK(sv)) + return SvCUR(sv); + return 0; +} + int magic_get(sv, mg) SV *sv; @@ -360,7 +446,7 @@ MAGIC* mg; (void)signal(i,SIG_DFL); else { (void)signal(i,sighandler); - if (!index(s,'\'')) { + if (!strchr(s,'\'')) { sprintf(tokenbuf, "main'%s",s); sv_setpv(sv,tokenbuf); } @@ -391,12 +477,8 @@ MAGIC* mg; gv = DBline; i = SvTRUE(sv); svp = av_fetch(GvAV(gv),atoi(mg->mg_ptr), FALSE); - if (svp && SvMAGICAL(*svp) && (o = (OP*)SvMAGIC(*svp)->mg_ptr)) { -#ifdef NOTDEF - cmd->cop_flags &= ~COPf_OPTIMIZE; - cmd->cop_flags |= i? COPo_D1 : COPo_D0; -#endif - } + if (svp && SvIOK(*svp) && (o = (OP*)SvSTASH(*svp))) + o->op_private = i; else warn("Can't break at that line\n"); return 0; @@ -479,6 +561,16 @@ MAGIC* mg; } int +magic_setmglob(sv,mg) +SV* sv; +MAGIC* mg; +{ + mg->mg_ptr = 0; + mg->mg_len = 0; + return 0; +} + +int magic_setbm(sv,mg) SV* sv; MAGIC* mg; @@ -578,17 +670,17 @@ MAGIC* mg; break; case '/': if (SvPOK(sv)) { - rs = SvPV(sv); - rslen = SvCUR(sv); + nrs = rs = SvPV(sv); + nrslen = rslen = SvCUR(sv); if (rspara = !rslen) { - rs = "\n\n"; - rslen = 2; + nrs = rs = "\n\n"; + nrslen = rslen = 2; } - rschar = rs[rslen - 1]; + nrschar = rschar = rs[rslen - 1]; } else { - rschar = 0777; /* fake a non-existent char */ - rslen = 1; + nrschar = rschar = 0777; /* fake a non-existent char */ + nrslen = rslen = 1; } break; case '\\': @@ -827,65 +919,3 @@ I32 sig; return; } - -#ifdef OLD - if (sv->sv_magic && !sv->sv_rare) { - GV *gv = sv->sv_magic->sv_u.sv_gv; - - switch (*SvPV(gv->sv_magic)) { - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': case '&': - if (curpm) { - paren = atoi(GvENAME(gv)); - getparen: - if (curpm->op_pmregexp && - paren <= curpm->op_pmregexp->nparens && - (s = curpm->op_pmregexp->startp[paren]) ) { - i = curpm->op_pmregexp->endp[paren] - s; - if (i >= 0) - return i; - else - return 0; - } - else - return 0; - } - break; - case '+': - if (curpm) { - paren = curpm->op_pmregexp->lastparen; - goto getparen; - } - break; - case '`': - if (curpm) { - if (curpm->op_pmregexp && - (s = curpm->op_pmregexp->subbeg) ) { - i = curpm->op_pmregexp->startp[0] - s; - if (i >= 0) - return i; - else - return 0; - } - else - return 0; - } - break; - case '\'': - if (curpm) { - if (curpm->op_pmregexp && - (s = curpm->op_pmregexp->endp[0]) ) { - return (STRLEN) (curpm->op_pmregexp->subend - s); - } - else - return 0; - } - break; - case ',': - return (STRLEN)ofslen; - case '\\': - return (STRLEN)orslen; - } - sv = gv_str(sv); - } -#endif @@ -32,8 +32,6 @@ extern int yychar; #define OA_SCALARREF 7 #define OA_OPTIONAL 8 -I32 op_seq; - void cpy7bit(d,s,l) register char *d; @@ -124,6 +122,112 @@ OP *op; /* "register" allocation */ PADOFFSET +pad_allocmy(name) +char *name; +{ + PADOFFSET off = pad_alloc(OP_PADSV, 'M'); + SV *sv = NEWSV(0,0); + sv_upgrade(sv, SVt_PVNV); + sv_setpv(sv, name); + av_store(comppadname, off, sv); + SvNV(sv) = (double)cop_seq; + SvIV(sv) = 99999999; + if (*name == '@') + av_store(comppad, off, newAV()); + else if (*name == '%') + av_store(comppad, off, newHV(COEFFSIZE)); + return off; +} + +PADOFFSET +pad_findmy(name) +char *name; +{ + I32 off; + SV *sv; + SV **svp = AvARRAY(comppadname); + register I32 i; + register CONTEXT *cx; + bool saweval; + AV *curlist; + AV *curname; + CV *cv; + I32 seq = cop_seq; + + for (off = comppadnamefill; off > 0; off--) { + if ((sv = svp[off]) && + seq <= SvIV(sv) && + seq > (I32)SvNV(sv) && + strEQ(SvPV(sv), name)) + { + return (PADOFFSET)off; + } + } + + /* Nothing in current lexical context--try eval's context, if any. + * This is necessary to let the perldb get at lexically scoped variables. + * XXX This will also probably interact badly with eval tree caching. + */ + + saweval = FALSE; + for (i = cxstack_ix; i >= 0; i--) { + cx = &cxstack[i]; + switch (cx->cx_type) { + default: + break; + case CXt_EVAL: + saweval = TRUE; + break; + case CXt_SUB: + if (!saweval) + return 0; + cv = cx->blk_sub.cv; + if (debstash && CvSTASH(cv) == debstash) /* ignore DB'* scope */ + continue; + seq = cxstack[i+1].blk_oldcop->cop_seq; + curlist = CvPADLIST(cv); + curname = (AV*)*av_fetch(curlist, 0, FALSE); + svp = AvARRAY(curname); + for (off = AvFILL(curname); off > 0; off--) { + if ((sv = svp[off]) && + seq <= SvIV(sv) && + seq > (I32)SvNV(sv) && + strEQ(SvPV(sv), name)) + { + PADOFFSET newoff = pad_alloc(OP_PADSV, 'M'); + AV *oldpad = (AV*)*av_fetch(curlist, CvDEPTH(cv), FALSE); + SV *oldsv = *av_fetch(oldpad, off, TRUE); + SV *sv = NEWSV(0,0); + sv_upgrade(sv, SVt_PVNV); + sv_setpv(sv, name); + av_store(comppadname, newoff, sv); + SvNV(sv) = (double)curcop->cop_seq; + SvIV(sv) = 99999999; + av_store(comppad, newoff, sv_ref(oldsv)); + return newoff; + } + } + return 0; + } + } + + return 0; +} + +void +pad_leavemy(fill) +I32 fill; +{ + I32 off; + SV **svp = AvARRAY(comppadname); + SV *sv; + for (off = AvFILL(comppadname); off > fill; off--) { + if (sv = svp[off]) + SvIV(sv) = cop_seq; + } +} + +PADOFFSET pad_alloc(optype,tmptype) I32 optype; char tmptype; @@ -314,6 +418,7 @@ OP *op; else scalar(kid); } + curcop = &compiling; return op; case OP_LIST: op = prepend_elem(OP_LIST, newOP(OP_PUSHMARK, 0), op); @@ -339,8 +444,14 @@ OP *op; switch (op->op_type) { default: + if (dowarn && (opargs[op->op_type] & OA_FOLDCONST)) + warn("Useless use of %s", op_name[op->op_type]); return op; + case OP_NEXTSTATE: + curcop = ((COP*)op); /* for warning above */ + break; + case OP_CONST: op->op_type = OP_NULL; /* don't execute a constant */ sv_free(cSVOP->op_sv); /* don't even remember it */ @@ -442,6 +553,7 @@ OP *op; else list(kid); } + curcop = &compiling; break; } return op; @@ -462,6 +574,7 @@ OP *op; if (kid->op_sibling) scalarvoid(kid); } + curcop = &compiling; } return op; } @@ -496,10 +609,10 @@ I32 type; case OP_ENTERSUBR: if ((type == OP_DEFINED || type == OP_UNDEF || type == OP_REFGEN) && !(op->op_flags & OPf_STACKED)) { - op->op_type = OP_NULL; /* disable entersubr */ - op->op_ppaddr = ppaddr[OP_NULL]; - cLISTOP->op_first->op_type = OP_NULL; /* disable pushmark */ - cLISTOP->op_first->op_ppaddr = ppaddr[OP_NULL]; + op->op_type = OP_RV2CV; /* entersubr => rv2cv */ + op->op_ppaddr = ppaddr[OP_RV2CV]; + cUNOP->op_first->op_type = OP_NULL; /* disable pushmark */ + cUNOP->op_first->op_ppaddr = ppaddr[OP_NULL]; break; } /* FALL THROUGH */ @@ -521,14 +634,18 @@ I32 type; case OP_RV2AV: case OP_RV2HV: case OP_RV2GV: - ref(cUNOP->op_first, type ? type : op->op_type); + ref(cUNOP->op_first, op->op_type); /* FALL THROUGH */ case OP_AASSIGN: case OP_ASLICE: case OP_HSLICE: - case OP_CURCOP: + case OP_NEXTSTATE: + case OP_DBSTATE: refcount = 10000; break; + case OP_PADSV: + case OP_PADAV: + case OP_PADHV: case OP_UNDEF: case OP_GV: case OP_RV2SV: @@ -559,7 +676,8 @@ I32 type; case OP_AELEM: case OP_HELEM: ref(cBINOP->op_first, type ? type : op->op_type); - op->op_private = type; + if (type == OP_RV2AV || type == OP_RV2HV) + op->op_private = type; break; case OP_LEAVE: @@ -577,7 +695,7 @@ I32 type; op->op_flags |= OPf_LVAL; if (!type) { op->op_flags &= ~OPf_SPECIAL; - op->op_flags |= OPf_LOCAL; + op->op_flags |= OPf_INTRO; } else if (type == OP_AASSIGN || type == OP_SASSIGN) op->op_flags |= OPf_SPECIAL; @@ -585,6 +703,35 @@ I32 type; } OP * +my(op) +OP *op; +{ + OP *kid; + SV *sv; + I32 type; + + if (!op) + return op; + + type = op->op_type; + if (type == OP_LIST) { + for (kid = cLISTOP->op_first; kid; kid = kid->op_sibling) + my(kid); + } + else if (type != OP_PADSV && + type != OP_PADAV && + type != OP_PADHV && + type != OP_PUSHMARK) + { + sprintf(tokenbuf, "Can't declare %s in my", op_name[op->op_type]); + yyerror(tokenbuf); + return op; + } + op->op_flags |= OPf_LVAL|OPf_INTRO; + return op; +} + +OP * sawparens(o) OP *o; { @@ -659,14 +806,19 @@ OP **startp; } OP * -localize(o) +localize(o, lex) OP *o; +I32 lex; { if (o->op_flags & OPf_PARENS) list(o); else scalar(o); - return ref(o, Nullop); /* a bit kludgey */ + in_my = FALSE; + if (lex) + return my(o); + else + return ref(o, OP_NULL); /* a bit kludgey */ } OP * @@ -699,7 +851,10 @@ register OP *o; goto nope; for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) { - if (curop->op_type != OP_CONST && curop->op_type != OP_LIST) { + if (curop->op_type != OP_CONST && + curop->op_type != OP_LIST && + curop->op_type != OP_SCALAR && + curop->op_type != OP_PUSHMARK) { goto nope; } } @@ -956,6 +1111,9 @@ OP* first; return newBINOP(type, flags, newOP(OP_PUSHMARK, 0), first); } + if (!first) + first = newOP(OP_STUB, 0); + Newz(1101, unop, 1, UNOP); unop->op_type = type; unop->op_ppaddr = ppaddr[type]; @@ -1114,7 +1272,7 @@ OP *repl; SV *pat = ((SVOP*)expr)->op_sv; char *p = SvPVn(pat); if ((op->op_flags & OPf_SPECIAL) && strEQ(p, " ")) { - sv_setpv(pat, "\\s+", 3); + sv_setpvn(pat, "\\s+", 3); p = SvPVn(pat); pm->op_pmflags |= PMf_SKIPWHITE; } @@ -1153,7 +1311,7 @@ OP *repl; if (opargs[curop->op_type] & OA_DANGEROUS) { if (curop->op_type == OP_GV) { GV *gv = ((GVOP*)curop)->op_gv; - if (index("&`'123456789+", *GvENAME(gv))) + if (strchr("&`'123456789+", *GvENAME(gv))) break; } else if (curop->op_type == OP_RV2CV) @@ -1285,21 +1443,29 @@ OP *op; { char tmpbuf[256]; GV *tmpgv; - SV *sv = cSVOP->op_sv; - char *name = SvPVn(sv); + SV *sv; + char *name; save_hptr(&curstash); save_item(curstname); - sv_setpv(curstname,name); - sprintf(tmpbuf,"'_%s",name); - tmpgv = gv_fetchpv(tmpbuf,TRUE); - if (!GvHV(tmpgv)) - GvHV(tmpgv) = newHV(0); - curstash = GvHV(tmpgv); - if (!HvNAME(curstash)) - HvNAME(curstash) = savestr(name); - HvCOEFFSIZE(curstash) = 0; - op_free(op); + if (op) { + sv = cSVOP->op_sv; + name = SvPVn(sv); + sv_setpv(curstname,name); + sprintf(tmpbuf,"'_%s",name); + tmpgv = gv_fetchpv(tmpbuf,TRUE); + if (!GvHV(tmpgv)) + GvHV(tmpgv) = newHV(0); + curstash = GvHV(tmpgv); + if (!HvNAME(curstash)) + HvNAME(curstash) = savestr(name); + HvCOEFFSIZE(curstash) = 0; + op_free(op); + } + else { + sv_setpv(curstname,"<none>"); + curstash = Nullhv; + } copline = NOLINE; expect = XBLOCK; } @@ -1341,6 +1507,9 @@ register OP *op; op->op_type == OP_ASLICE || op->op_type == OP_HSLICE) return TRUE; + if (op->op_type == OP_PADAV || op->op_type == OP_PADHV) + return TRUE; + if (op->op_type == OP_RV2SV) return FALSE; @@ -1383,7 +1552,7 @@ OP *right; list(prepend_elem(OP_LIST, newOP(OP_PUSHMARK, 0), right)), list(prepend_elem(OP_LIST, newOP(OP_PUSHMARK, 0), left)) ); op->op_private = 0; - if (!(left->op_flags & OPf_LOCAL)) { + if (!(left->op_flags & OPf_INTRO)) { static int generation = 0; OP *curop; OP *lastop = op; @@ -1436,14 +1605,17 @@ OP *op; { register COP *cop; + comppadnamefill = AvFILL(comppadname); /* introduce my variables */ + Newz(1101, cop, 1, COP); - cop->op_type = OP_CURCOP; - cop->op_ppaddr = ppaddr[OP_CURCOP]; + cop->op_type = OP_NEXTSTATE; + cop->op_ppaddr = ppaddr[ perldb ? OP_DBSTATE : OP_NEXTSTATE ]; cop->op_flags = flags; cop->op_private = 0; cop->op_next = (OP*)cop; cop->cop_label = label; + cop->cop_seq = cop_seq++; if (copline == NOLINE) cop->cop_line = curcop->cop_line; @@ -1454,6 +1626,15 @@ OP *op; cop->cop_filegv = curcop->cop_filegv; cop->cop_stash = curstash; + if (perldb) { + SV **svp = av_fetch(GvAV(curcop->cop_filegv),(I32)cop->cop_line, FALSE); + if (svp && *svp != &sv_undef && !SvIOK(*svp)) { + SvIV(*svp) = 1; + SvIOK_on(*svp); + SvSTASH(*svp) = (HV*)cop; + } + } + return prepend_elem(OP_LINESEQ, (OP*)cop, op); } @@ -1484,6 +1665,8 @@ OP* other; } } if (first->op_type == OP_CONST) { + if (dowarn && (first->op_private & OPpCONST_BARE)) + warn("Probable precedence problem on %s", op_name[type]); if ((type == OP_AND) == (SvTRUE(((SVOP*)first)->op_sv))) { op_free(first); return other; @@ -1632,7 +1815,12 @@ OP *expr; OP *block; { OP* listop = append_elem(OP_LINESEQ, block, newOP(OP_UNSTACK, 0)); - OP* op = newLOGOP(OP_AND, 0, expr, listop); + OP* op; + + if (expr && (expr->op_type == OP_READLINE || expr->op_type == OP_GLOB)) + expr = newASSIGNOP(0, newSVREF(newGVOP(OP_GV, 0, defgv)), expr); + + op = newLOGOP(OP_AND, 0, expr, listop); ((LISTOP*)listop)->op_last->op_next = LINKLIST(op); if (block->op_flags & OPf_SPECIAL && /* skip conditional on do {} ? */ @@ -1736,7 +1924,7 @@ OP*cont; prepend_elem(OP_LIST, newOP(OP_PUSHMARK, 0), expr), scalar(sv)))); return newSTATEOP(0, label, newWHILEOP(flags, 1, - loop, newOP(OP_ITER), block, cont)); + loop, newOP(OP_ITER, 0), block, cont)); } void @@ -1776,7 +1964,7 @@ OP *block; if (CvDEPTH(cv)) CvDELETED(cv) = TRUE; /* probably an autoloader */ else { - if (dowarn) { + if (dowarn && CvROOT(cv)) { line_t oldline = curcop->cop_line; curcop->cop_line = copline; @@ -1793,15 +1981,56 @@ OP *block; av = newAV(); AvREAL_off(av); + if (AvFILL(comppadname) < AvFILL(comppad)) + av_store(comppadname, AvFILL(comppad), Nullsv); + av_store(av, 0, (SV*)comppadname); av_store(av, 1, (SV*)comppad); AvFILL(av) = 1; CvPADLIST(cv) = av; + comppadname = newAV(); + if (!block) { + CvROOT(cv) = 0; + op_free(op); + copline = NOLINE; + leave_scope(floor); + return; + } CvROOT(cv) = newUNOP(OP_LEAVESUBR, 0, scalarseq(block)); CvSTART(cv) = LINKLIST(CvROOT(cv)); CvROOT(cv)->op_next = 0; + CvSTASH(cv) = curstash; peep(CvSTART(cv)); CvDELETED(cv) = FALSE; + if (strEQ(name, "BEGIN")) { + line_t oldline = curcop->cop_line; + GV* oldfile = curcop->cop_filegv; + + if (!beginav) + beginav = newAV(); + av_push(beginav, sv_ref(gv)); + DEBUG_x( dump_sub(gv) ); + rs = nrs; + rslen = nrslen; + rschar = nrschar; + rspara = (nrslen == 2); + calllist(beginav); + cv_free(cv); + rs = "\n"; + rslen = 1; + rschar = '\n'; + rspara = 0; + GvCV(gv) = 0; + curcop = &compiling; + curcop->cop_line = oldline; /* might have compiled something */ + curcop->cop_filegv = oldfile; /* recursively, clobbering these */ + } + else if (strEQ(name, "END")) { + if (!endav) + endav = newAV(); + av_unshift(endav, 1); + av_store(endav, 0, sv_ref(gv)); + } if (perldb) { SV *sv; SV *tmpstr = sv_mortalcopy(&sv_undef); @@ -1847,6 +2076,17 @@ char *filename; CvUSERSUB(cv) = subaddr; CvUSERINDEX(cv) = ix; CvDELETED(cv) = FALSE; + if (strEQ(name, "BEGIN")) { + if (!beginav) + beginav = newAV(); + av_push(beginav, sv_ref(gv)); + } + else if (strEQ(name, "END")) { + if (!endav) + endav = newAV(); + av_unshift(endav, 1); + av_store(endav, 0, sv_ref(gv)); + } } void @@ -1919,20 +2159,24 @@ OP * newANONLIST(op) OP* op; { - return newUNOP(OP_REFGEN, 0, ref(list(convert(OP_ANONLIST, 0, op)))); + return newUNOP(OP_REFGEN, 0, + ref(list(convert(OP_ANONLIST, 0, op)), OP_REFGEN)); } OP * newANONHASH(op) OP* op; { - return newUNOP(OP_REFGEN, 0, ref(list(convert(OP_ANONHASH, 0, op)))); + return newUNOP(OP_REFGEN, 0, + ref(list(convert(OP_ANONHASH, 0, op)), OP_REFGEN)); } OP * oopsAV(o) OP *o; { + if (o->op_type == OP_PADAV) + return o; if (o->op_type == OP_RV2SV) { o->op_type = OP_RV2AV; o->op_ppaddr = ppaddr[OP_RV2AV]; @@ -1947,6 +2191,8 @@ OP * oopsHV(o) OP *o; { + if (o->op_type == OP_PADHV) + return o; if (o->op_type == OP_RV2SV || o->op_type == OP_RV2AV) { o->op_type = OP_RV2HV; o->op_ppaddr = ppaddr[OP_RV2HV]; @@ -1961,6 +2207,8 @@ OP * newAVREF(o) OP *o; { + if (o->op_type == OP_PADAV) + return o; return newUNOP(OP_RV2AV, 0, scalar(o)); } @@ -1975,6 +2223,8 @@ OP * newHVREF(o) OP *o; { + if (o->op_type == OP_PADHV) + return o; return newUNOP(OP_RV2HV, 0, scalar(o)); } @@ -1998,6 +2248,8 @@ OP * newSVREF(o) OP *o; { + if (o->op_type == OP_PADSV) + return o; return newUNOP(OP_RV2SV, 0, scalar(o)); } @@ -2063,11 +2315,10 @@ OP *op; if (op->op_flags & OPf_KIDS) { SVOP *kid = (SVOP*)cUNOP->op_first; - if (kid->op_type == OP_CONST) { -#ifdef NOTDEF - op->op_type = OP_EVALONCE; - op->op_ppaddr = ppaddr[OP_EVALONCE]; -#endif + if (!kid) { + op->op_flags &= ~OPf_KIDS; + op->op_type = OP_NULL; + op->op_ppaddr = ppaddr[OP_NULL]; } else if (kid->op_type == OP_LINESEQ) { LOGOP *enter; @@ -2306,7 +2557,10 @@ OP *op; LOGOP *gwop; OP *kid; - op->op_flags &= ~OPf_STACKED; /* XXX do we need to scope() it? */ + if (op->op_flags & OPf_STACKED) { + op = ck_sort(op); + op->op_flags &= ~OPf_STACKED; + } op = ck_fun(op); if (error_count) return op; @@ -2363,7 +2617,7 @@ OP *op; kid = cLISTOP->op_first; if (!kid) { - prepend_elem(op->op_type, newOP(OP_PUSHMARK), op); + prepend_elem(op->op_type, newOP(OP_PUSHMARK, 0), op); kid = cLISTOP->op_first; } if (kid->op_type == OP_PUSHMARK) @@ -2545,7 +2799,16 @@ OP * ck_subr(op) OP *op; { + OP *o = ((cUNOP->op_first->op_sibling) + ? cUNOP : ((UNOP*)cUNOP->op_first))->op_first->op_sibling; + + if (o->op_type == OP_RV2CV) { + o->op_type = OP_NULL; /* disable rv2cv */ + o->op_ppaddr = ppaddr[OP_NULL]; + } op->op_private = 0; + if (perldb) + op->op_private |= OPpSUBR_DB; return op; } @@ -2575,6 +2838,7 @@ register OP* op; switch (op->op_type) { case OP_NULL: case OP_SCALAR: + case OP_LINESEQ: if (oldop) { oldop->op_next = op->op_next; continue; @@ -2586,7 +2850,7 @@ register OP* op; if (op->op_next->op_type == OP_RV2SV) { op->op_next->op_type = OP_NULL; op->op_next->op_ppaddr = ppaddr[OP_NULL]; - op->op_flags |= op->op_next->op_flags & OPf_LOCAL; + op->op_flags |= op->op_next->op_flags & OPf_INTRO; op->op_next = op->op_next->op_next; op->op_type = OP_GVSV; op->op_ppaddr = ppaddr[OP_GVSV]; @@ -51,7 +51,7 @@ typedef U16 PADOFFSET; #define OPf_PARENS 8 /* This operator was parenthesized. */ #define OPf_STACKED 16 /* Some arg is arriving on the stack. */ #define OPf_LVAL 32 /* Certified reference (lvalue). */ -#define OPf_LOCAL 64 /* Lvalue must be localized */ +#define OPf_INTRO 64 /* Lvalue must be localized */ #define OPf_SPECIAL 128 /* Do something weird for this op: */ /* On local LVAL, don't init local value. */ /* On OP_SORT, subroutine is inlined. */ @@ -1,327 +1,334 @@ typedef enum { OP_NULL, /* 0 */ - OP_SCALAR, /* 1 */ - OP_PUSHMARK, /* 2 */ - OP_WANTARRAY, /* 3 */ - OP_WORD, /* 4 */ + OP_STUB, /* 1 */ + OP_SCALAR, /* 2 */ + OP_PUSHMARK, /* 3 */ + OP_WANTARRAY, /* 4 */ OP_CONST, /* 5 */ OP_INTERP, /* 6 */ OP_GVSV, /* 7 */ OP_GV, /* 8 */ - OP_PUSHRE, /* 9 */ - OP_RV2GV, /* 10 */ - OP_SV2LEN, /* 11 */ - OP_RV2SV, /* 12 */ - OP_AV2ARYLEN, /* 13 */ - OP_RV2CV, /* 14 */ - OP_REFGEN, /* 15 */ - OP_REF, /* 16 */ - OP_BLESS, /* 17 */ - OP_BACKTICK, /* 18 */ - OP_GLOB, /* 19 */ - OP_READLINE, /* 20 */ - OP_RCATLINE, /* 21 */ - OP_REGCOMP, /* 22 */ - OP_MATCH, /* 23 */ - OP_SUBST, /* 24 */ - OP_SUBSTCONT, /* 25 */ - OP_TRANS, /* 26 */ - OP_SASSIGN, /* 27 */ - OP_AASSIGN, /* 28 */ - OP_SCHOP, /* 29 */ - OP_CHOP, /* 30 */ - OP_DEFINED, /* 31 */ - OP_UNDEF, /* 32 */ - OP_STUDY, /* 33 */ - OP_PREINC, /* 34 */ - OP_PREDEC, /* 35 */ - OP_POSTINC, /* 36 */ - OP_POSTDEC, /* 37 */ - OP_POW, /* 38 */ - OP_MULTIPLY, /* 39 */ - OP_DIVIDE, /* 40 */ - OP_MODULO, /* 41 */ - OP_REPEAT, /* 42 */ - OP_ADD, /* 43 */ - OP_INTADD, /* 44 */ - OP_SUBTRACT, /* 45 */ - OP_CONCAT, /* 46 */ - OP_LEFT_SHIFT, /* 47 */ - OP_RIGHT_SHIFT, /* 48 */ - OP_LT, /* 49 */ - OP_GT, /* 50 */ - OP_LE, /* 51 */ - OP_GE, /* 52 */ - OP_EQ, /* 53 */ - OP_NE, /* 54 */ - OP_NCMP, /* 55 */ - OP_SLT, /* 56 */ - OP_SGT, /* 57 */ - OP_SLE, /* 58 */ - OP_SGE, /* 59 */ - OP_SEQ, /* 60 */ - OP_SNE, /* 61 */ - OP_SCMP, /* 62 */ - OP_BIT_AND, /* 63 */ - OP_XOR, /* 64 */ - OP_BIT_OR, /* 65 */ - OP_NEGATE, /* 66 */ - OP_NOT, /* 67 */ - OP_COMPLEMENT, /* 68 */ - OP_ATAN2, /* 69 */ - OP_SIN, /* 70 */ - OP_COS, /* 71 */ - OP_RAND, /* 72 */ - OP_SRAND, /* 73 */ - OP_EXP, /* 74 */ - OP_LOG, /* 75 */ - OP_SQRT, /* 76 */ - OP_INT, /* 77 */ - OP_HEX, /* 78 */ - OP_OCT, /* 79 */ - OP_LENGTH, /* 80 */ - OP_SUBSTR, /* 81 */ - OP_VEC, /* 82 */ - OP_INDEX, /* 83 */ - OP_RINDEX, /* 84 */ - OP_SPRINTF, /* 85 */ - OP_FORMLINE, /* 86 */ - OP_ORD, /* 87 */ - OP_CRYPT, /* 88 */ - OP_UCFIRST, /* 89 */ - OP_LCFIRST, /* 90 */ - OP_UC, /* 91 */ - OP_LC, /* 92 */ - OP_RV2AV, /* 93 */ - OP_AELEMFAST, /* 94 */ - OP_AELEM, /* 95 */ - OP_ASLICE, /* 96 */ - OP_EACH, /* 97 */ - OP_VALUES, /* 98 */ - OP_KEYS, /* 99 */ - OP_DELETE, /* 100 */ - OP_RV2HV, /* 101 */ - OP_HELEM, /* 102 */ - OP_HSLICE, /* 103 */ - OP_UNPACK, /* 104 */ - OP_PACK, /* 105 */ - OP_SPLIT, /* 106 */ - OP_JOIN, /* 107 */ - OP_LIST, /* 108 */ - OP_LSLICE, /* 109 */ - OP_ANONLIST, /* 110 */ - OP_ANONHASH, /* 111 */ - OP_SPLICE, /* 112 */ - OP_PUSH, /* 113 */ - OP_POP, /* 114 */ - OP_SHIFT, /* 115 */ - OP_UNSHIFT, /* 116 */ - OP_SORT, /* 117 */ - OP_REVERSE, /* 118 */ - OP_GREPSTART, /* 119 */ - OP_GREPWHILE, /* 120 */ - OP_RANGE, /* 121 */ - OP_FLIP, /* 122 */ - OP_FLOP, /* 123 */ - OP_AND, /* 124 */ - OP_OR, /* 125 */ - OP_COND_EXPR, /* 126 */ - OP_ANDASSIGN, /* 127 */ - OP_ORASSIGN, /* 128 */ - OP_METHOD, /* 129 */ - OP_ENTERSUBR, /* 130 */ - OP_LEAVESUBR, /* 131 */ - OP_CALLER, /* 132 */ - OP_WARN, /* 133 */ - OP_DIE, /* 134 */ - OP_RESET, /* 135 */ - OP_LINESEQ, /* 136 */ - OP_CURCOP, /* 137 */ - OP_UNSTACK, /* 138 */ - OP_ENTER, /* 139 */ - OP_LEAVE, /* 140 */ - OP_ENTERITER, /* 141 */ - OP_ITER, /* 142 */ - OP_ENTERLOOP, /* 143 */ - OP_LEAVELOOP, /* 144 */ - OP_RETURN, /* 145 */ - OP_LAST, /* 146 */ - OP_NEXT, /* 147 */ - OP_REDO, /* 148 */ - OP_DUMP, /* 149 */ - OP_GOTO, /* 150 */ - OP_EXIT, /* 151 */ - OP_NSWITCH, /* 152 */ - OP_CSWITCH, /* 153 */ - OP_OPEN, /* 154 */ - OP_CLOSE, /* 155 */ - OP_PIPE_OP, /* 156 */ - OP_FILENO, /* 157 */ - OP_UMASK, /* 158 */ - OP_BINMODE, /* 159 */ - OP_DBMOPEN, /* 160 */ - OP_DBMCLOSE, /* 161 */ - OP_SSELECT, /* 162 */ - OP_SELECT, /* 163 */ - OP_GETC, /* 164 */ - OP_READ, /* 165 */ - OP_ENTERWRITE, /* 166 */ - OP_LEAVEWRITE, /* 167 */ - OP_PRTF, /* 168 */ - OP_PRINT, /* 169 */ - OP_SYSREAD, /* 170 */ - OP_SYSWRITE, /* 171 */ - OP_SEND, /* 172 */ - OP_RECV, /* 173 */ - OP_EOF, /* 174 */ - OP_TELL, /* 175 */ - OP_SEEK, /* 176 */ - OP_TRUNCATE, /* 177 */ - OP_FCNTL, /* 178 */ - OP_IOCTL, /* 179 */ - OP_FLOCK, /* 180 */ - OP_SOCKET, /* 181 */ - OP_SOCKPAIR, /* 182 */ - OP_BIND, /* 183 */ - OP_CONNECT, /* 184 */ - OP_LISTEN, /* 185 */ - OP_ACCEPT, /* 186 */ - OP_SHUTDOWN, /* 187 */ - OP_GSOCKOPT, /* 188 */ - OP_SSOCKOPT, /* 189 */ - OP_GETSOCKNAME, /* 190 */ - OP_GETPEERNAME, /* 191 */ - OP_LSTAT, /* 192 */ - OP_STAT, /* 193 */ - OP_FTRREAD, /* 194 */ - OP_FTRWRITE, /* 195 */ - OP_FTREXEC, /* 196 */ - OP_FTEREAD, /* 197 */ - OP_FTEWRITE, /* 198 */ - OP_FTEEXEC, /* 199 */ - OP_FTIS, /* 200 */ - OP_FTEOWNED, /* 201 */ - OP_FTROWNED, /* 202 */ - OP_FTZERO, /* 203 */ - OP_FTSIZE, /* 204 */ - OP_FTMTIME, /* 205 */ - OP_FTATIME, /* 206 */ - OP_FTCTIME, /* 207 */ - OP_FTSOCK, /* 208 */ - OP_FTCHR, /* 209 */ - OP_FTBLK, /* 210 */ - OP_FTFILE, /* 211 */ - OP_FTDIR, /* 212 */ - OP_FTPIPE, /* 213 */ - OP_FTLINK, /* 214 */ - OP_FTSUID, /* 215 */ - OP_FTSGID, /* 216 */ - OP_FTSVTX, /* 217 */ - OP_FTTTY, /* 218 */ - OP_FTTEXT, /* 219 */ - OP_FTBINARY, /* 220 */ - OP_CHDIR, /* 221 */ - OP_CHOWN, /* 222 */ - OP_CHROOT, /* 223 */ - OP_UNLINK, /* 224 */ - OP_CHMOD, /* 225 */ - OP_UTIME, /* 226 */ - OP_RENAME, /* 227 */ - OP_LINK, /* 228 */ - OP_SYMLINK, /* 229 */ - OP_READLINK, /* 230 */ - OP_MKDIR, /* 231 */ - OP_RMDIR, /* 232 */ - OP_OPEN_DIR, /* 233 */ - OP_READDIR, /* 234 */ - OP_TELLDIR, /* 235 */ - OP_SEEKDIR, /* 236 */ - OP_REWINDDIR, /* 237 */ - OP_CLOSEDIR, /* 238 */ - OP_FORK, /* 239 */ - OP_WAIT, /* 240 */ - OP_WAITPID, /* 241 */ - OP_SYSTEM, /* 242 */ - OP_EXEC, /* 243 */ - OP_KILL, /* 244 */ - OP_GETPPID, /* 245 */ - OP_GETPGRP, /* 246 */ - OP_SETPGRP, /* 247 */ - OP_GETPRIORITY, /* 248 */ - OP_SETPRIORITY, /* 249 */ - OP_TIME, /* 250 */ - OP_TMS, /* 251 */ - OP_LOCALTIME, /* 252 */ - OP_GMTIME, /* 253 */ - OP_ALARM, /* 254 */ - OP_SLEEP, /* 255 */ - OP_SHMGET, /* 256 */ - OP_SHMCTL, /* 257 */ - OP_SHMREAD, /* 258 */ - OP_SHMWRITE, /* 259 */ - OP_MSGGET, /* 260 */ - OP_MSGCTL, /* 261 */ - OP_MSGSND, /* 262 */ - OP_MSGRCV, /* 263 */ - OP_SEMGET, /* 264 */ - OP_SEMCTL, /* 265 */ - OP_SEMOP, /* 266 */ - OP_REQUIRE, /* 267 */ - OP_DOFILE, /* 268 */ - OP_ENTEREVAL, /* 269 */ - OP_LEAVEEVAL, /* 270 */ - OP_EVALONCE, /* 271 */ - OP_ENTERTRY, /* 272 */ - OP_LEAVETRY, /* 273 */ - OP_GHBYNAME, /* 274 */ - OP_GHBYADDR, /* 275 */ - OP_GHOSTENT, /* 276 */ - OP_GNBYNAME, /* 277 */ - OP_GNBYADDR, /* 278 */ - OP_GNETENT, /* 279 */ - OP_GPBYNAME, /* 280 */ - OP_GPBYNUMBER, /* 281 */ - OP_GPROTOENT, /* 282 */ - OP_GSBYNAME, /* 283 */ - OP_GSBYPORT, /* 284 */ - OP_GSERVENT, /* 285 */ - OP_SHOSTENT, /* 286 */ - OP_SNETENT, /* 287 */ - OP_SPROTOENT, /* 288 */ - OP_SSERVENT, /* 289 */ - OP_EHOSTENT, /* 290 */ - OP_ENETENT, /* 291 */ - OP_EPROTOENT, /* 292 */ - OP_ESERVENT, /* 293 */ - OP_GPWNAM, /* 294 */ - OP_GPWUID, /* 295 */ - OP_GPWENT, /* 296 */ - OP_SPWENT, /* 297 */ - OP_EPWENT, /* 298 */ - OP_GGRNAM, /* 299 */ - OP_GGRGID, /* 300 */ - OP_GGRENT, /* 301 */ - OP_SGRENT, /* 302 */ - OP_EGRENT, /* 303 */ - OP_GETLOGIN, /* 304 */ - OP_SYSCALL, /* 305 */ + OP_PADSV, /* 9 */ + OP_PADAV, /* 10 */ + OP_PADHV, /* 11 */ + OP_PUSHRE, /* 12 */ + OP_RV2GV, /* 13 */ + OP_SV2LEN, /* 14 */ + OP_RV2SV, /* 15 */ + OP_AV2ARYLEN, /* 16 */ + OP_RV2CV, /* 17 */ + OP_REFGEN, /* 18 */ + OP_REF, /* 19 */ + OP_BLESS, /* 20 */ + OP_BACKTICK, /* 21 */ + OP_GLOB, /* 22 */ + OP_READLINE, /* 23 */ + OP_RCATLINE, /* 24 */ + OP_REGCOMP, /* 25 */ + OP_MATCH, /* 26 */ + OP_SUBST, /* 27 */ + OP_SUBSTCONT, /* 28 */ + OP_TRANS, /* 29 */ + OP_SASSIGN, /* 30 */ + OP_AASSIGN, /* 31 */ + OP_SCHOP, /* 32 */ + OP_CHOP, /* 33 */ + OP_DEFINED, /* 34 */ + OP_UNDEF, /* 35 */ + OP_STUDY, /* 36 */ + OP_PREINC, /* 37 */ + OP_PREDEC, /* 38 */ + OP_POSTINC, /* 39 */ + OP_POSTDEC, /* 40 */ + OP_POW, /* 41 */ + OP_MULTIPLY, /* 42 */ + OP_DIVIDE, /* 43 */ + OP_MODULO, /* 44 */ + OP_REPEAT, /* 45 */ + OP_ADD, /* 46 */ + OP_INTADD, /* 47 */ + OP_SUBTRACT, /* 48 */ + OP_CONCAT, /* 49 */ + OP_LEFT_SHIFT, /* 50 */ + OP_RIGHT_SHIFT, /* 51 */ + OP_LT, /* 52 */ + OP_GT, /* 53 */ + OP_LE, /* 54 */ + OP_GE, /* 55 */ + OP_EQ, /* 56 */ + OP_NE, /* 57 */ + OP_NCMP, /* 58 */ + OP_SLT, /* 59 */ + OP_SGT, /* 60 */ + OP_SLE, /* 61 */ + OP_SGE, /* 62 */ + OP_SEQ, /* 63 */ + OP_SNE, /* 64 */ + OP_SCMP, /* 65 */ + OP_BIT_AND, /* 66 */ + OP_XOR, /* 67 */ + OP_BIT_OR, /* 68 */ + OP_NEGATE, /* 69 */ + OP_NOT, /* 70 */ + OP_COMPLEMENT, /* 71 */ + OP_ATAN2, /* 72 */ + OP_SIN, /* 73 */ + OP_COS, /* 74 */ + OP_RAND, /* 75 */ + OP_SRAND, /* 76 */ + OP_EXP, /* 77 */ + OP_LOG, /* 78 */ + OP_SQRT, /* 79 */ + OP_INT, /* 80 */ + OP_HEX, /* 81 */ + OP_OCT, /* 82 */ + OP_LENGTH, /* 83 */ + OP_SUBSTR, /* 84 */ + OP_VEC, /* 85 */ + OP_INDEX, /* 86 */ + OP_RINDEX, /* 87 */ + OP_SPRINTF, /* 88 */ + OP_FORMLINE, /* 89 */ + OP_ORD, /* 90 */ + OP_CRYPT, /* 91 */ + OP_UCFIRST, /* 92 */ + OP_LCFIRST, /* 93 */ + OP_UC, /* 94 */ + OP_LC, /* 95 */ + OP_RV2AV, /* 96 */ + OP_AELEMFAST, /* 97 */ + OP_AELEM, /* 98 */ + OP_ASLICE, /* 99 */ + OP_EACH, /* 100 */ + OP_VALUES, /* 101 */ + OP_KEYS, /* 102 */ + OP_DELETE, /* 103 */ + OP_RV2HV, /* 104 */ + OP_HELEM, /* 105 */ + OP_HSLICE, /* 106 */ + OP_UNPACK, /* 107 */ + OP_PACK, /* 108 */ + OP_SPLIT, /* 109 */ + OP_JOIN, /* 110 */ + OP_LIST, /* 111 */ + OP_LSLICE, /* 112 */ + OP_ANONLIST, /* 113 */ + OP_ANONHASH, /* 114 */ + OP_SPLICE, /* 115 */ + OP_PUSH, /* 116 */ + OP_POP, /* 117 */ + OP_SHIFT, /* 118 */ + OP_UNSHIFT, /* 119 */ + OP_SORT, /* 120 */ + OP_REVERSE, /* 121 */ + OP_GREPSTART, /* 122 */ + OP_GREPWHILE, /* 123 */ + OP_RANGE, /* 124 */ + OP_FLIP, /* 125 */ + OP_FLOP, /* 126 */ + OP_AND, /* 127 */ + OP_OR, /* 128 */ + OP_COND_EXPR, /* 129 */ + OP_ANDASSIGN, /* 130 */ + OP_ORASSIGN, /* 131 */ + OP_METHOD, /* 132 */ + OP_ENTERSUBR, /* 133 */ + OP_LEAVESUBR, /* 134 */ + OP_CALLER, /* 135 */ + OP_WARN, /* 136 */ + OP_DIE, /* 137 */ + OP_RESET, /* 138 */ + OP_LINESEQ, /* 139 */ + OP_NEXTSTATE, /* 140 */ + OP_DBSTATE, /* 141 */ + OP_UNSTACK, /* 142 */ + OP_ENTER, /* 143 */ + OP_LEAVE, /* 144 */ + OP_ENTERITER, /* 145 */ + OP_ITER, /* 146 */ + OP_ENTERLOOP, /* 147 */ + OP_LEAVELOOP, /* 148 */ + OP_RETURN, /* 149 */ + OP_LAST, /* 150 */ + OP_NEXT, /* 151 */ + OP_REDO, /* 152 */ + OP_DUMP, /* 153 */ + OP_GOTO, /* 154 */ + OP_EXIT, /* 155 */ + OP_NSWITCH, /* 156 */ + OP_CSWITCH, /* 157 */ + OP_OPEN, /* 158 */ + OP_CLOSE, /* 159 */ + OP_PIPE_OP, /* 160 */ + OP_FILENO, /* 161 */ + OP_UMASK, /* 162 */ + OP_BINMODE, /* 163 */ + OP_DBMOPEN, /* 164 */ + OP_DBMCLOSE, /* 165 */ + OP_SSELECT, /* 166 */ + OP_SELECT, /* 167 */ + OP_GETC, /* 168 */ + OP_READ, /* 169 */ + OP_ENTERWRITE, /* 170 */ + OP_LEAVEWRITE, /* 171 */ + OP_PRTF, /* 172 */ + OP_PRINT, /* 173 */ + OP_SYSREAD, /* 174 */ + OP_SYSWRITE, /* 175 */ + OP_SEND, /* 176 */ + OP_RECV, /* 177 */ + OP_EOF, /* 178 */ + OP_TELL, /* 179 */ + OP_SEEK, /* 180 */ + OP_TRUNCATE, /* 181 */ + OP_FCNTL, /* 182 */ + OP_IOCTL, /* 183 */ + OP_FLOCK, /* 184 */ + OP_SOCKET, /* 185 */ + OP_SOCKPAIR, /* 186 */ + OP_BIND, /* 187 */ + OP_CONNECT, /* 188 */ + OP_LISTEN, /* 189 */ + OP_ACCEPT, /* 190 */ + OP_SHUTDOWN, /* 191 */ + OP_GSOCKOPT, /* 192 */ + OP_SSOCKOPT, /* 193 */ + OP_GETSOCKNAME, /* 194 */ + OP_GETPEERNAME, /* 195 */ + OP_LSTAT, /* 196 */ + OP_STAT, /* 197 */ + OP_FTRREAD, /* 198 */ + OP_FTRWRITE, /* 199 */ + OP_FTREXEC, /* 200 */ + OP_FTEREAD, /* 201 */ + OP_FTEWRITE, /* 202 */ + OP_FTEEXEC, /* 203 */ + OP_FTIS, /* 204 */ + OP_FTEOWNED, /* 205 */ + OP_FTROWNED, /* 206 */ + OP_FTZERO, /* 207 */ + OP_FTSIZE, /* 208 */ + OP_FTMTIME, /* 209 */ + OP_FTATIME, /* 210 */ + OP_FTCTIME, /* 211 */ + OP_FTSOCK, /* 212 */ + OP_FTCHR, /* 213 */ + OP_FTBLK, /* 214 */ + OP_FTFILE, /* 215 */ + OP_FTDIR, /* 216 */ + OP_FTPIPE, /* 217 */ + OP_FTLINK, /* 218 */ + OP_FTSUID, /* 219 */ + OP_FTSGID, /* 220 */ + OP_FTSVTX, /* 221 */ + OP_FTTTY, /* 222 */ + OP_FTTEXT, /* 223 */ + OP_FTBINARY, /* 224 */ + OP_CHDIR, /* 225 */ + OP_CHOWN, /* 226 */ + OP_CHROOT, /* 227 */ + OP_UNLINK, /* 228 */ + OP_CHMOD, /* 229 */ + OP_UTIME, /* 230 */ + OP_RENAME, /* 231 */ + OP_LINK, /* 232 */ + OP_SYMLINK, /* 233 */ + OP_READLINK, /* 234 */ + OP_MKDIR, /* 235 */ + OP_RMDIR, /* 236 */ + OP_OPEN_DIR, /* 237 */ + OP_READDIR, /* 238 */ + OP_TELLDIR, /* 239 */ + OP_SEEKDIR, /* 240 */ + OP_REWINDDIR, /* 241 */ + OP_CLOSEDIR, /* 242 */ + OP_FORK, /* 243 */ + OP_WAIT, /* 244 */ + OP_WAITPID, /* 245 */ + OP_SYSTEM, /* 246 */ + OP_EXEC, /* 247 */ + OP_KILL, /* 248 */ + OP_GETPPID, /* 249 */ + OP_GETPGRP, /* 250 */ + OP_SETPGRP, /* 251 */ + OP_GETPRIORITY, /* 252 */ + OP_SETPRIORITY, /* 253 */ + OP_TIME, /* 254 */ + OP_TMS, /* 255 */ + OP_LOCALTIME, /* 256 */ + OP_GMTIME, /* 257 */ + OP_ALARM, /* 258 */ + OP_SLEEP, /* 259 */ + OP_SHMGET, /* 260 */ + OP_SHMCTL, /* 261 */ + OP_SHMREAD, /* 262 */ + OP_SHMWRITE, /* 263 */ + OP_MSGGET, /* 264 */ + OP_MSGCTL, /* 265 */ + OP_MSGSND, /* 266 */ + OP_MSGRCV, /* 267 */ + OP_SEMGET, /* 268 */ + OP_SEMCTL, /* 269 */ + OP_SEMOP, /* 270 */ + OP_REQUIRE, /* 271 */ + OP_DOFILE, /* 272 */ + OP_ENTEREVAL, /* 273 */ + OP_LEAVEEVAL, /* 274 */ + OP_EVALONCE, /* 275 */ + OP_ENTERTRY, /* 276 */ + OP_LEAVETRY, /* 277 */ + OP_GHBYNAME, /* 278 */ + OP_GHBYADDR, /* 279 */ + OP_GHOSTENT, /* 280 */ + OP_GNBYNAME, /* 281 */ + OP_GNBYADDR, /* 282 */ + OP_GNETENT, /* 283 */ + OP_GPBYNAME, /* 284 */ + OP_GPBYNUMBER, /* 285 */ + OP_GPROTOENT, /* 286 */ + OP_GSBYNAME, /* 287 */ + OP_GSBYPORT, /* 288 */ + OP_GSERVENT, /* 289 */ + OP_SHOSTENT, /* 290 */ + OP_SNETENT, /* 291 */ + OP_SPROTOENT, /* 292 */ + OP_SSERVENT, /* 293 */ + OP_EHOSTENT, /* 294 */ + OP_ENETENT, /* 295 */ + OP_EPROTOENT, /* 296 */ + OP_ESERVENT, /* 297 */ + OP_GPWNAM, /* 298 */ + OP_GPWUID, /* 299 */ + OP_GPWENT, /* 300 */ + OP_SPWENT, /* 301 */ + OP_EPWENT, /* 302 */ + OP_GGRNAM, /* 303 */ + OP_GGRGID, /* 304 */ + OP_GGRENT, /* 305 */ + OP_SGRENT, /* 306 */ + OP_EGRENT, /* 307 */ + OP_GETLOGIN, /* 308 */ + OP_SYSCALL, /* 309 */ } opcode; -#define MAXO 306 +#define MAXO 310 #ifndef DOINIT extern char *op_name[]; #else char *op_name[] = { "null operation", - "null operation", + "stub", + "scalar", "pushmark", "wantarray", - "bare word", "constant item", "interpreted string", "scalar variable", "glob value", + "private variable", + "private array", + "private hash", "push regexp", "ref-to-glob cast", "scalar value length", @@ -451,6 +458,7 @@ char *op_name[] = { "reset", "line sequence", "next statement", + "debug next statement", "unstack", "block entry", "block exit", @@ -649,14 +657,17 @@ OP * ck_subr P((OP* op)); OP * ck_trunc P((OP* op)); OP * pp_null P((ARGSproto)); +OP * pp_stub P((ARGSproto)); OP * pp_scalar P((ARGSproto)); OP * pp_pushmark P((ARGSproto)); OP * pp_wantarray P((ARGSproto)); -OP * pp_word P((ARGSproto)); OP * pp_const P((ARGSproto)); OP * pp_interp P((ARGSproto)); OP * pp_gvsv P((ARGSproto)); OP * pp_gv P((ARGSproto)); +OP * pp_padsv P((ARGSproto)); +OP * pp_padav P((ARGSproto)); +OP * pp_padhv P((ARGSproto)); OP * pp_pushre P((ARGSproto)); OP * pp_rv2gv P((ARGSproto)); OP * pp_sv2len P((ARGSproto)); @@ -785,7 +796,8 @@ OP * pp_warn P((ARGSproto)); OP * pp_die P((ARGSproto)); OP * pp_reset P((ARGSproto)); OP * pp_lineseq P((ARGSproto)); -OP * pp_curcop P((ARGSproto)); +OP * pp_nextstate P((ARGSproto)); +OP * pp_dbstate P((ARGSproto)); OP * pp_unstack P((ARGSproto)); OP * pp_enter P((ARGSproto)); OP * pp_leave P((ARGSproto)); @@ -960,14 +972,17 @@ extern OP * (*ppaddr[])(); #else OP * (*ppaddr[])() = { pp_null, + pp_stub, pp_scalar, pp_pushmark, pp_wantarray, - pp_word, pp_const, pp_interp, pp_gvsv, pp_gv, + pp_padsv, + pp_padav, + pp_padhv, pp_pushre, pp_rv2gv, pp_sv2len, @@ -1096,7 +1111,8 @@ OP * (*ppaddr[])() = { pp_die, pp_reset, pp_lineseq, - pp_curcop, + pp_nextstate, + pp_dbstate, pp_unstack, pp_enter, pp_leave, @@ -1273,14 +1289,17 @@ extern OP * (*check[])(); #else OP * (*check[])() = { ck_null, /* null */ - ck_null, /* scalar */ + ck_null, /* stub */ + ck_fun, /* scalar */ ck_null, /* pushmark */ ck_null, /* wantarray */ - ck_null, /* word */ ck_null, /* const */ ck_null, /* interp */ ck_null, /* gvsv */ ck_null, /* gv */ + ck_null, /* padsv */ + ck_null, /* padav */ + ck_null, /* padhv */ ck_null, /* pushre */ ck_rvconst, /* rv2gv */ ck_null, /* sv2len */ @@ -1409,7 +1428,8 @@ OP * (*check[])() = { ck_fun, /* die */ ck_fun, /* reset */ ck_null, /* lineseq */ - ck_null, /* curcop */ + ck_null, /* nextstate */ + ck_null, /* dbstate */ ck_null, /* unstack */ ck_null, /* enter */ ck_null, /* leave */ @@ -1586,14 +1606,17 @@ EXT U32 opargs[]; #else U32 opargs[] = { 0x00000000, /* null */ - 0x00000004, /* scalar */ + 0x00000000, /* stub */ + 0x00000104, /* scalar */ 0x00000004, /* pushmark */ 0x00000014, /* wantarray */ - 0x00000004, /* word */ 0x00000004, /* const */ 0x00000000, /* interp */ 0x00000044, /* gvsv */ 0x00000044, /* gv */ + 0x00000000, /* padsv */ + 0x00000000, /* padav */ + 0x00000000, /* padhv */ 0x00000000, /* pushre */ 0x00000044, /* rv2gv */ 0x0000001c, /* sv2len */ @@ -1722,7 +1745,8 @@ U32 opargs[] = { 0x0000025d, /* die */ 0x00000914, /* reset */ 0x00000000, /* lineseq */ - 0x00000004, /* curcop */ + 0x00000004, /* nextstate */ + 0x00000004, /* dbstate */ 0x00000004, /* unstack */ 0x00000000, /* enter */ 0x00000000, /* leave */ @@ -1871,14 +1895,14 @@ U32 opargs[] = { 0x00001100, /* gsbyname */ 0x00001100, /* gsbyport */ 0x00000000, /* gservent */ - 0x0000011c, /* shostent */ - 0x0000011c, /* snetent */ - 0x0000011c, /* sprotoent */ - 0x0000011c, /* sservent */ - 0x0000001c, /* ehostent */ - 0x0000001c, /* enetent */ - 0x0000001c, /* eprotoent */ - 0x0000001c, /* eservent */ + 0x00000114, /* shostent */ + 0x00000114, /* snetent */ + 0x00000114, /* sprotoent */ + 0x00000114, /* sservent */ + 0x00000014, /* ehostent */ + 0x00000014, /* enetent */ + 0x00000014, /* eprotoent */ + 0x00000014, /* eservent */ 0x00000100, /* gpwnam */ 0x00000100, /* gpwuid */ 0x00000000, /* gpwent */ @@ -155,19 +155,22 @@ __END__ # Nothing. null null operation ck_null 0 -scalar null operation ck_null s +stub stub ck_null 0 +scalar scalar ck_fun s S # Pushy stuff. pushmark pushmark ck_null s wantarray wantarray ck_null is -word bare word ck_null s const constant item ck_null s interp interpreted string ck_null 0 gvsv scalar variable ck_null ds gv glob value ck_null ds +padsv private variable ck_null 0 +padav private array ck_null 0 +padhv private hash ck_null 0 pushre push regexp ck_null 0 @@ -352,7 +355,8 @@ die die ck_fun dimst L reset reset ck_fun is S? lineseq line sequence ck_null 0 -curcop next statement ck_null s +nextstate next statement ck_null s +dbstate debug next statement ck_null s unstack unstack ck_null s enter block entry ck_null 0 leave block exit ck_null 0 @@ -550,14 +554,14 @@ gprotoent getprotoent ck_null 0 gsbyname getservbyname ck_fun 0 S S gsbyport getservbyport ck_fun 0 S S gservent getservent ck_null 0 -shostent sethostent ck_fun ist S -snetent setnetent ck_fun ist S -sprotoent setprotoent ck_fun ist S -sservent setservent ck_fun ist S -ehostent endhostent ck_null ist -enetent endnetent ck_null ist -eprotoent endprotoent ck_null ist -eservent endservent ck_null ist +shostent sethostent ck_fun is S +snetent setnetent ck_fun is S +sprotoent setprotoent ck_fun is S +sservent setservent ck_fun is S +ehostent endhostent ck_null is +enetent endnetent ck_null is +eprotoent endprotoent ck_null is +eservent endservent ck_null is gpwnam getpwnam ck_fun 0 S gpwuid getpwuid ck_fun 0 S gpwent getpwent ck_null 0 @@ -84,26 +84,26 @@ static void init_predump_symbols(); static void init_postdump_symbols(); static void init_perllib(); -Interpreter * +PerlInterpreter * perl_alloc() { - Interpreter *sv_interp; - Interpreter junk; + PerlInterpreter *sv_interp; + PerlInterpreter junk; curinterp = &junk; - Zero(&junk, 1, Interpreter); - New(53, sv_interp, 1, Interpreter); + Zero(&junk, 1, PerlInterpreter); + New(53, sv_interp, 1, PerlInterpreter); return sv_interp; } void perl_construct( sv_interp ) -register Interpreter *sv_interp; +register PerlInterpreter *sv_interp; { if (!(curinterp = sv_interp)) return; - Zero(sv_interp, 1, Interpreter); + Zero(sv_interp, 1, PerlInterpreter); /* Init the real globals? */ if (!linestr) { @@ -158,9 +158,9 @@ register Interpreter *sv_interp; euid = (int)geteuid(); gid = (int)getgid(); egid = (int)getegid(); - sprintf(patchlevel,"%3.3s%2.2d", index(rcsid,'4'), PATCHLEVEL); + sprintf(patchlevel,"%3.3s%2.2d", strchr(rcsid,'4'), PATCHLEVEL); - (void)sprintf(index(rcsid,'#'), "%d\n", PATCHLEVEL); + (void)sprintf(strchr(rcsid,'#'), "%d\n", PATCHLEVEL); fdpid = newAV(); /* for remembering popen pids by fd */ pidstatus = newHV(COEFFSIZE);/* for remembering status of dead pids */ @@ -176,7 +176,7 @@ register Interpreter *sv_interp; void perl_destruct(sv_interp) -register Interpreter *sv_interp; +register PerlInterpreter *sv_interp; { if (!(curinterp = sv_interp)) return; @@ -184,15 +184,12 @@ register Interpreter *sv_interp; if (main_root) op_free(main_root); main_root = 0; - if (last_root) - op_free(last_root); - last_root = 0; #endif } void perl_free(sv_interp) -Interpreter *sv_interp; +PerlInterpreter *sv_interp; { if (!(curinterp = sv_interp)) return; @@ -201,7 +198,7 @@ Interpreter *sv_interp; int perl_parse(sv_interp, argc, argv, env) -Interpreter *sv_interp; +PerlInterpreter *sv_interp; register int argc; register char **argv; char **env; @@ -227,9 +224,6 @@ setuid perl scripts securely.\n"); if (main_root) op_free(main_root); main_root = 0; - if (last_root) - op_free(last_root); - last_root = 0; origargv = argv; origargc = argc; @@ -388,10 +382,20 @@ setuid perl scripts securely.\n"); comppad = pad; av_push(comppad, Nullsv); curpad = AvARRAY(comppad); + padname = newAV(); + comppadname = padname; + comppadnamefill = -1; padix = 0; init_stack(); + init_context_stack(); + + userinit(); /* in case linked C routines want magical variables */ + + allgvs = TRUE; + init_predump_symbols(); + init_lexer(); /* now parse the script */ @@ -413,9 +417,13 @@ setuid perl scripts securely.\n"); (void)UNLINK(e_tmpname); } - init_context_stack(); + /* now that script is parsed, we can modify record separator */ - init_predump_symbols(); + rs = nrs; + rslen = nrslen; + rschar = nrschar; + rspara = (nrslen == 2); + sv_setpvn(GvSV(gv_fetchpv("/", TRUE)), rs, rslen); if (do_undump) my_unexec(); @@ -427,25 +435,21 @@ setuid perl scripts securely.\n"); int perl_run(sv_interp) -Interpreter *sv_interp; +PerlInterpreter *sv_interp; { if (!(curinterp = sv_interp)) return 255; + if (beginav) + calllist(beginav); switch (setjmp(top_env)) { case 1: cxstack_ix = -1; /* start context stack again */ break; case 2: curstash = defstash; - { - GV *gv = gv_fetchpv("END", FALSE); - - if (gv && GvCV(gv)) { - if (!setjmp(top_env)) - perl_callback("END", 0, G_SCALAR, 0, 0); - } - return(statusvalue); /* my_exit() was called */ - } + if (endav) + calllist(endav); + return(statusvalue); /* my_exit() was called */ case 3: if (!restartop) { fprintf(stderr, "panic: restartop\n"); @@ -479,8 +483,6 @@ Interpreter *sv_interp; op = main_start; run(); } - else - fatal("panic: perl_run"); my_exit(0); } @@ -508,10 +510,10 @@ I32 numargs; /* how many args are pushed on the stack */ ENTER; SAVESPTR(op); stack_base = AvARRAY(stack); - stack_sp = stack_base + sp - numargs; + stack_sp = stack_base + sp - numargs - 1; op = (OP*)&myop; pp_pushmark(); /* doesn't look at op, actually, except to return */ - *stack_sp = (SV*)gv_fetchpv(subname, FALSE); + *++stack_sp = (SV*)gv_fetchpv(subname, FALSE); stack_sp += numargs; myop.op_last = hasargs ? (OP*)&myop : Nullop; @@ -545,17 +547,6 @@ register char **argv; /* null terminated arg list, NULL for no arglist */ } void -magicalize(list) -register char *list; -{ - char sym[2]; - - sym[1] = '\0'; - while (*sym = *list++) - magicname(sym, sym, 1); -} - -void magicname(sym,name,namlen) char *sym; char *name; @@ -590,7 +581,7 @@ char *p; /* (void)av_push(GvAVn(incgv), newSVpv(".", 1)); */ p++; } - if ( (s = index(p, PERLLIB_SEP)) != Nullch ) { + if ( (s = strchr(p, PERLLIB_SEP)) != Nullch ) { (void)av_push(GvAVn(incgv), newSVpv(p, (I32)(s - p))); p = s + 1; } else { @@ -649,7 +640,7 @@ char *s; static char debopts[] = "psltocPmfrxuLHX"; char *d; - for (s++; *s && (d = index(debopts,*s)); s++) + for (s++; *s && (d = strchr(debopts,*s)); s++) debug |= 1 << (d - debopts); } else { @@ -806,7 +797,7 @@ SV *sv; register char *s; I32 len; - if (dosearch && !index(scriptname, '/') && (s = getenv("PATH"))) { + if (dosearch && !strchr(scriptname, '/') && (s = getenv("PATH"))) { bufend = s + strlen(s); while (*s) { @@ -950,6 +941,7 @@ static void validate_suid(validarg) char *validarg; { + char *s; /* do we need to emulate setuid on scripts? */ /* This code is for those BSD systems that have setuid #! scripts disabled @@ -1260,48 +1252,8 @@ init_context_stack() static void init_predump_symbols() { - SV *sv; - GV* tmpgv; - - /* initialize everything that won't change if we undump */ + GV *tmpgv; - if (siggv = gv_fetchpv("SIG",allgvs)) { - HV *hv; - SvMULTI_on(siggv); - hv = GvHVn(siggv); - hv_magic(hv, siggv, 'S'); - - /* initialize signal stack */ - signalstack = newAV(); - av_store(signalstack, 32, Nullsv); - av_clear(signalstack); - AvREAL_off(signalstack); - } - - magicalize("!#?^~=-%.+&*()<>,\\/[|`':\004\t\020\024\027\006"); - userinit(); /* in case linked C routines want magical variables */ - - ampergv = gv_fetchpv("&",allgvs); - leftgv = gv_fetchpv("`",allgvs); - rightgv = gv_fetchpv("'",allgvs); - sawampersand = (ampergv || leftgv || rightgv); - if (tmpgv = gv_fetchpv(":",allgvs)) - sv_setpv(GvSV(tmpgv),chopset); - - /* these aren't necessarily magical */ - if (tmpgv = gv_fetchpv("\014",allgvs)) { - sv_setpv(GvSV(tmpgv),"\f"); - formfeed = GvSV(tmpgv); - } - if (tmpgv = gv_fetchpv(";",allgvs)) - sv_setpv(GvSV(tmpgv),"\034"); - if (tmpgv = gv_fetchpv("]",allgvs)) { - sv = GvSV(tmpgv); - sv_upgrade(sv, SVt_PVNV); - sv_setpv(sv,rcsid); - SvNV(sv) = atof(patchlevel); - SvNOK_on(sv); - } sv_setpvn(GvSV(gv_fetchpv("\"", TRUE)), " ", 1); stdingv = gv_fetchpv("STDIN",TRUE); @@ -1334,14 +1286,6 @@ init_predump_symbols() curoutgv = defoutgv; /* switch back to STDOUT */ statname = NEWSV(66,0); /* last filename we did stat on */ - - /* now that script is parsed, we can modify record separator */ - - rs = nrs; - rslen = nrslen; - rschar = nrschar; - rspara = (nrslen == 2); - sv_setpvn(GvSV(gv_fetchpv("/", TRUE)), rs, rslen); } static void @@ -1363,7 +1307,7 @@ register char **env; argc--,argv++; break; } - if (s = index(argv[0], '=')) { + if (s = strchr(argv[0], '=')) { *s++ = '\0'; sv_setpv(GvSV(gv_fetchpv(argv[0]+1,TRUE)),s); } @@ -1410,7 +1354,7 @@ register char **env; if (env != environ) environ[0] = Nullch; for (; *env; env++) { - if (!(s = index(*env,'='))) + if (!(s = strchr(*env,'='))) continue; *s++ = '\0'; sv = newSVpv(s--,0); @@ -1443,3 +1387,38 @@ init_perllib() incpush(PRIVLIB); (void)av_push(GvAVn(incgv),newSVpv(".",1)); } + +void +calllist(list) +AV* list; +{ + I32 i; + I32 fill = AvFILL(list); + jmp_buf oldtop; + I32 sp = stack_sp - stack_base; + + av_store(stack, ++sp, Nullsv); /* reserve spot for 1st return arg */ + Copy(top_env, oldtop, 1, jmp_buf); + + for (i = 0; i <= fill; i++) + { + GV *gv = (GV*)av_shift(list); + SV* tmpsv = NEWSV(0,0); + + if (gv && GvCV(gv)) { + gv_efullname(tmpsv, gv); + if (setjmp(top_env)) { + if (list == beginav) + exit(1); + } + else { + perl_callback(SvPV(tmpsv), sp, G_SCALAR, 0, 0); + } + } + sv_free(tmpsv); + sv_free(gv); + } + + Copy(oldtop, top_env, 1, jmp_buf); +} + @@ -575,7 +575,7 @@ typedef struct loop LOOP; typedef struct Outrec Outrec; typedef struct lstring Lstring; -typedef struct interpreter Interpreter; +typedef struct interpreter PerlInterpreter; typedef struct ff FF; typedef struct io IO; typedef struct sv SV; @@ -784,7 +784,7 @@ double atof P((const char*)); /* All of these are in stdlib.h or time.h for ANSI C */ long time(); struct tm *gmtime(), *localtime(); -char *index(), *rindex(); +char *strchr(), *strrchr(); char *strcpy(), *strcat(); #endif /* ! STANDARD_C */ @@ -849,7 +849,7 @@ int unlnk P((char*)); /****************/ /* global state */ -EXT Interpreter *curinterp; /* currently running interpreter */ +EXT PerlInterpreter *curinterp; /* currently running interpreter */ extern char ** environ; /* environment variables supplied via exec */ EXT int uid; /* current real user id */ EXT int euid; /* current effective user id */ @@ -857,6 +857,8 @@ EXT int gid; /* current real group id */ EXT int egid; /* current effective group id */ EXT bool nomemok; /* let malloc context handle nomem */ EXT U32 an; /* malloc sequence number */ +EXT U32 cop_seq; /* statement sequence number */ +EXT U32 op_seq; /* op sequence number */ EXT char ** origenviron; EXT U32 origalen; @@ -906,18 +908,30 @@ EXT char * dc; EXT char * Yes INIT("1"); EXT char * No INIT(""); EXT char * hexdigit INIT("0123456789abcdef0123456789ABCDEFx"); -EXT char * warn_nl INIT("Unsuccessful %s on filename containing newline"); -EXT char no_modify[] INIT("Modification of a read-only value attempted"); -EXT char no_mem[] INIT("Out of memory!\n"); -EXT char no_security[] INIT("Insecure dependency in %s"); -EXT char no_sock_func[] - INIT("Unsupported socket function \"%s\" called"); -EXT char no_dir_func[] - INIT("Unsupported directory function \"%s\" called"); -EXT char no_func[] INIT("The %s function is unimplemented"); EXT char * patleave INIT("\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}"); EXT char * vert INIT("|"); +EXT char * warn_nl + INIT("Unsuccessful %s on filename containing newline"); +EXT char no_usym[] + INIT("Can't use an undefined value to create a symbol"); +EXT char no_aelem[] + INIT("Modification of non-creatable array value attempted, subscript %d"); +EXT char no_helem[] + INIT("Modification of non-creatable hash value attempted, subscript \"%s\""); +EXT char no_modify[] + INIT("Modification of a read-only value attempted"); +EXT char no_mem[] + INIT("Out of memory!\n"); +EXT char no_security[] + INIT("Insecure dependency in %s"); +EXT char no_sock_func[] + INIT("Unsupported socket function \"%s\" called"); +EXT char no_dir_func[] + INIT("Unsupported directory function \"%s\" called"); +EXT char no_func[] + INIT("The %s function is unimplemented"); + EXT SV sv_undef; EXT SV sv_no; EXT SV sv_yes; @@ -1055,8 +1069,9 @@ EXT I32 error_count; /* how many errors so far, max 10 */ EXT I32 subline; /* line this subroutine began on */ EXT SV * subname; /* name of current subroutine */ -EXT AV * pad; /* storage for lexically scoped temporaries */ -EXT AV * comppad; /* same for currently compiling routine */ +EXT AV * comppad; /* storage for lexically scoped temporaries */ +EXT AV * comppadname; /* variable names for "my" variables */ +EXT I32 comppadnamefill;/* last "introduced" variable offset */ EXT I32 padix; /* max used index in current "register" pad */ EXT COP compiling; @@ -1065,6 +1080,7 @@ EXT I32 thisexpr; /* name id for nothing_in_common() */ EXT char * last_uni; /* position of last named-unary operator */ EXT char * last_lop; /* position of last list operator */ EXT bool in_format; /* we're compiling a run_format */ +EXT bool in_my; /* we're compiling a "my" declaration */ #ifdef FCRYPT EXT I32 cryptseen; /* has fast crypt() been initialized? */ #endif @@ -1180,7 +1196,6 @@ IEXT GV * Ileftgv; IEXT GV * Iampergv; IEXT GV * Irightgv; IEXT PMOP * Icurpm; /* what to do \ interps from */ -IEXT char * Ihint; /* hint from cop_exec to do_match et al */ IEXT I32 * Iscreamfirst; IEXT I32 * Iscreamnext; IEXT I32 Imaxscream IINIT(-1); @@ -1201,6 +1216,10 @@ IEXT HV * Idefstash; /* main symbol table */ IEXT HV * Icurstash; /* symbol table for current package */ IEXT HV * Idebstash; /* symbol table for perldb package */ IEXT SV * Icurstname; /* name of current package */ +IEXT AV * Ibeginav; /* names of BEGIN subroutines */ +IEXT AV * Iendav; /* names of END subroutines */ +IEXT AV * Ipad; /* storage for lexically scoped temporaries */ +IEXT AV * Ipadname; /* variable names for "my" variables */ /* memory management */ IEXT SV * Ifreestrroot; @@ -1240,9 +1259,6 @@ IEXT OP * VOL Imain_root; IEXT OP * VOL Imain_start; IEXT OP * VOL Ieval_root; IEXT OP * VOL Ieval_start; -IEXT OP * Ilast_root; -IEXT char * Ilast_eval; -IEXT I32 Ilast_elen; /* runtime control stuff */ IEXT COP * VOL Icurcop IINIT(&compiling); @@ -1265,7 +1281,7 @@ IEXT SV * bodytarget; IEXT SV * toptarget; /* statics moved here for shared library purposes */ -IEXT SV Istrchop; /* return value from chop */ +IEXT SV Istrchop; /* return value from chop */ IEXT int Ifilemode; /* so nextargv() can preserve mode */ IEXT int Ilastfd; /* what to preserve mode on */ IEXT char * Ioldname; /* what to preserve mode on */ @@ -1309,10 +1325,10 @@ extern "C" { }; #endif -/* The follow must follow proto.h */ +/* The following must follow proto.h */ #ifdef DOINIT -MGVTBL vtbl_sv = {magic_get, magic_set, 0, 0, 0}; +MGVTBL vtbl_sv = {magic_get, magic_set, magic_len, 0, 0}; MGVTBL vtbl_env = {0, 0, 0, 0, 0}; MGVTBL vtbl_envelem = {0, magic_setenv, 0, 0, 0}; MGVTBL vtbl_sig = {0, 0, 0, 0, 0}; @@ -1322,6 +1338,7 @@ MGVTBL vtbl_dbmelem = {0, magic_setdbm, 0, 0, 0}; MGVTBL vtbl_dbline = {0, magic_setdbline, 0, 0, 0}; MGVTBL vtbl_arylen = {magic_getarylen,magic_setarylen, 0, 0, 0}; MGVTBL vtbl_glob = {magic_getglob, magic_setglob, 0, 0, 0}; +MGVTBL vtbl_mglob = {0, magic_setmglob, 0, 0, 0}; MGVTBL vtbl_substr = {0, magic_setsubstr, 0, 0, 0}; MGVTBL vtbl_vec = {0, magic_setvec, 0, 0, 0}; MGVTBL vtbl_bm = {0, magic_setbm, 0, 0, 0}; @@ -1337,6 +1354,7 @@ EXT MGVTBL vtbl_dbmelem; EXT MGVTBL vtbl_dbline; EXT MGVTBL vtbl_arylen; EXT MGVTBL vtbl_glob; +EXT MGVTBL vtbl_mglob; EXT MGVTBL vtbl_substr; EXT MGVTBL vtbl_vec; EXT MGVTBL vtbl_bm; @@ -1,6 +1,8 @@ -extern char *malloc(), *realloc(); - -# line 39 "perly.y" +#ifndef lint +static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; +#endif +#define YYBYACC 1 +#line 39 "perly.y" #include "EXTERN.h" #include "perl.h" @@ -8,1741 +10,2341 @@ extern char *malloc(), *realloc(); /*SUPPRESS 593*/ /*SUPPRESS 595*/ - -# line 50 "perly.y" -typedef union { +#line 50 "perly.y" +typedef union { I32 ival; char *pval; OP *opval; GV *gvval; } YYSTYPE; -# define WORD 257 -# define METHOD 258 -# define THING 259 -# define PMFUNC 260 -# define LABEL 261 -# define FORMAT 262 -# define SUB 263 -# define PACKAGE 264 -# define WHILE 265 -# define UNTIL 266 -# define IF 267 -# define UNLESS 268 -# define ELSE 269 -# define ELSIF 270 -# define CONTINUE 271 -# define FOR 272 -# define LOOPEX 273 -# define DOTDOT 274 -# define FUNC0 275 -# define FUNC1 276 -# define FUNC 277 -# define RELOP 278 -# define EQOP 279 -# define MULOP 280 -# define ADDOP 281 -# define DOLSHARP 282 -# define DO 283 -# define LOCAL 284 -# define DELETE 285 -# define HASHBRACK 286 -# define LSTOP 287 -# define OROR 288 -# define ANDAND 289 -# define BITOROP 290 -# define BITANDOP 291 -# define UNIOP 292 -# define SHIFTOP 293 -# define MATCHOP 294 -# define ARROW 295 -# define UMINUS 296 -# define REFGEN 297 -# define POWOP 298 -# define PREINC 299 -# define PREDEC 300 -# define POSTINC 301 -# define POSTDEC 302 -#define yyclearin yychar = -1 -#define yyerrok yyerrflag = 0 -extern int yychar; -extern int yyerrflag; -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 150 -#endif -YYSTYPE yylval, yyval; -# define YYERRCODE 256 - -# line 569 "perly.y" - /* PROGRAM */ -int yyexca[] ={ --1, 1, - 0, -1, - -2, 0, --1, 3, - 0, 2, - -2, 39, --1, 21, - 295, 145, - -2, 25, --1, 40, - 41, 97, - 265, 97, - 266, 97, - 267, 97, - 268, 97, - 274, 97, - 278, 97, - 279, 97, - 280, 97, - 281, 97, - 44, 97, - 61, 97, - 63, 97, - 58, 97, - 288, 97, - 289, 97, - 290, 97, - 291, 97, - 293, 97, - 294, 97, - 295, 97, - 298, 97, - 301, 97, - 302, 97, - 59, 97, - 93, 97, - -2, 144, --1, 54, - 41, 133, - 265, 133, - 266, 133, - 267, 133, - 268, 133, - 274, 133, - 278, 133, - 279, 133, - 280, 133, - 281, 133, - 44, 133, - 61, 133, - 63, 133, - 58, 133, - 288, 133, - 289, 133, - 290, 133, - 291, 133, - 293, 133, - 294, 133, - 295, 133, - 298, 133, - 301, 133, - 302, 133, - 59, 133, - 93, 133, - -2, 143, --1, 76, - 59, 35, - -2, 0, --1, 112, - 301, 0, - 302, 0, - -2, 88, --1, 113, - 301, 0, - 302, 0, - -2, 89, --1, 192, - 278, 0, - -2, 71, --1, 193, - 279, 0, - -2, 72, --1, 194, - 274, 0, - -2, 75, --1, 310, - 41, 35, - -2, 0, - }; -# define YYNPROD 152 -# define YYLAST 2258 -int yyact[]={ - - 107, 162, 104, 105, 90, 102, 229, 103, 148, 90, - 21, 239, 67, 104, 105, 150, 228, 91, 25, 72, - 74, 240, 241, 80, 82, 78, 91, 92, 56, 31, - 26, 102, 56, 58, 61, 90, 37, 132, 57, 30, - 102, 29, 69, 68, 90, 244, 115, 117, 119, 129, - 98, 133, 91, 92, 324, 16, 155, 77, 91, 92, - 59, 14, 11, 12, 13, 93, 102, 152, 87, 153, - 90, 93, 102, 157, 317, 159, 90, 315, 198, 164, - 156, 166, 158, 168, 298, 161, 297, 38, 165, 296, - 167, 262, 169, 170, 171, 172, 202, 210, 26, 200, - 268, 215, 123, 220, 31, 81, 87, 56, 58, 61, - 199, 37, 121, 57, 30, 26, 29, 87, 258, 26, - 79, 203, 32, 73, 3, 310, 98, 99, 91, 92, - 211, 212, 213, 214, 124, 59, 218, 98, 99, 91, - 92, 93, 102, 71, 122, 223, 90, 97, 96, 95, - 94, 237, 93, 102, 121, 316, 154, 90, 87, 70, - 87, 87, 38, 87, 66, 87, 295, 31, 87, 235, - 56, 58, 61, 318, 37, 299, 57, 30, 293, 29, - 243, 14, 11, 12, 13, 327, 122, 325, 26, 98, - 99, 91, 92, 87, 26, 204, 87, 32, 59, 320, - 96, 95, 94, 26, 93, 102, 26, 255, 256, 90, - 292, 266, 259, 174, 265, 232, 87, 234, 314, 304, - 98, 99, 91, 92, 267, 38, 26, 323, 271, 273, - 87, 264, 281, 94, 282, 93, 102, 284, 278, 286, - 90, 287, 263, 289, 206, 197, 156, 56, 202, 139, - 207, 200, 24, 54, 65, 46, 53, 26, 231, 221, - 32, 18, 19, 22, 23, 209, 56, 294, 20, 49, - 126, 51, 52, 63, 288, 280, 254, 300, 60, 48, - 36, 45, 39, 62, 308, 101, 219, 160, 50, 85, - 86, 83, 84, 33, 285, 34, 35, 312, 311, 274, - 242, 313, 87, 87, 238, 233, 31, 87, 87, 56, - 58, 61, 322, 37, 272, 57, 30, 149, 29, 25, - 85, 86, 83, 84, 326, 201, 328, 24, 54, 65, - 46, 53, 56, 137, 136, 135, 76, 59, 329, 306, - 307, 127, 309, 8, 49, 7, 51, 52, 63, 163, - 2, 9, 55, 60, 48, 36, 45, 39, 62, 17, - 47, 41, 44, 50, 38, 42, 321, 43, 33, 31, - 34, 35, 56, 58, 61, 15, 37, 270, 57, 30, - 10, 29, 5, 208, 205, 88, 6, 4, 147, 1, - 0, 54, 65, 46, 53, 0, 26, 0, 0, 32, - 59, 0, 0, 0, 0, 0, 0, 49, 0, 51, - 52, 63, 0, 0, 0, 28, 60, 48, 36, 45, - 39, 62, 0, 0, 0, 0, 50, 38, 0, 150, - 0, 33, 31, 34, 35, 56, 58, 61, 0, 37, - 0, 57, 30, 0, 29, 106, 108, 109, 110, 111, - 112, 113, 98, 99, 91, 92, 0, 0, 261, 26, - 0, 0, 32, 59, 95, 94, 0, 93, 102, 0, - 0, 0, 90, 0, 0, 0, 31, 0, 0, 56, - 58, 61, 0, 37, 0, 57, 30, 236, 29, 0, - 38, 0, 0, 0, 0, 0, 100, 0, 0, 0, - 98, 99, 91, 92, 0, 0, 0, 59, 0, 0, - 97, 96, 95, 94, 0, 93, 102, 0, 0, 0, - 90, 275, 26, 0, 276, 32, 0, 0, 0, 0, - 54, 65, 46, 53, 38, 225, 260, 0, 227, 0, - 230, 89, 0, 101, 269, 0, 49, 0, 51, 52, - 63, 0, 0, 0, 0, 60, 48, 36, 45, 39, - 62, 283, 0, 0, 0, 50, 26, 0, 0, 32, - 33, 31, 34, 35, 56, 58, 61, 0, 37, 257, - 57, 30, 0, 29, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 54, 65, 46, 53, 301, 0, 302, - 0, 0, 59, 0, 0, 0, 0, 0, 0, 49, - 0, 51, 52, 63, 0, 277, 0, 279, 60, 48, - 36, 45, 39, 62, 319, 0, 0, 0, 50, 38, - 0, 0, 0, 33, 0, 34, 35, 0, 0, 0, - 0, 0, 0, 291, 89, 0, 101, 0, 0, 0, - 0, 64, 0, 0, 0, 0, 54, 65, 46, 53, - 0, 26, 0, 0, 32, 0, 0, 0, 0, 305, - 0, 0, 49, 0, 51, 52, 63, 0, 0, 0, - 0, 60, 48, 36, 45, 39, 62, 89, 0, 101, - 0, 50, 0, 0, 0, 0, 33, 0, 34, 35, - 54, 65, 46, 53, 0, 0, 0, 0, 138, 141, - 142, 143, 144, 145, 146, 0, 49, 151, 51, 52, - 63, 0, 0, 0, 0, 60, 48, 36, 45, 39, - 62, 0, 0, 0, 0, 50, 0, 0, 0, 0, - 33, 31, 34, 35, 56, 58, 61, 0, 37, 222, - 57, 30, 0, 29, 100, 0, 0, 0, 98, 99, - 91, 92, 0, 0, 0, 0, 0, 0, 97, 96, - 95, 94, 59, 93, 102, 0, 0, 0, 90, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 54, 65, 46, 53, 38, - 0, 226, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 49, 0, 51, 52, 63, 0, 0, 0, 0, - 60, 48, 36, 45, 39, 62, 0, 0, 0, 0, - 50, 26, 0, 0, 32, 33, 31, 34, 35, 56, - 58, 61, 0, 37, 217, 57, 30, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, - 0, 98, 99, 91, 92, 0, 0, 59, 0, 0, - 0, 97, 96, 95, 94, 0, 93, 102, 0, 0, - 31, 90, 0, 56, 58, 61, 0, 37, 0, 57, - 30, 0, 29, 0, 38, 0, 0, 0, 0, 0, - 100, 0, 0, 0, 98, 99, 91, 92, 190, 0, - 0, 59, 0, 0, 97, 96, 95, 94, 0, 93, - 102, 0, 0, 0, 90, 0, 26, 0, 0, 32, - 31, 0, 0, 56, 58, 61, 0, 37, 38, 57, - 30, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, - 0, 59, 0, 0, 0, 54, 65, 46, 53, 0, - 26, 0, 0, 32, 0, 0, 0, 0, 0, 0, - 0, 49, 0, 51, 52, 63, 0, 0, 38, 0, - 60, 48, 36, 45, 39, 62, 0, 0, 0, 0, - 50, 0, 0, 0, 0, 33, 31, 34, 35, 56, - 58, 61, 0, 37, 0, 57, 30, 0, 29, 0, - 26, 0, 0, 32, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 186, 0, 0, 59, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 65, 46, 53, 38, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 49, 0, 51, 52, - 63, 0, 0, 0, 0, 60, 48, 36, 45, 39, - 62, 0, 0, 0, 0, 50, 26, 0, 0, 32, - 33, 0, 34, 35, 54, 65, 46, 53, 0, 31, - 0, 0, 56, 58, 61, 0, 37, 0, 57, 30, - 49, 29, 51, 52, 63, 0, 0, 0, 0, 60, - 48, 36, 45, 39, 62, 0, 0, 184, 0, 50, - 59, 0, 0, 0, 33, 0, 34, 35, 0, 0, - 0, 0, 0, 0, 54, 65, 46, 53, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, - 49, 0, 51, 52, 63, 0, 0, 0, 0, 60, - 48, 36, 45, 39, 62, 0, 0, 0, 0, 50, - 0, 0, 0, 0, 33, 0, 34, 35, 0, 26, - 0, 0, 32, 0, 0, 0, 31, 0, 0, 56, - 58, 61, 0, 37, 0, 57, 30, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 65, 46, 53, 182, 0, 0, 59, 0, 0, - 0, 0, 0, 0, 0, 0, 49, 0, 51, 52, - 63, 0, 0, 0, 40, 60, 48, 36, 45, 39, - 62, 0, 0, 0, 38, 50, 0, 0, 0, 0, - 33, 0, 34, 35, 31, 75, 0, 56, 58, 61, - 0, 37, 0, 57, 30, 0, 29, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 32, - 125, 0, 180, 131, 0, 59, 0, 0, 0, 0, - 0, 140, 140, 140, 140, 140, 140, 0, 0, 31, - 140, 0, 56, 58, 61, 0, 37, 0, 57, 30, - 0, 29, 38, 54, 65, 46, 53, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 178, 0, 49, - 59, 51, 52, 63, 0, 0, 0, 0, 60, 48, - 36, 45, 39, 62, 26, 0, 0, 32, 50, 0, - 0, 0, 0, 33, 0, 34, 35, 38, 0, 0, - 0, 216, 0, 0, 0, 31, 0, 0, 56, 58, - 61, 0, 37, 0, 57, 30, 0, 29, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, - 0, 0, 32, 176, 0, 0, 59, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 54, 65, 46, 53, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 38, 0, 0, 49, 0, 51, 52, - 63, 0, 0, 0, 0, 60, 48, 36, 45, 39, - 62, 0, 0, 0, 0, 50, 253, 0, 0, 89, - 33, 101, 34, 35, 0, 26, 0, 0, 32, 0, - 0, 0, 0, 0, 31, 0, 0, 56, 58, 61, - 0, 37, 0, 57, 30, 0, 29, 0, 54, 65, - 46, 53, 0, 0, 0, 0, 0, 0, 0, 0, - 120, 0, 0, 0, 49, 59, 51, 52, 63, 0, - 0, 0, 0, 60, 48, 36, 45, 39, 62, 0, - 0, 0, 0, 50, 0, 0, 0, 0, 33, 0, - 34, 35, 38, 54, 65, 46, 53, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, - 0, 51, 52, 63, 0, 0, 0, 0, 60, 48, - 36, 45, 39, 62, 26, 0, 0, 32, 50, 0, - 0, 0, 0, 33, 0, 34, 35, 31, 0, 0, - 56, 58, 61, 0, 37, 0, 57, 30, 0, 29, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, - 65, 46, 53, 0, 0, 0, 0, 0, 59, 0, - 0, 0, 0, 0, 0, 49, 0, 51, 52, 63, - 0, 0, 0, 0, 60, 48, 36, 45, 39, 62, - 0, 0, 0, 0, 50, 38, 0, 118, 0, 33, - 0, 34, 35, 0, 31, 0, 0, 56, 58, 61, - 0, 37, 116, 57, 30, 0, 29, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, - 32, 0, 100, 0, 0, 59, 98, 99, 91, 92, - 0, 0, 0, 0, 0, 0, 97, 96, 95, 94, - 0, 93, 102, 0, 0, 0, 90, 0, 54, 65, - 46, 53, 38, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 49, 0, 51, 52, 63, 0, - 0, 0, 0, 60, 48, 36, 45, 39, 62, 0, - 0, 0, 0, 50, 26, 0, 0, 32, 33, 0, - 34, 35, 31, 0, 0, 56, 58, 61, 0, 37, - 0, 57, 30, 0, 29, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, - 56, 58, 61, 0, 37, 0, 57, 30, 0, 29, - 38, 54, 65, 46, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 49, 59, 51, - 52, 63, 0, 0, 0, 0, 60, 48, 36, 45, - 39, 62, 26, 0, 0, 32, 50, 0, 0, 0, - 0, 33, 0, 34, 35, 38, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 54, 65, - 46, 53, 0, 0, 0, 0, 0, 26, 0, 0, - 32, 0, 0, 0, 49, 0, 51, 52, 63, 0, - 0, 0, 0, 60, 48, 36, 45, 39, 62, 0, - 0, 0, 0, 50, 0, 0, 0, 0, 33, 0, - 34, 35, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 54, 65, 46, 53, - 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 49, 0, 51, 52, 63, 0, 0, 0, - 0, 60, 48, 36, 45, 39, 62, 0, 0, 0, - 0, 50, 0, 0, 0, 0, 33, 114, 34, 35, - 0, 130, 65, 46, 53, 0, 0, 0, 0, 128, - 0, 134, 0, 0, 0, 0, 0, 49, 0, 51, - 52, 63, 0, 0, 0, 0, 60, 48, 36, 45, - 39, 62, 0, 0, 0, 0, 50, 0, 0, 0, - 0, 33, 0, 34, 35, 0, 0, 0, 173, 0, - 175, 177, 179, 181, 183, 185, 187, 189, 191, 192, - 193, 194, 195, 196, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 224, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 245, 0, 246, - 0, 247, 0, 248, 0, 249, 0, 250, 0, 251, - 0, 252, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 173, 0, 0, 0, 173, 0, 0, 173, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 290, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 303 }; -int yypact[]={ - - -1000, -1000, -1000, -200, -1000, -1000, -1000, -1000, -1000, -4, - -1000, -93, -214, -215, -1000, -1000, -1000, 100, 103, 83, - 296, -246, 80, 65, -1000, 24, -1000, 626, -288, 1719, - 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1621, 1554, 1451, - 21, -1000, -1000, 11, -1000, 230, -1000, 301, 1764, -220, - 1719, 295, 294, 293, -1000, -1000, -8, -8, -8, -8, - -8, -8, 1719, 277, -280, -8, -25, -1000, -25, 97, - -1000, 1719, -25, 1719, -25, 247, 71, -1000, -25, 1719, - -25, 1719, -25, 1719, 1719, 1719, 1719, 1719, -1000, 1719, - 1352, 1286, 1241, 1173, 1076, 973, 897, 847, 1719, 1719, - 1719, 1719, 1719, -13, -1000, -1000, -299, -1000, -299, -299, - -299, -299, -1000, -1000, -222, 207, 30, 151, -1000, 206, - -28, 1719, 1719, 1719, 1719, -22, 211, 803, -222, -1000, - 246, 63, -1000, -1000, -222, 218, 708, 1719, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, 134, -1000, 124, 1719, - -271, 1719, -1000, -1000, -1000, 217, 124, -246, 264, -246, - 1719, 55, 92, -1000, -1000, 263, -248, 259, -248, 124, - 124, 124, 124, 626, -80, 626, 1719, -294, 1719, -289, - 1719, -263, 1719, -254, 1719, -152, 1719, -58, 1719, 174, - 1719, -89, -222, -228, -141, 1408, -294, 236, 1719, 1719, - 538, 27, -1000, 1719, 443, -1000, -1000, 399, -1000, -34, - -1000, 149, 172, 121, 152, 1719, -23, -1000, 207, 336, - 273, -1000, -1000, 258, 480, -1000, 134, 197, 1719, 235, - -1000, -25, -1000, -25, -1000, 207, -25, 1719, -25, -1000, - -25, 234, -25, -1000, -1000, 626, 626, 626, 626, 626, - 626, 626, 626, 1719, 1719, 117, 119, -1000, 1719, 73, - -1000, -36, -1000, -1000, -39, -1000, -41, 116, 1719, -1000, - -1000, 207, -1000, 207, -1000, -1000, 1719, 178, -1000, -1000, - 1719, -246, -246, -25, -246, 66, -248, -1000, 1719, -248, - 222, 177, -1000, -48, 62, -1000, -1000, -1000, -1000, -51, - 114, -1000, -1000, 583, -1000, 158, -1000, -1000, -246, -1000, - 71, -1000, 186, -1000, -1000, -1000, -1000, -1000, -71, -1000, - -1000, -1000, 146, -25, 144, -25, -248, -1000, -1000, -1000 }; -int yypgo[]={ - - 0, 389, 387, 386, 385, 325, 384, 383, 0, 124, - 382, 380, 375, 1, 11, 8, 1980, 415, 1254, 367, - 365, 362, 361, 360, 349, 388, 651, 56, 352, 351, - 57, 350, 345, 343 }; -int yyr1[]={ - - 0, 31, 1, 8, 4, 9, 9, 9, 10, 10, - 10, 10, 24, 24, 24, 24, 24, 24, 14, 14, - 14, 12, 12, 12, 12, 30, 30, 11, 11, 11, - 11, 11, 11, 11, 11, 13, 13, 27, 27, 29, - 29, 2, 2, 2, 3, 3, 32, 33, 15, 15, - 28, 28, 28, 28, 28, 28, 28, 28, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 25, 25, 23, 18, 19, - 20, 21, 22, 26, 26, 26, 5, 5, 6, 6, - 7, 7 }; -int yyr2[]={ - - 0, 1, 5, 9, 1, 1, 5, 5, 5, 2, - 5, 7, 3, 3, 7, 7, 7, 7, 1, 5, - 13, 13, 13, 9, 9, 1, 5, 15, 15, 11, - 11, 17, 15, 21, 7, 1, 2, 1, 2, 1, - 2, 3, 3, 3, 7, 5, 7, 7, 7, 2, - 7, 11, 9, 13, 13, 7, 5, 9, 7, 9, - 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 11, 7, - 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 7, 5, 7, 5, 7, 7, 3, 3, 9, - 11, 3, 3, 3, 11, 13, 13, 11, 9, 11, - 13, 17, 3, 3, 7, 9, 5, 5, 9, 11, - 9, 11, 3, 5, 3, 5, 5, 3, 7, 7, - 9, 9, 13, 2, 2, 1, 3, 5, 5, 5, - 5, 5, 5, 3, 3, 3, 5, 3, 5, 3, - 7, 5 }; -int yychk[]={ - - -1000, -1, -31, -9, -2, -10, -3, -32, -33, -29, - -11, 262, 263, 264, 261, -12, 59, -24, 265, 266, - 272, -8, 267, 268, 256, -15, 123, -16, -17, 45, - 43, 33, 126, 297, 299, 300, 284, 40, 91, 286, - -18, -22, -20, -19, -21, 285, 259, -23, 283, 273, - 292, 275, 276, 260, 257, -28, 36, 42, 37, 64, - 282, 38, 287, 277, -26, 258, 257, -8, 257, 257, - 59, 40, -8, 40, -8, -18, 40, -30, 271, 40, - -8, 40, -8, 267, 268, 265, 266, 44, -4, 61, - 298, 280, 281, 293, 291, 290, 289, 288, 278, 279, - 274, 63, 294, 295, 301, 302, -17, -8, -17, -17, - -17, -17, -17, -17, -16, -15, 41, -15, 93, -15, - 59, 91, 123, 91, 123, -18, 40, 40, -16, -8, - 257, -18, 257, -8, -16, 40, 40, 40, -26, 257, - -18, -26, -26, -26, -26, -26, -26, -25, -15, 40, - 295, -26, -8, -8, 59, -27, -15, -8, -15, -8, - 40, -15, -13, -24, -8, -15, -8, -15, -8, -15, - -15, -15, -15, -16, -9, -16, 61, -16, 61, -16, - 61, -16, 61, -16, 61, -16, 61, -16, 61, -16, - 61, -16, -16, -16, -16, -16, -16, 258, 91, 123, - 44, -5, 41, 91, 44, -6, 93, 44, -7, 59, - 125, -15, -15, -15, -15, 123, -18, 41, -15, 40, - 40, 41, 41, -15, -16, -25, -26, -25, 287, 277, - -25, 41, -30, 41, -30, -15, -5, 59, 41, -14, - 269, 270, 41, -14, 125, -16, -16, -16, -16, -16, - -16, -16, -16, 58, 40, -15, -15, 41, 91, -15, - 93, 59, 125, 93, 59, 93, 59, -15, 123, -5, - 41, -15, 41, -15, 41, 41, 44, -25, 41, -25, - 40, -8, -8, -5, -8, -27, -8, -8, 40, -8, - -16, -25, 93, 59, -15, 93, 125, 125, 125, 59, - -15, -5, -5, -16, 41, -25, -30, -30, -8, -30, - 59, -14, -15, -14, 41, 125, 93, 125, 59, 41, - 41, -30, -13, 41, 125, 41, -8, 41, -8, -14 }; -int yydef[]={ - - 1, -2, 5, -2, 6, 7, 41, 42, 43, 0, - 9, 0, 0, 0, 40, 8, 10, 0, 0, 0, - 0, -2, 0, 0, 12, 13, 4, 49, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -2, 98, 101, 102, 103, 0, 112, 113, 0, 122, - 124, 127, 0, 0, -2, 134, 0, 0, 0, 0, - 0, 0, 135, 0, 0, 0, 0, 45, 0, 0, - 11, 37, 0, 0, 0, 0, -2, 34, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 86, 87, 81, 145, 82, 83, - 84, 85, -2, -2, 90, 0, 92, 0, 94, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 116, 117, - 133, 97, 123, 125, 126, 0, 0, 0, 138, 143, - 144, 142, 140, 139, 141, 137, 135, 56, 136, 135, - 0, 135, 44, 46, 47, 0, 38, 25, 0, 25, - 0, 13, 0, 36, 26, 0, 18, 0, 18, 14, - 15, 16, 17, 48, 39, 58, 0, 67, 0, 68, - 0, 69, 0, 70, 0, 73, 0, 74, 0, 76, - 0, 77, -2, -2, -2, 0, 79, 0, 0, 0, - 0, 91, 147, 0, 0, 93, 149, 0, 95, 0, - 96, 0, 0, 0, 0, 0, 0, 114, 0, 0, - 0, 128, 129, 0, 0, 50, 135, 0, 135, 0, - 55, 0, 29, 0, 30, 0, 0, 37, 0, 23, - 0, 0, 0, 24, 3, 59, 60, 61, 62, 63, - 64, 65, 66, 0, 135, 0, 0, 146, 0, 0, - 148, 0, 151, 99, 0, 108, 0, 0, 0, 115, - 118, 0, 120, 0, 130, 131, 0, 0, 57, 52, - 135, 25, 25, 0, 25, 0, 18, 19, 0, 18, - 78, 0, 100, 0, 0, 107, 150, 104, 109, 0, - 0, 119, 121, 0, 51, 0, 27, 28, 25, 32, - -2, 21, 0, 22, 54, 105, 106, 110, 0, 132, - 53, 31, 0, 0, 0, 0, 18, 111, 33, 20 }; -typedef struct { char *t_name; int t_val; } yytoktype; +#line 21 "y.tab.c" +#define WORD 257 +#define METHOD 258 +#define THING 259 +#define PMFUNC 260 +#define PRIVATEREF 261 +#define LABEL 262 +#define FORMAT 263 +#define SUB 264 +#define PACKAGE 265 +#define WHILE 266 +#define UNTIL 267 +#define IF 268 +#define UNLESS 269 +#define ELSE 270 +#define ELSIF 271 +#define CONTINUE 272 +#define FOR 273 +#define LOOPEX 274 +#define DOTDOT 275 +#define FUNC0 276 +#define FUNC1 277 +#define FUNC 278 +#define RELOP 279 +#define EQOP 280 +#define MULOP 281 +#define ADDOP 282 +#define DOLSHARP 283 +#define DO 284 +#define LOCAL 285 +#define DELETE 286 +#define HASHBRACK 287 +#define NOAMP 288 +#define LSTOP 289 +#define OROR 290 +#define ANDAND 291 +#define BITOROP 292 +#define BITANDOP 293 +#define UNIOP 294 +#define SHIFTOP 295 +#define MATCHOP 296 +#define ARROW 297 +#define UMINUS 298 +#define REFGEN 299 +#define POWOP 300 +#define PREINC 301 +#define PREDEC 302 +#define POSTINC 303 +#define POSTDEC 304 +#define YYERRCODE 256 +short yylhs[] = { -1, + 30, 0, 7, 3, 8, 8, 8, 9, 9, 9, + 9, 23, 23, 23, 23, 23, 23, 13, 13, 13, + 11, 11, 11, 11, 29, 29, 10, 10, 10, 10, + 10, 10, 10, 10, 12, 12, 26, 26, 28, 28, + 1, 1, 1, 2, 2, 31, 31, 32, 32, 14, + 14, 27, 27, 27, 27, 27, 27, 27, 27, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 24, 24, 22, + 17, 18, 19, 20, 21, 25, 25, 25, 25, 4, + 4, 5, 5, 6, 6, +}; +short yylen[] = { 2, + 0, 2, 4, 0, 0, 2, 2, 2, 1, 2, + 3, 1, 1, 3, 3, 3, 3, 0, 2, 6, + 6, 6, 4, 4, 0, 2, 7, 7, 5, 5, + 8, 7, 10, 3, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 3, 2, 3, 3, 3, 2, 3, + 1, 3, 5, 4, 6, 6, 3, 2, 4, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, + 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 3, 2, 3, 2, 3, 3, 1, 1, + 4, 5, 1, 1, 1, 5, 6, 6, 5, 4, + 5, 6, 8, 1, 1, 3, 4, 3, 2, 2, + 4, 5, 4, 5, 1, 2, 1, 2, 2, 1, + 3, 3, 4, 4, 6, 1, 1, 0, 1, 2, + 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, + 1, 2, 1, 3, 2, +}; +short yydefred[] = { 1, + 0, 5, 0, 40, 0, 0, 0, 6, 41, 7, + 9, 0, 42, 43, 4, 0, 45, 0, 0, 49, + 12, 0, 0, 114, 0, 149, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 103, 105, 100, 0, 0, + 0, 137, 5, 44, 47, 46, 48, 146, 148, 147, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 126, 0, 0, 0, 144, 0, 120, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, + 128, 0, 0, 0, 0, 90, 91, 0, 0, 0, + 0, 96, 0, 140, 141, 142, 143, 145, 0, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 88, 89, 0, 0, 0, 0, 0, 11, 0, 0, + 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 36, 0, 131, 132, 0, 0, 0, + 0, 0, 0, 0, 98, 0, 0, 97, 118, 52, + 0, 151, 0, 0, 0, 153, 95, 26, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 116, 0, 0, 0, 3, 134, 0, 0, + 29, 0, 30, 0, 0, 0, 23, 0, 24, 0, + 0, 0, 133, 59, 0, 121, 0, 123, 0, 0, + 0, 0, 155, 0, 150, 0, 152, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 101, 0, 110, 117, 0, 54, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 53, 122, 124, 0, + 0, 154, 109, 0, 0, 0, 0, 102, 106, 111, + 0, 135, 27, 28, 21, 0, 22, 0, 32, 0, + 0, 112, 108, 107, 56, 55, 0, 0, 31, 0, + 0, 0, 113, 20, 33, +}; +short yydgoto[] = { 1, + 8, 9, 73, 194, 197, 188, 79, 3, 10, 11, + 60, 172, 247, 108, 62, 63, 64, 65, 66, 67, + 68, 69, 174, 109, 71, 164, 72, 12, 130, 2, + 13, 14, +}; +short yysindex[] = { 0, + 0, 0, 20, 0, -122, -241, -57, 0, 0, 0, + 0, 606, 0, 0, 0, -84, 0, -32, 39, 0, + 0, 0, -33, 0, 19, 0, -28, -23, -21, -19, + 169, -143, 77, 83, 107, -33, 2774, 2835, 172, 884, + -108, 2835, 2835, 2835, 2835, 2835, 2835, 2835, 945, 0, + 2835, 2835, 992, -33, -33, -33, -33, -33, -106, 0, + -14, 1210, -59, -60, -58, 0, 0, 0, 143, 159, + -76, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2835, 2835, 2835, -84, 2835, -84, 2835, -84, 2835, -84, + 1056, 194, 0, 201, 1262, 2835, 0, 209, 0, -1, + -30, -1, 223, 147, 139, 28, 2835, 231, 0, 1323, + 0, -1, -237, -237, -237, 0, 0, 182, 115, -237, + -237, 0, -18, 0, 0, 0, 0, 0, -84, 0, + 2835, 2835, 2835, 2835, 2835, 2835, 2835, 2835, 1370, 1434, + 2835, 2835, 1640, 1701, 1748, 1812, 2018, 2835, 2079, -87, + 0, 0, 2835, 2835, 2835, 2835, 2126, 0, -92, -119, + 0, 4249, 231, 245, -106, 141, -106, 217, -44, 246, + -44, 233, -36, 0, 2835, 0, 0, 257, 255, 1323, + 2190, 2396, 181, 2835, 0, 2457, 184, 0, 0, 0, + 2835, 0, 2504, 215, 2568, 0, 0, 0, 231, 231, + 231, 231, 1210, -89, -1, -174, 2835, -40, 2835, -236, + 1210, 409, 2835, 345, 2835, 376, 2835, -238, 2835, 382, + 2835, -247, 16, 2835, 16, 2835, 270, 2835, 68, -16, + 75, -15, 0, 115, 271, 2835, 0, 0, 2835, -84, + 0, -84, 0, -84, -84, 277, 0, -84, 0, 2835, + -84, 115, 0, 0, 278, 0, 115, 0, 115, 2835, + 96, 193, 0, -4, 0, 2835, 0, 1210, 1210, 2835, + 1210, 1210, 1210, 1210, 1210, 1210, 116, 2835, 3, 196, + 0, 199, 0, 0, 2835, 0, 4397, -106, -106, -44, + 0, 2835, -44, 266, -106, -84, 0, 0, 0, 136, + 203, 0, 0, 4, 1102, 218, 303, 0, 0, 0, + 304, 0, 0, 0, 0, 264, 0, 1056, 0, -106, + 228, 0, 0, 0, 0, 0, -84, 307, 0, 313, + -44, -84, 0, 0, 0, +}; +short yyrindex[] = { 0, + 0, 0, 229, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 496, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2708, 2864, 0, 0, 0, 0, 0, 0, 0, + 0, 2904, 2978, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, + 11, 363, 4373, 557, 3023, 0, 0, 0, 3161, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2904, 0, 322, 0, 0, 0, 0, 0, 0, 0, + 305, 0, 0, 0, 0, 324, 0, 3236, 0, 2284, + 3280, 3735, 0, 0, 0, 0, 2904, 3408, 0, 3449, + 0, 3768, 4128, 4182, 4218, 0, 0, 3319, 0, 4284, + 4320, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 678, + 0, 0, 15, 0, 125, 0, 125, 0, 177, 0, + 177, 0, 309, 0, 0, 0, 0, 0, 0, 324, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3362, 0, 0, 0, 0, 79, 98, + 128, 135, 860, 958, 3834, 3867, 0, 1906, 0, 1150, + 1575, 0, 0, 1021, 0, 4047, 0, 4005, 0, 3915, + 0, 1528, 3577, 0, 3702, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2904, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 310, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1953, 2331, 0, + 2667, 3620, 3907, 3931, 4037, 4063, 0, 324, 0, 0, + 0, 0, 0, 0, 324, 0, 0, 125, 125, 177, + 0, 0, 177, 0, 125, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 325, 0, 125, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 0, +}; +short yygindex[] = { 0, + 0, 0, 0, -158, 0, 0, -5, 298, 0, 0, + 0, 55, -157, -3, 4489, 520, 488, 0, 0, 0, + 0, 0, 364, 216, 527, 127, 0, 0, -147, 0, + 0, 0, +}; +#define YYTABLESIZE 4759 +short yytable[] = { 17, + 15, 20, 55, 228, 192, 237, 59, 193, 61, 182, + 74, 83, 76, 249, 251, 18, 85, 241, 87, 243, + 89, 84, 86, 88, 90, 195, 75, 135, 135, 135, + 154, 99, 156, 139, 140, 226, 106, 111, 15, 135, + 137, 138, 139, 140, 139, 119, 135, 135, 148, 123, + 80, 13, 149, 80, 146, 38, 147, 148, 82, 148, + 154, 149, 153, 149, 155, 151, 152, 80, 80, 13, + 80, 186, 25, 38, 196, 284, 281, 283, 165, 163, + 167, 166, 169, 168, 171, 170, 187, 173, 303, 15, + 15, 178, 153, 296, 15, 308, 323, 77, 298, 15, + 299, 15, 80, 15, 137, 25, 139, 140, 25, 25, + 25, 135, 25, 93, 25, 25, 94, 25, 135, 16, + 147, 148, 95, 198, 25, 149, 280, 199, 200, 201, + 202, 25, 315, 282, 16, 317, 25, 16, 17, 135, + 313, 314, 4, 5, 6, 7, 96, 319, 107, 229, + 230, 231, 232, 234, 301, 192, 17, 25, 193, 135, + 25, 25, 25, 25, 25, 129, 25, 25, 14, 25, + 227, 252, 329, 334, 306, 15, 18, 257, 259, 135, + 261, 242, 157, 25, 135, 235, 14, 264, 25, 137, + 138, 139, 140, 15, 321, 25, 236, 25, 25, 19, + 143, 144, 145, 146, 55, 147, 148, 55, 91, 18, + 149, 103, 18, 18, 18, 25, 18, 158, 18, 18, + 159, 18, 277, 78, 279, 245, 246, 26, 2, 131, + 132, 133, 134, 175, 288, 18, 289, 150, 290, 291, + 18, 176, 293, 151, 152, 295, 163, 25, 181, 25, + 25, 131, 132, 133, 134, 148, 300, 244, 55, 149, + 135, 39, 304, 185, 39, 39, 39, 18, 39, 184, + 39, 39, 191, 39, 135, 80, 80, 80, 80, 139, + 140, 4, 5, 6, 7, 240, 248, 39, 316, 135, + 320, 250, 39, 147, 148, 254, 161, 253, 149, 18, + 135, 18, 18, 260, 327, 266, 80, 135, 263, 278, + 285, 179, 80, 80, 61, 149, 292, 302, 297, 39, + 309, 331, 189, 310, 318, 190, 335, 322, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 324, 325, 326, 25, 25, 332, 25, 25, + 25, 39, 330, 333, 39, 25, 25, 25, 25, 25, + 25, 25, 37, 35, 138, 35, 25, 13, 37, 148, + 160, 25, 328, 25, 25, 70, 294, 0, 0, 0, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 0, 255, 0, 25, 25, 0, + 25, 25, 25, 51, 0, 0, 51, 25, 25, 25, + 25, 25, 25, 25, 0, 0, 0, 0, 25, 0, + 51, 51, 0, 25, 0, 25, 25, 0, 0, 0, + 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 0, 0, 0, 18, + 18, 286, 18, 18, 18, 51, 0, 0, 0, 18, + 18, 18, 18, 18, 18, 18, 270, 0, 0, 141, + 18, 142, 0, 0, 0, 18, 0, 18, 18, 0, + 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, + 0, 0, 0, 307, 39, 39, 39, 39, 0, 0, + 311, 39, 39, 0, 39, 39, 39, 0, 0, 0, + 80, 39, 39, 39, 39, 39, 39, 39, 92, 0, + 0, 0, 39, 80, 101, 0, 104, 39, 146, 39, + 39, 146, 146, 146, 0, 146, 136, 146, 146, 136, + 146, 80, 80, 80, 80, 80, 0, 0, 0, 81, + 0, 0, 0, 136, 136, 0, 136, 0, 136, 146, + 0, 0, 97, 113, 114, 115, 116, 117, 110, 0, + 120, 121, 0, 0, 0, 0, 0, 0, 0, 0, + 124, 125, 126, 127, 128, 0, 146, 0, 136, 147, + 183, 0, 147, 147, 147, 0, 147, 99, 147, 147, + 99, 147, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 99, 99, 0, 99, 146, 99, + 147, 146, 180, 137, 138, 139, 140, 0, 51, 51, + 51, 51, 0, 0, 0, 144, 145, 146, 44, 147, + 148, 55, 57, 54, 149, 49, 0, 58, 52, 99, + 51, 0, 0, 0, 137, 138, 139, 140, 0, 51, + 137, 138, 139, 140, 50, 51, 51, 145, 146, 56, + 147, 148, 0, 0, 0, 149, 147, 148, 0, 0, + 0, 149, 147, 136, 0, 0, 0, 137, 138, 139, + 140, 0, 0, 0, 0, 0, 53, 0, 143, 144, + 145, 146, 0, 147, 148, 0, 0, 0, 149, 0, + 39, 0, 0, 39, 39, 39, 0, 39, 0, 39, + 39, 0, 39, 0, 0, 0, 0, 0, 15, 0, + 0, 45, 0, 0, 0, 0, 39, 0, 0, 0, + 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 146, 146, 146, 146, 146, 0, 0, 0, + 0, 136, 136, 136, 136, 0, 0, 0, 39, 146, + 136, 146, 146, 146, 136, 136, 136, 136, 146, 146, + 146, 146, 146, 146, 146, 136, 136, 136, 136, 146, + 136, 136, 136, 0, 146, 136, 146, 146, 136, 136, + 39, 0, 0, 39, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 147, 147, 147, 147, 147, 0, 0, + 0, 0, 99, 99, 99, 99, 0, 0, 0, 0, + 147, 99, 147, 147, 147, 99, 99, 99, 99, 147, + 147, 147, 147, 147, 147, 147, 99, 99, 99, 99, + 147, 99, 99, 99, 0, 147, 99, 147, 147, 99, + 99, 21, 22, 23, 24, 25, 26, 0, 0, 0, + 0, 27, 28, 29, 30, 0, 0, 0, 31, 32, + 0, 33, 34, 35, 0, 0, 0, 0, 36, 37, + 38, 39, 40, 41, 42, 0, 0, 0, 0, 43, + 50, 0, 0, 50, 46, 0, 47, 48, 0, 0, + 0, 0, 0, 0, 0, 0, 44, 50, 50, 55, + 57, 54, 0, 49, 0, 58, 52, 0, 51, 0, + 0, 0, 0, 39, 39, 39, 39, 39, 39, 0, + 0, 0, 105, 39, 39, 39, 39, 56, 0, 0, + 39, 39, 50, 39, 39, 39, 0, 0, 0, 0, + 39, 39, 39, 39, 39, 39, 39, 0, 0, 0, + 0, 39, 0, 0, 53, 0, 39, 44, 39, 39, + 55, 57, 54, 0, 49, 118, 58, 52, 0, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, + 0, 77, 0, 0, 0, 0, 15, 0, 56, 45, + 0, 0, 0, 0, 0, 77, 77, 0, 77, 0, + 77, 0, 0, 0, 44, 0, 0, 55, 57, 54, + 0, 49, 0, 58, 52, 53, 51, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 0, 0, 0, 0, 56, 0, 0, 0, 0, + 0, 79, 0, 0, 79, 0, 0, 15, 0, 0, + 45, 0, 0, 0, 0, 0, 0, 0, 79, 79, + 0, 79, 53, 79, 122, 0, 0, 0, 44, 0, + 0, 55, 57, 54, 0, 49, 0, 58, 52, 0, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 79, 15, 0, 0, 45, 0, 56, + 0, 0, 0, 0, 0, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 23, 24, 25, 26, 0, 53, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 32, 0, 33, + 34, 35, 50, 50, 142, 0, 36, 37, 38, 39, + 40, 41, 42, 0, 0, 0, 0, 43, 15, 0, + 0, 45, 46, 0, 47, 48, 0, 0, 0, 0, + 71, 0, 0, 71, 0, 0, 0, 0, 0, 0, + 0, 22, 23, 24, 25, 26, 0, 71, 71, 0, + 71, 0, 71, 0, 0, 0, 0, 0, 32, 0, + 33, 34, 35, 77, 77, 77, 77, 36, 37, 38, + 39, 40, 41, 42, 0, 0, 0, 0, 43, 0, + 0, 0, 71, 46, 0, 47, 48, 0, 22, 23, + 24, 25, 26, 0, 77, 0, 0, 0, 0, 0, + 77, 77, 0, 0, 0, 32, 0, 33, 34, 35, + 141, 0, 142, 0, 36, 37, 38, 39, 40, 41, + 42, 0, 0, 0, 0, 43, 79, 79, 79, 79, + 46, 0, 47, 48, 44, 79, 0, 55, 57, 54, + 0, 49, 177, 58, 52, 0, 51, 0, 0, 0, + 79, 21, 22, 23, 24, 25, 26, 79, 0, 0, + 0, 0, 0, 79, 79, 56, 0, 0, 0, 32, + 0, 33, 34, 35, 0, 0, 0, 0, 36, 37, + 38, 39, 40, 41, 42, 0, 0, 0, 0, 43, + 0, 0, 53, 0, 46, 44, 47, 48, 55, 57, + 54, 0, 49, 0, 58, 52, 0, 51, 0, 0, + 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, + 137, 138, 139, 140, 15, 0, 56, 45, 0, 0, + 0, 143, 144, 145, 146, 0, 147, 148, 0, 0, + 0, 149, 44, 0, 0, 55, 57, 54, 0, 49, + 0, 58, 52, 53, 51, 71, 71, 71, 71, 0, + 0, 0, 0, 0, 71, 0, 0, 0, 71, 71, + 207, 71, 0, 56, 0, 0, 0, 0, 0, 71, + 71, 71, 71, 0, 71, 15, 71, 0, 45, 0, + 0, 0, 71, 71, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 0, 0, 44, 0, 0, 55, + 57, 54, 0, 49, 0, 58, 52, 0, 51, 0, + 0, 0, 0, 0, 136, 0, 0, 0, 137, 138, + 139, 140, 15, 0, 209, 45, 0, 56, 0, 143, + 144, 145, 146, 0, 147, 148, 0, 0, 0, 149, + 0, 0, 0, 0, 0, 0, 0, 0, 22, 23, + 24, 25, 26, 0, 53, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 32, 0, 33, 34, 35, + 0, 0, 0, 0, 36, 37, 38, 39, 40, 41, + 42, 0, 0, 0, 0, 43, 15, 0, 0, 45, + 46, 0, 47, 48, 0, 0, 0, 0, 72, 0, + 0, 72, 0, 0, 0, 0, 0, 0, 0, 22, + 23, 24, 25, 26, 0, 72, 72, 0, 72, 0, + 72, 0, 0, 0, 0, 0, 32, 0, 33, 34, + 35, 0, 0, 0, 0, 36, 37, 38, 39, 40, + 41, 42, 0, 0, 0, 60, 43, 0, 60, 159, + 72, 46, 0, 47, 48, 0, 22, 23, 24, 25, + 26, 0, 60, 60, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 32, 0, 33, 34, 35, 0, 0, + 0, 0, 36, 37, 38, 39, 40, 41, 42, 0, + 0, 0, 0, 43, 0, 0, 0, 60, 46, 0, + 47, 48, 44, 0, 0, 55, 57, 54, 0, 49, + 0, 58, 52, 0, 51, 0, 0, 0, 0, 0, + 22, 23, 24, 25, 26, 0, 0, 0, 0, 0, + 213, 0, 0, 56, 0, 0, 0, 32, 0, 33, + 34, 35, 0, 0, 0, 0, 36, 37, 38, 39, + 40, 41, 42, 0, 0, 0, 0, 43, 0, 0, + 53, 0, 46, 44, 47, 48, 55, 57, 54, 0, + 49, 0, 58, 52, 0, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 215, 15, 0, 56, 45, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 55, 57, 54, 0, 49, 0, 58, + 52, 53, 51, 72, 72, 72, 72, 0, 0, 0, + 0, 0, 72, 0, 0, 0, 72, 72, 217, 0, + 0, 56, 0, 0, 0, 0, 0, 72, 72, 72, + 72, 0, 72, 15, 72, 0, 45, 0, 0, 0, + 72, 72, 0, 0, 0, 0, 0, 0, 53, 0, + 60, 60, 60, 60, 44, 0, 0, 55, 57, 54, + 0, 49, 0, 58, 52, 0, 51, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 60, 219, 45, 0, 56, 0, 60, 60, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 23, 24, 25, + 26, 0, 53, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 32, 0, 33, 34, 35, 0, 0, + 0, 0, 36, 37, 38, 39, 40, 41, 42, 0, + 0, 0, 0, 43, 15, 0, 0, 45, 46, 0, + 47, 48, 0, 0, 0, 0, 70, 0, 0, 70, + 0, 0, 0, 0, 0, 0, 0, 22, 23, 24, + 25, 26, 0, 70, 70, 0, 70, 0, 70, 0, + 0, 0, 0, 0, 32, 0, 33, 34, 35, 0, + 0, 0, 0, 36, 37, 38, 39, 40, 41, 42, + 0, 0, 0, 62, 43, 0, 62, 0, 70, 46, + 0, 47, 48, 0, 22, 23, 24, 25, 26, 0, + 62, 62, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 0, 33, 34, 35, 0, 0, 0, 0, + 36, 37, 38, 39, 40, 41, 42, 0, 0, 0, + 0, 43, 0, 0, 0, 62, 46, 0, 47, 48, + 44, 0, 0, 55, 57, 54, 0, 49, 0, 58, + 52, 0, 51, 0, 0, 0, 0, 0, 22, 23, + 24, 25, 26, 0, 0, 0, 0, 0, 221, 0, + 0, 56, 0, 0, 0, 32, 0, 33, 34, 35, + 0, 0, 0, 0, 36, 37, 38, 39, 40, 41, + 42, 0, 0, 0, 0, 43, 0, 0, 53, 0, + 46, 44, 47, 48, 55, 57, 54, 0, 49, 0, + 58, 52, 0, 51, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, + 15, 0, 56, 45, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, + 0, 55, 57, 54, 0, 49, 233, 58, 52, 53, + 51, 70, 70, 70, 70, 0, 0, 0, 0, 0, + 70, 0, 0, 0, 70, 70, 70, 70, 0, 56, + 0, 0, 0, 0, 0, 70, 70, 70, 70, 0, + 70, 15, 70, 0, 45, 0, 0, 0, 70, 70, + 0, 0, 0, 0, 0, 0, 53, 0, 62, 62, + 62, 62, 44, 0, 0, 55, 57, 54, 0, 49, + 256, 58, 52, 0, 51, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 62, + 0, 45, 0, 56, 0, 62, 62, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 22, 23, 24, 25, 26, 0, + 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 0, 33, 34, 35, 0, 0, 0, 0, + 36, 37, 38, 39, 40, 41, 42, 0, 0, 0, + 0, 43, 15, 0, 0, 45, 46, 0, 47, 48, + 0, 0, 0, 0, 119, 0, 0, 119, 0, 0, + 0, 0, 0, 0, 0, 22, 23, 24, 25, 26, + 0, 119, 119, 0, 119, 0, 119, 0, 0, 0, + 0, 0, 32, 0, 33, 34, 35, 0, 0, 0, + 0, 36, 37, 38, 39, 40, 41, 42, 0, 0, + 0, 63, 43, 0, 63, 0, 119, 46, 0, 47, + 48, 0, 22, 23, 24, 25, 26, 0, 63, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, + 0, 33, 34, 35, 0, 0, 0, 0, 36, 37, + 38, 39, 40, 41, 42, 0, 0, 0, 0, 43, + 0, 0, 0, 63, 46, 0, 47, 48, 44, 0, + 0, 55, 57, 54, 0, 49, 258, 58, 52, 0, + 51, 0, 0, 0, 0, 0, 22, 23, 24, 25, + 26, 0, 0, 0, 0, 0, 0, 0, 0, 56, + 0, 0, 0, 32, 0, 33, 34, 35, 0, 0, + 0, 0, 36, 37, 38, 39, 40, 41, 42, 0, + 0, 0, 0, 43, 0, 0, 53, 0, 46, 44, + 47, 48, 55, 57, 54, 0, 49, 0, 58, 52, + 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 262, 0, 0, 15, 0, + 56, 45, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 44, 0, 0, 55, + 57, 54, 0, 49, 265, 58, 52, 53, 51, 119, + 119, 119, 119, 0, 0, 0, 0, 0, 119, 0, + 0, 0, 119, 119, 0, 0, 0, 56, 0, 0, + 0, 0, 0, 119, 119, 119, 119, 0, 0, 15, + 119, 0, 45, 0, 0, 0, 119, 119, 0, 0, + 0, 0, 0, 0, 53, 0, 63, 63, 63, 63, + 44, 0, 0, 55, 57, 54, 0, 49, 0, 58, + 52, 0, 51, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 63, 0, 45, + 0, 56, 0, 63, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 22, 23, 24, 25, 26, 0, 53, 0, + 267, 0, 0, 0, 0, 0, 0, 0, 0, 32, + 0, 33, 34, 35, 0, 0, 0, 0, 36, 37, + 38, 39, 40, 41, 42, 0, 0, 0, 0, 43, + 15, 0, 0, 45, 46, 0, 47, 48, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, + 68, 0, 0, 22, 23, 24, 25, 26, 0, 0, + 0, 0, 0, 0, 68, 68, 0, 0, 0, 0, + 32, 0, 33, 34, 35, 0, 0, 0, 0, 36, + 37, 38, 39, 40, 41, 42, 0, 0, 125, 0, + 43, 125, 0, 0, 0, 46, 0, 47, 48, 68, + 22, 23, 24, 25, 26, 125, 125, 0, 125, 0, + 125, 0, 0, 0, 0, 0, 0, 32, 0, 33, + 34, 35, 0, 0, 0, 0, 36, 37, 38, 39, + 40, 41, 42, 0, 0, 0, 0, 43, 0, 0, + 125, 0, 46, 0, 47, 48, 44, 0, 0, 55, + 57, 54, 0, 49, 0, 58, 52, 0, 51, 0, + 0, 0, 0, 0, 22, 23, 24, 25, 26, 0, + 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, + 0, 32, 0, 33, 34, 35, 0, 0, 0, 0, + 36, 37, 38, 39, 40, 41, 42, 0, 0, 0, + 0, 43, 0, 0, 53, 0, 46, 44, 47, 48, + 55, 57, 54, 0, 49, 0, 58, 52, 0, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 56, 45, + 0, 0, 0, 0, 130, 0, 0, 130, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 130, 130, 0, 130, 53, 130, 0, 0, 0, + 0, 0, 68, 68, 68, 68, 0, 0, 0, 0, + 0, 0, 0, 0, 138, 0, 0, 138, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 15, 0, 0, + 45, 138, 138, 68, 138, 0, 138, 0, 0, 68, + 68, 0, 0, 125, 125, 125, 125, 0, 0, 0, + 0, 0, 125, 0, 0, 0, 125, 125, 125, 125, + 0, 0, 0, 0, 0, 0, 138, 125, 125, 125, + 125, 0, 125, 125, 125, 0, 0, 125, 0, 0, + 125, 125, 0, 0, 0, 0, 0, 0, 127, 0, + 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, + 98, 23, 24, 25, 26, 127, 127, 0, 127, 0, + 127, 0, 0, 0, 0, 0, 0, 32, 0, 33, + 34, 35, 0, 0, 0, 0, 36, 37, 38, 39, + 40, 41, 42, 104, 0, 0, 104, 43, 0, 0, + 127, 0, 46, 0, 47, 48, 0, 0, 0, 0, + 104, 104, 0, 104, 0, 104, 0, 0, 0, 0, + 0, 22, 23, 24, 25, 26, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, + 33, 34, 35, 0, 0, 104, 0, 36, 37, 38, + 39, 40, 41, 42, 0, 0, 0, 0, 43, 130, + 130, 130, 130, 46, 0, 47, 48, 0, 130, 0, + 0, 0, 130, 130, 130, 130, 0, 0, 0, 0, + 0, 0, 0, 130, 130, 130, 130, 0, 130, 130, + 130, 0, 0, 130, 0, 0, 130, 130, 0, 138, + 138, 138, 138, 0, 0, 0, 0, 0, 138, 0, + 0, 0, 138, 138, 138, 138, 0, 0, 0, 0, + 0, 0, 0, 138, 138, 138, 138, 0, 138, 138, + 138, 115, 0, 138, 115, 0, 138, 138, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 115, 115, + 0, 115, 0, 115, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 127, 127, 127, 127, 0, 0, 0, + 0, 0, 127, 115, 0, 0, 127, 127, 127, 127, + 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, + 127, 0, 127, 127, 127, 0, 136, 127, 0, 136, + 127, 127, 0, 0, 0, 0, 0, 0, 104, 104, + 104, 104, 0, 136, 136, 0, 136, 104, 136, 0, + 0, 104, 104, 104, 104, 0, 0, 0, 0, 0, + 0, 0, 104, 104, 104, 104, 0, 104, 104, 104, + 99, 0, 104, 99, 0, 104, 104, 0, 136, 0, + 0, 0, 0, 0, 0, 0, 0, 99, 99, 0, + 99, 0, 99, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, + 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 99, 0, 0, 0, 94, 94, 0, 94, + 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 93, 0, 0, 93, 0, 0, 0, 0, + 0, 94, 0, 0, 0, 0, 0, 0, 0, 93, + 93, 0, 93, 0, 93, 0, 115, 115, 115, 115, + 0, 0, 0, 0, 0, 115, 0, 0, 0, 115, + 115, 115, 115, 0, 0, 0, 0, 0, 139, 0, + 115, 115, 115, 115, 93, 115, 115, 115, 0, 0, + 115, 0, 0, 115, 115, 139, 139, 0, 139, 0, + 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, + 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, + 139, 136, 136, 136, 136, 0, 138, 138, 0, 138, + 136, 138, 0, 0, 136, 136, 136, 136, 0, 0, + 0, 0, 0, 0, 0, 136, 136, 136, 136, 0, + 136, 136, 136, 0, 0, 136, 0, 0, 136, 136, + 0, 138, 0, 0, 0, 99, 99, 99, 99, 0, + 0, 0, 0, 0, 99, 0, 0, 0, 99, 99, + 99, 99, 0, 0, 0, 0, 0, 0, 0, 99, + 99, 99, 99, 0, 99, 99, 99, 0, 0, 99, + 0, 0, 99, 99, 94, 94, 94, 94, 0, 0, + 0, 0, 0, 94, 0, 0, 0, 94, 94, 94, + 94, 0, 0, 0, 0, 0, 0, 0, 94, 94, + 94, 94, 0, 94, 94, 94, 0, 81, 94, 0, + 81, 94, 94, 0, 0, 0, 0, 93, 93, 93, + 93, 0, 0, 0, 81, 81, 93, 81, 0, 81, + 93, 93, 93, 93, 0, 0, 0, 0, 0, 0, + 0, 93, 93, 93, 93, 0, 93, 93, 93, 0, + 67, 93, 0, 67, 93, 93, 0, 0, 0, 81, + 0, 0, 0, 139, 139, 139, 139, 67, 67, 0, + 0, 0, 139, 0, 0, 0, 139, 139, 139, 139, + 0, 0, 0, 0, 0, 0, 0, 139, 139, 139, + 139, 0, 139, 139, 139, 0, 0, 139, 0, 0, + 139, 139, 67, 0, 138, 138, 138, 138, 0, 0, + 0, 0, 0, 138, 0, 0, 0, 138, 138, 138, + 138, 0, 0, 0, 0, 0, 0, 0, 138, 138, + 138, 138, 69, 138, 138, 69, 0, 0, 138, 0, + 0, 138, 138, 0, 0, 0, 0, 0, 0, 69, + 69, 0, 69, 0, 69, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 0, 0, 92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 92, 92, 69, 92, 0, 92, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 129, 0, + 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 129, 129, 92, 129, 0, + 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 81, 81, 81, 81, 0, 0, 0, 0, + 0, 81, 0, 0, 0, 81, 81, 81, 81, 0, + 129, 0, 0, 0, 0, 0, 81, 81, 81, 81, + 0, 81, 81, 81, 73, 0, 0, 73, 0, 81, + 81, 0, 0, 0, 0, 67, 67, 67, 67, 0, + 0, 73, 73, 0, 73, 0, 73, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 74, 0, 0, + 74, 0, 0, 0, 0, 0, 67, 0, 0, 0, + 0, 0, 67, 67, 74, 74, 73, 74, 0, 74, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 66, 0, 0, 0, 0, 75, 0, 0, 75, 74, + 0, 0, 0, 0, 66, 66, 0, 69, 69, 69, + 69, 65, 75, 75, 65, 75, 69, 75, 0, 0, + 69, 69, 69, 69, 0, 0, 0, 0, 65, 65, + 0, 69, 69, 69, 69, 0, 69, 69, 69, 66, + 92, 92, 92, 92, 69, 69, 0, 75, 0, 92, + 0, 0, 0, 92, 92, 0, 0, 0, 0, 0, + 0, 0, 0, 65, 92, 92, 92, 92, 0, 0, + 0, 92, 0, 129, 129, 129, 129, 92, 92, 0, + 0, 0, 129, 0, 0, 76, 129, 129, 76, 0, + 0, 0, 0, 0, 0, 0, 0, 129, 129, 129, + 129, 0, 76, 76, 129, 76, 0, 76, 0, 0, + 129, 129, 0, 0, 0, 0, 0, 64, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 78, 0, 0, + 78, 0, 0, 0, 64, 64, 0, 76, 0, 73, + 73, 73, 73, 61, 78, 78, 61, 78, 73, 78, + 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, + 61, 61, 0, 73, 73, 73, 73, 0, 0, 64, + 73, 0, 74, 74, 74, 74, 73, 73, 0, 78, + 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 61, 74, 74, 74, 74, + 0, 0, 0, 74, 0, 0, 0, 0, 85, 74, + 74, 85, 66, 66, 66, 66, 0, 0, 0, 0, + 75, 75, 75, 75, 0, 85, 85, 0, 85, 75, + 85, 0, 0, 0, 0, 0, 65, 65, 65, 65, + 0, 0, 0, 66, 75, 75, 75, 75, 0, 66, + 66, 75, 0, 0, 0, 0, 0, 75, 75, 0, + 85, 0, 86, 0, 0, 86, 0, 65, 0, 0, + 0, 0, 0, 65, 65, 0, 0, 0, 0, 86, + 86, 0, 86, 0, 86, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 87, 0, + 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, + 76, 76, 76, 76, 86, 87, 87, 0, 87, 76, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 238, + 0, 0, 239, 0, 76, 76, 76, 0, 0, 0, + 0, 76, 64, 64, 64, 64, 0, 76, 76, 141, + 87, 142, 78, 78, 78, 78, 0, 0, 0, 0, + 0, 78, 0, 0, 83, 0, 0, 83, 61, 61, + 61, 61, 0, 64, 0, 0, 78, 78, 0, 64, + 64, 83, 83, 78, 83, 0, 83, 0, 0, 78, + 78, 0, 0, 0, 0, 0, 0, 0, 0, 61, + 84, 0, 0, 84, 0, 61, 61, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 83, 84, 84, 0, + 84, 0, 84, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 85, 85, 85, 85, 0, 0, 0, + 0, 0, 85, 0, 0, 0, 85, 85, 85, 85, + 0, 0, 84, 82, 0, 0, 82, 85, 85, 85, + 85, 0, 85, 85, 85, 0, 0, 85, 0, 0, + 82, 82, 0, 82, 0, 82, 0, 312, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 86, 86, 86, + 86, 0, 0, 0, 0, 0, 86, 141, 0, 142, + 86, 86, 86, 86, 0, 82, 0, 0, 0, 0, + 0, 86, 86, 86, 86, 0, 86, 86, 86, 0, + 0, 86, 0, 87, 87, 87, 87, 0, 0, 0, + 0, 0, 87, 0, 0, 0, 87, 87, 87, 87, + 0, 0, 0, 0, 0, 0, 0, 87, 87, 87, + 87, 0, 87, 87, 87, 0, 0, 87, 0, 0, + 0, 0, 0, 136, 0, 100, 102, 137, 138, 139, + 140, 112, 0, 0, 0, 0, 0, 0, 143, 144, + 145, 146, 0, 147, 148, 0, 0, 0, 149, 83, + 83, 83, 83, 0, 0, 0, 0, 0, 83, 0, + 0, 0, 83, 83, 83, 83, 0, 0, 0, 0, + 162, 0, 0, 83, 83, 83, 83, 0, 83, 83, + 83, 0, 0, 83, 0, 84, 84, 84, 84, 0, + 0, 0, 0, 0, 84, 0, 0, 0, 84, 84, + 84, 84, 0, 0, 0, 0, 0, 0, 0, 84, + 84, 84, 84, 0, 84, 84, 84, 0, 0, 84, + 0, 0, 0, 203, 204, 205, 206, 208, 210, 211, + 212, 214, 216, 218, 220, 222, 223, 225, 82, 82, + 82, 82, 0, 0, 0, 0, 0, 82, 0, 0, + 0, 82, 82, 82, 82, 0, 0, 0, 0, 0, + 0, 0, 82, 82, 82, 82, 0, 82, 82, 0, + 0, 136, 82, 0, 203, 137, 138, 139, 140, 0, + 0, 203, 0, 203, 0, 0, 143, 144, 145, 146, + 0, 147, 148, 0, 0, 268, 149, 269, 0, 0, + 0, 271, 0, 272, 0, 273, 0, 274, 0, 275, + 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 287, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 305, +}; +short yycheck[] = { 5, + 123, 59, 36, 91, 41, 125, 12, 44, 12, 40, + 16, 40, 18, 171, 173, 257, 40, 165, 40, 167, + 40, 27, 28, 29, 30, 44, 59, 44, 44, 44, + 91, 37, 91, 281, 282, 123, 40, 43, 123, 44, + 279, 280, 281, 282, 281, 49, 44, 44, 296, 53, + 41, 41, 300, 44, 293, 41, 295, 296, 40, 296, + 91, 300, 123, 300, 123, 303, 304, 58, 59, 59, + 61, 44, 0, 59, 93, 234, 93, 93, 84, 83, + 86, 85, 88, 87, 90, 89, 59, 91, 93, 123, + 123, 95, 123, 252, 123, 93, 93, 59, 257, 123, + 259, 123, 93, 123, 279, 33, 281, 282, 36, 37, + 38, 44, 40, 257, 42, 43, 40, 45, 44, 41, + 295, 296, 40, 129, 0, 300, 59, 131, 132, 133, + 134, 59, 290, 59, 257, 293, 64, 59, 41, 44, + 288, 289, 262, 263, 264, 265, 40, 295, 257, 153, + 154, 155, 156, 157, 59, 41, 59, 33, 44, 44, + 36, 37, 38, 91, 40, 272, 42, 43, 41, 45, + 258, 175, 320, 331, 59, 41, 0, 181, 182, 44, + 184, 41, 40, 59, 44, 278, 59, 191, 64, 279, + 280, 281, 282, 59, 59, 123, 289, 125, 126, 257, + 290, 291, 292, 293, 36, 295, 296, 36, 40, 33, + 300, 40, 36, 37, 38, 91, 40, 59, 42, 43, + 297, 45, 226, 257, 228, 270, 271, 261, 0, 266, + 267, 268, 269, 40, 240, 59, 242, 297, 244, 245, + 64, 41, 248, 303, 304, 251, 250, 123, 40, 125, + 126, 266, 267, 268, 269, 296, 260, 41, 36, 300, + 44, 33, 266, 125, 36, 37, 38, 91, 40, 123, + 42, 43, 91, 45, 44, 266, 267, 268, 269, 281, + 282, 262, 263, 264, 265, 41, 41, 59, 292, 44, + 296, 59, 64, 295, 296, 41, 81, 41, 300, 123, + 44, 125, 126, 123, 41, 91, 297, 44, 125, 40, + 40, 96, 303, 304, 318, 300, 40, 125, 41, 91, + 125, 327, 107, 125, 59, 110, 332, 125, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 125, 41, 41, 273, 274, 41, 276, 277, + 278, 123, 125, 41, 126, 283, 284, 285, 286, 287, + 288, 289, 41, 59, 41, 41, 294, 59, 59, 297, + 73, 299, 318, 301, 302, 12, 250, -1, -1, -1, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, -1, 180, -1, 273, 274, -1, + 276, 277, 278, 41, -1, -1, 44, 283, 284, 285, + 286, 287, 288, 289, -1, -1, -1, -1, 294, -1, + 58, 59, -1, 299, -1, 301, 302, -1, -1, -1, + -1, -1, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, -1, -1, -1, 273, + 274, 236, 276, 277, 278, 93, -1, -1, -1, 283, + 284, 285, 286, 287, 288, 289, 58, -1, -1, 61, + 294, 63, -1, -1, -1, 299, -1, 301, 302, -1, + -1, -1, -1, -1, 256, 257, 258, 259, 260, 261, + -1, -1, -1, 278, 266, 267, 268, 269, -1, -1, + 285, 273, 274, -1, 276, 277, 278, -1, -1, -1, + 23, 283, 284, 285, 286, 287, 288, 289, 31, -1, + -1, -1, 294, 36, 37, -1, 39, 299, 33, 301, + 302, 36, 37, 38, -1, 40, 41, 42, 43, 44, + 45, 54, 55, 56, 57, 58, -1, -1, -1, 23, + -1, -1, -1, 58, 59, -1, 61, -1, 63, 64, + -1, -1, 36, 44, 45, 46, 47, 48, 42, -1, + 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, + 54, 55, 56, 57, 58, -1, 91, -1, 93, 33, + 103, -1, 36, 37, 38, -1, 40, 41, 42, 43, + 44, 45, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 58, 59, -1, 61, 123, 63, + 64, 126, 96, 279, 280, 281, 282, -1, 266, 267, + 268, 269, -1, -1, -1, 291, 292, 293, 33, 295, + 296, 36, 37, 38, 300, 40, -1, 42, 43, 93, + 45, -1, -1, -1, 279, 280, 281, 282, -1, 297, + 279, 280, 281, 282, 59, 303, 304, 292, 293, 64, + 295, 296, -1, -1, -1, 300, 295, 296, -1, -1, + -1, 300, 126, 275, -1, -1, -1, 279, 280, 281, + 282, -1, -1, -1, -1, -1, 91, -1, 290, 291, + 292, 293, -1, 295, 296, -1, -1, -1, 300, -1, + 33, -1, -1, 36, 37, 38, -1, 40, -1, 42, + 43, -1, 45, -1, -1, -1, -1, -1, 123, -1, + -1, 126, -1, -1, -1, -1, 59, -1, -1, -1, + -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 257, 258, 259, 260, 261, -1, -1, -1, + -1, 266, 267, 268, 269, -1, -1, -1, 91, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, -1, 299, 300, 301, 302, 303, 304, + 123, -1, -1, 126, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 257, 258, 259, 260, 261, -1, -1, + -1, -1, 266, 267, 268, 269, -1, -1, -1, -1, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, -1, 299, 300, 301, 302, 303, + 304, 256, 257, 258, 259, 260, 261, -1, -1, -1, + -1, 266, 267, 268, 269, -1, -1, -1, 273, 274, + -1, 276, 277, 278, -1, -1, -1, -1, 283, 284, + 285, 286, 287, 288, 289, -1, -1, -1, -1, 294, + 41, -1, -1, 44, 299, -1, 301, 302, -1, -1, + -1, -1, -1, -1, -1, -1, 33, 58, 59, 36, + 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, + -1, -1, -1, 256, 257, 258, 259, 260, 261, -1, + -1, -1, 59, 266, 267, 268, 269, 64, -1, -1, + 273, 274, 93, 276, 277, 278, -1, -1, -1, -1, + 283, 284, 285, 286, 287, 288, 289, -1, -1, -1, + -1, 294, -1, -1, 91, -1, 299, 33, 301, 302, + 36, 37, 38, -1, 40, 41, 42, 43, -1, 45, + -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, 123, -1, 64, 126, + -1, -1, -1, -1, -1, 58, 59, -1, 61, -1, + 63, -1, -1, -1, 33, -1, -1, 36, 37, 38, + -1, 40, -1, 42, 43, 91, 45, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 93, -1, -1, -1, -1, 64, -1, -1, -1, -1, + -1, 41, -1, -1, 44, -1, -1, 123, -1, -1, + 126, -1, -1, -1, -1, -1, -1, -1, 58, 59, + -1, 61, 91, 63, 93, -1, -1, -1, 33, -1, + -1, 36, 37, 38, -1, 40, -1, 42, 43, -1, + 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 93, 123, -1, -1, 126, -1, 64, + -1, -1, -1, -1, -1, 266, 267, 268, 269, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 257, 258, 259, 260, 261, -1, 91, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 297, 274, -1, 276, + 277, 278, 303, 304, 63, -1, 283, 284, 285, 286, + 287, 288, 289, -1, -1, -1, -1, 294, 123, -1, + -1, 126, 299, -1, 301, 302, -1, -1, -1, -1, + 41, -1, -1, 44, -1, -1, -1, -1, -1, -1, + -1, 257, 258, 259, 260, 261, -1, 58, 59, -1, + 61, -1, 63, -1, -1, -1, -1, -1, 274, -1, + 276, 277, 278, 266, 267, 268, 269, 283, 284, 285, + 286, 287, 288, 289, -1, -1, -1, -1, 294, -1, + -1, -1, 93, 299, -1, 301, 302, -1, 257, 258, + 259, 260, 261, -1, 297, -1, -1, -1, -1, -1, + 303, 304, -1, -1, -1, 274, -1, 276, 277, 278, + 61, -1, 63, -1, 283, 284, 285, 286, 287, 288, + 289, -1, -1, -1, -1, 294, 266, 267, 268, 269, + 299, -1, 301, 302, 33, 275, -1, 36, 37, 38, + -1, 40, 41, 42, 43, -1, 45, -1, -1, -1, + 290, 256, 257, 258, 259, 260, 261, 297, -1, -1, + -1, -1, -1, 303, 304, 64, -1, -1, -1, 274, + -1, 276, 277, 278, -1, -1, -1, -1, 283, 284, + 285, 286, 287, 288, 289, -1, -1, -1, -1, 294, + -1, -1, 91, -1, 299, 33, 301, 302, 36, 37, + 38, -1, 40, -1, 42, 43, -1, 45, -1, -1, + -1, -1, -1, -1, -1, -1, 275, -1, -1, -1, + 279, 280, 281, 282, 123, -1, 64, 126, -1, -1, + -1, 290, 291, 292, 293, -1, 295, 296, -1, -1, + -1, 300, 33, -1, -1, 36, 37, 38, -1, 40, + -1, 42, 43, 91, 45, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 275, -1, -1, -1, 279, 280, + 61, 282, -1, 64, -1, -1, -1, -1, -1, 290, + 291, 292, 293, -1, 295, 123, 297, -1, 126, -1, + -1, -1, 303, 304, -1, -1, -1, -1, -1, -1, + 91, -1, -1, -1, -1, -1, 33, -1, -1, 36, + 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, + -1, -1, -1, -1, 275, -1, -1, -1, 279, 280, + 281, 282, 123, -1, 61, 126, -1, 64, -1, 290, + 291, 292, 293, -1, 295, 296, -1, -1, -1, 300, + -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, -1, 91, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 274, -1, 276, 277, 278, + -1, -1, -1, -1, 283, 284, 285, 286, 287, 288, + 289, -1, -1, -1, -1, 294, 123, -1, -1, 126, + 299, -1, 301, 302, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, -1, -1, -1, 257, + 258, 259, 260, 261, -1, 58, 59, -1, 61, -1, + 63, -1, -1, -1, -1, -1, 274, -1, 276, 277, + 278, -1, -1, -1, -1, 283, 284, 285, 286, 287, + 288, 289, -1, -1, -1, 41, 294, -1, 44, 297, + 93, 299, -1, 301, 302, -1, 257, 258, 259, 260, + 261, -1, 58, 59, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 274, -1, 276, 277, 278, -1, -1, + -1, -1, 283, 284, 285, 286, 287, 288, 289, -1, + -1, -1, -1, 294, -1, -1, -1, 93, 299, -1, + 301, 302, 33, -1, -1, 36, 37, 38, -1, 40, + -1, 42, 43, -1, 45, -1, -1, -1, -1, -1, + 257, 258, 259, 260, 261, -1, -1, -1, -1, -1, + 61, -1, -1, 64, -1, -1, -1, 274, -1, 276, + 277, 278, -1, -1, -1, -1, 283, 284, 285, 286, + 287, 288, 289, -1, -1, -1, -1, 294, -1, -1, + 91, -1, 299, 33, 301, 302, 36, 37, 38, -1, + 40, -1, 42, 43, -1, 45, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 61, 123, -1, 64, 126, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, -1, -1, 36, 37, 38, -1, 40, -1, 42, + 43, 91, 45, 266, 267, 268, 269, -1, -1, -1, + -1, -1, 275, -1, -1, -1, 279, 280, 61, -1, + -1, 64, -1, -1, -1, -1, -1, 290, 291, 292, + 293, -1, 295, 123, 297, -1, 126, -1, -1, -1, + 303, 304, -1, -1, -1, -1, -1, -1, 91, -1, + 266, 267, 268, 269, 33, -1, -1, 36, 37, 38, + -1, 40, -1, 42, 43, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 123, 297, 61, 126, -1, 64, -1, 303, 304, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 257, 258, 259, 260, + 261, -1, 91, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 274, -1, 276, 277, 278, -1, -1, + -1, -1, 283, 284, 285, 286, 287, 288, 289, -1, + -1, -1, -1, 294, 123, -1, -1, 126, 299, -1, + 301, 302, -1, -1, -1, -1, 41, -1, -1, 44, + -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, + 260, 261, -1, 58, 59, -1, 61, -1, 63, -1, + -1, -1, -1, -1, 274, -1, 276, 277, 278, -1, + -1, -1, -1, 283, 284, 285, 286, 287, 288, 289, + -1, -1, -1, 41, 294, -1, 44, -1, 93, 299, + -1, 301, 302, -1, 257, 258, 259, 260, 261, -1, + 58, 59, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 274, -1, 276, 277, 278, -1, -1, -1, -1, + 283, 284, 285, 286, 287, 288, 289, -1, -1, -1, + -1, 294, -1, -1, -1, 93, 299, -1, 301, 302, + 33, -1, -1, 36, 37, 38, -1, 40, -1, 42, + 43, -1, 45, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, -1, -1, -1, -1, -1, 61, -1, + -1, 64, -1, -1, -1, 274, -1, 276, 277, 278, + -1, -1, -1, -1, 283, 284, 285, 286, 287, 288, + 289, -1, -1, -1, -1, 294, -1, -1, 91, -1, + 299, 33, 301, 302, 36, 37, 38, -1, 40, -1, + 42, 43, -1, 45, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, + 123, -1, 64, 126, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, + -1, 36, 37, 38, -1, 40, 41, 42, 43, 91, + 45, 266, 267, 268, 269, -1, -1, -1, -1, -1, + 275, -1, -1, -1, 279, 280, 281, 282, -1, 64, + -1, -1, -1, -1, -1, 290, 291, 292, 293, -1, + 295, 123, 297, -1, 126, -1, -1, -1, 303, 304, + -1, -1, -1, -1, -1, -1, 91, -1, 266, 267, + 268, 269, 33, -1, -1, 36, 37, 38, -1, 40, + 41, 42, 43, -1, 45, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 123, 297, + -1, 126, -1, 64, -1, 303, 304, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 257, 258, 259, 260, 261, -1, + 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 274, -1, 276, 277, 278, -1, -1, -1, -1, + 283, 284, 285, 286, 287, 288, 289, -1, -1, -1, + -1, 294, 123, -1, -1, 126, 299, -1, 301, 302, + -1, -1, -1, -1, 41, -1, -1, 44, -1, -1, + -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, + -1, 58, 59, -1, 61, -1, 63, -1, -1, -1, + -1, -1, 274, -1, 276, 277, 278, -1, -1, -1, + -1, 283, 284, 285, 286, 287, 288, 289, -1, -1, + -1, 41, 294, -1, 44, -1, 93, 299, -1, 301, + 302, -1, 257, 258, 259, 260, 261, -1, 58, 59, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, + -1, 276, 277, 278, -1, -1, -1, -1, 283, 284, + 285, 286, 287, 288, 289, -1, -1, -1, -1, 294, + -1, -1, -1, 93, 299, -1, 301, 302, 33, -1, + -1, 36, 37, 38, -1, 40, 41, 42, 43, -1, + 45, -1, -1, -1, -1, -1, 257, 258, 259, 260, + 261, -1, -1, -1, -1, -1, -1, -1, -1, 64, + -1, -1, -1, 274, -1, 276, 277, 278, -1, -1, + -1, -1, 283, 284, 285, 286, 287, 288, 289, -1, + -1, -1, -1, 294, -1, -1, 91, -1, 299, 33, + 301, 302, 36, 37, 38, -1, 40, -1, 42, 43, + -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 59, -1, -1, 123, -1, + 64, 126, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, -1, -1, 36, + 37, 38, -1, 40, 41, 42, 43, 91, 45, 266, + 267, 268, 269, -1, -1, -1, -1, -1, 275, -1, + -1, -1, 279, 280, -1, -1, -1, 64, -1, -1, + -1, -1, -1, 290, 291, 292, 293, -1, -1, 123, + 297, -1, 126, -1, -1, -1, 303, 304, -1, -1, + -1, -1, -1, -1, 91, -1, 266, 267, 268, 269, + 33, -1, -1, 36, 37, 38, -1, 40, -1, 42, + 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 123, 297, -1, 126, + -1, 64, -1, 303, 304, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 257, 258, 259, 260, 261, -1, 91, -1, + 93, -1, -1, -1, -1, -1, -1, -1, -1, 274, + -1, 276, 277, 278, -1, -1, -1, -1, 283, 284, + 285, 286, 287, 288, 289, -1, -1, -1, -1, 294, + 123, -1, -1, 126, 299, -1, 301, 302, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, + 44, -1, -1, 257, 258, 259, 260, 261, -1, -1, + -1, -1, -1, -1, 58, 59, -1, -1, -1, -1, + 274, -1, 276, 277, 278, -1, -1, -1, -1, 283, + 284, 285, 286, 287, 288, 289, -1, -1, 41, -1, + 294, 44, -1, -1, -1, 299, -1, 301, 302, 93, + 257, 258, 259, 260, 261, 58, 59, -1, 61, -1, + 63, -1, -1, -1, -1, -1, -1, 274, -1, 276, + 277, 278, -1, -1, -1, -1, 283, 284, 285, 286, + 287, 288, 289, -1, -1, -1, -1, 294, -1, -1, + 93, -1, 299, -1, 301, 302, 33, -1, -1, 36, + 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, + -1, -1, -1, -1, 257, 258, 259, 260, 261, -1, + -1, -1, -1, -1, -1, -1, -1, 64, -1, -1, + -1, 274, -1, 276, 277, 278, -1, -1, -1, -1, + 283, 284, 285, 286, 287, 288, 289, -1, -1, -1, + -1, 294, -1, -1, 91, -1, 299, 33, 301, 302, + 36, 37, 38, -1, 40, -1, 42, 43, -1, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 123, -1, 64, 126, + -1, -1, -1, -1, 41, -1, -1, 44, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 58, 59, -1, 61, 91, 63, -1, -1, -1, + -1, -1, 266, 267, 268, 269, -1, -1, -1, -1, + -1, -1, -1, -1, 41, -1, -1, 44, -1, -1, + -1, -1, -1, -1, -1, -1, 93, 123, -1, -1, + 126, 58, 59, 297, 61, -1, 63, -1, -1, 303, + 304, -1, -1, 266, 267, 268, 269, -1, -1, -1, + -1, -1, 275, -1, -1, -1, 279, 280, 281, 282, + -1, -1, -1, -1, -1, -1, 93, 290, 291, 292, + 293, -1, 295, 296, 297, -1, -1, 300, -1, -1, + 303, 304, -1, -1, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, + 257, 258, 259, 260, 261, 58, 59, -1, 61, -1, + 63, -1, -1, -1, -1, -1, -1, 274, -1, 276, + 277, 278, -1, -1, -1, -1, 283, 284, 285, 286, + 287, 288, 289, 41, -1, -1, 44, 294, -1, -1, + 93, -1, 299, -1, 301, 302, -1, -1, -1, -1, + 58, 59, -1, 61, -1, 63, -1, -1, -1, -1, + -1, 257, 258, 259, 260, 261, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 274, -1, + 276, 277, 278, -1, -1, 93, -1, 283, 284, 285, + 286, 287, 288, 289, -1, -1, -1, -1, 294, 266, + 267, 268, 269, 299, -1, 301, 302, -1, 275, -1, + -1, -1, 279, 280, 281, 282, -1, -1, -1, -1, + -1, -1, -1, 290, 291, 292, 293, -1, 295, 296, + 297, -1, -1, 300, -1, -1, 303, 304, -1, 266, + 267, 268, 269, -1, -1, -1, -1, -1, 275, -1, + -1, -1, 279, 280, 281, 282, -1, -1, -1, -1, + -1, -1, -1, 290, 291, 292, 293, -1, 295, 296, + 297, 41, -1, 300, 44, -1, 303, 304, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 58, 59, + -1, 61, -1, 63, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 266, 267, 268, 269, -1, -1, -1, + -1, -1, 275, 93, -1, -1, 279, 280, 281, 282, + -1, -1, -1, -1, -1, -1, -1, 290, 291, 292, + 293, -1, 295, 296, 297, -1, 41, 300, -1, 44, + 303, 304, -1, -1, -1, -1, -1, -1, 266, 267, + 268, 269, -1, 58, 59, -1, 61, 275, 63, -1, + -1, 279, 280, 281, 282, -1, -1, -1, -1, -1, + -1, -1, 290, 291, 292, 293, -1, 295, 296, 297, + 41, -1, 300, 44, -1, 303, 304, -1, 93, -1, + -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, + 61, -1, 63, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 93, -1, -1, -1, 58, 59, -1, 61, + -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, + -1, 93, -1, -1, -1, -1, -1, -1, -1, 58, + 59, -1, 61, -1, 63, -1, 266, 267, 268, 269, + -1, -1, -1, -1, -1, 275, -1, -1, -1, 279, + 280, 281, 282, -1, -1, -1, -1, -1, 41, -1, + 290, 291, 292, 293, 93, 295, 296, 297, -1, -1, + 300, -1, -1, 303, 304, 58, 59, -1, 61, -1, + 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + 93, 266, 267, 268, 269, -1, 58, 59, -1, 61, + 275, 63, -1, -1, 279, 280, 281, 282, -1, -1, + -1, -1, -1, -1, -1, 290, 291, 292, 293, -1, + 295, 296, 297, -1, -1, 300, -1, -1, 303, 304, + -1, 93, -1, -1, -1, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 275, -1, -1, -1, 279, 280, + 281, 282, -1, -1, -1, -1, -1, -1, -1, 290, + 291, 292, 293, -1, 295, 296, 297, -1, -1, 300, + -1, -1, 303, 304, 266, 267, 268, 269, -1, -1, + -1, -1, -1, 275, -1, -1, -1, 279, 280, 281, + 282, -1, -1, -1, -1, -1, -1, -1, 290, 291, + 292, 293, -1, 295, 296, 297, -1, 41, 300, -1, + 44, 303, 304, -1, -1, -1, -1, 266, 267, 268, + 269, -1, -1, -1, 58, 59, 275, 61, -1, 63, + 279, 280, 281, 282, -1, -1, -1, -1, -1, -1, + -1, 290, 291, 292, 293, -1, 295, 296, 297, -1, + 41, 300, -1, 44, 303, 304, -1, -1, -1, 93, + -1, -1, -1, 266, 267, 268, 269, 58, 59, -1, + -1, -1, 275, -1, -1, -1, 279, 280, 281, 282, + -1, -1, -1, -1, -1, -1, -1, 290, 291, 292, + 293, -1, 295, 296, 297, -1, -1, 300, -1, -1, + 303, 304, 93, -1, 266, 267, 268, 269, -1, -1, + -1, -1, -1, 275, -1, -1, -1, 279, 280, 281, + 282, -1, -1, -1, -1, -1, -1, -1, 290, 291, + 292, 293, 41, 295, 296, 44, -1, -1, 300, -1, + -1, 303, 304, -1, -1, -1, -1, -1, -1, 58, + 59, -1, 61, -1, 63, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 41, -1, -1, 44, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 58, 59, 93, 61, -1, 63, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 58, 59, 93, 61, -1, + 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 266, 267, 268, 269, -1, -1, -1, -1, + -1, 275, -1, -1, -1, 279, 280, 281, 282, -1, + 93, -1, -1, -1, -1, -1, 290, 291, 292, 293, + -1, 295, 296, 297, 41, -1, -1, 44, -1, 303, + 304, -1, -1, -1, -1, 266, 267, 268, 269, -1, + -1, 58, 59, -1, 61, -1, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, + 44, -1, -1, -1, -1, -1, 297, -1, -1, -1, + -1, -1, 303, 304, 58, 59, 93, 61, -1, 63, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, + 44, -1, -1, -1, -1, 41, -1, -1, 44, 93, + -1, -1, -1, -1, 58, 59, -1, 266, 267, 268, + 269, 41, 58, 59, 44, 61, 275, 63, -1, -1, + 279, 280, 281, 282, -1, -1, -1, -1, 58, 59, + -1, 290, 291, 292, 293, -1, 295, 296, 297, 93, + 266, 267, 268, 269, 303, 304, -1, 93, -1, 275, + -1, -1, -1, 279, 280, -1, -1, -1, -1, -1, + -1, -1, -1, 93, 290, 291, 292, 293, -1, -1, + -1, 297, -1, 266, 267, 268, 269, 303, 304, -1, + -1, -1, 275, -1, -1, 41, 279, 280, 44, -1, + -1, -1, -1, -1, -1, -1, -1, 290, 291, 292, + 293, -1, 58, 59, 297, 61, -1, 63, -1, -1, + 303, 304, -1, -1, -1, -1, -1, 41, -1, -1, + 44, -1, -1, -1, -1, -1, -1, 41, -1, -1, + 44, -1, -1, -1, 58, 59, -1, 93, -1, 266, + 267, 268, 269, 41, 58, 59, 44, 61, 275, 63, + -1, -1, -1, 280, -1, -1, -1, -1, -1, -1, + 58, 59, -1, 290, 291, 292, 293, -1, -1, 93, + 297, -1, 266, 267, 268, 269, 303, 304, -1, 93, + -1, 275, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 93, 290, 291, 292, 293, + -1, -1, -1, 297, -1, -1, -1, -1, 41, 303, + 304, 44, 266, 267, 268, 269, -1, -1, -1, -1, + 266, 267, 268, 269, -1, 58, 59, -1, 61, 275, + 63, -1, -1, -1, -1, -1, 266, 267, 268, 269, + -1, -1, -1, 297, 290, 291, 292, 293, -1, 303, + 304, 297, -1, -1, -1, -1, -1, 303, 304, -1, + 93, -1, 41, -1, -1, 44, -1, 297, -1, -1, + -1, -1, -1, 303, 304, -1, -1, -1, -1, 58, + 59, -1, 61, -1, 63, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, + 266, 267, 268, 269, 93, 58, 59, -1, 61, 275, + 63, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, -1, 44, -1, 290, 291, 292, -1, -1, -1, + -1, 297, 266, 267, 268, 269, -1, 303, 304, 61, + 93, 63, 266, 267, 268, 269, -1, -1, -1, -1, + -1, 275, -1, -1, 41, -1, -1, 44, 266, 267, + 268, 269, -1, 297, -1, -1, 290, 291, -1, 303, + 304, 58, 59, 297, 61, -1, 63, -1, -1, 303, + 304, -1, -1, -1, -1, -1, -1, -1, -1, 297, + 41, -1, -1, 44, -1, 303, 304, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 93, 58, 59, -1, + 61, -1, 63, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 266, 267, 268, 269, -1, -1, -1, + -1, -1, 275, -1, -1, -1, 279, 280, 281, 282, + -1, -1, 93, 41, -1, -1, 44, 290, 291, 292, + 293, -1, 295, 296, 297, -1, -1, 300, -1, -1, + 58, 59, -1, 61, -1, 63, -1, 41, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 266, 267, 268, + 269, -1, -1, -1, -1, -1, 275, 61, -1, 63, + 279, 280, 281, 282, -1, 93, -1, -1, -1, -1, + -1, 290, 291, 292, 293, -1, 295, 296, 297, -1, + -1, 300, -1, 266, 267, 268, 269, -1, -1, -1, + -1, -1, 275, -1, -1, -1, 279, 280, 281, 282, + -1, -1, -1, -1, -1, -1, -1, 290, 291, 292, + 293, -1, 295, 296, 297, -1, -1, 300, -1, -1, + -1, -1, -1, 275, -1, 37, 38, 279, 280, 281, + 282, 43, -1, -1, -1, -1, -1, -1, 290, 291, + 292, 293, -1, 295, 296, -1, -1, -1, 300, 266, + 267, 268, 269, -1, -1, -1, -1, -1, 275, -1, + -1, -1, 279, 280, 281, 282, -1, -1, -1, -1, + 82, -1, -1, 290, 291, 292, 293, -1, 295, 296, + 297, -1, -1, 300, -1, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 275, -1, -1, -1, 279, 280, + 281, 282, -1, -1, -1, -1, -1, -1, -1, 290, + 291, 292, 293, -1, 295, 296, 297, -1, -1, 300, + -1, -1, -1, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 266, 267, + 268, 269, -1, -1, -1, -1, -1, 275, -1, -1, + -1, 279, 280, 281, 282, -1, -1, -1, -1, -1, + -1, -1, 290, 291, 292, 293, -1, 295, 296, -1, + -1, 275, 300, -1, 186, 279, 280, 281, 282, -1, + -1, 193, -1, 195, -1, -1, 290, 291, 292, 293, + -1, 295, 296, -1, -1, 207, 300, 209, -1, -1, + -1, 213, -1, 215, -1, 217, -1, 219, -1, 221, + -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 239, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 270, +}; +#define YYFINAL 1 #ifndef YYDEBUG -# define YYDEBUG 0 /* don't allow debugging */ +#define YYDEBUG 0 #endif - +#define YYMAXTOKEN 304 #if YYDEBUG - -yytoktype yytoks[] = -{ - "{", 123, - ")", 41, - "WORD", 257, - "METHOD", 258, - "THING", 259, - "PMFUNC", 260, - "LABEL", 261, - "FORMAT", 262, - "SUB", 263, - "PACKAGE", 264, - "WHILE", 265, - "UNTIL", 266, - "IF", 267, - "UNLESS", 268, - "ELSE", 269, - "ELSIF", 270, - "CONTINUE", 271, - "FOR", 272, - "LOOPEX", 273, - "DOTDOT", 274, - "FUNC0", 275, - "FUNC1", 276, - "FUNC", 277, - "RELOP", 278, - "EQOP", 279, - "MULOP", 280, - "ADDOP", 281, - "DOLSHARP", 282, - "DO", 283, - "LOCAL", 284, - "DELETE", 285, - "HASHBRACK", 286, - "LSTOP", 287, - ",", 44, - "=", 61, - "?", 63, - ":", 58, - "OROR", 288, - "ANDAND", 289, - "BITOROP", 290, - "BITANDOP", 291, - "UNIOP", 292, - "SHIFTOP", 293, - "MATCHOP", 294, - "ARROW", 295, - "!", 33, - "~", 126, - "UMINUS", 296, - "REFGEN", 297, - "POWOP", 298, - "PREINC", 299, - "PREDEC", 300, - "POSTINC", 301, - "POSTDEC", 302, - "(", 40, - "-unknown-", -1 /* ends search */ +char *yyname[] = { +"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +"'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0, +0,0,0,0,0,"':'","';'",0,"'='",0,"'?'","'@'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,"'{'",0,"'}'","'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"WORD","METHOD","THING", +"PMFUNC","PRIVATEREF","LABEL","FORMAT","SUB","PACKAGE","WHILE","UNTIL","IF", +"UNLESS","ELSE","ELSIF","CONTINUE","FOR","LOOPEX","DOTDOT","FUNC0","FUNC1", +"FUNC","RELOP","EQOP","MULOP","ADDOP","DOLSHARP","DO","LOCAL","DELETE", +"HASHBRACK","NOAMP","LSTOP","OROR","ANDAND","BITOROP","BITANDOP","UNIOP", +"SHIFTOP","MATCHOP","ARROW","UMINUS","REFGEN","POWOP","PREINC","PREDEC", +"POSTINC","POSTDEC", }; - -char * yyreds[] = -{ - "-no such reduction-", - "prog : /* empty */", - "prog : lineseq", - "block : '{' remember lineseq '}'", - "remember : /* empty */", - "lineseq : /* empty */", - "lineseq : lineseq decl", - "lineseq : lineseq line", - "line : label cond", - "line : loop", - "line : label ';'", - "line : label sideff ';'", - "sideff : error", - "sideff : expr", - "sideff : expr IF expr", - "sideff : expr UNLESS expr", - "sideff : expr WHILE expr", - "sideff : expr UNTIL expr", - "else : /* empty */", - "else : ELSE block", - "else : ELSIF '(' expr ')' block else", - "cond : IF '(' expr ')' block else", - "cond : UNLESS '(' expr ')' block else", - "cond : IF block block else", - "cond : UNLESS block block else", - "cont : /* empty */", - "cont : CONTINUE block", - "loop : label WHILE '(' texpr ')' block cont", - "loop : label UNTIL '(' expr ')' block cont", - "loop : label WHILE block block cont", - "loop : label UNTIL block block cont", - "loop : label FOR scalar '(' expr crp block cont", - "loop : label FOR '(' expr crp block cont", - "loop : label FOR '(' nexpr ';' texpr ';' nexpr ')' block", - "loop : label block cont", - "nexpr : /* empty */", - "nexpr : sideff", - "texpr : /* empty */", - "texpr : expr", - "label : /* empty */", - "label : LABEL", - "decl : format", - "decl : subrout", - "decl : package", - "format : FORMAT WORD block", - "format : FORMAT block", - "subrout : SUB WORD block", - "package : PACKAGE WORD ';'", - "expr : expr ',' sexpr", - "expr : sexpr", - "listop : LSTOP indirob listexpr", - "listop : FUNC '(' indirob listexpr ')'", - "listop : indirob ARROW LSTOP listexpr", - "listop : indirob ARROW FUNC '(' listexpr ')'", - "listop : term ARROW METHOD '(' listexpr ')'", - "listop : METHOD indirob listexpr", - "listop : LSTOP listexpr", - "listop : FUNC '(' listexpr ')'", - "sexpr : sexpr '=' sexpr", - "sexpr : sexpr POWOP '=' sexpr", - "sexpr : sexpr MULOP '=' sexpr", - "sexpr : sexpr ADDOP '=' sexpr", - "sexpr : sexpr SHIFTOP '=' sexpr", - "sexpr : sexpr BITANDOP '=' sexpr", - "sexpr : sexpr BITOROP '=' sexpr", - "sexpr : sexpr ANDAND '=' sexpr", - "sexpr : sexpr OROR '=' sexpr", - "sexpr : sexpr POWOP sexpr", - "sexpr : sexpr MULOP sexpr", - "sexpr : sexpr ADDOP sexpr", - "sexpr : sexpr SHIFTOP sexpr", - "sexpr : sexpr RELOP sexpr", - "sexpr : sexpr EQOP sexpr", - "sexpr : sexpr BITANDOP sexpr", - "sexpr : sexpr BITOROP sexpr", - "sexpr : sexpr DOTDOT sexpr", - "sexpr : sexpr ANDAND sexpr", - "sexpr : sexpr OROR sexpr", - "sexpr : sexpr '?' sexpr ':' sexpr", - "sexpr : sexpr MATCHOP sexpr", - "sexpr : term", - "term : '-' term", - "term : '+' term", - "term : '!' term", - "term : '~' term", - "term : REFGEN term", - "term : term POSTINC", - "term : term POSTDEC", - "term : PREINC term", - "term : PREDEC term", - "term : LOCAL sexpr", - "term : '(' expr crp", - "term : '(' ')'", - "term : '[' expr crb", - "term : '[' ']'", - "term : HASHBRACK expr crhb", - "term : HASHBRACK ';' '}'", - "term : scalar", - "term : star", - "term : scalar '[' expr ']'", - "term : term ARROW '[' expr ']'", - "term : hsh", - "term : ary", - "term : arylen", - "term : scalar '{' expr ';' '}'", - "term : term ARROW '{' expr ';' '}'", - "term : '(' expr crp '[' expr ']'", - "term : '(' ')' '[' expr ']'", - "term : ary '[' expr ']'", - "term : ary '{' expr ';' '}'", - "term : DELETE scalar '{' expr ';' '}'", - "term : DELETE '(' scalar '{' expr ';' '}' ')'", - "term : THING", - "term : amper", - "term : amper '(' ')'", - "term : amper '(' expr crp", - "term : DO sexpr", - "term : DO block", - "term : DO WORD '(' ')'", - "term : DO WORD '(' expr crp", - "term : DO scalar '(' ')'", - "term : DO scalar '(' expr crp", - "term : LOOPEX", - "term : LOOPEX WORD", - "term : UNIOP", - "term : UNIOP block", - "term : UNIOP sexpr", - "term : FUNC0", - "term : FUNC0 '(' ')'", - "term : FUNC1 '(' ')'", - "term : FUNC1 '(' expr ')'", - "term : PMFUNC '(' sexpr ')'", - "term : PMFUNC '(' sexpr ',' sexpr ')'", - "term : WORD", - "term : listop", - "listexpr : /* empty */", - "listexpr : expr", - "amper : '&' indirob", - "scalar : '$' indirob", - "ary : '@' indirob", - "hsh : '%' indirob", - "arylen : DOLSHARP indirob", - "star : '*' indirob", - "indirob : WORD", - "indirob : scalar", - "indirob : block", - "crp : ',' ')'", - "crp : ')'", - "crb : ',' ']'", - "crb : ']'", - "crhb : ',' ';' '}'", - "crhb : ';' '}'", +char *yyrule[] = { +"$accept : prog", +"$$1 :", +"prog : $$1 lineseq", +"block : '{' remember lineseq '}'", +"remember :", +"lineseq :", +"lineseq : lineseq decl", +"lineseq : lineseq line", +"line : label cond", +"line : loop", +"line : label ';'", +"line : label sideff ';'", +"sideff : error", +"sideff : expr", +"sideff : expr IF expr", +"sideff : expr UNLESS expr", +"sideff : expr WHILE expr", +"sideff : expr UNTIL expr", +"else :", +"else : ELSE block", +"else : ELSIF '(' expr ')' block else", +"cond : IF '(' expr ')' block else", +"cond : UNLESS '(' expr ')' block else", +"cond : IF block block else", +"cond : UNLESS block block else", +"cont :", +"cont : CONTINUE block", +"loop : label WHILE '(' texpr ')' block cont", +"loop : label UNTIL '(' expr ')' block cont", +"loop : label WHILE block block cont", +"loop : label UNTIL block block cont", +"loop : label FOR scalar '(' expr crp block cont", +"loop : label FOR '(' expr crp block cont", +"loop : label FOR '(' nexpr ';' texpr ';' nexpr ')' block", +"loop : label block cont", +"nexpr :", +"nexpr : sideff", +"texpr :", +"texpr : expr", +"label :", +"label : LABEL", +"decl : format", +"decl : subrout", +"decl : package", +"format : FORMAT WORD block", +"format : FORMAT block", +"subrout : SUB WORD block", +"subrout : SUB WORD ';'", +"package : PACKAGE WORD ';'", +"package : PACKAGE ';'", +"expr : expr ',' sexpr", +"expr : sexpr", +"listop : LSTOP indirob listexpr", +"listop : FUNC '(' indirob listexpr ')'", +"listop : indirob ARROW LSTOP listexpr", +"listop : indirob ARROW FUNC '(' listexpr ')'", +"listop : term ARROW METHOD '(' listexpr ')'", +"listop : METHOD indirob listexpr", +"listop : LSTOP listexpr", +"listop : FUNC '(' listexpr ')'", +"sexpr : sexpr '=' sexpr", +"sexpr : sexpr POWOP '=' sexpr", +"sexpr : sexpr MULOP '=' sexpr", +"sexpr : sexpr ADDOP '=' sexpr", +"sexpr : sexpr SHIFTOP '=' sexpr", +"sexpr : sexpr BITANDOP '=' sexpr", +"sexpr : sexpr BITOROP '=' sexpr", +"sexpr : sexpr ANDAND '=' sexpr", +"sexpr : sexpr OROR '=' sexpr", +"sexpr : sexpr POWOP sexpr", +"sexpr : sexpr MULOP sexpr", +"sexpr : sexpr ADDOP sexpr", +"sexpr : sexpr SHIFTOP sexpr", +"sexpr : sexpr RELOP sexpr", +"sexpr : sexpr EQOP sexpr", +"sexpr : sexpr BITANDOP sexpr", +"sexpr : sexpr BITOROP sexpr", +"sexpr : sexpr DOTDOT sexpr", +"sexpr : sexpr ANDAND sexpr", +"sexpr : sexpr OROR sexpr", +"sexpr : sexpr '?' sexpr ':' sexpr", +"sexpr : sexpr MATCHOP sexpr", +"sexpr : term", +"term : '-' term", +"term : '+' term", +"term : '!' term", +"term : '~' term", +"term : REFGEN term", +"term : term POSTINC", +"term : term POSTDEC", +"term : PREINC term", +"term : PREDEC term", +"term : LOCAL sexpr", +"term : '(' expr crp", +"term : '(' ')'", +"term : '[' expr crb", +"term : '[' ']'", +"term : HASHBRACK expr crhb", +"term : HASHBRACK ';' '}'", +"term : scalar", +"term : star", +"term : scalar '[' expr ']'", +"term : term ARROW '[' expr ']'", +"term : hsh", +"term : ary", +"term : arylen", +"term : scalar '{' expr ';' '}'", +"term : term ARROW '{' expr ';' '}'", +"term : '(' expr crp '[' expr ']'", +"term : '(' ')' '[' expr ']'", +"term : ary '[' expr ']'", +"term : ary '{' expr ';' '}'", +"term : DELETE scalar '{' expr ';' '}'", +"term : DELETE '(' scalar '{' expr ';' '}' ')'", +"term : THING", +"term : amper", +"term : amper '(' ')'", +"term : amper '(' expr crp", +"term : NOAMP WORD listexpr", +"term : DO sexpr", +"term : DO block", +"term : DO WORD '(' ')'", +"term : DO WORD '(' expr crp", +"term : DO scalar '(' ')'", +"term : DO scalar '(' expr crp", +"term : LOOPEX", +"term : LOOPEX WORD", +"term : UNIOP", +"term : UNIOP block", +"term : UNIOP sexpr", +"term : FUNC0", +"term : FUNC0 '(' ')'", +"term : FUNC1 '(' ')'", +"term : FUNC1 '(' expr ')'", +"term : PMFUNC '(' sexpr ')'", +"term : PMFUNC '(' sexpr ',' sexpr ')'", +"term : WORD", +"term : listop", +"listexpr :", +"listexpr : expr", +"amper : '&' indirob", +"scalar : '$' indirob", +"ary : '@' indirob", +"hsh : '%' indirob", +"arylen : DOLSHARP indirob", +"star : '*' indirob", +"indirob : WORD", +"indirob : scalar", +"indirob : block", +"indirob : PRIVATEREF", +"crp : ',' ')'", +"crp : ')'", +"crb : ',' ']'", +"crb : ']'", +"crhb : ',' ';' '}'", +"crhb : ';' '}'", }; -#endif /* YYDEBUG */ -#line 1 "/usr/lib/yaccpar" -/* @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10 */ - -/* -** Skeleton parser driver for yacc output -*/ - -/* -** yacc user known macros and defines -*/ -#define YYERROR goto yyerrlab -#define YYACCEPT { free(yys); free(yyv); return(0); } -#define YYABORT { free(yys); free(yyv); return(1); } -#define YYBACKUP( newtoken, newvalue )\ -{\ - if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\ - {\ - yyerror( "syntax error - cannot backup" );\ - goto yyerrlab;\ - }\ - yychar = newtoken;\ - yystate = *yyps;\ - yylval = newvalue;\ - goto yynewstate;\ -} -#define YYRECOVERING() (!!yyerrflag) -#ifndef YYDEBUG -# define YYDEBUG 1 /* make debugging available */ #endif - -/* -** user known globals -*/ -int yydebug; /* set to 1 to get debugging */ - -/* -** driver internal defines -*/ -#define YYFLAG (-1000) - -/* -** static variables used by the parser -*/ -static YYSTYPE *yyv; /* value stack */ -static int *yys; /* state stack */ - -static YYSTYPE *yypv; /* top of value stack */ -static int *yyps; /* top of state stack */ - -static int yystate; /* current state */ -static int yytmp; /* extra var (lasts between blocks) */ - -int yynerrs; /* number of errors */ - -int yyerrflag; /* error recovery flag */ -int yychar; /* current input token number */ - - -/* -** yyparse - return 0 if worked, 1 if syntax error not recovered from -*/ +#define yyclearin (yychar=(-1)) +#define yyerrok (yyerrflag=0) +#ifdef YYSTACKSIZE +#ifndef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#endif +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 +#endif +#endif +int yydebug; +int yynerrs; +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; +#line 579 "perly.y" + /* PROGRAM */ +#line 1392 "y.tab.c" +#define YYABORT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab int yyparse() { - register YYSTYPE *yypvt; /* top of value stack for $vars */ - unsigned yymaxdepth = YYMAXDEPTH; + register int yym, yyn, yystate; + register short *yyssp; + register YYSTYPE *yyvsp; + short* yyss; + YYSTYPE* yyvs; + unsigned yystacksize = YYSTACKSIZE; + int oldyydebug = yydebug; + int oldyynerrs = yynerrs; + int oldyyerrflag = yyerrflag; + int oldyychar = yychar; + YYSTYPE oldyyval = yyval; + YYSTYPE oldyylval = yylval; + int retval = 0; - /* - ** Initialize externals - yyparse may be called more than once - */ - yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE)); - yys = (int*)malloc(yymaxdepth*sizeof(int)); - if (!yyv || !yys) - { - yyerror( "out of memory" ); - return(1); - } - yypv = &yyv[-1]; - yyps = &yys[-1]; - yystate = 0; - yytmp = 0; - yynerrs = 0; - yyerrflag = 0; - yychar = -1; - - goto yystack; - { - register YYSTYPE *yy_pv; /* top of value stack */ - register int *yy_ps; /* top of state stack */ - register int yy_state; /* current state */ - register int yy_n; /* internal state number info */ +#if YYDEBUG + register char *yys; + extern char *getenv(); - /* - ** get globals into registers. - ** branch to here only if YYBACKUP was called. - */ - yynewstate: - yy_pv = yypv; - yy_ps = yyps; - yy_state = yystate; - goto yy_newstate; + if (yys = getenv("YYDEBUG")) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif - /* - ** get globals into registers. - ** either we just started, or we just finished a reduction - */ - yystack: - yy_pv = yypv; - yy_ps = yyps; - yy_state = yystate; + yynerrs = 0; + yyerrflag = 0; + yychar = (-1); - /* - ** top of for (;;) loop while no reductions done - */ - yy_stack: - /* - ** put a state and value onto the stacks - */ -#if YYDEBUG - /* - ** if debugging, look up token value in list of value vs. - ** name pairs. 0 and negative (-1) are special values. - ** Note: linear search is used since time is not a real - ** consideration while debugging. - */ - if ( yydebug ) - { - register int yy_i; + /* + ** Initialize private stacks (yyparse may be called from an action) + */ + yyss = (short*)malloc(yystacksize*sizeof(short)); + yyvs = (YYSTYPE*)malloc(yystacksize*sizeof(YYSTYPE)); + if (!yyvs || !yyss) + goto yyoverflow; - (void)printf( "State %d, token ", yy_state ); - if ( yychar == 0 ) - (void)printf( "end-of-file\n" ); - else if ( yychar < 0 ) - (void)printf( "-none-\n" ); - else - { - for ( yy_i = 0; yytoks[yy_i].t_val >= 0; - yy_i++ ) - { - if ( yytoks[yy_i].t_val == yychar ) - break; - } - (void)printf( "%s\n", yytoks[yy_i].t_name ); - } - } -#endif /* YYDEBUG */ - if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */ - { - /* - ** reallocate and recover. Note that pointers - ** have to be reset, or bad things will happen - */ - int yyps_index = (yy_ps - yys); - int yypv_index = (yy_pv - yyv); - int yypvt_index = (yypvt - yyv); - yymaxdepth += YYMAXDEPTH; - yyv = (YYSTYPE*)realloc((char*)yyv, - yymaxdepth * sizeof(YYSTYPE)); - yys = (int*)realloc((char*)yys, - yymaxdepth * sizeof(int)); - if (!yyv || !yys) - { - yyerror( "yacc stack overflow" ); - return(1); - } - yy_ps = yys + yyps_index; - yy_pv = yyv + yypv_index; - yypvt = yyv + yypvt_index; - } - *yy_ps = yy_state; - *++yy_pv = yyval; + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; - /* - ** we have a new state - find out what to do - */ - yy_newstate: - if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG ) - goto yydefault; /* simple state */ +yyloop: + if (yyn = yydefred[yystate]) goto yyreduce; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; #if YYDEBUG - /* - ** if debugging, need to mark whether new token grabbed - */ - yytmp = yychar < 0; + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("yydebug: state %d, reading %d (%s)\n", yystate, + yychar, yys); + } #endif - if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) ) - yychar = 0; /* reached EOF */ -#if YYDEBUG - if ( yydebug && yytmp ) - { - register int yy_i; - - (void)printf( " *** Received token " ); - if ( yychar == 0 ) - (void)printf( "end-of-file\n" ); - else if ( yychar < 0 ) - (void)printf( "-none-\n" ); - else - { - for ( yy_i = 0; yytoks[yy_i].t_val >= 0; - yy_i++ ) - { - if ( yytoks[yy_i].t_val == yychar ) - break; - } - (void)printf( "%s\n", yytoks[yy_i].t_name ); - } - } -#endif /* YYDEBUG */ - if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) ) - goto yydefault; - if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/ - { - yychar = -1; - yyval = yylval; - yy_state = yy_n; - if ( yyerrflag > 0 ) - yyerrflag--; - goto yy_stack; - } - - yydefault: - if ( ( yy_n = yydef[ yy_state ] ) == -2 ) - { + } + if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { #if YYDEBUG - yytmp = yychar < 0; + if (yydebug) + printf("yydebug: state %d, shifting to state %d\n", + yystate, yytable[yyn]); #endif - if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) ) - yychar = 0; /* reached EOF */ + if (yyssp >= yyss + yystacksize - 1) + { + /* + ** reallocate and recover. Note that pointers + ** have to be reset, or bad things will happen + */ + int yyps_index = (yyssp - yyss); + int yypv_index = (yyvsp - yyvs); + yystacksize += YYSTACKSIZE; + yyvs = (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE)); + yyss = (short*)realloc((char*)yyss,yystacksize * sizeof(short)); + if (!yyvs || !yyss) + goto yyoverflow; + yyssp = yyss + yyps_index; + yyvsp = yyvs + yypv_index; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = (-1); + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag) goto yyinrecovery; +#ifdef lint + goto yynewerror; +#endif +yynewerror: + yyerror("syntax error"); +#ifdef lint + goto yyerrlab; +#endif +yyerrlab: + ++yynerrs; +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { #if YYDEBUG - if ( yydebug && yytmp ) - { - register int yy_i; - - (void)printf( " *** Received token " ); - if ( yychar == 0 ) - (void)printf( "end-of-file\n" ); - else if ( yychar < 0 ) - (void)printf( "-none-\n" ); - else - { - for ( yy_i = 0; - yytoks[yy_i].t_val >= 0; - yy_i++ ) - { - if ( yytoks[yy_i].t_val - == yychar ) - { - break; - } - } - (void)printf( "%s\n", yytoks[yy_i].t_name ); - } - } -#endif /* YYDEBUG */ - /* - ** look through exception table - */ - { - register int *yyxi = yyexca; - - while ( ( *yyxi != -1 ) || - ( yyxi[1] != yy_state ) ) - { - yyxi += 2; - } - while ( ( *(yyxi += 2) >= 0 ) && - ( *yyxi != yychar ) ) - ; - if ( ( yy_n = yyxi[1] ) < 0 ) - YYACCEPT; - } - } - - /* - ** check for syntax error - */ - if ( yy_n == 0 ) /* have an error */ - { - /* no worry about speed here! */ - switch ( yyerrflag ) - { - case 0: /* new error */ - yyerror( "syntax error" ); - goto skip_init; - yyerrlab: - /* - ** get globals into registers. - ** we have a user generated syntax type error - */ - yy_pv = yypv; - yy_ps = yyps; - yy_state = yystate; - yynerrs++; - skip_init: - case 1: - case 2: /* incompletely recovered error */ - /* try again... */ - yyerrflag = 3; - /* - ** find state where "error" is a legal - ** shift action - */ - while ( yy_ps >= yys ) - { - yy_n = yypact[ *yy_ps ] + YYERRCODE; - if ( yy_n >= 0 && yy_n < YYLAST && - yychk[yyact[yy_n]] == YYERRCODE) { - /* - ** simulate shift of "error" - */ - yy_state = yyact[ yy_n ]; - goto yy_stack; - } - /* - ** current state has no shift on - ** "error", pop stack - */ + if (yydebug) + printf("yydebug: state %d, error recovery shifting\ + to state %d\n", *yyssp, yytable[yyn]); +#endif + if (yyssp >= yyss + yystacksize - 1) + { + /* + ** reallocate and recover. Note that pointers + ** have to be reset, or bad things will happen + */ + int yyps_index = (yyssp - yyss); + int yypv_index = (yyvsp - yyvs); + yystacksize += YYSTACKSIZE; + yyvs = (YYSTYPE*)realloc((char*)yyvs, + yystacksize * sizeof(YYSTYPE)); + yyss = (short*)realloc((char*)yyss, + yystacksize * sizeof(short)); + if (!yyvs || !yyss) + goto yyoverflow; + yyssp = yyss + yyps_index; + yyvsp = yyvs + yypv_index; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { #if YYDEBUG -# define _POP_ "Error recovery pops state %d, uncovers state %d\n" - if ( yydebug ) - (void)printf( _POP_, *yy_ps, - yy_ps[-1] ); -# undef _POP_ + if (yydebug) + printf("yydebug: error recovery discarding state %d\n", + *yyssp); #endif - yy_ps--; - yy_pv--; - } - /* - ** there is no state on stack with "error" as - ** a valid shift. give up. - */ - YYABORT; - case 3: /* no shift yet; eat a token */ + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; #if YYDEBUG - /* - ** if debugging, look up token in list of - ** pairs. 0 and negative shouldn't occur, - ** but since timing doesn't matter when - ** debugging, it doesn't hurt to leave the - ** tests here. - */ - if ( yydebug ) - { - register int yy_i; - - (void)printf( "Error recovery discards " ); - if ( yychar == 0 ) - (void)printf( "token end-of-file\n" ); - else if ( yychar < 0 ) - (void)printf( "token -none-\n" ); - else - { - for ( yy_i = 0; - yytoks[yy_i].t_val >= 0; - yy_i++ ) - { - if ( yytoks[yy_i].t_val - == yychar ) - { - break; - } - } - (void)printf( "token %s\n", - yytoks[yy_i].t_name ); - } - } -#endif /* YYDEBUG */ - if ( yychar == 0 ) /* reached EOF. quit */ - YYABORT; - yychar = -1; - goto yy_newstate; - } - }/* end if ( yy_n == 0 ) */ - /* - ** reduction by production yy_n - ** put stack tops, etc. so things right after switch - */ + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("yydebug: state %d, error recovery discards token %d (%s)\n", + yystate, yychar, yys); + } +#endif + yychar = (-1); + goto yyloop; + } +yyreduce: #if YYDEBUG - /* - ** if debugging, print the string that is the user's - ** specification of the reduction which is just about - ** to be done. - */ - if ( yydebug ) - (void)printf( "Reduce by (%d) \"%s\"\n", - yy_n, yyreds[ yy_n ] ); + if (yydebug) + printf("yydebug: state %d, reducing by rule %d (%s)\n", + yystate, yyn, yyrule[yyn]); #endif - yytmp = yy_n; /* value to switch over */ - yypvt = yy_pv; /* $vars top of value stack */ - /* - ** Look in goto table for next state - ** Sorry about using yy_state here as temporary - ** register variable, but why not, if it works... - ** If yyr2[ yy_n ] doesn't have the low order bit - ** set, then there is no action to be done for - ** this reduction. So, no saving & unsaving of - ** registers done. The only difference between the - ** code just after the if and the body of the if is - ** the goto yy_stack in the body. This way the test - ** can be made before the choice of what to do is needed. - */ - { - /* length of production doubled with extra bit */ - register int yy_len = yyr2[ yy_n ]; - - if ( !( yy_len & 01 ) ) - { - yy_len >>= 1; - yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */ - yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] + - *( yy_ps -= yy_len ) + 1; - if ( yy_state >= YYLAST || - yychk[ yy_state = - yyact[ yy_state ] ] != -yy_n ) - { - yy_state = yyact[ yypgo[ yy_n ] ]; - } - goto yy_stack; - } - yy_len >>= 1; - yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */ - yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] + - *( yy_ps -= yy_len ) + 1; - if ( yy_state >= YYLAST || - yychk[ yy_state = yyact[ yy_state ] ] != -yy_n ) - { - yy_state = yyact[ yypgo[ yy_n ] ]; - } - } - /* save until reenter driver code */ - yystate = yy_state; - yyps = yy_ps; - yypv = yy_pv; - } - /* - ** code supplied by user is placed in this switch - */ - switch( yytmp ) - { - + yym = yylen[yyn]; + yyval = yyvsp[1-yym]; + switch (yyn) + { case 1: -# line 100 "perly.y" +#line 100 "perly.y" { #if defined(YYDEBUG) && defined(DEBUGGING) yydebug = (debug & 1); #endif expect = XBLOCK; - } break; + } +break; case 2: -# line 107 "perly.y" +#line 107 "perly.y" { if (in_eval) { - eval_root = newUNOP(OP_LEAVEEVAL, 0, yypvt[-0].opval); + eval_root = newUNOP(OP_LEAVEEVAL, 0, yyvsp[0].opval); eval_start = linklist(eval_root); eval_root->op_next = 0; peep(eval_start); } else - main_root = block_head(scalar(yypvt[-0].opval), &main_start); - } break; + main_root = block_head(yyvsp[0].opval, &main_start); + } +break; case 3: -# line 119 "perly.y" -{ yyval.opval = scalarseq(yypvt[-1].opval); - if (copline > (line_t)yypvt[-3].ival) - copline = yypvt[-3].ival; - if (savestack_ix > yypvt[-2].ival) - leave_scope(yypvt[-2].ival); - expect = XBLOCK; } break; +#line 119 "perly.y" +{ yyval.opval = scalarseq(yyvsp[-1].opval); + if (copline > (line_t)yyvsp[-3].ival) + copline = yyvsp[-3].ival; + leave_scope(yyvsp[-2].ival); + pad_leavemy(comppadnamefill); + expect = XBLOCK; } +break; case 4: -# line 128 "perly.y" -{ yyval.ival = savestack_ix; } break; +#line 128 "perly.y" +{ yyval.ival = savestack_ix; SAVEINT(comppadnamefill); } +break; case 5: -# line 132 "perly.y" -{ yyval.opval = Nullop; } break; +#line 132 "perly.y" +{ yyval.opval = Nullop; } +break; case 6: -# line 134 "perly.y" -{ yyval.opval = yypvt[-1].opval; } break; +#line 134 "perly.y" +{ yyval.opval = yyvsp[-1].opval; } +break; case 7: -# line 136 "perly.y" -{ yyval.opval = append_list(OP_LINESEQ, yypvt[-1].opval, yypvt[-0].opval); pad_reset(); } break; +#line 136 "perly.y" +{ yyval.opval = append_list(OP_LINESEQ, yyvsp[-1].opval, yyvsp[0].opval); pad_reset(); } +break; case 8: -# line 140 "perly.y" -{ yyval.opval = newSTATEOP(0, yypvt[-1].pval, yypvt[-0].opval); } break; +#line 140 "perly.y" +{ yyval.opval = newSTATEOP(0, yyvsp[-1].pval, yyvsp[0].opval); } +break; case 10: -# line 143 "perly.y" -{ if (yypvt[-1].pval != Nullch) { - yyval.opval = newSTATEOP(0, yypvt[-1].pval, newOP(OP_NULL, 0)); +#line 143 "perly.y" +{ if (yyvsp[-1].pval != Nullch) { + yyval.opval = newSTATEOP(0, yyvsp[-1].pval, newOP(OP_NULL, 0)); } else { yyval.opval = Nullop; copline = NOLINE; } - expect = XBLOCK; } break; + expect = XBLOCK; } +break; case 11: -# line 152 "perly.y" -{ yyval.opval = newSTATEOP(0, yypvt[-2].pval, yypvt[-1].opval); - expect = XBLOCK; } break; +#line 152 "perly.y" +{ yyval.opval = newSTATEOP(0, yyvsp[-2].pval, yyvsp[-1].opval); + expect = XBLOCK; } +break; case 12: -# line 157 "perly.y" -{ yyval.opval = Nullop; } break; +#line 157 "perly.y" +{ yyval.opval = Nullop; } +break; case 13: -# line 159 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 159 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 14: -# line 161 "perly.y" -{ yyval.opval = newLOGOP(OP_AND, 0, yypvt[-0].opval, yypvt[-2].opval); } break; +#line 161 "perly.y" +{ yyval.opval = newLOGOP(OP_AND, 0, yyvsp[0].opval, yyvsp[-2].opval); } +break; case 15: -# line 163 "perly.y" -{ yyval.opval = newLOGOP(OP_OR, 0, yypvt[-0].opval, yypvt[-2].opval); } break; +#line 163 "perly.y" +{ yyval.opval = newLOGOP(OP_OR, 0, yyvsp[0].opval, yyvsp[-2].opval); } +break; case 16: -# line 165 "perly.y" -{ yyval.opval = newLOOPOP(0, 1, scalar(yypvt[-0].opval), yypvt[-2].opval, Nullop); } break; +#line 165 "perly.y" +{ yyval.opval = newLOOPOP(0, 1, scalar(yyvsp[0].opval), yyvsp[-2].opval); } +break; case 17: -# line 167 "perly.y" -{ yyval.opval = newLOOPOP(0, 1, invert(scalar(yypvt[-0].opval)), yypvt[-2].opval, Nullop);} break; +#line 167 "perly.y" +{ yyval.opval = newLOOPOP(0, 1, invert(scalar(yyvsp[0].opval)), yyvsp[-2].opval);} +break; case 18: -# line 171 "perly.y" -{ yyval.opval = Nullop; } break; +#line 171 "perly.y" +{ yyval.opval = Nullop; } +break; case 19: -# line 173 "perly.y" -{ yyval.opval = scope(yypvt[-0].opval); } break; +#line 173 "perly.y" +{ yyval.opval = scope(yyvsp[0].opval); } +break; case 20: -# line 175 "perly.y" -{ copline = yypvt[-5].ival; - yyval.opval = newCONDOP(0, yypvt[-3].opval, scope(yypvt[-1].opval), yypvt[-0].opval); } break; +#line 175 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; case 21: -# line 180 "perly.y" -{ copline = yypvt[-5].ival; - yyval.opval = newCONDOP(0, yypvt[-3].opval, scope(yypvt[-1].opval), yypvt[-0].opval); } break; +#line 180 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; case 22: -# line 183 "perly.y" -{ copline = yypvt[-5].ival; +#line 183 "perly.y" +{ copline = yyvsp[-5].ival; yyval.opval = newCONDOP(0, - invert(scalar(yypvt[-3].opval)), scope(yypvt[-1].opval), yypvt[-0].opval); } break; + invert(scalar(yyvsp[-3].opval)), scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; case 23: -# line 187 "perly.y" -{ copline = yypvt[-3].ival; - yyval.opval = newCONDOP(0, scope(yypvt[-2].opval), scope(yypvt[-1].opval), yypvt[-0].opval); } break; +#line 187 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newCONDOP(0, scope(yyvsp[-2].opval), scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; case 24: -# line 190 "perly.y" -{ copline = yypvt[-3].ival; - yyval.opval = newCONDOP(0, invert(scalar(scope(yypvt[-2].opval))), - scope(yypvt[-1].opval), yypvt[-0].opval); } break; +#line 190 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newCONDOP(0, invert(scalar(scope(yyvsp[-2].opval))), + scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; case 25: -# line 196 "perly.y" -{ yyval.opval = Nullop; } break; +#line 196 "perly.y" +{ yyval.opval = Nullop; } +break; case 26: -# line 198 "perly.y" -{ yyval.opval = scope(yypvt[-0].opval); } break; +#line 198 "perly.y" +{ yyval.opval = scope(yyvsp[0].opval); } +break; case 27: -# line 202 "perly.y" -{ copline = yypvt[-5].ival; - yyval.opval = newSTATEOP(0, yypvt[-6].pval, - newWHILEOP(0, 1, Nullop, yypvt[-3].opval, yypvt[-1].opval, yypvt[-0].opval) ); } break; +#line 202 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newSTATEOP(0, yyvsp[-6].pval, + newWHILEOP(0, 1, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval) ); } +break; case 28: -# line 206 "perly.y" -{ copline = yypvt[-5].ival; - yyval.opval = newSTATEOP(0, yypvt[-6].pval, +#line 206 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newSTATEOP(0, yyvsp[-6].pval, newWHILEOP(0, 1, Nullop, - invert(scalar(yypvt[-3].opval)), yypvt[-1].opval, yypvt[-0].opval) ); } break; + invert(scalar(yyvsp[-3].opval)), yyvsp[-1].opval, yyvsp[0].opval) ); } +break; case 29: -# line 211 "perly.y" -{ copline = yypvt[-3].ival; - yyval.opval = newSTATEOP(0, yypvt[-4].pval, +#line 211 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newSTATEOP(0, yyvsp[-4].pval, newWHILEOP(0, 1, Nullop, - scope(yypvt[-2].opval), yypvt[-1].opval, yypvt[-0].opval) ); } break; + scope(yyvsp[-2].opval), yyvsp[-1].opval, yyvsp[0].opval) ); } +break; case 30: -# line 216 "perly.y" -{ copline = yypvt[-3].ival; - yyval.opval = newSTATEOP(0, yypvt[-4].pval, +#line 216 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newSTATEOP(0, yyvsp[-4].pval, newWHILEOP(0, 1, Nullop, - invert(scalar(scope(yypvt[-2].opval))), yypvt[-1].opval, yypvt[-0].opval)); } break; + invert(scalar(scope(yyvsp[-2].opval))), yyvsp[-1].opval, yyvsp[0].opval)); } +break; case 31: -# line 221 "perly.y" -{ yyval.opval = newFOROP(0, yypvt[-7].pval, yypvt[-6].ival, ref(yypvt[-5].opval, OP_ENTERLOOP), - yypvt[-3].opval, yypvt[-1].opval, yypvt[-0].opval); } break; +#line 221 "perly.y" +{ yyval.opval = newFOROP(0, yyvsp[-7].pval, yyvsp[-6].ival, ref(yyvsp[-5].opval, OP_ENTERLOOP), + yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval); } +break; case 32: -# line 224 "perly.y" -{ yyval.opval = newFOROP(0, yypvt[-6].pval, yypvt[-5].ival, Nullop, yypvt[-3].opval, yypvt[-1].opval, yypvt[-0].opval); } break; +#line 224 "perly.y" +{ yyval.opval = newFOROP(0, yyvsp[-6].pval, yyvsp[-5].ival, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval); } +break; case 33: -# line 227 "perly.y" -{ copline = yypvt[-8].ival; +#line 227 "perly.y" +{ copline = yyvsp[-8].ival; yyval.opval = append_elem(OP_LINESEQ, - newSTATEOP(0, yypvt[-9].pval, scalar(yypvt[-6].opval)), - newSTATEOP(0, yypvt[-9].pval, + newSTATEOP(0, yyvsp[-9].pval, scalar(yyvsp[-6].opval)), + newSTATEOP(0, yyvsp[-9].pval, newWHILEOP(0, 1, Nullop, - scalar(yypvt[-4].opval), yypvt[-0].opval, scalar(yypvt[-2].opval)) )); } break; + scalar(yyvsp[-4].opval), yyvsp[0].opval, scalar(yyvsp[-2].opval)) )); } +break; case 34: -# line 234 "perly.y" +#line 234 "perly.y" { yyval.opval = newSTATEOP(0, - yypvt[-2].pval, newWHILEOP(0, 1, Nullop, Nullop, yypvt[-1].opval, yypvt[-0].opval)); } break; + yyvsp[-2].pval, newWHILEOP(0, 1, Nullop, Nullop, yyvsp[-1].opval, yyvsp[0].opval)); } +break; case 35: -# line 239 "perly.y" -{ yyval.opval = Nullop; } break; +#line 239 "perly.y" +{ yyval.opval = Nullop; } +break; case 37: -# line 244 "perly.y" -{ (void)scan_num("1"); yyval.opval = yylval.opval; } break; +#line 244 "perly.y" +{ (void)scan_num("1"); yyval.opval = yylval.opval; } +break; case 39: -# line 249 "perly.y" -{ yyval.pval = Nullch; } break; +#line 249 "perly.y" +{ yyval.pval = Nullch; } +break; case 41: -# line 254 "perly.y" -{ yyval.ival = 0; } break; +#line 254 "perly.y" +{ yyval.ival = 0; } +break; case 42: -# line 256 "perly.y" -{ yyval.ival = 0; } break; +#line 256 "perly.y" +{ yyval.ival = 0; } +break; case 43: -# line 258 "perly.y" -{ yyval.ival = 0; } break; +#line 258 "perly.y" +{ yyval.ival = 0; } +break; case 44: -# line 262 "perly.y" -{ newFORM(yypvt[-2].ival, yypvt[-1].opval, yypvt[-0].opval); } break; +#line 262 "perly.y" +{ newFORM(yyvsp[-2].ival, yyvsp[-1].opval, yyvsp[0].opval); } +break; case 45: -# line 264 "perly.y" -{ newFORM(yypvt[-1].ival, Nullop, yypvt[-0].opval); } break; +#line 264 "perly.y" +{ newFORM(yyvsp[-1].ival, Nullop, yyvsp[0].opval); } +break; case 46: -# line 268 "perly.y" -{ newSUB(yypvt[-2].ival, yypvt[-1].opval, yypvt[-0].opval); } break; +#line 268 "perly.y" +{ newSUB(yyvsp[-2].ival, yyvsp[-1].opval, yyvsp[0].opval); } +break; case 47: -# line 272 "perly.y" -{ package(yypvt[-1].opval); } break; +#line 270 "perly.y" +{ newSUB(yyvsp[-2].ival, yyvsp[-1].opval, Nullop); } +break; case 48: -# line 276 "perly.y" -{ yyval.opval = append_elem(OP_LIST, yypvt[-2].opval, yypvt[-0].opval); } break; +#line 274 "perly.y" +{ package(yyvsp[-1].opval); } +break; +case 49: +#line 276 "perly.y" +{ package(Nullop); } +break; case 50: -# line 281 "perly.y" -{ yyval.opval = convert(yypvt[-2].ival, OPf_STACKED, - prepend_elem(OP_LIST, newGVREF(yypvt[-1].opval), yypvt[-0].opval) ); } break; -case 51: -# line 284 "perly.y" -{ yyval.opval = convert(yypvt[-4].ival, OPf_STACKED, - prepend_elem(OP_LIST, newGVREF(yypvt[-2].opval), yypvt[-1].opval) ); } break; +#line 280 "perly.y" +{ yyval.opval = append_elem(OP_LIST, yyvsp[-2].opval, yyvsp[0].opval); } +break; case 52: -# line 287 "perly.y" -{ yyval.opval = convert(yypvt[-1].ival, OPf_STACKED, - prepend_elem(OP_LIST, newGVREF(yypvt[-3].opval), yypvt[-0].opval) ); } break; +#line 285 "perly.y" +{ yyval.opval = convert(yyvsp[-2].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-1].opval), yyvsp[0].opval) ); } +break; case 53: -# line 290 "perly.y" -{ yyval.opval = convert(yypvt[-3].ival, OPf_STACKED, - prepend_elem(OP_LIST, newGVREF(yypvt[-5].opval), yypvt[-1].opval) ); } break; +#line 288 "perly.y" +{ yyval.opval = convert(yyvsp[-4].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-2].opval), yyvsp[-1].opval) ); } +break; case 54: -# line 293 "perly.y" -{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, - prepend_elem(OP_LIST, newMETHOD(yypvt[-5].opval,yypvt[-3].opval), yypvt[-1].opval)); } break; +#line 291 "perly.y" +{ yyval.opval = convert(yyvsp[-1].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-3].opval), yyvsp[0].opval) ); } +break; case 55: -# line 296 "perly.y" -{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, - prepend_elem(OP_LIST, newMETHOD(yypvt[-1].opval,yypvt[-2].opval), yypvt[-0].opval)); } break; +#line 294 "perly.y" +{ yyval.opval = convert(yyvsp[-3].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-5].opval), yyvsp[-1].opval) ); } +break; case 56: -# line 299 "perly.y" -{ yyval.opval = convert(yypvt[-1].ival, 0, yypvt[-0].opval); } break; +#line 297 "perly.y" +{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, + prepend_elem(OP_LIST, newMETHOD(yyvsp[-5].opval,yyvsp[-3].opval), yyvsp[-1].opval)); } +break; case 57: -# line 301 "perly.y" -{ yyval.opval = convert(yypvt[-3].ival, 0, yypvt[-1].opval); } break; +#line 300 "perly.y" +{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, + prepend_elem(OP_LIST, newMETHOD(yyvsp[-1].opval,yyvsp[-2].opval), yyvsp[0].opval)); } +break; case 58: -# line 305 "perly.y" -{ yyval.opval = newASSIGNOP(OPf_STACKED, yypvt[-2].opval, yypvt[-0].opval); } break; +#line 303 "perly.y" +{ yyval.opval = convert(yyvsp[-1].ival, 0, yyvsp[0].opval); } +break; case 59: -# line 307 "perly.y" -{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, - ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +#line 305 "perly.y" +{ yyval.opval = convert(yyvsp[-3].ival, 0, yyvsp[-1].opval); } +break; case 60: -# line 310 "perly.y" -{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, - ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +#line 309 "perly.y" +{ yyval.opval = newASSIGNOP(OPf_STACKED, yyvsp[-2].opval, yyvsp[0].opval); } +break; case 61: -# line 313 "perly.y" -{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, - ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval));} break; +#line 311 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; case 62: -# line 316 "perly.y" -{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, - ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +#line 314 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; case 63: -# line 319 "perly.y" -{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, - ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +#line 317 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval));} +break; case 64: -# line 322 "perly.y" -{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, - ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +#line 320 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; case 65: -# line 325 "perly.y" -{ yyval.opval = newLOGOP(OP_ANDASSIGN, 0, - ref(scalar(yypvt[-3].opval), OP_ANDASSIGN), - newUNOP(OP_SASSIGN, 0, scalar(yypvt[-0].opval))); } break; +#line 323 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; case 66: -# line 329 "perly.y" -{ yyval.opval = newLOGOP(OP_ORASSIGN, 0, - ref(scalar(yypvt[-3].opval), OP_ORASSIGN), - newUNOP(OP_SASSIGN, 0, scalar(yypvt[-0].opval))); } break; +#line 326 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; case 67: -# line 335 "perly.y" -{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +#line 329 "perly.y" +{ yyval.opval = newLOGOP(OP_ANDASSIGN, 0, + ref(scalar(yyvsp[-3].opval), OP_ANDASSIGN), + newUNOP(OP_SASSIGN, 0, scalar(yyvsp[0].opval))); } +break; case 68: -# line 337 "perly.y" -{ if (yypvt[-1].ival != OP_REPEAT) - scalar(yypvt[-2].opval); - yyval.opval = newBINOP(yypvt[-1].ival, 0, yypvt[-2].opval, scalar(yypvt[-0].opval)); } break; +#line 333 "perly.y" +{ yyval.opval = newLOGOP(OP_ORASSIGN, 0, + ref(scalar(yyvsp[-3].opval), OP_ORASSIGN), + newUNOP(OP_SASSIGN, 0, scalar(yyvsp[0].opval))); } +break; case 69: -# line 341 "perly.y" -{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +#line 339 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; case 70: -# line 343 "perly.y" -{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +#line 341 "perly.y" +{ if (yyvsp[-1].ival != OP_REPEAT) + scalar(yyvsp[-2].opval); + yyval.opval = newBINOP(yyvsp[-1].ival, 0, yyvsp[-2].opval, scalar(yyvsp[0].opval)); } +break; case 71: -# line 345 "perly.y" -{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +#line 345 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; case 72: -# line 347 "perly.y" -{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +#line 347 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; case 73: -# line 349 "perly.y" -{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +#line 349 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; case 74: -# line 351 "perly.y" -{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +#line 351 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; case 75: -# line 353 "perly.y" -{ yyval.opval = newRANGE(yypvt[-1].ival, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval));} break; +#line 353 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; case 76: -# line 355 "perly.y" -{ yyval.opval = newLOGOP(OP_AND, 0, yypvt[-2].opval, yypvt[-0].opval); } break; +#line 355 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; case 77: -# line 357 "perly.y" -{ yyval.opval = newLOGOP(OP_OR, 0, yypvt[-2].opval, yypvt[-0].opval); } break; +#line 357 "perly.y" +{ yyval.opval = newRANGE(yyvsp[-1].ival, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval));} +break; case 78: -# line 359 "perly.y" -{ yyval.opval = newCONDOP(0, yypvt[-4].opval, yypvt[-2].opval, yypvt[-0].opval); } break; +#line 359 "perly.y" +{ yyval.opval = newLOGOP(OP_AND, 0, yyvsp[-2].opval, yyvsp[0].opval); } +break; case 79: -# line 361 "perly.y" -{ yyval.opval = bind_match(yypvt[-1].ival, yypvt[-2].opval, yypvt[-0].opval); } break; +#line 361 "perly.y" +{ yyval.opval = newLOGOP(OP_OR, 0, yyvsp[-2].opval, yyvsp[0].opval); } +break; case 80: -# line 363 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 363 "perly.y" +{ yyval.opval = newCONDOP(0, yyvsp[-4].opval, yyvsp[-2].opval, yyvsp[0].opval); } +break; case 81: -# line 367 "perly.y" -{ yyval.opval = newUNOP(OP_NEGATE, 0, scalar(yypvt[-0].opval)); } break; +#line 365 "perly.y" +{ yyval.opval = bind_match(yyvsp[-1].ival, yyvsp[-2].opval, yyvsp[0].opval); } +break; case 82: -# line 369 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 367 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 83: -# line 371 "perly.y" -{ yyval.opval = newUNOP(OP_NOT, 0, scalar(yypvt[-0].opval)); } break; +#line 371 "perly.y" +{ yyval.opval = newUNOP(OP_NEGATE, 0, scalar(yyvsp[0].opval)); } +break; case 84: -# line 373 "perly.y" -{ yyval.opval = newUNOP(OP_COMPLEMENT, 0, scalar(yypvt[-0].opval));} break; +#line 373 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 85: -# line 375 "perly.y" -{ yyval.opval = newUNOP(OP_REFGEN, 0, ref(yypvt[-0].opval, OP_REFGEN)); } break; +#line 375 "perly.y" +{ yyval.opval = newUNOP(OP_NOT, 0, scalar(yyvsp[0].opval)); } +break; case 86: -# line 377 "perly.y" -{ yyval.opval = newUNOP(OP_POSTINC, 0, - ref(scalar(yypvt[-1].opval), OP_POSTINC)); } break; +#line 377 "perly.y" +{ yyval.opval = newUNOP(OP_COMPLEMENT, 0, scalar(yyvsp[0].opval));} +break; case 87: -# line 380 "perly.y" -{ yyval.opval = newUNOP(OP_POSTDEC, 0, - ref(scalar(yypvt[-1].opval), OP_POSTDEC)); } break; +#line 379 "perly.y" +{ yyval.opval = newUNOP(OP_REFGEN, 0, ref(yyvsp[0].opval, OP_REFGEN)); } +break; case 88: -# line 383 "perly.y" -{ yyval.opval = newUNOP(OP_PREINC, 0, - ref(scalar(yypvt[-0].opval), OP_PREINC)); } break; +#line 381 "perly.y" +{ yyval.opval = newUNOP(OP_POSTINC, 0, + ref(scalar(yyvsp[-1].opval), OP_POSTINC)); } +break; case 89: -# line 386 "perly.y" -{ yyval.opval = newUNOP(OP_PREDEC, 0, - ref(scalar(yypvt[-0].opval), OP_PREDEC)); } break; +#line 384 "perly.y" +{ yyval.opval = newUNOP(OP_POSTDEC, 0, + ref(scalar(yyvsp[-1].opval), OP_POSTDEC)); } +break; case 90: -# line 389 "perly.y" -{ yyval.opval = localize(yypvt[-0].opval); } break; +#line 387 "perly.y" +{ yyval.opval = newUNOP(OP_PREINC, 0, + ref(scalar(yyvsp[0].opval), OP_PREINC)); } +break; case 91: -# line 391 "perly.y" -{ yyval.opval = sawparens(yypvt[-1].opval); } break; +#line 390 "perly.y" +{ yyval.opval = newUNOP(OP_PREDEC, 0, + ref(scalar(yyvsp[0].opval), OP_PREDEC)); } +break; case 92: -# line 393 "perly.y" -{ yyval.opval = newNULLLIST(); } break; +#line 393 "perly.y" +{ yyval.opval = localize(yyvsp[0].opval,yyvsp[-1].ival); } +break; case 93: -# line 395 "perly.y" -{ yyval.opval = newANONLIST(yypvt[-1].opval); } break; +#line 395 "perly.y" +{ yyval.opval = sawparens(yyvsp[-1].opval); } +break; case 94: -# line 397 "perly.y" -{ yyval.opval = newANONLIST(Nullop); } break; +#line 397 "perly.y" +{ yyval.opval = newNULLLIST(); } +break; case 95: -# line 399 "perly.y" -{ yyval.opval = newANONHASH(yypvt[-1].opval); } break; +#line 399 "perly.y" +{ yyval.opval = newANONLIST(yyvsp[-1].opval); } +break; case 96: -# line 401 "perly.y" -{ yyval.opval = newANONHASH(Nullop); } break; +#line 401 "perly.y" +{ yyval.opval = newANONLIST(Nullop); } +break; case 97: -# line 403 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 403 "perly.y" +{ yyval.opval = newANONHASH(yyvsp[-1].opval); } +break; case 98: -# line 405 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 405 "perly.y" +{ yyval.opval = newANONHASH(Nullop); } +break; case 99: -# line 407 "perly.y" -{ yyval.opval = newBINOP(OP_AELEM, 0, oopsAV(yypvt[-3].opval), scalar(yypvt[-1].opval)); } break; +#line 407 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 100: -# line 409 "perly.y" -{ yyval.opval = newBINOP(OP_AELEM, 0, - scalar(ref(newAVREF(yypvt[-4].opval),OP_RV2AV)), - scalar(yypvt[-1].opval));} break; +#line 409 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 101: -# line 413 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 411 "perly.y" +{ yyval.opval = newBINOP(OP_AELEM, 0, oopsAV(yyvsp[-3].opval), scalar(yyvsp[-1].opval)); } +break; case 102: -# line 415 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 413 "perly.y" +{ yyval.opval = newBINOP(OP_AELEM, 0, + scalar(ref(newAVREF(yyvsp[-4].opval),OP_RV2AV)), + scalar(yyvsp[-1].opval));} +break; case 103: -# line 417 "perly.y" -{ yyval.opval = newUNOP(OP_AV2ARYLEN, 0, ref(yypvt[-0].opval, OP_AV2ARYLEN));} break; +#line 417 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 104: -# line 419 "perly.y" -{ yyval.opval = newBINOP(OP_HELEM, 0, oopsHV(yypvt[-4].opval), jmaybe(yypvt[-2].opval)); - expect = XOPERATOR; } break; +#line 419 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 105: -# line 422 "perly.y" -{ yyval.opval = newBINOP(OP_HELEM, 0, - scalar(ref(newHVREF(yypvt[-5].opval),OP_RV2HV)), - jmaybe(yypvt[-2].opval)); - expect = XOPERATOR; } break; +#line 421 "perly.y" +{ yyval.opval = newUNOP(OP_AV2ARYLEN, 0, ref(yyvsp[0].opval, OP_AV2ARYLEN));} +break; case 106: -# line 427 "perly.y" -{ yyval.opval = newSLICEOP(0, yypvt[-1].opval, yypvt[-4].opval); } break; +#line 423 "perly.y" +{ yyval.opval = newBINOP(OP_HELEM, 0, oopsHV(yyvsp[-4].opval), jmaybe(yyvsp[-2].opval)); + expect = XOPERATOR; } +break; case 107: -# line 429 "perly.y" -{ yyval.opval = newSLICEOP(0, yypvt[-1].opval, Nullop); } break; +#line 426 "perly.y" +{ yyval.opval = newBINOP(OP_HELEM, 0, + scalar(ref(newHVREF(yyvsp[-5].opval),OP_RV2HV)), + jmaybe(yyvsp[-2].opval)); + expect = XOPERATOR; } +break; case 108: -# line 431 "perly.y" +#line 431 "perly.y" +{ yyval.opval = newSLICEOP(0, yyvsp[-1].opval, yyvsp[-4].opval); } +break; +case 109: +#line 433 "perly.y" +{ yyval.opval = newSLICEOP(0, yyvsp[-1].opval, Nullop); } +break; +case 110: +#line 435 "perly.y" { yyval.opval = prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), list( newLISTOP(OP_ASLICE, 0, - list(yypvt[-1].opval), - ref(yypvt[-3].opval, OP_ASLICE)))); } break; -case 109: -# line 438 "perly.y" + list(yyvsp[-1].opval), + ref(yyvsp[-3].opval, OP_ASLICE)))); } +break; +case 111: +#line 442 "perly.y" { yyval.opval = prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), list( newLISTOP(OP_HSLICE, 0, - list(yypvt[-2].opval), - ref(oopsHV(yypvt[-4].opval), OP_HSLICE)))); - expect = XOPERATOR; } break; -case 110: -# line 446 "perly.y" -{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yypvt[-4].opval), jmaybe(yypvt[-2].opval)); - expect = XOPERATOR; } break; -case 111: -# line 449 "perly.y" -{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yypvt[-5].opval), jmaybe(yypvt[-3].opval)); - expect = XOPERATOR; } break; + list(yyvsp[-2].opval), + ref(oopsHV(yyvsp[-4].opval), OP_HSLICE)))); + expect = XOPERATOR; } +break; case 112: -# line 452 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; +#line 450 "perly.y" +{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yyvsp[-4].opval), jmaybe(yyvsp[-2].opval)); + expect = XOPERATOR; } +break; case 113: -# line 454 "perly.y" -{ yyval.opval = newUNOP(OP_ENTERSUBR, 0, - scalar(yypvt[-0].opval)); } break; +#line 453 "perly.y" +{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yyvsp[-5].opval), jmaybe(yyvsp[-3].opval)); + expect = XOPERATOR; } +break; case 114: -# line 457 "perly.y" -{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, scalar(yypvt[-2].opval)); } break; +#line 456 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 115: -# line 459 "perly.y" -{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, - list(prepend_elem(OP_LIST, scalar(yypvt[-3].opval), yypvt[-1].opval))); } break; +#line 458 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, 0, + scalar(yyvsp[0].opval)); } +break; case 116: -# line 462 "perly.y" -{ yyval.opval = newUNOP(OP_DOFILE, 0, scalar(yypvt[-0].opval)); - allgvs = TRUE;} break; +#line 461 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, scalar(yyvsp[-2].opval)); } +break; case 117: -# line 465 "perly.y" -{ yyval.opval = newUNOP(OP_NULL, OPf_SPECIAL, scope(yypvt[-0].opval)); } break; +#line 463 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, + list(prepend_elem(OP_LIST, scalar(yyvsp[-3].opval), yyvsp[-1].opval))); } +break; case 118: -# line 467 "perly.y" -{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, +#line 466 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, list(prepend_elem(OP_LIST, - scalar(newCVREF(scalar(yypvt[-2].opval))), newNULLLIST()))); } break; + newCVREF(scalar(yyvsp[-1].opval)), yyvsp[0].opval))); } +break; case 119: -# line 471 "perly.y" -{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, - list(prepend_elem(OP_LIST, - scalar(newCVREF(scalar(yypvt[-3].opval))), - yypvt[-1].opval))); } break; +#line 470 "perly.y" +{ yyval.opval = newUNOP(OP_DOFILE, 0, scalar(yyvsp[0].opval)); + allgvs = TRUE;} +break; case 120: -# line 476 "perly.y" -{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, - list(prepend_elem(OP_LIST, - scalar(newCVREF(scalar(yypvt[-2].opval))), newNULLLIST())));} break; +#line 473 "perly.y" +{ yyval.opval = newUNOP(OP_NULL, OPf_SPECIAL, scope(yyvsp[0].opval)); } +break; case 121: -# line 480 "perly.y" +#line 475 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, list(prepend_elem(OP_LIST, - scalar(newCVREF(scalar(yypvt[-3].opval))), - yypvt[-1].opval))); } break; + scalar(newCVREF(scalar(yyvsp[-2].opval))), newNULLLIST()))); } +break; case 122: -# line 485 "perly.y" -{ yyval.opval = newOP(yypvt[-0].ival, OPf_SPECIAL); } break; +#line 479 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yyvsp[-3].opval))), + yyvsp[-1].opval))); } +break; case 123: -# line 487 "perly.y" -{ yyval.opval = newPVOP(yypvt[-1].ival, 0, - savestr(SvPVnx(((SVOP*)yypvt[-0].opval)->op_sv))); - op_free(yypvt[-0].opval); } break; +#line 484 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yyvsp[-2].opval))), newNULLLIST())));} +break; case 124: -# line 491 "perly.y" -{ yyval.opval = newOP(yypvt[-0].ival, 0); } break; +#line 488 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yyvsp[-3].opval))), + yyvsp[-1].opval))); } +break; case 125: -# line 493 "perly.y" -{ yyval.opval = newUNOP(yypvt[-1].ival, 0, yypvt[-0].opval); } break; +#line 493 "perly.y" +{ yyval.opval = newOP(yyvsp[0].ival, OPf_SPECIAL); } +break; case 126: -# line 495 "perly.y" -{ yyval.opval = newUNOP(yypvt[-1].ival, 0, yypvt[-0].opval); } break; +#line 495 "perly.y" +{ yyval.opval = newPVOP(yyvsp[-1].ival, 0, + savestr(SvPVnx(((SVOP*)yyvsp[0].opval)->op_sv))); + op_free(yyvsp[0].opval); } +break; case 127: -# line 497 "perly.y" -{ yyval.opval = newOP(yypvt[-0].ival, 0); } break; +#line 499 "perly.y" +{ yyval.opval = newOP(yyvsp[0].ival, 0); } +break; case 128: -# line 499 "perly.y" -{ yyval.opval = newOP(yypvt[-2].ival, 0); } break; +#line 501 "perly.y" +{ yyval.opval = newUNOP(yyvsp[-1].ival, 0, yyvsp[0].opval); } +break; case 129: -# line 501 "perly.y" -{ yyval.opval = newOP(yypvt[-2].ival, OPf_SPECIAL); } break; +#line 503 "perly.y" +{ yyval.opval = newUNOP(yyvsp[-1].ival, 0, yyvsp[0].opval); } +break; case 130: -# line 503 "perly.y" -{ yyval.opval = newUNOP(yypvt[-3].ival, 0, yypvt[-1].opval); } break; +#line 505 "perly.y" +{ yyval.opval = newOP(yyvsp[0].ival, 0); } +break; case 131: -# line 505 "perly.y" -{ yyval.opval = pmruntime(yypvt[-3].opval, yypvt[-1].opval, Nullop); } break; +#line 507 "perly.y" +{ yyval.opval = newOP(yyvsp[-2].ival, 0); } +break; case 132: -# line 507 "perly.y" -{ yyval.opval = pmruntime(yypvt[-5].opval, yypvt[-3].opval, yypvt[-1].opval); } break; +#line 509 "perly.y" +{ yyval.opval = newOP(yyvsp[-2].ival, OPf_SPECIAL); } +break; +case 133: +#line 511 "perly.y" +{ yyval.opval = newUNOP(yyvsp[-3].ival, 0, yyvsp[-1].opval); } +break; +case 134: +#line 513 "perly.y" +{ yyval.opval = pmruntime(yyvsp[-3].opval, yyvsp[-1].opval, Nullop); } +break; case 135: -# line 513 "perly.y" -{ yyval.opval = newNULLLIST(); } break; -case 136: -# line 515 "perly.y" -{ yyval.opval = yypvt[-0].opval; } break; -case 137: -# line 519 "perly.y" -{ yyval.opval = newCVREF(yypvt[-0].opval); } break; +#line 515 "perly.y" +{ yyval.opval = pmruntime(yyvsp[-5].opval, yyvsp[-3].opval, yyvsp[-1].opval); } +break; case 138: -# line 523 "perly.y" -{ yyval.opval = newSVREF(yypvt[-0].opval); } break; +#line 521 "perly.y" +{ yyval.opval = newNULLLIST(); } +break; case 139: -# line 527 "perly.y" -{ yyval.opval = newAVREF(yypvt[-0].opval); } break; +#line 523 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 140: -# line 531 "perly.y" -{ yyval.opval = newHVREF(yypvt[-0].opval); } break; +#line 527 "perly.y" +{ yyval.opval = newCVREF(yyvsp[0].opval); } +break; case 141: -# line 535 "perly.y" -{ yyval.opval = newAVREF(yypvt[-0].opval); } break; +#line 531 "perly.y" +{ yyval.opval = newSVREF(yyvsp[0].opval); } +break; case 142: -# line 539 "perly.y" -{ yyval.opval = newGVREF(yypvt[-0].opval); } break; +#line 535 "perly.y" +{ yyval.opval = newAVREF(yyvsp[0].opval); } +break; case 143: -# line 543 "perly.y" -{ yyval.opval = scalar(yypvt[-0].opval); } break; +#line 539 "perly.y" +{ yyval.opval = newHVREF(yyvsp[0].opval); } +break; case 144: -# line 545 "perly.y" -{ yyval.opval = scalar(yypvt[-0].opval); } break; +#line 543 "perly.y" +{ yyval.opval = newAVREF(yyvsp[0].opval); } +break; case 145: -# line 547 "perly.y" -{ yyval.opval = scalar(scope(yypvt[-0].opval)); } break; +#line 547 "perly.y" +{ yyval.opval = newGVREF(yyvsp[0].opval); } +break; case 146: -# line 552 "perly.y" -{ yyval.ival = 1; } break; +#line 551 "perly.y" +{ yyval.opval = scalar(yyvsp[0].opval); } +break; case 147: -# line 554 "perly.y" -{ yyval.ival = 0; } break; +#line 553 "perly.y" +{ yyval.opval = scalar(yyvsp[0].opval); } +break; case 148: -# line 558 "perly.y" -{ yyval.ival = 1; } break; +#line 555 "perly.y" +{ yyval.opval = scalar(scope(yyvsp[0].opval)); } +break; case 149: -# line 560 "perly.y" -{ yyval.ival = 0; } break; +#line 558 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; case 150: -# line 564 "perly.y" -{ yyval.ival = 1; } break; +#line 562 "perly.y" +{ yyval.ival = 1; } +break; case 151: -# line 566 "perly.y" -{ yyval.ival = 0; } break; - } - goto yystack; /* reset registers in driver code */ +#line 564 "perly.y" +{ yyval.ival = 0; } +break; +case 152: +#line 568 "perly.y" +{ yyval.ival = 1; } +break; +case 153: +#line 570 "perly.y" +{ yyval.ival = 0; } +break; +case 154: +#line 574 "perly.y" +{ yyval.ival = 1; } +break; +case 155: +#line 576 "perly.y" +{ yyval.ival = 0; } +break; +#line 2233 "y.tab.c" + } + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("yydebug: after reduction, shifting from state 0 to\ + state %d\n", YYFINAL); +#endif + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("yydebug: state %d, reading %d (%s)\n", + YYFINAL, yychar, yys); + } +#endif + } + if (yychar == 0) goto yyaccept; + goto yyloop; + } + if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("yydebug: after reduction, shifting from state %d \ +to state %d\n", *yyssp, yystate); +#endif + if (yyssp >= yyss + yystacksize - 1) + { + /* + ** reallocate and recover. Note that pointers + ** have to be reset, or bad things will happen + */ + int yyps_index = (yyssp - yyss); + int yypv_index = (yyvsp - yyvs); + yystacksize += YYSTACKSIZE; + yyvs = (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE)); + yyss = (short*)realloc((char*)yyss,yystacksize * sizeof(short)); + if (!yyvs || !yyss) + goto yyoverflow; + yyssp = yyss + yyps_index; + yyvsp = yyvs + yypv_index; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; +yyoverflow: + yyerror("Out of memory for yacc stack"); +yyabort: + retval = 1; +yyaccept: + if (yyss) free(yyss); + if (yyvs) free(yyvs); + yydebug = oldyydebug; + yynerrs = oldyynerrs; + yyerrflag = oldyyerrflag; + yychar = oldyychar; + yyval = oldyyval; + yylval = oldyylval; + return retval; } diff --git a/perly.c.byacc b/perly.c.byacc new file mode 100644 index 0000000000..e78ca0d59a --- /dev/null +++ b/perly.c.byacc @@ -0,0 +1,2295 @@ +#ifndef lint +static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; +#endif +#define YYBYACC 1 +#line 39 "perly.y" +#include "EXTERN.h" +#include "perl.h" + +/*SUPPRESS 530*/ +/*SUPPRESS 593*/ +/*SUPPRESS 595*/ + +#line 50 "perly.y" +typedef union { + I32 ival; + char *pval; + OP *opval; + GV *gvval; +} YYSTYPE; +#line 21 "y.tab.c" +#define WORD 257 +#define METHOD 258 +#define THING 259 +#define PMFUNC 260 +#define PRIVATEREF 261 +#define LABEL 262 +#define FORMAT 263 +#define SUB 264 +#define PACKAGE 265 +#define WHILE 266 +#define UNTIL 267 +#define IF 268 +#define UNLESS 269 +#define ELSE 270 +#define ELSIF 271 +#define CONTINUE 272 +#define FOR 273 +#define LOOPEX 274 +#define DOTDOT 275 +#define FUNC0 276 +#define FUNC1 277 +#define FUNC 278 +#define RELOP 279 +#define EQOP 280 +#define MULOP 281 +#define ADDOP 282 +#define DOLSHARP 283 +#define DO 284 +#define LOCAL 285 +#define DELETE 286 +#define HASHBRACK 287 +#define LSTOP 288 +#define OROR 289 +#define ANDAND 290 +#define BITOROP 291 +#define BITANDOP 292 +#define UNIOP 293 +#define SHIFTOP 294 +#define MATCHOP 295 +#define ARROW 296 +#define UMINUS 297 +#define REFGEN 298 +#define POWOP 299 +#define PREINC 300 +#define PREDEC 301 +#define POSTINC 302 +#define POSTDEC 303 +#define YYERRCODE 256 +short yylhs[] = { -1, + 30, 0, 7, 3, 8, 8, 8, 9, 9, 9, + 9, 23, 23, 23, 23, 23, 23, 13, 13, 13, + 11, 11, 11, 11, 29, 29, 10, 10, 10, 10, + 10, 10, 10, 10, 12, 12, 26, 26, 28, 28, + 1, 1, 1, 2, 2, 31, 32, 32, 14, 14, + 27, 27, 27, 27, 27, 27, 27, 27, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 24, 24, 22, 17, 18, + 19, 20, 21, 25, 25, 25, 25, 4, 4, 5, + 5, 6, 6, +}; +short yylen[] = { 2, + 0, 2, 4, 0, 0, 2, 2, 2, 1, 2, + 3, 1, 1, 3, 3, 3, 3, 0, 2, 6, + 6, 6, 4, 4, 0, 2, 7, 7, 5, 5, + 8, 7, 10, 3, 0, 1, 0, 1, 0, 1, + 1, 1, 1, 3, 2, 3, 3, 2, 3, 1, + 3, 5, 4, 6, 6, 3, 2, 4, 3, 4, + 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 3, 2, 3, 2, 3, 3, 1, 1, 4, + 5, 1, 1, 1, 5, 6, 6, 5, 4, 5, + 6, 8, 1, 1, 3, 4, 2, 2, 4, 5, + 4, 5, 1, 2, 1, 2, 2, 1, 3, 3, + 4, 4, 6, 1, 1, 0, 1, 2, 2, 2, + 2, 2, 2, 1, 1, 1, 1, 2, 1, 2, + 1, 3, 2, +}; +short yydefred[] = { 1, + 0, 5, 0, 40, 0, 0, 0, 6, 41, 7, + 9, 0, 42, 43, 4, 0, 45, 0, 0, 48, + 12, 0, 0, 113, 0, 147, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, + 0, 0, 0, 0, 102, 104, 99, 0, 0, 0, + 135, 5, 44, 46, 47, 144, 146, 145, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 142, 0, 118, 0, 0, 0, + 0, 0, 0, 0, 0, 57, 0, 126, 0, 0, + 0, 0, 89, 90, 0, 0, 0, 0, 95, 0, + 138, 139, 140, 141, 143, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 87, 88, 0, + 0, 0, 0, 0, 11, 0, 0, 56, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 129, 130, 0, 0, 0, 0, 0, 0, + 0, 97, 0, 0, 96, 51, 0, 149, 0, 0, + 0, 151, 94, 26, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 115, 0, + 0, 0, 3, 132, 0, 0, 29, 0, 30, 0, + 0, 0, 23, 0, 24, 0, 0, 0, 131, 58, + 0, 119, 0, 121, 0, 0, 0, 0, 153, 0, + 148, 0, 150, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 100, 0, 109, 116, + 0, 53, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 52, 120, 122, 0, 0, 152, 108, 0, + 0, 0, 0, 101, 105, 110, 0, 133, 27, 28, + 21, 0, 22, 0, 32, 0, 0, 111, 107, 106, + 55, 54, 0, 0, 31, 0, 0, 0, 112, 20, + 33, +}; +short yydgoto[] = { 1, + 8, 9, 72, 190, 193, 185, 77, 3, 10, 11, + 59, 169, 243, 105, 61, 62, 63, 64, 65, 66, + 67, 68, 171, 106, 70, 161, 71, 12, 127, 2, + 13, 14, +}; +short yysindex[] = { 0, + 0, 0, -17, 0, -120, -239, -58, 0, 0, 0, + 0, 620, 0, 0, 0, -93, 0, -93, -21, 0, + 0, 0, -20, 0, 7, 0, -30, -28, -26, -23, + -9, -172, 23, 86, 143, -20, 2759, 2804, 24, 886, + 2804, 2804, 2804, 2804, 2804, 2804, 2804, 931, 0, 2804, + 2804, 997, -20, -20, -20, -20, -20, -96, 0, 94, + 3685, -73, -82, -71, 0, 0, 0, 149, 139, -92, + 0, 0, 0, 0, 0, 0, 0, 0, 2804, 2804, + 2804, -93, 2804, -93, 2804, -93, 2804, -93, 1197, 171, + 0, 185, 1263, 2804, 0, 180, 0, -94, -32, -94, + 192, 111, 119, 80, 188, 0, 1308, 0, -94, -100, + -100, -100, 0, 0, 165, 108, -100, -100, 0, -39, + 0, 0, 0, 0, 0, -93, 0, 2804, 2804, 2804, + 2804, 2804, 2804, 2804, 2804, 1368, 1574, 2804, 2804, 1634, + 1679, 1745, 1948, 2011, 2804, 2056, -87, 0, 0, 2804, + 2804, 2804, 2804, 2119, 0, -216, -119, 0, 4405, 188, + 219, -96, 210, -96, 214, -3, 225, -3, 220, 84, + 0, 2804, 0, 0, 234, 239, 1308, 2322, 2385, 172, + 2804, 0, 2430, 169, 0, 0, 2804, 0, 2493, 197, + 2696, 0, 0, 0, 188, 188, 188, 188, 3685, 699, + -94, 295, 2804, -194, 2804, -225, 3685, 4320, 2804, 269, + 2804, 330, 2804, 393, 2804, 230, 2804, -253, 1, 2804, + 1, 2804, 261, 2804, 107, -11, 115, -4, 0, 108, + 263, 2804, 0, 0, 2804, -93, 0, -93, 0, -93, + -93, 270, 0, -93, 0, 2804, -93, 108, 0, 0, + 273, 0, 108, 0, 108, 2804, 133, 190, 0, 5, + 0, 2804, 0, 3685, 3685, 2804, 3685, 3685, 3685, 3685, + 3685, 3685, 134, 2804, 6, 196, 0, 199, 0, 0, + 2804, 0, 3169, -96, -96, -3, 0, 2804, -3, 266, + -96, -93, 0, 0, 0, 136, 201, 0, 0, 29, + -18, 216, 281, 0, 0, 0, 301, 0, 0, 0, + 0, 249, 0, 1197, 0, -96, 218, 0, 0, 0, + 0, 0, -93, 305, 0, 324, -3, -93, 0, 0, + 0, +}; +short yyrindex[] = { 0, + 0, 0, 449, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 494, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 2840, 0, 0, 0, 0, 0, 0, 0, + 2878, 2946, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 71, 0, -15, + 375, 4354, 555, 2990, 0, 0, 0, 3035, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2878, 0, + 325, 0, 0, 0, 0, 0, 0, 0, 309, 0, + 0, 0, 0, 329, 0, 3138, 0, 3762, 3203, 3800, + 0, 0, 0, 0, 3329, 0, 3394, 0, 3839, 4095, + 4163, 4203, 0, 0, 3250, 0, 4256, 4295, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 826, 0, 0, -2, + 0, 127, 0, 127, 0, 179, 0, 179, 0, 314, + 0, 0, 0, 0, 0, 0, 329, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3291, + 0, 0, 0, 0, 77, 88, 99, 109, 1460, 899, + 3900, 1092, 0, 3585, 0, 3646, 1901, 0, 0, 2217, + 0, 1469, 0, 3910, 0, 1840, 0, 3719, 3463, 0, + 3506, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2878, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 315, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2398, 2591, 0, 3097, 3107, 3547, 3991, + 4002, 4041, 0, 329, 0, 0, 0, 0, 0, 0, + 329, 0, 0, 127, 127, 179, 0, 0, 179, 0, + 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 365, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 334, 0, 127, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 179, 0, 0, 0, + 0, +}; +short yygindex[] = { 0, + 0, 0, 0, -136, 0, 0, -5, 304, 0, 0, + 0, 63, -166, 3, 4588, 163, 465, 0, 0, 0, + 0, 0, 366, 8, 12, 135, 0, 0, -143, 0, + 0, 0, +}; +#define YYTABLESIZE 4854 +short yytable[] = { 17, + 20, 245, 15, 224, 191, 233, 58, 179, 151, 81, + 73, 83, 74, 85, 60, 54, 87, 18, 237, 153, + 239, 82, 84, 86, 88, 13, 54, 136, 137, 15, + 89, 97, 132, 247, 79, 222, 108, 75, 38, 132, + 150, 145, 104, 13, 139, 146, 80, 95, 132, 132, + 116, 152, 107, 192, 120, 136, 38, 123, 151, 54, + 123, 231, 92, 101, 121, 122, 123, 124, 125, 145, + 25, 232, 132, 146, 123, 123, 162, 123, 164, 123, + 166, 277, 168, 160, 91, 163, 158, 165, 279, 167, + 150, 170, 15, 280, 15, 175, 15, 299, 304, 15, + 145, 176, 15, 25, 146, 177, 25, 25, 25, 123, + 25, 292, 25, 25, 186, 25, 294, 16, 295, 311, + 194, 319, 313, 183, 188, 93, 25, 189, 17, 25, + 195, 196, 197, 198, 25, 16, 16, 132, 184, 14, + 309, 310, 4, 5, 6, 7, 17, 315, 188, 15, + 132, 189, 225, 226, 227, 228, 230, 14, 132, 25, + 330, 25, 25, 25, 25, 276, 25, 15, 25, 25, + 223, 25, 325, 278, 248, 126, 132, 132, 18, 132, + 253, 255, 94, 257, 251, 25, 136, 137, 154, 260, + 25, 297, 302, 25, 317, 25, 25, 155, 19, 144, + 145, 148, 149, 156, 146, 110, 111, 112, 113, 114, + 172, 18, 117, 118, 18, 18, 18, 25, 18, 178, + 18, 18, 147, 18, 273, 173, 275, 54, 148, 149, + 284, 132, 285, 181, 286, 287, 76, 18, 289, 282, + 26, 291, 18, 182, 4, 5, 6, 7, 160, 25, + 238, 25, 25, 132, 240, 187, 133, 132, 296, 236, + 134, 135, 136, 137, 300, 244, 241, 242, 132, 18, + 140, 141, 142, 143, 249, 144, 145, 132, 246, 250, + 146, 303, 123, 123, 123, 123, 316, 262, 307, 323, + 312, 123, 132, 259, 256, 123, 123, 123, 123, 146, + 274, 18, 281, 18, 18, 123, 123, 123, 123, 288, + 123, 123, 123, 293, 298, 123, 60, 327, 123, 123, + 305, 321, 331, 306, 314, 318, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 320, 322, 326, 25, 25, 328, 25, 25, 25, 128, + 129, 130, 131, 25, 25, 25, 25, 25, 25, 128, + 129, 130, 131, 25, 329, 37, 146, 35, 25, 136, + 25, 25, 13, 37, 35, 157, 324, 69, 0, 0, + 290, 0, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 0, 0, 0, 25, + 25, 0, 25, 25, 25, 79, 0, 0, 79, 25, + 25, 25, 25, 25, 25, 50, 0, 0, 50, 25, + 0, 0, 79, 79, 25, 79, 25, 25, 0, 0, + 0, 0, 50, 50, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 2, 0, + 0, 18, 18, 0, 18, 18, 18, 79, 0, 0, + 0, 18, 18, 18, 18, 18, 18, 50, 0, 0, + 0, 18, 0, 0, 0, 0, 18, 0, 18, 18, + 0, 39, 0, 0, 39, 39, 39, 78, 39, 0, + 39, 39, 0, 39, 0, 90, 0, 0, 0, 0, + 78, 99, 0, 102, 0, 0, 0, 39, 134, 135, + 136, 137, 39, 0, 0, 0, 0, 78, 78, 78, + 78, 78, 0, 144, 145, 0, 144, 0, 146, 144, + 144, 144, 0, 144, 134, 144, 144, 134, 144, 39, + 0, 0, 0, 0, 0, 0, 0, 134, 135, 136, + 137, 134, 134, 0, 134, 0, 134, 144, 141, 142, + 143, 0, 144, 145, 0, 180, 0, 146, 0, 0, + 0, 39, 0, 134, 39, 136, 137, 0, 0, 0, + 0, 0, 0, 0, 144, 0, 134, 145, 144, 145, + 145, 145, 145, 146, 145, 98, 145, 145, 98, 145, + 0, 0, 0, 0, 0, 0, 0, 0, 134, 135, + 136, 137, 98, 98, 0, 98, 144, 98, 145, 144, + 142, 143, 0, 144, 145, 0, 0, 0, 146, 0, + 79, 79, 79, 79, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 0, 0, 0, 98, 0, 0, + 0, 0, 43, 0, 0, 54, 56, 53, 0, 48, + 79, 57, 51, 0, 50, 0, 79, 79, 0, 0, + 50, 134, 135, 136, 137, 0, 50, 50, 49, 0, + 145, 0, 0, 55, 143, 0, 144, 145, 0, 0, + 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, + 52, 0, 0, 0, 39, 39, 39, 39, 0, 0, + 0, 39, 39, 0, 39, 39, 39, 0, 0, 0, + 0, 39, 39, 39, 39, 39, 39, 0, 0, 0, + 0, 39, 15, 0, 0, 44, 39, 0, 39, 39, + 144, 144, 144, 144, 144, 0, 0, 0, 0, 134, + 134, 134, 134, 0, 0, 0, 0, 144, 134, 144, + 144, 144, 134, 134, 134, 134, 144, 144, 144, 144, + 144, 144, 134, 134, 134, 134, 144, 134, 134, 134, + 0, 144, 134, 144, 144, 134, 134, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 145, 145, 145, 145, 145, 0, 0, 0, 0, + 98, 98, 98, 98, 0, 0, 0, 0, 145, 98, + 145, 145, 145, 98, 98, 98, 98, 145, 145, 145, + 145, 145, 145, 98, 98, 98, 98, 145, 98, 98, + 98, 0, 145, 98, 145, 145, 98, 98, 39, 0, + 0, 39, 39, 39, 0, 39, 0, 39, 39, 0, + 39, 0, 0, 0, 0, 21, 22, 23, 24, 25, + 26, 0, 0, 0, 39, 27, 28, 29, 30, 39, + 0, 0, 31, 32, 0, 33, 34, 35, 0, 0, + 0, 0, 36, 37, 38, 39, 40, 41, 0, 0, + 0, 0, 42, 0, 0, 0, 39, 45, 43, 46, + 47, 54, 56, 53, 0, 48, 0, 57, 51, 0, + 50, 0, 0, 0, 0, 0, 0, 0, 0, 76, + 0, 0, 76, 0, 103, 0, 0, 0, 39, 55, + 0, 39, 0, 0, 0, 0, 76, 76, 0, 76, + 0, 76, 0, 43, 0, 0, 54, 56, 53, 0, + 48, 115, 57, 51, 0, 50, 52, 134, 135, 136, + 137, 0, 0, 0, 0, 0, 0, 140, 141, 142, + 143, 76, 144, 145, 55, 0, 0, 146, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 52, 0, 0, 0, 0, 0, 0, 0, 43, + 0, 0, 54, 56, 53, 0, 48, 0, 57, 51, + 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 44, 0, 0, 0, + 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 39, 39, 39, 39, 39, 39, 52, 0, 119, + 0, 39, 39, 39, 39, 0, 0, 0, 39, 39, + 0, 39, 39, 39, 0, 0, 0, 0, 39, 39, + 39, 39, 39, 39, 0, 0, 0, 0, 39, 15, + 0, 0, 44, 39, 0, 39, 39, 0, 0, 0, + 0, 0, 73, 0, 0, 73, 0, 0, 0, 0, + 0, 0, 22, 23, 24, 25, 26, 0, 0, 73, + 73, 0, 73, 0, 73, 0, 0, 0, 0, 32, + 0, 33, 34, 35, 76, 76, 76, 76, 36, 37, + 38, 39, 40, 41, 0, 0, 0, 0, 42, 0, + 0, 0, 0, 45, 73, 46, 47, 22, 23, 24, + 25, 26, 0, 0, 76, 0, 0, 0, 0, 0, + 76, 76, 0, 0, 32, 0, 33, 34, 35, 0, + 0, 0, 0, 36, 37, 38, 39, 40, 41, 0, + 0, 0, 0, 42, 0, 0, 0, 0, 45, 43, + 46, 47, 54, 56, 53, 0, 48, 0, 57, 51, + 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 23, 24, 25, 26, 0, 0, + 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 0, 33, 34, 35, 0, 0, 0, 0, 36, + 37, 38, 39, 40, 41, 0, 0, 52, 0, 42, + 0, 0, 0, 0, 45, 43, 46, 47, 54, 56, + 53, 0, 48, 174, 57, 51, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 44, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 43, 0, 0, 54, 56, 53, 0, 48, 0, 57, + 51, 0, 50, 52, 0, 0, 0, 73, 73, 73, + 73, 0, 0, 0, 0, 0, 73, 0, 0, 0, + 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, + 73, 73, 73, 73, 0, 15, 0, 73, 44, 0, + 0, 0, 0, 73, 73, 0, 0, 0, 52, 0, + 43, 0, 0, 54, 56, 53, 0, 48, 0, 57, + 51, 0, 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 203, 0, + 15, 55, 0, 44, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 21, 22, 23, 24, 25, 26, 52, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 0, 33, 34, 35, 0, 0, 0, 0, 36, + 37, 38, 39, 40, 41, 0, 0, 0, 0, 42, + 15, 0, 0, 44, 45, 0, 46, 47, 0, 0, + 49, 0, 0, 49, 0, 0, 0, 0, 0, 77, + 0, 0, 77, 0, 0, 0, 0, 49, 49, 22, + 23, 24, 25, 26, 0, 0, 77, 77, 0, 77, + 0, 77, 0, 0, 0, 0, 32, 0, 33, 34, + 35, 0, 0, 0, 0, 36, 37, 38, 39, 40, + 41, 0, 49, 0, 0, 42, 0, 0, 0, 0, + 45, 77, 46, 47, 22, 23, 24, 25, 26, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 0, 33, 34, 35, 0, 0, 0, 0, + 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, + 42, 0, 0, 156, 0, 45, 43, 46, 47, 54, + 56, 53, 0, 48, 0, 57, 51, 0, 50, 0, + 0, 0, 0, 0, 22, 23, 24, 25, 26, 0, + 0, 0, 0, 0, 205, 0, 0, 55, 0, 0, + 0, 32, 0, 33, 34, 35, 0, 0, 0, 0, + 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, + 42, 0, 0, 0, 52, 45, 43, 46, 47, 54, + 56, 53, 0, 48, 0, 57, 51, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 209, 0, 15, 55, 0, 44, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 43, 0, 0, 54, 56, 53, 0, 48, 0, + 57, 51, 0, 50, 52, 49, 49, 49, 49, 0, + 0, 0, 0, 0, 77, 77, 77, 77, 0, 211, + 0, 0, 55, 77, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 49, 15, 77, 77, 44, + 0, 49, 49, 0, 77, 0, 0, 0, 0, 52, + 77, 77, 0, 0, 0, 0, 0, 43, 0, 0, + 54, 56, 53, 0, 48, 0, 57, 51, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 44, 213, 0, 0, 55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 23, 24, 25, 26, 52, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 32, 0, 33, + 34, 35, 0, 0, 0, 0, 36, 37, 38, 39, + 40, 41, 0, 0, 0, 0, 42, 15, 0, 0, + 44, 45, 0, 46, 47, 0, 0, 0, 0, 0, + 74, 0, 0, 74, 0, 0, 0, 0, 0, 0, + 22, 23, 24, 25, 26, 0, 0, 74, 74, 0, + 74, 0, 74, 0, 0, 0, 0, 32, 0, 33, + 34, 35, 0, 0, 0, 0, 36, 37, 38, 39, + 40, 41, 0, 0, 0, 0, 42, 0, 0, 0, + 0, 45, 74, 46, 47, 22, 23, 24, 25, 26, + 0, 59, 0, 0, 59, 0, 0, 0, 0, 0, + 0, 0, 32, 0, 33, 34, 35, 0, 59, 59, + 0, 36, 37, 38, 39, 40, 41, 0, 0, 0, + 0, 42, 0, 0, 0, 0, 45, 0, 46, 47, + 43, 0, 0, 54, 56, 53, 0, 48, 0, 57, + 51, 0, 50, 59, 0, 0, 0, 0, 0, 0, + 0, 22, 23, 24, 25, 26, 0, 0, 215, 0, + 0, 55, 0, 0, 0, 0, 0, 0, 32, 0, + 33, 34, 35, 0, 0, 0, 0, 36, 37, 38, + 39, 40, 41, 0, 0, 0, 0, 42, 52, 0, + 0, 0, 45, 43, 46, 47, 54, 56, 53, 0, + 48, 0, 57, 51, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 217, 0, 44, 55, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, + 0, 54, 56, 53, 0, 48, 0, 57, 51, 0, + 50, 52, 0, 0, 0, 74, 74, 74, 74, 0, + 0, 0, 0, 0, 74, 0, 220, 0, 0, 55, + 0, 0, 0, 0, 0, 0, 0, 0, 74, 74, + 74, 74, 0, 15, 0, 74, 44, 0, 0, 0, + 0, 74, 74, 0, 0, 0, 52, 0, 0, 0, + 0, 43, 0, 0, 54, 56, 53, 0, 48, 229, + 57, 51, 0, 50, 0, 0, 59, 59, 59, 59, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 44, 55, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, + 0, 0, 59, 59, 22, 23, 24, 25, 26, 52, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 0, 33, 34, 35, 0, 0, 0, 0, + 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, + 42, 15, 0, 0, 44, 45, 0, 46, 47, 0, + 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, + 78, 0, 0, 0, 0, 0, 0, 22, 23, 24, + 25, 26, 0, 0, 78, 78, 0, 78, 0, 78, + 0, 0, 0, 0, 32, 0, 33, 34, 35, 0, + 0, 0, 0, 36, 37, 38, 39, 40, 41, 0, + 0, 0, 0, 42, 0, 0, 0, 0, 45, 78, + 46, 47, 22, 23, 24, 25, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, + 0, 33, 34, 35, 0, 0, 0, 0, 36, 37, + 38, 39, 40, 41, 0, 0, 0, 0, 42, 0, + 0, 0, 0, 45, 43, 46, 47, 54, 56, 53, + 0, 48, 252, 57, 51, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 22, 23, 24, 25, 26, + 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, + 0, 0, 32, 0, 33, 34, 35, 0, 0, 0, + 0, 36, 37, 38, 39, 40, 41, 0, 0, 0, + 0, 42, 52, 0, 0, 0, 45, 43, 46, 47, + 54, 56, 53, 0, 48, 254, 57, 51, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, + 0, 61, 0, 0, 15, 0, 0, 44, 55, 0, + 0, 0, 0, 0, 0, 61, 61, 0, 0, 0, + 0, 0, 43, 0, 0, 54, 56, 53, 0, 48, + 0, 57, 51, 0, 50, 52, 0, 0, 0, 0, + 0, 0, 78, 78, 78, 78, 0, 0, 258, 0, + 61, 78, 0, 55, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 78, 0, 15, 0, 0, + 44, 0, 78, 0, 0, 0, 0, 0, 78, 78, + 52, 0, 0, 0, 0, 43, 0, 0, 54, 56, + 53, 0, 48, 261, 57, 51, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 44, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 22, 23, + 24, 25, 26, 52, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 32, 0, 33, 34, 35, + 0, 0, 0, 0, 36, 37, 38, 39, 40, 41, + 0, 0, 0, 0, 42, 15, 0, 0, 44, 45, + 0, 46, 47, 0, 0, 0, 0, 0, 0, 0, + 0, 62, 0, 0, 62, 0, 0, 0, 0, 0, + 0, 22, 23, 24, 25, 26, 0, 0, 62, 62, + 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, + 33, 34, 35, 61, 61, 61, 61, 36, 37, 38, + 39, 40, 41, 0, 0, 0, 0, 42, 0, 0, + 0, 0, 45, 62, 46, 47, 22, 23, 24, 25, + 26, 0, 0, 61, 0, 0, 0, 0, 0, 61, + 61, 0, 0, 32, 0, 33, 34, 35, 0, 0, + 0, 0, 36, 37, 38, 39, 40, 41, 0, 0, + 0, 0, 42, 0, 0, 0, 0, 45, 43, 46, + 47, 54, 56, 53, 0, 48, 0, 57, 51, 0, + 50, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 23, 24, 25, 26, 0, 0, 0, 0, 0, 55, + 0, 0, 0, 0, 0, 0, 32, 0, 33, 34, + 35, 0, 0, 0, 0, 36, 37, 38, 39, 40, + 41, 0, 0, 0, 0, 42, 52, 0, 263, 0, + 45, 43, 46, 47, 54, 56, 53, 0, 48, 0, + 57, 51, 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 44, 55, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 43, 0, 0, 54, + 56, 53, 0, 48, 0, 57, 51, 0, 50, 52, + 0, 0, 0, 0, 0, 0, 62, 62, 62, 62, + 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 128, 15, 0, 128, 44, 0, 62, 0, 0, 0, + 0, 0, 62, 62, 52, 0, 0, 128, 128, 0, + 128, 0, 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 136, 0, + 0, 136, 0, 0, 0, 0, 15, 0, 0, 44, + 0, 0, 128, 0, 0, 136, 136, 0, 136, 0, + 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 22, 23, 24, 25, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, + 136, 33, 34, 35, 0, 0, 0, 0, 36, 37, + 38, 39, 40, 41, 0, 0, 125, 0, 42, 125, + 0, 0, 0, 45, 0, 46, 47, 0, 0, 0, + 0, 0, 0, 125, 125, 0, 125, 0, 125, 0, + 0, 0, 0, 0, 0, 96, 23, 24, 25, 26, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 103, 0, 32, 103, 33, 34, 35, 0, 125, 0, + 0, 36, 37, 38, 39, 40, 41, 103, 103, 0, + 103, 42, 103, 0, 0, 0, 45, 0, 46, 47, + 22, 23, 24, 25, 26, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 114, 0, 32, 114, 33, + 34, 35, 103, 0, 0, 0, 36, 37, 38, 39, + 40, 41, 114, 114, 0, 114, 42, 114, 0, 0, + 0, 45, 0, 46, 47, 128, 128, 128, 128, 0, + 0, 0, 0, 0, 128, 0, 0, 0, 128, 128, + 128, 128, 0, 0, 0, 0, 0, 114, 128, 128, + 128, 128, 0, 128, 128, 128, 0, 67, 128, 0, + 67, 128, 128, 136, 136, 136, 136, 66, 0, 0, + 66, 0, 136, 0, 67, 67, 136, 136, 136, 136, + 0, 0, 0, 0, 66, 66, 136, 136, 136, 136, + 0, 136, 136, 136, 0, 0, 136, 0, 134, 136, + 136, 134, 0, 0, 0, 0, 0, 0, 0, 67, + 0, 0, 0, 0, 0, 134, 134, 0, 134, 66, + 134, 0, 0, 0, 0, 0, 0, 0, 0, 308, + 0, 125, 125, 125, 125, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 125, 125, 125, 125, 0, 138, + 134, 139, 0, 0, 125, 125, 125, 125, 0, 125, + 125, 125, 0, 98, 125, 0, 98, 125, 125, 0, + 0, 0, 0, 0, 0, 103, 103, 103, 103, 0, + 98, 98, 0, 98, 103, 98, 0, 0, 103, 103, + 103, 103, 0, 0, 0, 0, 0, 0, 103, 103, + 103, 103, 0, 103, 103, 103, 0, 0, 103, 0, + 93, 103, 103, 93, 0, 98, 0, 0, 0, 0, + 114, 114, 114, 114, 0, 0, 0, 93, 93, 114, + 93, 0, 93, 114, 114, 114, 114, 0, 0, 0, + 0, 0, 0, 114, 114, 114, 114, 0, 114, 114, + 114, 92, 0, 114, 92, 0, 114, 114, 0, 0, + 0, 0, 93, 0, 0, 0, 0, 0, 92, 92, + 0, 92, 0, 92, 0, 0, 0, 0, 0, 0, + 0, 0, 67, 67, 67, 67, 0, 0, 0, 137, + 0, 0, 66, 66, 66, 66, 0, 0, 0, 0, + 0, 0, 0, 92, 0, 0, 137, 137, 0, 137, + 0, 137, 67, 0, 0, 0, 0, 0, 67, 67, + 0, 0, 66, 134, 134, 134, 134, 0, 66, 66, + 0, 0, 134, 0, 0, 0, 134, 134, 134, 134, + 0, 137, 0, 0, 0, 0, 134, 134, 134, 134, + 0, 134, 134, 134, 136, 0, 134, 136, 0, 134, + 134, 0, 0, 133, 0, 0, 0, 134, 135, 136, + 137, 136, 136, 0, 136, 0, 136, 140, 141, 142, + 143, 0, 144, 145, 0, 0, 0, 146, 98, 98, + 98, 98, 0, 0, 0, 0, 0, 98, 0, 0, + 0, 98, 98, 98, 98, 0, 136, 0, 0, 0, + 0, 98, 98, 98, 98, 0, 98, 98, 98, 0, + 0, 98, 0, 80, 98, 98, 80, 0, 0, 0, + 0, 0, 0, 0, 0, 93, 93, 93, 93, 0, + 80, 80, 0, 80, 93, 80, 0, 0, 93, 93, + 93, 93, 0, 0, 0, 0, 0, 0, 93, 93, + 93, 93, 0, 93, 93, 93, 68, 0, 93, 68, + 0, 93, 93, 0, 0, 80, 92, 92, 92, 92, + 0, 0, 0, 68, 68, 92, 68, 0, 68, 92, + 92, 92, 92, 0, 0, 0, 0, 0, 0, 92, + 92, 92, 92, 0, 92, 92, 92, 65, 0, 92, + 65, 0, 92, 92, 137, 137, 137, 137, 68, 0, + 0, 0, 0, 137, 65, 65, 0, 137, 137, 137, + 137, 0, 0, 0, 0, 0, 0, 137, 137, 137, + 137, 0, 137, 137, 137, 69, 0, 137, 69, 0, + 137, 137, 0, 0, 0, 0, 0, 0, 0, 65, + 0, 0, 69, 69, 0, 69, 0, 69, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, + 136, 136, 136, 0, 0, 0, 0, 0, 136, 0, + 0, 0, 136, 136, 136, 136, 0, 69, 0, 0, + 0, 0, 136, 136, 136, 136, 70, 136, 136, 70, + 0, 0, 136, 0, 0, 136, 136, 0, 0, 0, + 0, 0, 0, 70, 70, 0, 70, 0, 70, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, + 80, 80, 0, 0, 0, 0, 0, 80, 70, 0, + 0, 80, 80, 80, 80, 138, 0, 139, 0, 0, + 0, 80, 80, 80, 80, 0, 80, 80, 80, 71, + 0, 0, 71, 0, 80, 80, 0, 0, 0, 0, + 0, 68, 68, 68, 68, 0, 71, 71, 0, 71, + 68, 71, 0, 0, 68, 68, 68, 68, 0, 0, + 0, 0, 0, 0, 68, 68, 68, 68, 0, 68, + 68, 68, 117, 0, 0, 117, 0, 68, 68, 0, + 0, 71, 65, 65, 65, 65, 0, 0, 0, 117, + 117, 0, 117, 0, 117, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 91, 0, 65, 91, 0, 0, 0, 0, 65, 65, + 69, 69, 69, 69, 117, 0, 0, 91, 91, 69, + 91, 0, 91, 69, 69, 69, 69, 0, 0, 0, + 0, 0, 0, 69, 69, 69, 69, 0, 69, 127, + 69, 0, 127, 0, 0, 0, 69, 69, 0, 0, + 0, 0, 91, 0, 0, 0, 127, 127, 0, 127, + 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 70, 70, 70, 70, 0, 0, 0, 0, 0, + 70, 0, 0, 0, 70, 70, 0, 70, 0, 0, + 0, 127, 0, 0, 70, 70, 70, 70, 0, 70, + 72, 70, 0, 72, 0, 0, 0, 70, 70, 0, + 75, 0, 0, 75, 0, 0, 0, 72, 72, 133, + 72, 0, 72, 134, 135, 136, 137, 75, 75, 0, + 75, 0, 75, 140, 141, 142, 143, 0, 144, 145, + 0, 0, 0, 146, 71, 71, 71, 71, 0, 0, + 0, 0, 72, 71, 0, 0, 0, 71, 71, 0, + 0, 0, 75, 0, 0, 0, 0, 71, 71, 71, + 71, 0, 71, 0, 71, 0, 0, 0, 0, 0, + 71, 71, 0, 0, 0, 0, 0, 117, 117, 117, + 117, 64, 0, 0, 64, 0, 117, 0, 0, 0, + 117, 117, 63, 0, 0, 63, 0, 0, 64, 64, + 117, 117, 117, 117, 0, 0, 0, 117, 0, 63, + 63, 0, 0, 117, 117, 91, 91, 91, 91, 0, + 0, 0, 0, 0, 91, 0, 0, 0, 91, 91, + 0, 60, 0, 64, 60, 0, 0, 0, 91, 91, + 91, 91, 0, 0, 63, 91, 0, 0, 60, 60, + 0, 91, 91, 0, 127, 127, 127, 127, 0, 0, + 0, 0, 0, 127, 0, 0, 0, 127, 127, 0, + 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, + 127, 0, 0, 60, 127, 84, 0, 0, 84, 0, + 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 84, 84, 0, 84, 0, 84, 0, 0, + 0, 0, 0, 0, 0, 72, 72, 72, 72, 0, + 0, 0, 0, 0, 72, 75, 75, 75, 75, 72, + 0, 0, 0, 0, 75, 0, 0, 84, 72, 72, + 72, 72, 0, 0, 0, 72, 0, 0, 75, 75, + 75, 72, 72, 85, 0, 75, 85, 0, 0, 0, + 0, 75, 75, 0, 0, 0, 0, 0, 0, 0, + 85, 85, 0, 85, 0, 85, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 86, 0, 0, 86, 0, 0, 0, + 0, 0, 0, 0, 0, 85, 64, 64, 64, 64, + 86, 86, 0, 86, 0, 86, 0, 63, 63, 63, + 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, + 0, 0, 64, 64, 0, 86, 82, 63, 0, 82, + 0, 0, 0, 63, 63, 0, 60, 60, 60, 60, + 0, 0, 0, 82, 82, 0, 82, 0, 82, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 83, 60, 0, 83, 0, + 0, 0, 60, 60, 0, 0, 0, 0, 82, 0, + 0, 0, 83, 83, 0, 83, 0, 83, 0, 0, + 84, 84, 84, 84, 0, 0, 0, 0, 0, 84, + 0, 0, 0, 84, 84, 84, 84, 266, 0, 0, + 138, 0, 139, 84, 84, 84, 84, 83, 84, 84, + 84, 0, 0, 84, 81, 0, 0, 81, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 81, 81, 0, 81, 0, 81, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 85, 85, + 85, 85, 0, 0, 0, 0, 0, 85, 0, 0, + 0, 85, 85, 85, 85, 234, 81, 0, 235, 0, + 0, 85, 85, 85, 85, 0, 85, 85, 85, 0, + 0, 85, 0, 0, 0, 138, 0, 139, 86, 86, + 86, 86, 0, 0, 0, 0, 0, 86, 0, 0, + 0, 86, 86, 86, 86, 0, 0, 0, 0, 0, + 0, 86, 86, 86, 86, 0, 86, 86, 86, 0, + 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 82, 82, 82, 82, 0, 0, 0, 0, 0, + 82, 0, 0, 0, 82, 82, 82, 82, 0, 0, + 0, 0, 0, 0, 82, 82, 82, 82, 0, 82, + 82, 82, 0, 0, 82, 0, 0, 0, 0, 0, + 83, 83, 83, 83, 0, 0, 0, 0, 0, 83, + 0, 0, 0, 83, 83, 83, 83, 0, 0, 0, + 0, 0, 0, 83, 83, 83, 83, 0, 83, 83, + 83, 0, 0, 83, 133, 0, 0, 0, 134, 135, + 136, 137, 0, 0, 0, 0, 0, 0, 140, 141, + 142, 143, 0, 144, 145, 0, 0, 0, 146, 81, + 81, 81, 81, 0, 98, 100, 0, 0, 81, 109, + 0, 0, 81, 81, 81, 81, 0, 0, 0, 0, + 0, 0, 81, 81, 81, 81, 0, 81, 81, 0, + 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 159, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, + 0, 0, 0, 134, 135, 136, 137, 0, 0, 0, + 0, 0, 0, 140, 141, 142, 143, 0, 144, 145, + 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, + 200, 201, 202, 204, 206, 207, 208, 210, 212, 214, + 216, 218, 219, 221, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 199, 0, 0, 0, 0, 0, 199, 0, 199, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 264, 0, 265, 0, 0, 0, 267, 0, 268, 0, + 269, 0, 270, 0, 271, 0, 0, 272, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 283, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 301, +}; +short yycheck[] = { 5, + 59, 168, 123, 91, 44, 125, 12, 40, 91, 40, + 16, 40, 18, 40, 12, 36, 40, 257, 162, 91, + 164, 27, 28, 29, 30, 41, 36, 281, 282, 123, + 40, 37, 44, 170, 23, 123, 42, 59, 41, 44, + 123, 295, 40, 59, 63, 299, 40, 36, 44, 44, + 48, 123, 41, 93, 52, 281, 59, 41, 91, 36, + 44, 278, 40, 40, 53, 54, 55, 56, 57, 295, + 0, 288, 44, 299, 58, 59, 82, 61, 84, 63, + 86, 93, 88, 81, 257, 83, 79, 85, 93, 87, + 123, 89, 123, 230, 123, 93, 123, 93, 93, 123, + 295, 94, 123, 33, 299, 94, 36, 37, 38, 93, + 40, 248, 42, 43, 107, 45, 253, 41, 255, 286, + 126, 93, 289, 44, 41, 40, 0, 44, 41, 59, + 128, 129, 130, 131, 64, 59, 257, 44, 59, 41, + 284, 285, 262, 263, 264, 265, 59, 291, 41, 41, + 44, 44, 150, 151, 152, 153, 154, 59, 44, 33, + 327, 91, 36, 37, 38, 59, 40, 59, 42, 43, + 258, 45, 316, 59, 172, 272, 44, 44, 0, 44, + 178, 179, 40, 181, 177, 59, 281, 282, 40, 187, + 64, 59, 59, 123, 59, 125, 126, 59, 257, 294, + 295, 302, 303, 296, 299, 43, 44, 45, 46, 47, + 40, 33, 50, 51, 36, 37, 38, 91, 40, 40, + 42, 43, 296, 45, 222, 41, 224, 36, 302, 303, + 236, 44, 238, 123, 240, 241, 257, 59, 244, 232, + 261, 247, 64, 125, 262, 263, 264, 265, 246, 123, + 41, 125, 126, 44, 41, 91, 275, 44, 256, 41, + 279, 280, 281, 282, 262, 41, 270, 271, 44, 91, + 289, 290, 291, 292, 41, 294, 295, 44, 59, 41, + 299, 274, 266, 267, 268, 269, 292, 91, 281, 41, + 288, 275, 44, 125, 123, 279, 280, 281, 282, 299, + 40, 123, 40, 125, 126, 289, 290, 291, 292, 40, + 294, 295, 296, 41, 125, 299, 314, 323, 302, 303, + 125, 41, 328, 125, 59, 125, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 125, 41, 125, 273, 274, 41, 276, 277, 278, 266, + 267, 268, 269, 283, 284, 285, 286, 287, 288, 266, + 267, 268, 269, 293, 41, 41, 296, 59, 298, 41, + 300, 301, 59, 59, 41, 72, 314, 12, -1, -1, + 246, -1, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, -1, -1, -1, 273, + 274, -1, 276, 277, 278, 41, -1, -1, 44, 283, + 284, 285, 286, 287, 288, 41, -1, -1, 44, 293, + -1, -1, 58, 59, 298, 61, 300, 301, -1, -1, + -1, -1, 58, 59, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 0, -1, + -1, 273, 274, -1, 276, 277, 278, 93, -1, -1, + -1, 283, 284, 285, 286, 287, 288, 93, -1, -1, + -1, 293, -1, -1, -1, -1, 298, -1, 300, 301, + -1, 33, -1, -1, 36, 37, 38, 23, 40, -1, + 42, 43, -1, 45, -1, 31, -1, -1, -1, -1, + 36, 37, -1, 39, -1, -1, -1, 59, 279, 280, + 281, 282, 64, -1, -1, -1, -1, 53, 54, 55, + 56, 57, -1, 294, 295, -1, 33, -1, 299, 36, + 37, 38, -1, 40, 41, 42, 43, 44, 45, 91, + -1, -1, -1, -1, -1, -1, -1, 279, 280, 281, + 282, 58, 59, -1, 61, -1, 63, 64, 290, 291, + 292, -1, 294, 295, -1, 101, -1, 299, -1, -1, + -1, 123, -1, 279, 126, 281, 282, -1, -1, -1, + -1, -1, -1, -1, 91, -1, 93, 33, 294, 295, + 36, 37, 38, 299, 40, 41, 42, 43, 44, 45, + -1, -1, -1, -1, -1, -1, -1, -1, 279, 280, + 281, 282, 58, 59, -1, 61, 123, 63, 64, 126, + 291, 292, -1, 294, 295, -1, -1, -1, 299, -1, + 266, 267, 268, 269, -1, -1, -1, -1, -1, -1, + 266, 267, 268, 269, -1, -1, -1, 93, -1, -1, + -1, -1, 33, -1, -1, 36, 37, 38, -1, 40, + 296, 42, 43, -1, 45, -1, 302, 303, -1, -1, + 296, 279, 280, 281, 282, -1, 302, 303, 59, -1, + 126, -1, -1, 64, 292, -1, 294, 295, -1, -1, + -1, 299, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 256, 257, 258, 259, 260, 261, + 91, -1, -1, -1, 266, 267, 268, 269, -1, -1, + -1, 273, 274, -1, 276, 277, 278, -1, -1, -1, + -1, 283, 284, 285, 286, 287, 288, -1, -1, -1, + -1, 293, 123, -1, -1, 126, 298, -1, 300, 301, + 257, 258, 259, 260, 261, -1, -1, -1, -1, 266, + 267, 268, 269, -1, -1, -1, -1, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + -1, 298, 299, 300, 301, 302, 303, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 257, 258, 259, 260, 261, -1, -1, -1, -1, + 266, 267, 268, 269, -1, -1, -1, -1, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, -1, 298, 299, 300, 301, 302, 303, 33, -1, + -1, 36, 37, 38, -1, 40, -1, 42, 43, -1, + 45, -1, -1, -1, -1, 256, 257, 258, 259, 260, + 261, -1, -1, -1, 59, 266, 267, 268, 269, 64, + -1, -1, 273, 274, -1, 276, 277, 278, -1, -1, + -1, -1, 283, 284, 285, 286, 287, 288, -1, -1, + -1, -1, 293, -1, -1, -1, 91, 298, 33, 300, + 301, 36, 37, 38, -1, 40, -1, 42, 43, -1, + 45, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, -1, 44, -1, 59, -1, -1, -1, 123, 64, + -1, 126, -1, -1, -1, -1, 58, 59, -1, 61, + -1, 63, -1, 33, -1, -1, 36, 37, 38, -1, + 40, 41, 42, 43, -1, 45, 91, 279, 280, 281, + 282, -1, -1, -1, -1, -1, -1, 289, 290, 291, + 292, 93, 294, 295, 64, -1, -1, 299, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 123, -1, + -1, 126, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 91, -1, -1, -1, -1, -1, -1, -1, 33, + -1, -1, 36, 37, 38, -1, 40, -1, 42, 43, + -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 123, -1, -1, 126, -1, -1, -1, + 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 256, 257, 258, 259, 260, 261, 91, -1, 93, + -1, 266, 267, 268, 269, -1, -1, -1, 273, 274, + -1, 276, 277, 278, -1, -1, -1, -1, 283, 284, + 285, 286, 287, 288, -1, -1, -1, -1, 293, 123, + -1, -1, 126, 298, -1, 300, 301, -1, -1, -1, + -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, + -1, -1, 257, 258, 259, 260, 261, -1, -1, 58, + 59, -1, 61, -1, 63, -1, -1, -1, -1, 274, + -1, 276, 277, 278, 266, 267, 268, 269, 283, 284, + 285, 286, 287, 288, -1, -1, -1, -1, 293, -1, + -1, -1, -1, 298, 93, 300, 301, 257, 258, 259, + 260, 261, -1, -1, 296, -1, -1, -1, -1, -1, + 302, 303, -1, -1, 274, -1, 276, 277, 278, -1, + -1, -1, -1, 283, 284, 285, 286, 287, 288, -1, + -1, -1, -1, 293, -1, -1, -1, -1, 298, 33, + 300, 301, 36, 37, 38, -1, 40, -1, 42, 43, + -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 257, 258, 259, 260, 261, -1, -1, + 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 274, -1, 276, 277, 278, -1, -1, -1, -1, 283, + 284, 285, 286, 287, 288, -1, -1, 91, -1, 293, + -1, -1, -1, -1, 298, 33, 300, 301, 36, 37, + 38, -1, 40, 41, 42, 43, -1, 45, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 123, + -1, -1, 126, -1, -1, -1, 64, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 33, -1, -1, 36, 37, 38, -1, 40, -1, 42, + 43, -1, 45, 91, -1, -1, -1, 266, 267, 268, + 269, -1, -1, -1, -1, -1, 275, -1, -1, -1, + -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, + 289, 290, 291, 292, -1, 123, -1, 296, 126, -1, + -1, -1, -1, 302, 303, -1, -1, -1, 91, -1, + 33, -1, -1, 36, 37, 38, -1, 40, -1, 42, + 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, + 123, 64, -1, 126, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 256, 257, 258, 259, 260, 261, 91, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 274, -1, 276, 277, 278, -1, -1, -1, -1, 283, + 284, 285, 286, 287, 288, -1, -1, -1, -1, 293, + 123, -1, -1, 126, 298, -1, 300, 301, -1, -1, + 41, -1, -1, 44, -1, -1, -1, -1, -1, 41, + -1, -1, 44, -1, -1, -1, -1, 58, 59, 257, + 258, 259, 260, 261, -1, -1, 58, 59, -1, 61, + -1, 63, -1, -1, -1, -1, 274, -1, 276, 277, + 278, -1, -1, -1, -1, 283, 284, 285, 286, 287, + 288, -1, 93, -1, -1, 293, -1, -1, -1, -1, + 298, 93, 300, 301, 257, 258, 259, 260, 261, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 274, -1, 276, 277, 278, -1, -1, -1, -1, + 283, 284, 285, 286, 287, 288, -1, -1, -1, -1, + 293, -1, -1, 296, -1, 298, 33, 300, 301, 36, + 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, + -1, -1, -1, -1, 257, 258, 259, 260, 261, -1, + -1, -1, -1, -1, 61, -1, -1, 64, -1, -1, + -1, 274, -1, 276, 277, 278, -1, -1, -1, -1, + 283, 284, 285, 286, 287, 288, -1, -1, -1, -1, + 293, -1, -1, -1, 91, 298, 33, 300, 301, 36, + 37, 38, -1, 40, -1, 42, 43, -1, 45, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 61, -1, 123, 64, -1, 126, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, -1, -1, 36, 37, 38, -1, 40, -1, + 42, 43, -1, 45, 91, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 266, 267, 268, 269, -1, 61, + -1, -1, 64, 275, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 296, 123, 289, 290, 126, + -1, 302, 303, -1, 296, -1, -1, -1, -1, 91, + 302, 303, -1, -1, -1, -1, -1, 33, -1, -1, + 36, 37, 38, -1, 40, -1, 42, 43, -1, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 123, -1, -1, 126, 61, -1, -1, 64, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 257, 258, 259, 260, 261, 91, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 274, -1, 276, + 277, 278, -1, -1, -1, -1, 283, 284, 285, 286, + 287, 288, -1, -1, -1, -1, 293, 123, -1, -1, + 126, 298, -1, 300, 301, -1, -1, -1, -1, -1, + 41, -1, -1, 44, -1, -1, -1, -1, -1, -1, + 257, 258, 259, 260, 261, -1, -1, 58, 59, -1, + 61, -1, 63, -1, -1, -1, -1, 274, -1, 276, + 277, 278, -1, -1, -1, -1, 283, 284, 285, 286, + 287, 288, -1, -1, -1, -1, 293, -1, -1, -1, + -1, 298, 93, 300, 301, 257, 258, 259, 260, 261, + -1, 41, -1, -1, 44, -1, -1, -1, -1, -1, + -1, -1, 274, -1, 276, 277, 278, -1, 58, 59, + -1, 283, 284, 285, 286, 287, 288, -1, -1, -1, + -1, 293, -1, -1, -1, -1, 298, -1, 300, 301, + 33, -1, -1, 36, 37, 38, -1, 40, -1, 42, + 43, -1, 45, 93, -1, -1, -1, -1, -1, -1, + -1, 257, 258, 259, 260, 261, -1, -1, 61, -1, + -1, 64, -1, -1, -1, -1, -1, -1, 274, -1, + 276, 277, 278, -1, -1, -1, -1, 283, 284, 285, + 286, 287, 288, -1, -1, -1, -1, 293, 91, -1, + -1, -1, 298, 33, 300, 301, 36, 37, 38, -1, + 40, -1, 42, 43, -1, 45, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 123, 61, -1, 126, 64, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, + -1, 36, 37, 38, -1, 40, -1, 42, 43, -1, + 45, 91, -1, -1, -1, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 275, -1, 61, -1, -1, 64, + -1, -1, -1, -1, -1, -1, -1, -1, 289, 290, + 291, 292, -1, 123, -1, 296, 126, -1, -1, -1, + -1, 302, 303, -1, -1, -1, 91, -1, -1, -1, + -1, 33, -1, -1, 36, 37, 38, -1, 40, 41, + 42, 43, -1, 45, -1, -1, 266, 267, 268, 269, + -1, -1, -1, -1, -1, -1, -1, -1, 123, -1, + -1, 126, 64, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, + -1, -1, 302, 303, 257, 258, 259, 260, 261, 91, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 274, -1, 276, 277, 278, -1, -1, -1, -1, + 283, 284, 285, 286, 287, 288, -1, -1, -1, -1, + 293, 123, -1, -1, 126, 298, -1, 300, 301, -1, + -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, + 44, -1, -1, -1, -1, -1, -1, 257, 258, 259, + 260, 261, -1, -1, 58, 59, -1, 61, -1, 63, + -1, -1, -1, -1, 274, -1, 276, 277, 278, -1, + -1, -1, -1, 283, 284, 285, 286, 287, 288, -1, + -1, -1, -1, 293, -1, -1, -1, -1, 298, 93, + 300, 301, 257, 258, 259, 260, 261, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, + -1, 276, 277, 278, -1, -1, -1, -1, 283, 284, + 285, 286, 287, 288, -1, -1, -1, -1, 293, -1, + -1, -1, -1, 298, 33, 300, 301, 36, 37, 38, + -1, 40, 41, 42, 43, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, + -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, + -1, -1, 274, -1, 276, 277, 278, -1, -1, -1, + -1, 283, 284, 285, 286, 287, 288, -1, -1, -1, + -1, 293, 91, -1, -1, -1, 298, 33, 300, 301, + 36, 37, 38, -1, 40, 41, 42, 43, -1, 45, + -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, 123, -1, -1, 126, 64, -1, + -1, -1, -1, -1, -1, 58, 59, -1, -1, -1, + -1, -1, 33, -1, -1, 36, 37, 38, -1, 40, + -1, 42, 43, -1, 45, 91, -1, -1, -1, -1, + -1, -1, 266, 267, 268, 269, -1, -1, 59, -1, + 93, 275, -1, 64, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 289, -1, 123, -1, -1, + 126, -1, 296, -1, -1, -1, -1, -1, 302, 303, + 91, -1, -1, -1, -1, 33, -1, -1, 36, 37, + 38, -1, 40, 41, 42, 43, -1, 45, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 123, -1, -1, 126, 64, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, + 259, 260, 261, 91, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 274, -1, 276, 277, 278, + -1, -1, -1, -1, 283, 284, 285, 286, 287, 288, + -1, -1, -1, -1, 293, 123, -1, -1, 126, 298, + -1, 300, 301, -1, -1, -1, -1, -1, -1, -1, + -1, 41, -1, -1, 44, -1, -1, -1, -1, -1, + -1, 257, 258, 259, 260, 261, -1, -1, 58, 59, + -1, -1, -1, -1, -1, -1, -1, -1, 274, -1, + 276, 277, 278, 266, 267, 268, 269, 283, 284, 285, + 286, 287, 288, -1, -1, -1, -1, 293, -1, -1, + -1, -1, 298, 93, 300, 301, 257, 258, 259, 260, + 261, -1, -1, 296, -1, -1, -1, -1, -1, 302, + 303, -1, -1, 274, -1, 276, 277, 278, -1, -1, + -1, -1, 283, 284, 285, 286, 287, 288, -1, -1, + -1, -1, 293, -1, -1, -1, -1, 298, 33, 300, + 301, 36, 37, 38, -1, 40, -1, 42, 43, -1, + 45, -1, -1, -1, -1, -1, -1, -1, -1, 257, + 258, 259, 260, 261, -1, -1, -1, -1, -1, 64, + -1, -1, -1, -1, -1, -1, 274, -1, 276, 277, + 278, -1, -1, -1, -1, 283, 284, 285, 286, 287, + 288, -1, -1, -1, -1, 293, 91, -1, 93, -1, + 298, 33, 300, 301, 36, 37, 38, -1, 40, -1, + 42, 43, -1, 45, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 123, -1, + -1, 126, 64, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, -1, -1, 36, + 37, 38, -1, 40, -1, 42, 43, -1, 45, 91, + -1, -1, -1, -1, -1, -1, 266, 267, 268, 269, + -1, -1, -1, -1, -1, -1, -1, 64, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 41, 123, -1, 44, 126, -1, 296, -1, -1, -1, + -1, -1, 302, 303, 91, -1, -1, 58, 59, -1, + 61, -1, 63, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, + -1, 44, -1, -1, -1, -1, 123, -1, -1, 126, + -1, -1, 93, -1, -1, 58, 59, -1, 61, -1, + 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 257, 258, 259, 260, 261, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, + 93, 276, 277, 278, -1, -1, -1, -1, 283, 284, + 285, 286, 287, 288, -1, -1, 41, -1, 293, 44, + -1, -1, -1, 298, -1, 300, 301, -1, -1, -1, + -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, + -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 41, -1, 274, 44, 276, 277, 278, -1, 93, -1, + -1, 283, 284, 285, 286, 287, 288, 58, 59, -1, + 61, 293, 63, -1, -1, -1, 298, -1, 300, 301, + 257, 258, 259, 260, 261, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 41, -1, 274, 44, 276, + 277, 278, 93, -1, -1, -1, 283, 284, 285, 286, + 287, 288, 58, 59, -1, 61, 293, 63, -1, -1, + -1, 298, -1, 300, 301, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 275, -1, -1, -1, 279, 280, + 281, 282, -1, -1, -1, -1, -1, 93, 289, 290, + 291, 292, -1, 294, 295, 296, -1, 41, 299, -1, + 44, 302, 303, 266, 267, 268, 269, 41, -1, -1, + 44, -1, 275, -1, 58, 59, 279, 280, 281, 282, + -1, -1, -1, -1, 58, 59, 289, 290, 291, 292, + -1, 294, 295, 296, -1, -1, 299, -1, 41, 302, + 303, 44, -1, -1, -1, -1, -1, -1, -1, 93, + -1, -1, -1, -1, -1, 58, 59, -1, 61, 93, + 63, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, 266, 267, 268, 269, -1, -1, -1, -1, -1, + 275, -1, -1, -1, 279, 280, 281, 282, -1, 61, + 93, 63, -1, -1, 289, 290, 291, 292, -1, 294, + 295, 296, -1, 41, 299, -1, 44, 302, 303, -1, + -1, -1, -1, -1, -1, 266, 267, 268, 269, -1, + 58, 59, -1, 61, 275, 63, -1, -1, 279, 280, + 281, 282, -1, -1, -1, -1, -1, -1, 289, 290, + 291, 292, -1, 294, 295, 296, -1, -1, 299, -1, + 41, 302, 303, 44, -1, 93, -1, -1, -1, -1, + 266, 267, 268, 269, -1, -1, -1, 58, 59, 275, + 61, -1, 63, 279, 280, 281, 282, -1, -1, -1, + -1, -1, -1, 289, 290, 291, 292, -1, 294, 295, + 296, 41, -1, 299, 44, -1, 302, 303, -1, -1, + -1, -1, 93, -1, -1, -1, -1, -1, 58, 59, + -1, 61, -1, 63, -1, -1, -1, -1, -1, -1, + -1, -1, 266, 267, 268, 269, -1, -1, -1, 41, + -1, -1, 266, 267, 268, 269, -1, -1, -1, -1, + -1, -1, -1, 93, -1, -1, 58, 59, -1, 61, + -1, 63, 296, -1, -1, -1, -1, -1, 302, 303, + -1, -1, 296, 266, 267, 268, 269, -1, 302, 303, + -1, -1, 275, -1, -1, -1, 279, 280, 281, 282, + -1, 93, -1, -1, -1, -1, 289, 290, 291, 292, + -1, 294, 295, 296, 41, -1, 299, 44, -1, 302, + 303, -1, -1, 275, -1, -1, -1, 279, 280, 281, + 282, 58, 59, -1, 61, -1, 63, 289, 290, 291, + 292, -1, 294, 295, -1, -1, -1, 299, 266, 267, + 268, 269, -1, -1, -1, -1, -1, 275, -1, -1, + -1, 279, 280, 281, 282, -1, 93, -1, -1, -1, + -1, 289, 290, 291, 292, -1, 294, 295, 296, -1, + -1, 299, -1, 41, 302, 303, 44, -1, -1, -1, + -1, -1, -1, -1, -1, 266, 267, 268, 269, -1, + 58, 59, -1, 61, 275, 63, -1, -1, 279, 280, + 281, 282, -1, -1, -1, -1, -1, -1, 289, 290, + 291, 292, -1, 294, 295, 296, 41, -1, 299, 44, + -1, 302, 303, -1, -1, 93, 266, 267, 268, 269, + -1, -1, -1, 58, 59, 275, 61, -1, 63, 279, + 280, 281, 282, -1, -1, -1, -1, -1, -1, 289, + 290, 291, 292, -1, 294, 295, 296, 41, -1, 299, + 44, -1, 302, 303, 266, 267, 268, 269, 93, -1, + -1, -1, -1, 275, 58, 59, -1, 279, 280, 281, + 282, -1, -1, -1, -1, -1, -1, 289, 290, 291, + 292, -1, 294, 295, 296, 41, -1, 299, 44, -1, + 302, 303, -1, -1, -1, -1, -1, -1, -1, 93, + -1, -1, 58, 59, -1, 61, -1, 63, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 266, + 267, 268, 269, -1, -1, -1, -1, -1, 275, -1, + -1, -1, 279, 280, 281, 282, -1, 93, -1, -1, + -1, -1, 289, 290, 291, 292, 41, 294, 295, 44, + -1, -1, 299, -1, -1, 302, 303, -1, -1, -1, + -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 266, 267, + 268, 269, -1, -1, -1, -1, -1, 275, 93, -1, + -1, 279, 280, 281, 282, 61, -1, 63, -1, -1, + -1, 289, 290, 291, 292, -1, 294, 295, 296, 41, + -1, -1, 44, -1, 302, 303, -1, -1, -1, -1, + -1, 266, 267, 268, 269, -1, 58, 59, -1, 61, + 275, 63, -1, -1, 279, 280, 281, 282, -1, -1, + -1, -1, -1, -1, 289, 290, 291, 292, -1, 294, + 295, 296, 41, -1, -1, 44, -1, 302, 303, -1, + -1, 93, 266, 267, 268, 269, -1, -1, -1, 58, + 59, -1, 61, -1, 63, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 41, -1, 296, 44, -1, -1, -1, -1, 302, 303, + 266, 267, 268, 269, 93, -1, -1, 58, 59, 275, + 61, -1, 63, 279, 280, 281, 282, -1, -1, -1, + -1, -1, -1, 289, 290, 291, 292, -1, 294, 41, + 296, -1, 44, -1, -1, -1, 302, 303, -1, -1, + -1, -1, 93, -1, -1, -1, 58, 59, -1, 61, + -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 266, 267, 268, 269, -1, -1, -1, -1, -1, + 275, -1, -1, -1, 279, 280, -1, 282, -1, -1, + -1, 93, -1, -1, 289, 290, 291, 292, -1, 294, + 41, 296, -1, 44, -1, -1, -1, 302, 303, -1, + 41, -1, -1, 44, -1, -1, -1, 58, 59, 275, + 61, -1, 63, 279, 280, 281, 282, 58, 59, -1, + 61, -1, 63, 289, 290, 291, 292, -1, 294, 295, + -1, -1, -1, 299, 266, 267, 268, 269, -1, -1, + -1, -1, 93, 275, -1, -1, -1, 279, 280, -1, + -1, -1, 93, -1, -1, -1, -1, 289, 290, 291, + 292, -1, 294, -1, 296, -1, -1, -1, -1, -1, + 302, 303, -1, -1, -1, -1, -1, 266, 267, 268, + 269, 41, -1, -1, 44, -1, 275, -1, -1, -1, + 279, 280, 41, -1, -1, 44, -1, -1, 58, 59, + 289, 290, 291, 292, -1, -1, -1, 296, -1, 58, + 59, -1, -1, 302, 303, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 275, -1, -1, -1, 279, 280, + -1, 41, -1, 93, 44, -1, -1, -1, 289, 290, + 291, 292, -1, -1, 93, 296, -1, -1, 58, 59, + -1, 302, 303, -1, 266, 267, 268, 269, -1, -1, + -1, -1, -1, 275, -1, -1, -1, 279, 280, -1, + -1, -1, -1, -1, -1, -1, -1, 289, 290, 291, + 292, -1, -1, 93, 296, 41, -1, -1, 44, -1, + 302, 303, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 58, 59, -1, 61, -1, 63, -1, -1, + -1, -1, -1, -1, -1, 266, 267, 268, 269, -1, + -1, -1, -1, -1, 275, 266, 267, 268, 269, 280, + -1, -1, -1, -1, 275, -1, -1, 93, 289, 290, + 291, 292, -1, -1, -1, 296, -1, -1, 289, 290, + 291, 302, 303, 41, -1, 296, 44, -1, -1, -1, + -1, 302, 303, -1, -1, -1, -1, -1, -1, -1, + 58, 59, -1, 61, -1, 63, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 41, -1, -1, 44, -1, -1, -1, + -1, -1, -1, -1, -1, 93, 266, 267, 268, 269, + 58, 59, -1, 61, -1, 63, -1, 266, 267, 268, + 269, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, + -1, -1, 302, 303, -1, 93, 41, 296, -1, 44, + -1, -1, -1, 302, 303, -1, 266, 267, 268, 269, + -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 41, 296, -1, 44, -1, + -1, -1, 302, 303, -1, -1, -1, -1, 93, -1, + -1, -1, 58, 59, -1, 61, -1, 63, -1, -1, + 266, 267, 268, 269, -1, -1, -1, -1, -1, 275, + -1, -1, -1, 279, 280, 281, 282, 58, -1, -1, + 61, -1, 63, 289, 290, 291, 292, 93, 294, 295, + 296, -1, -1, 299, 41, -1, -1, 44, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 58, 59, -1, 61, -1, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 266, 267, + 268, 269, -1, -1, -1, -1, -1, 275, -1, -1, + -1, 279, 280, 281, 282, 41, 93, -1, 44, -1, + -1, 289, 290, 291, 292, -1, 294, 295, 296, -1, + -1, 299, -1, -1, -1, 61, -1, 63, 266, 267, + 268, 269, -1, -1, -1, -1, -1, 275, -1, -1, + -1, 279, 280, 281, 282, -1, -1, -1, -1, -1, + -1, 289, 290, 291, 292, -1, 294, 295, 296, -1, + -1, 299, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 266, 267, 268, 269, -1, -1, -1, -1, -1, + 275, -1, -1, -1, 279, 280, 281, 282, -1, -1, + -1, -1, -1, -1, 289, 290, 291, 292, -1, 294, + 295, 296, -1, -1, 299, -1, -1, -1, -1, -1, + 266, 267, 268, 269, -1, -1, -1, -1, -1, 275, + -1, -1, -1, 279, 280, 281, 282, -1, -1, -1, + -1, -1, -1, 289, 290, 291, 292, -1, 294, 295, + 296, -1, -1, 299, 275, -1, -1, -1, 279, 280, + 281, 282, -1, -1, -1, -1, -1, -1, 289, 290, + 291, 292, -1, 294, 295, -1, -1, -1, 299, 266, + 267, 268, 269, -1, 37, 38, -1, -1, 275, 42, + -1, -1, 279, 280, 281, 282, -1, -1, -1, -1, + -1, -1, 289, 290, 291, 292, -1, 294, 295, -1, + -1, -1, 299, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 80, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 275, + -1, -1, -1, 279, 280, 281, 282, -1, -1, -1, + -1, -1, -1, 289, 290, 291, 292, -1, 294, 295, + -1, -1, -1, 299, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 183, -1, -1, -1, -1, -1, 189, -1, 191, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 203, -1, 205, -1, -1, -1, 209, -1, 211, -1, + 213, -1, 215, -1, 217, -1, -1, 220, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 235, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 266, +}; +#define YYFINAL 1 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 303 +#if YYDEBUG +char *yyname[] = { +"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +"'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0, +0,0,0,0,0,"':'","';'",0,"'='",0,"'?'","'@'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,"'{'",0,"'}'","'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"WORD","METHOD","THING", +"PMFUNC","PRIVATEREF","LABEL","FORMAT","SUB","PACKAGE","WHILE","UNTIL","IF", +"UNLESS","ELSE","ELSIF","CONTINUE","FOR","LOOPEX","DOTDOT","FUNC0","FUNC1", +"FUNC","RELOP","EQOP","MULOP","ADDOP","DOLSHARP","DO","LOCAL","DELETE", +"HASHBRACK","LSTOP","OROR","ANDAND","BITOROP","BITANDOP","UNIOP","SHIFTOP", +"MATCHOP","ARROW","UMINUS","REFGEN","POWOP","PREINC","PREDEC","POSTINC", +"POSTDEC", +}; +char *yyrule[] = { +"$accept : prog", +"$$1 :", +"prog : $$1 lineseq", +"block : '{' remember lineseq '}'", +"remember :", +"lineseq :", +"lineseq : lineseq decl", +"lineseq : lineseq line", +"line : label cond", +"line : loop", +"line : label ';'", +"line : label sideff ';'", +"sideff : error", +"sideff : expr", +"sideff : expr IF expr", +"sideff : expr UNLESS expr", +"sideff : expr WHILE expr", +"sideff : expr UNTIL expr", +"else :", +"else : ELSE block", +"else : ELSIF '(' expr ')' block else", +"cond : IF '(' expr ')' block else", +"cond : UNLESS '(' expr ')' block else", +"cond : IF block block else", +"cond : UNLESS block block else", +"cont :", +"cont : CONTINUE block", +"loop : label WHILE '(' texpr ')' block cont", +"loop : label UNTIL '(' expr ')' block cont", +"loop : label WHILE block block cont", +"loop : label UNTIL block block cont", +"loop : label FOR scalar '(' expr crp block cont", +"loop : label FOR '(' expr crp block cont", +"loop : label FOR '(' nexpr ';' texpr ';' nexpr ')' block", +"loop : label block cont", +"nexpr :", +"nexpr : sideff", +"texpr :", +"texpr : expr", +"label :", +"label : LABEL", +"decl : format", +"decl : subrout", +"decl : package", +"format : FORMAT WORD block", +"format : FORMAT block", +"subrout : SUB WORD block", +"package : PACKAGE WORD ';'", +"package : PACKAGE ';'", +"expr : expr ',' sexpr", +"expr : sexpr", +"listop : LSTOP indirob listexpr", +"listop : FUNC '(' indirob listexpr ')'", +"listop : indirob ARROW LSTOP listexpr", +"listop : indirob ARROW FUNC '(' listexpr ')'", +"listop : term ARROW METHOD '(' listexpr ')'", +"listop : METHOD indirob listexpr", +"listop : LSTOP listexpr", +"listop : FUNC '(' listexpr ')'", +"sexpr : sexpr '=' sexpr", +"sexpr : sexpr POWOP '=' sexpr", +"sexpr : sexpr MULOP '=' sexpr", +"sexpr : sexpr ADDOP '=' sexpr", +"sexpr : sexpr SHIFTOP '=' sexpr", +"sexpr : sexpr BITANDOP '=' sexpr", +"sexpr : sexpr BITOROP '=' sexpr", +"sexpr : sexpr ANDAND '=' sexpr", +"sexpr : sexpr OROR '=' sexpr", +"sexpr : sexpr POWOP sexpr", +"sexpr : sexpr MULOP sexpr", +"sexpr : sexpr ADDOP sexpr", +"sexpr : sexpr SHIFTOP sexpr", +"sexpr : sexpr RELOP sexpr", +"sexpr : sexpr EQOP sexpr", +"sexpr : sexpr BITANDOP sexpr", +"sexpr : sexpr BITOROP sexpr", +"sexpr : sexpr DOTDOT sexpr", +"sexpr : sexpr ANDAND sexpr", +"sexpr : sexpr OROR sexpr", +"sexpr : sexpr '?' sexpr ':' sexpr", +"sexpr : sexpr MATCHOP sexpr", +"sexpr : term", +"term : '-' term", +"term : '+' term", +"term : '!' term", +"term : '~' term", +"term : REFGEN term", +"term : term POSTINC", +"term : term POSTDEC", +"term : PREINC term", +"term : PREDEC term", +"term : LOCAL sexpr", +"term : '(' expr crp", +"term : '(' ')'", +"term : '[' expr crb", +"term : '[' ']'", +"term : HASHBRACK expr crhb", +"term : HASHBRACK ';' '}'", +"term : scalar", +"term : star", +"term : scalar '[' expr ']'", +"term : term ARROW '[' expr ']'", +"term : hsh", +"term : ary", +"term : arylen", +"term : scalar '{' expr ';' '}'", +"term : term ARROW '{' expr ';' '}'", +"term : '(' expr crp '[' expr ']'", +"term : '(' ')' '[' expr ']'", +"term : ary '[' expr ']'", +"term : ary '{' expr ';' '}'", +"term : DELETE scalar '{' expr ';' '}'", +"term : DELETE '(' scalar '{' expr ';' '}' ')'", +"term : THING", +"term : amper", +"term : amper '(' ')'", +"term : amper '(' expr crp", +"term : DO sexpr", +"term : DO block", +"term : DO WORD '(' ')'", +"term : DO WORD '(' expr crp", +"term : DO scalar '(' ')'", +"term : DO scalar '(' expr crp", +"term : LOOPEX", +"term : LOOPEX WORD", +"term : UNIOP", +"term : UNIOP block", +"term : UNIOP sexpr", +"term : FUNC0", +"term : FUNC0 '(' ')'", +"term : FUNC1 '(' ')'", +"term : FUNC1 '(' expr ')'", +"term : PMFUNC '(' sexpr ')'", +"term : PMFUNC '(' sexpr ',' sexpr ')'", +"term : WORD", +"term : listop", +"listexpr :", +"listexpr : expr", +"amper : '&' indirob", +"scalar : '$' indirob", +"ary : '@' indirob", +"hsh : '%' indirob", +"arylen : DOLSHARP indirob", +"star : '*' indirob", +"indirob : WORD", +"indirob : scalar", +"indirob : block", +"indirob : PRIVATEREF", +"crp : ',' ')'", +"crp : ')'", +"crb : ',' ']'", +"crb : ']'", +"crhb : ',' ';' '}'", +"crhb : ';' '}'", +}; +#endif +#define yyclearin (yychar=(-1)) +#define yyerrok (yyerrflag=0) +#ifdef YYSTACKSIZE +#ifndef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#endif +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 +#endif +#endif +int yydebug; +int yynerrs; +int yyerrflag; +int yychar; +short *yyssp; +YYSTYPE *yyvsp; +YYSTYPE yyval; +YYSTYPE yylval; +short yyss[YYSTACKSIZE]; +YYSTYPE yyvs[YYSTACKSIZE]; +#define yystacksize YYSTACKSIZE +#line 573 "perly.y" + /* PROGRAM */ +#line 1409 "y.tab.c" +#define YYABORT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +int +yyparse() +{ + register int yym, yyn, yystate; +#if YYDEBUG + register char *yys; + extern char *getenv(); + + if (yys = getenv("YYDEBUG")) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif + + yynerrs = 0; + yyerrflag = 0; + yychar = (-1); + + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; + +yyloop: + if (yyn = yydefred[yystate]) goto yyreduce; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("yydebug: state %d, reading %d (%s)\n", yystate, + yychar, yys); + } +#endif + } + if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { +#if YYDEBUG + if (yydebug) + printf("yydebug: state %d, shifting to state %d\n", + yystate, yytable[yyn]); +#endif + if (yyssp >= yyss + yystacksize - 1) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = (-1); + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag) goto yyinrecovery; +#ifdef lint + goto yynewerror; +#endif +yynewerror: + yyerror("syntax error"); +#ifdef lint + goto yyerrlab; +#endif +yyerrlab: + ++yynerrs; +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("yydebug: state %d, error recovery shifting\ + to state %d\n", *yyssp, yytable[yyn]); +#endif + if (yyssp >= yyss + yystacksize - 1) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("yydebug: error recovery discarding state %d\n", + *yyssp); +#endif + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("yydebug: state %d, error recovery discards token %d (%s)\n", + yystate, yychar, yys); + } +#endif + yychar = (-1); + goto yyloop; + } +yyreduce: +#if YYDEBUG + if (yydebug) + printf("yydebug: state %d, reducing by rule %d (%s)\n", + yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + yyval = yyvsp[1-yym]; + switch (yyn) + { +case 1: +#line 100 "perly.y" +{ +#if defined(YYDEBUG) && defined(DEBUGGING) + yydebug = (debug & 1); +#endif + expect = XBLOCK; + } +break; +case 2: +#line 107 "perly.y" +{ if (in_eval) { + eval_root = newUNOP(OP_LEAVEEVAL, 0, yyvsp[0].opval); + eval_start = linklist(eval_root); + eval_root->op_next = 0; + peep(eval_start); + } + else + main_root = block_head(yyvsp[0].opval, &main_start); + } +break; +case 3: +#line 119 "perly.y" +{ yyval.opval = scalarseq(yyvsp[-1].opval); + if (copline > (line_t)yyvsp[-3].ival) + copline = yyvsp[-3].ival; + leave_scope(yyvsp[-2].ival); + pad_leavemy(comppadnamefill); + expect = XBLOCK; } +break; +case 4: +#line 128 "perly.y" +{ yyval.ival = savestack_ix; SAVEINT(comppadnamefill); } +break; +case 5: +#line 132 "perly.y" +{ yyval.opval = Nullop; } +break; +case 6: +#line 134 "perly.y" +{ yyval.opval = yyvsp[-1].opval; } +break; +case 7: +#line 136 "perly.y" +{ yyval.opval = append_list(OP_LINESEQ, yyvsp[-1].opval, yyvsp[0].opval); pad_reset(); } +break; +case 8: +#line 140 "perly.y" +{ yyval.opval = newSTATEOP(0, yyvsp[-1].pval, yyvsp[0].opval); } +break; +case 10: +#line 143 "perly.y" +{ if (yyvsp[-1].pval != Nullch) { + yyval.opval = newSTATEOP(0, yyvsp[-1].pval, newOP(OP_NULL, 0)); + } + else { + yyval.opval = Nullop; + copline = NOLINE; + } + expect = XBLOCK; } +break; +case 11: +#line 152 "perly.y" +{ yyval.opval = newSTATEOP(0, yyvsp[-2].pval, yyvsp[-1].opval); + expect = XBLOCK; } +break; +case 12: +#line 157 "perly.y" +{ yyval.opval = Nullop; } +break; +case 13: +#line 159 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 14: +#line 161 "perly.y" +{ yyval.opval = newLOGOP(OP_AND, 0, yyvsp[0].opval, yyvsp[-2].opval); } +break; +case 15: +#line 163 "perly.y" +{ yyval.opval = newLOGOP(OP_OR, 0, yyvsp[0].opval, yyvsp[-2].opval); } +break; +case 16: +#line 165 "perly.y" +{ yyval.opval = newLOOPOP(0, 1, scalar(yyvsp[0].opval), yyvsp[-2].opval); } +break; +case 17: +#line 167 "perly.y" +{ yyval.opval = newLOOPOP(0, 1, invert(scalar(yyvsp[0].opval)), yyvsp[-2].opval);} +break; +case 18: +#line 171 "perly.y" +{ yyval.opval = Nullop; } +break; +case 19: +#line 173 "perly.y" +{ yyval.opval = scope(yyvsp[0].opval); } +break; +case 20: +#line 175 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; +case 21: +#line 180 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newCONDOP(0, yyvsp[-3].opval, scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; +case 22: +#line 183 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newCONDOP(0, + invert(scalar(yyvsp[-3].opval)), scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; +case 23: +#line 187 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newCONDOP(0, scope(yyvsp[-2].opval), scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; +case 24: +#line 190 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newCONDOP(0, invert(scalar(scope(yyvsp[-2].opval))), + scope(yyvsp[-1].opval), yyvsp[0].opval); } +break; +case 25: +#line 196 "perly.y" +{ yyval.opval = Nullop; } +break; +case 26: +#line 198 "perly.y" +{ yyval.opval = scope(yyvsp[0].opval); } +break; +case 27: +#line 202 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newSTATEOP(0, yyvsp[-6].pval, + newWHILEOP(0, 1, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval) ); } +break; +case 28: +#line 206 "perly.y" +{ copline = yyvsp[-5].ival; + yyval.opval = newSTATEOP(0, yyvsp[-6].pval, + newWHILEOP(0, 1, Nullop, + invert(scalar(yyvsp[-3].opval)), yyvsp[-1].opval, yyvsp[0].opval) ); } +break; +case 29: +#line 211 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newSTATEOP(0, yyvsp[-4].pval, + newWHILEOP(0, 1, Nullop, + scope(yyvsp[-2].opval), yyvsp[-1].opval, yyvsp[0].opval) ); } +break; +case 30: +#line 216 "perly.y" +{ copline = yyvsp[-3].ival; + yyval.opval = newSTATEOP(0, yyvsp[-4].pval, + newWHILEOP(0, 1, Nullop, + invert(scalar(scope(yyvsp[-2].opval))), yyvsp[-1].opval, yyvsp[0].opval)); } +break; +case 31: +#line 221 "perly.y" +{ yyval.opval = newFOROP(0, yyvsp[-7].pval, yyvsp[-6].ival, ref(yyvsp[-5].opval, OP_ENTERLOOP), + yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval); } +break; +case 32: +#line 224 "perly.y" +{ yyval.opval = newFOROP(0, yyvsp[-6].pval, yyvsp[-5].ival, Nullop, yyvsp[-3].opval, yyvsp[-1].opval, yyvsp[0].opval); } +break; +case 33: +#line 227 "perly.y" +{ copline = yyvsp[-8].ival; + yyval.opval = append_elem(OP_LINESEQ, + newSTATEOP(0, yyvsp[-9].pval, scalar(yyvsp[-6].opval)), + newSTATEOP(0, yyvsp[-9].pval, + newWHILEOP(0, 1, Nullop, + scalar(yyvsp[-4].opval), yyvsp[0].opval, scalar(yyvsp[-2].opval)) )); } +break; +case 34: +#line 234 "perly.y" +{ yyval.opval = newSTATEOP(0, + yyvsp[-2].pval, newWHILEOP(0, 1, Nullop, Nullop, yyvsp[-1].opval, yyvsp[0].opval)); } +break; +case 35: +#line 239 "perly.y" +{ yyval.opval = Nullop; } +break; +case 37: +#line 244 "perly.y" +{ (void)scan_num("1"); yyval.opval = yylval.opval; } +break; +case 39: +#line 249 "perly.y" +{ yyval.pval = Nullch; } +break; +case 41: +#line 254 "perly.y" +{ yyval.ival = 0; } +break; +case 42: +#line 256 "perly.y" +{ yyval.ival = 0; } +break; +case 43: +#line 258 "perly.y" +{ yyval.ival = 0; } +break; +case 44: +#line 262 "perly.y" +{ newFORM(yyvsp[-2].ival, yyvsp[-1].opval, yyvsp[0].opval); } +break; +case 45: +#line 264 "perly.y" +{ newFORM(yyvsp[-1].ival, Nullop, yyvsp[0].opval); } +break; +case 46: +#line 268 "perly.y" +{ newSUB(yyvsp[-2].ival, yyvsp[-1].opval, yyvsp[0].opval); } +break; +case 47: +#line 272 "perly.y" +{ package(yyvsp[-1].opval); } +break; +case 48: +#line 274 "perly.y" +{ package(Nullop); } +break; +case 49: +#line 278 "perly.y" +{ yyval.opval = append_elem(OP_LIST, yyvsp[-2].opval, yyvsp[0].opval); } +break; +case 51: +#line 283 "perly.y" +{ yyval.opval = convert(yyvsp[-2].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-1].opval), yyvsp[0].opval) ); } +break; +case 52: +#line 286 "perly.y" +{ yyval.opval = convert(yyvsp[-4].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-2].opval), yyvsp[-1].opval) ); } +break; +case 53: +#line 289 "perly.y" +{ yyval.opval = convert(yyvsp[-1].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-3].opval), yyvsp[0].opval) ); } +break; +case 54: +#line 292 "perly.y" +{ yyval.opval = convert(yyvsp[-3].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yyvsp[-5].opval), yyvsp[-1].opval) ); } +break; +case 55: +#line 295 "perly.y" +{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, + prepend_elem(OP_LIST, newMETHOD(yyvsp[-5].opval,yyvsp[-3].opval), yyvsp[-1].opval)); } +break; +case 56: +#line 298 "perly.y" +{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, + prepend_elem(OP_LIST, newMETHOD(yyvsp[-1].opval,yyvsp[-2].opval), yyvsp[0].opval)); } +break; +case 57: +#line 301 "perly.y" +{ yyval.opval = convert(yyvsp[-1].ival, 0, yyvsp[0].opval); } +break; +case 58: +#line 303 "perly.y" +{ yyval.opval = convert(yyvsp[-3].ival, 0, yyvsp[-1].opval); } +break; +case 59: +#line 307 "perly.y" +{ yyval.opval = newASSIGNOP(OPf_STACKED, yyvsp[-2].opval, yyvsp[0].opval); } +break; +case 60: +#line 309 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; +case 61: +#line 312 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; +case 62: +#line 315 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval));} +break; +case 63: +#line 318 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; +case 64: +#line 321 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; +case 65: +#line 324 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-2].ival, OPf_STACKED, + ref(scalar(yyvsp[-3].opval), yyvsp[-2].ival), scalar(yyvsp[0].opval)); } +break; +case 66: +#line 327 "perly.y" +{ yyval.opval = newLOGOP(OP_ANDASSIGN, 0, + ref(scalar(yyvsp[-3].opval), OP_ANDASSIGN), + newUNOP(OP_SASSIGN, 0, scalar(yyvsp[0].opval))); } +break; +case 67: +#line 331 "perly.y" +{ yyval.opval = newLOGOP(OP_ORASSIGN, 0, + ref(scalar(yyvsp[-3].opval), OP_ORASSIGN), + newUNOP(OP_SASSIGN, 0, scalar(yyvsp[0].opval))); } +break; +case 68: +#line 337 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; +case 69: +#line 339 "perly.y" +{ if (yyvsp[-1].ival != OP_REPEAT) + scalar(yyvsp[-2].opval); + yyval.opval = newBINOP(yyvsp[-1].ival, 0, yyvsp[-2].opval, scalar(yyvsp[0].opval)); } +break; +case 70: +#line 343 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; +case 71: +#line 345 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; +case 72: +#line 347 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; +case 73: +#line 349 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; +case 74: +#line 351 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; +case 75: +#line 353 "perly.y" +{ yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } +break; +case 76: +#line 355 "perly.y" +{ yyval.opval = newRANGE(yyvsp[-1].ival, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval));} +break; +case 77: +#line 357 "perly.y" +{ yyval.opval = newLOGOP(OP_AND, 0, yyvsp[-2].opval, yyvsp[0].opval); } +break; +case 78: +#line 359 "perly.y" +{ yyval.opval = newLOGOP(OP_OR, 0, yyvsp[-2].opval, yyvsp[0].opval); } +break; +case 79: +#line 361 "perly.y" +{ yyval.opval = newCONDOP(0, yyvsp[-4].opval, yyvsp[-2].opval, yyvsp[0].opval); } +break; +case 80: +#line 363 "perly.y" +{ yyval.opval = bind_match(yyvsp[-1].ival, yyvsp[-2].opval, yyvsp[0].opval); } +break; +case 81: +#line 365 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 82: +#line 369 "perly.y" +{ yyval.opval = newUNOP(OP_NEGATE, 0, scalar(yyvsp[0].opval)); } +break; +case 83: +#line 371 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 84: +#line 373 "perly.y" +{ yyval.opval = newUNOP(OP_NOT, 0, scalar(yyvsp[0].opval)); } +break; +case 85: +#line 375 "perly.y" +{ yyval.opval = newUNOP(OP_COMPLEMENT, 0, scalar(yyvsp[0].opval));} +break; +case 86: +#line 377 "perly.y" +{ yyval.opval = newUNOP(OP_REFGEN, 0, ref(yyvsp[0].opval, OP_REFGEN)); } +break; +case 87: +#line 379 "perly.y" +{ yyval.opval = newUNOP(OP_POSTINC, 0, + ref(scalar(yyvsp[-1].opval), OP_POSTINC)); } +break; +case 88: +#line 382 "perly.y" +{ yyval.opval = newUNOP(OP_POSTDEC, 0, + ref(scalar(yyvsp[-1].opval), OP_POSTDEC)); } +break; +case 89: +#line 385 "perly.y" +{ yyval.opval = newUNOP(OP_PREINC, 0, + ref(scalar(yyvsp[0].opval), OP_PREINC)); } +break; +case 90: +#line 388 "perly.y" +{ yyval.opval = newUNOP(OP_PREDEC, 0, + ref(scalar(yyvsp[0].opval), OP_PREDEC)); } +break; +case 91: +#line 391 "perly.y" +{ yyval.opval = localize(yyvsp[0].opval,yyvsp[-1].ival); } +break; +case 92: +#line 393 "perly.y" +{ yyval.opval = sawparens(yyvsp[-1].opval); } +break; +case 93: +#line 395 "perly.y" +{ yyval.opval = newNULLLIST(); } +break; +case 94: +#line 397 "perly.y" +{ yyval.opval = newANONLIST(yyvsp[-1].opval); } +break; +case 95: +#line 399 "perly.y" +{ yyval.opval = newANONLIST(Nullop); } +break; +case 96: +#line 401 "perly.y" +{ yyval.opval = newANONHASH(yyvsp[-1].opval); } +break; +case 97: +#line 403 "perly.y" +{ yyval.opval = newANONHASH(Nullop); } +break; +case 98: +#line 405 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 99: +#line 407 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 100: +#line 409 "perly.y" +{ yyval.opval = newBINOP(OP_AELEM, 0, oopsAV(yyvsp[-3].opval), scalar(yyvsp[-1].opval)); } +break; +case 101: +#line 411 "perly.y" +{ yyval.opval = newBINOP(OP_AELEM, 0, + scalar(ref(newAVREF(yyvsp[-4].opval),OP_RV2AV)), + scalar(yyvsp[-1].opval));} +break; +case 102: +#line 415 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 103: +#line 417 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 104: +#line 419 "perly.y" +{ yyval.opval = newUNOP(OP_AV2ARYLEN, 0, ref(yyvsp[0].opval, OP_AV2ARYLEN));} +break; +case 105: +#line 421 "perly.y" +{ yyval.opval = newBINOP(OP_HELEM, 0, oopsHV(yyvsp[-4].opval), jmaybe(yyvsp[-2].opval)); + expect = XOPERATOR; } +break; +case 106: +#line 424 "perly.y" +{ yyval.opval = newBINOP(OP_HELEM, 0, + scalar(ref(newHVREF(yyvsp[-5].opval),OP_RV2HV)), + jmaybe(yyvsp[-2].opval)); + expect = XOPERATOR; } +break; +case 107: +#line 429 "perly.y" +{ yyval.opval = newSLICEOP(0, yyvsp[-1].opval, yyvsp[-4].opval); } +break; +case 108: +#line 431 "perly.y" +{ yyval.opval = newSLICEOP(0, yyvsp[-1].opval, Nullop); } +break; +case 109: +#line 433 "perly.y" +{ yyval.opval = prepend_elem(OP_ASLICE, + newOP(OP_PUSHMARK, 0), + list( + newLISTOP(OP_ASLICE, 0, + list(yyvsp[-1].opval), + ref(yyvsp[-3].opval, OP_ASLICE)))); } +break; +case 110: +#line 440 "perly.y" +{ yyval.opval = prepend_elem(OP_HSLICE, + newOP(OP_PUSHMARK, 0), + list( + newLISTOP(OP_HSLICE, 0, + list(yyvsp[-2].opval), + ref(oopsHV(yyvsp[-4].opval), OP_HSLICE)))); + expect = XOPERATOR; } +break; +case 111: +#line 448 "perly.y" +{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yyvsp[-4].opval), jmaybe(yyvsp[-2].opval)); + expect = XOPERATOR; } +break; +case 112: +#line 451 "perly.y" +{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yyvsp[-5].opval), jmaybe(yyvsp[-3].opval)); + expect = XOPERATOR; } +break; +case 113: +#line 454 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 114: +#line 456 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, 0, + scalar(yyvsp[0].opval)); } +break; +case 115: +#line 459 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, scalar(yyvsp[-2].opval)); } +break; +case 116: +#line 461 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, + list(prepend_elem(OP_LIST, scalar(yyvsp[-3].opval), yyvsp[-1].opval))); } +break; +case 117: +#line 464 "perly.y" +{ yyval.opval = newUNOP(OP_DOFILE, 0, scalar(yyvsp[0].opval)); + allgvs = TRUE;} +break; +case 118: +#line 467 "perly.y" +{ yyval.opval = newUNOP(OP_NULL, OPf_SPECIAL, scope(yyvsp[0].opval)); } +break; +case 119: +#line 469 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yyvsp[-2].opval))), newNULLLIST()))); } +break; +case 120: +#line 473 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yyvsp[-3].opval))), + yyvsp[-1].opval))); } +break; +case 121: +#line 478 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yyvsp[-2].opval))), newNULLLIST())));} +break; +case 122: +#line 482 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yyvsp[-3].opval))), + yyvsp[-1].opval))); } +break; +case 123: +#line 487 "perly.y" +{ yyval.opval = newOP(yyvsp[0].ival, OPf_SPECIAL); } +break; +case 124: +#line 489 "perly.y" +{ yyval.opval = newPVOP(yyvsp[-1].ival, 0, + savestr(SvPVnx(((SVOP*)yyvsp[0].opval)->op_sv))); + op_free(yyvsp[0].opval); } +break; +case 125: +#line 493 "perly.y" +{ yyval.opval = newOP(yyvsp[0].ival, 0); } +break; +case 126: +#line 495 "perly.y" +{ yyval.opval = newUNOP(yyvsp[-1].ival, 0, yyvsp[0].opval); } +break; +case 127: +#line 497 "perly.y" +{ yyval.opval = newUNOP(yyvsp[-1].ival, 0, yyvsp[0].opval); } +break; +case 128: +#line 499 "perly.y" +{ yyval.opval = newOP(yyvsp[0].ival, 0); } +break; +case 129: +#line 501 "perly.y" +{ yyval.opval = newOP(yyvsp[-2].ival, 0); } +break; +case 130: +#line 503 "perly.y" +{ yyval.opval = newOP(yyvsp[-2].ival, OPf_SPECIAL); } +break; +case 131: +#line 505 "perly.y" +{ yyval.opval = newUNOP(yyvsp[-3].ival, 0, yyvsp[-1].opval); } +break; +case 132: +#line 507 "perly.y" +{ yyval.opval = pmruntime(yyvsp[-3].opval, yyvsp[-1].opval, Nullop); } +break; +case 133: +#line 509 "perly.y" +{ yyval.opval = pmruntime(yyvsp[-5].opval, yyvsp[-3].opval, yyvsp[-1].opval); } +break; +case 136: +#line 515 "perly.y" +{ yyval.opval = newNULLLIST(); } +break; +case 137: +#line 517 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 138: +#line 521 "perly.y" +{ yyval.opval = newCVREF(yyvsp[0].opval); } +break; +case 139: +#line 525 "perly.y" +{ yyval.opval = newSVREF(yyvsp[0].opval); } +break; +case 140: +#line 529 "perly.y" +{ yyval.opval = newAVREF(yyvsp[0].opval); } +break; +case 141: +#line 533 "perly.y" +{ yyval.opval = newHVREF(yyvsp[0].opval); } +break; +case 142: +#line 537 "perly.y" +{ yyval.opval = newAVREF(yyvsp[0].opval); } +break; +case 143: +#line 541 "perly.y" +{ yyval.opval = newGVREF(yyvsp[0].opval); } +break; +case 144: +#line 545 "perly.y" +{ yyval.opval = scalar(yyvsp[0].opval); } +break; +case 145: +#line 547 "perly.y" +{ yyval.opval = scalar(yyvsp[0].opval); } +break; +case 146: +#line 549 "perly.y" +{ yyval.opval = scalar(scope(yyvsp[0].opval)); } +break; +case 147: +#line 552 "perly.y" +{ yyval.opval = yyvsp[0].opval; } +break; +case 148: +#line 556 "perly.y" +{ yyval.ival = 1; } +break; +case 149: +#line 558 "perly.y" +{ yyval.ival = 0; } +break; +case 150: +#line 562 "perly.y" +{ yyval.ival = 1; } +break; +case 151: +#line 564 "perly.y" +{ yyval.ival = 0; } +break; +case 152: +#line 568 "perly.y" +{ yyval.ival = 1; } +break; +case 153: +#line 570 "perly.y" +{ yyval.ival = 0; } +break; +#line 2240 "y.tab.c" + } + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("yydebug: after reduction, shifting from state 0 to\ + state %d\n", YYFINAL); +#endif + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("yydebug: state %d, reading %d (%s)\n", + YYFINAL, yychar, yys); + } +#endif + } + if (yychar == 0) goto yyaccept; + goto yyloop; + } + if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("yydebug: after reduction, shifting from state %d \ +to state %d\n", *yyssp, yystate); +#endif + if (yyssp >= yyss + yystacksize - 1) + { + goto yyoverflow; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; +yyoverflow: + yyerror("yacc stack overflow"); +yyabort: + return (1); +yyaccept: + return (0); +} diff --git a/perly.c.diff b/perly.c.diff new file mode 100644 index 0000000000..06a8b6ca1e --- /dev/null +++ b/perly.c.diff @@ -0,0 +1,170 @@ +*** perly.c.byacc Tue Oct 5 15:44:31 1993 +--- perly.c Tue Oct 5 16:23:53 1993 +*************** +*** 1396,1408 **** + int yynerrs; + int yyerrflag; + int yychar; +- short *yyssp; +- YYSTYPE *yyvsp; + YYSTYPE yyval; + YYSTYPE yylval; +- short yyss[YYSTACKSIZE]; +- YYSTYPE yyvs[YYSTACKSIZE]; +- #define yystacksize YYSTACKSIZE + #line 573 "perly.y" + /* PROGRAM */ + #line 1409 "y.tab.c" +--- 1396,1403 ---- +*************** +*** 1413,1418 **** +--- 1408,1426 ---- + yyparse() + { + register int yym, yyn, yystate; ++ register short *yyssp; ++ register YYSTYPE *yyvsp; ++ short* yyss; ++ YYSTYPE* yyvs; ++ unsigned yystacksize = YYSTACKSIZE; ++ int oldyydebug = yydebug; ++ int oldyynerrs = yynerrs; ++ int oldyyerrflag = yyerrflag; ++ int oldyychar = yychar; ++ YYSTYPE oldyyval = yyval; ++ YYSTYPE oldyylval = yylval; ++ int retval = 0; ++ + #if YYDEBUG + register char *yys; + extern char *getenv(); +*************** +*** 1429,1434 **** +--- 1437,1450 ---- + yyerrflag = 0; + yychar = (-1); + ++ /* ++ ** Initialize private stacks (yyparse may be called from an action) ++ */ ++ yyss = (short*)malloc(yystacksize*sizeof(short)); ++ yyvs = (YYSTYPE*)malloc(yystacksize*sizeof(YYSTYPE)); ++ if (!yyvs || !yyss) ++ goto yyoverflow; ++ + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; +*************** +*** 1459,1465 **** + #endif + if (yyssp >= yyss + yystacksize - 1) + { +! goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; +--- 1475,1493 ---- + #endif + if (yyssp >= yyss + yystacksize - 1) + { +! /* +! ** reallocate and recover. Note that pointers +! ** have to be reset, or bad things will happen +! */ +! int yyps_index = (yyssp - yyss); +! int yypv_index = (yyvsp - yyvs); +! yystacksize += YYSTACKSIZE; +! yyvs = (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE)); +! yyss = (short*)realloc((char*)yyss,yystacksize * sizeof(short)); +! if (!yyvs || !yyss) +! goto yyoverflow; +! yyssp = yyss + yyps_index; +! yyvsp = yyvs + yypv_index; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; +*************** +*** 1500,1506 **** + #endif + if (yyssp >= yyss + yystacksize - 1) + { +! goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; +--- 1528,1548 ---- + #endif + if (yyssp >= yyss + yystacksize - 1) + { +! /* +! ** reallocate and recover. Note that pointers +! ** have to be reset, or bad things will happen +! */ +! int yyps_index = (yyssp - yyss); +! int yypv_index = (yyvsp - yyvs); +! yystacksize += YYSTACKSIZE; +! yyvs = (YYSTYPE*)realloc((char*)yyvs, +! yystacksize * sizeof(YYSTYPE)); +! yyss = (short*)realloc((char*)yyss, +! yystacksize * sizeof(short)); +! if (!yyvs || !yyss) +! goto yyoverflow; +! yyssp = yyss + yyps_index; +! yyvsp = yyvs + yypv_index; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; +*************** +*** 2281,2295 **** + #endif + if (yyssp >= yyss + yystacksize - 1) + { +! goto yyoverflow; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; + yyoverflow: +! yyerror("yacc stack overflow"); + yyabort: +! return (1); + yyaccept: +! return (0); + } +--- 2323,2357 ---- + #endif + if (yyssp >= yyss + yystacksize - 1) + { +! /* +! ** reallocate and recover. Note that pointers +! ** have to be reset, or bad things will happen +! */ +! int yyps_index = (yyssp - yyss); +! int yypv_index = (yyvsp - yyvs); +! yystacksize += YYSTACKSIZE; +! yyvs = (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE)); +! yyss = (short*)realloc((char*)yyss,yystacksize * sizeof(short)); +! if (!yyvs || !yyss) +! goto yyoverflow; +! yyssp = yyss + yyps_index; +! yyvsp = yyvs + yypv_index; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; + yyoverflow: +! yyerror("Out of memory for yacc stack"); + yyabort: +! retval = 1; + yyaccept: +! if (yyss) free(yyss); +! if (yyvs) free(yyvs); +! yydebug = oldyydebug; +! yynerrs = oldyynerrs; +! yyerrflag = oldyyerrflag; +! yychar = oldyychar; +! yyval = oldyyval; +! yylval = oldyylval; +! return retval; + } diff --git a/perly.c.yacc b/perly.c.yacc new file mode 100644 index 0000000000..f1f410ac5f --- /dev/null +++ b/perly.c.yacc @@ -0,0 +1,1767 @@ +extern char *malloc(), *realloc(); + +# line 39 "perly.y" +#include "EXTERN.h" +#include "perl.h" + +/*SUPPRESS 530*/ +/*SUPPRESS 593*/ +/*SUPPRESS 595*/ + + +# line 50 "perly.y" +typedef union { + I32 ival; + char *pval; + OP *opval; + GV *gvval; +} YYSTYPE; +# define WORD 257 +# define METHOD 258 +# define THING 259 +# define PMFUNC 260 +# define PRIVATEREF 261 +# define LABEL 262 +# define FORMAT 263 +# define SUB 264 +# define PACKAGE 265 +# define WHILE 266 +# define UNTIL 267 +# define IF 268 +# define UNLESS 269 +# define ELSE 270 +# define ELSIF 271 +# define CONTINUE 272 +# define FOR 273 +# define LOOPEX 274 +# define DOTDOT 275 +# define FUNC0 276 +# define FUNC1 277 +# define FUNC 278 +# define RELOP 279 +# define EQOP 280 +# define MULOP 281 +# define ADDOP 282 +# define DOLSHARP 283 +# define DO 284 +# define LOCAL 285 +# define DELETE 286 +# define HASHBRACK 287 +# define LSTOP 288 +# define OROR 289 +# define ANDAND 290 +# define BITOROP 291 +# define BITANDOP 292 +# define UNIOP 293 +# define SHIFTOP 294 +# define MATCHOP 295 +# define ARROW 296 +# define UMINUS 297 +# define REFGEN 298 +# define POWOP 299 +# define PREINC 300 +# define PREDEC 301 +# define POSTINC 302 +# define POSTDEC 303 +#define yyclearin yychar = -1 +#define yyerrok yyerrflag = 0 +extern int yychar; +extern int yyerrflag; +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 150 +#endif +YYSTYPE yylval, yyval; +# define YYERRCODE 256 + +# line 573 "perly.y" + /* PROGRAM */ +int yyexca[] ={ +-1, 1, + 0, -1, + -2, 0, +-1, 3, + 0, 2, + -2, 39, +-1, 21, + 296, 146, + -2, 25, +-1, 40, + 41, 98, + 266, 98, + 267, 98, + 268, 98, + 269, 98, + 275, 98, + 279, 98, + 280, 98, + 281, 98, + 282, 98, + 44, 98, + 61, 98, + 63, 98, + 58, 98, + 289, 98, + 290, 98, + 291, 98, + 292, 98, + 294, 98, + 295, 98, + 296, 98, + 299, 98, + 302, 98, + 303, 98, + 59, 98, + 93, 98, + -2, 145, +-1, 54, + 41, 134, + 266, 134, + 267, 134, + 268, 134, + 269, 134, + 275, 134, + 279, 134, + 280, 134, + 281, 134, + 282, 134, + 44, 134, + 61, 134, + 63, 134, + 58, 134, + 289, 134, + 290, 134, + 291, 134, + 292, 134, + 294, 134, + 295, 134, + 296, 134, + 299, 134, + 302, 134, + 303, 134, + 59, 134, + 93, 134, + -2, 144, +-1, 78, + 59, 35, + -2, 0, +-1, 114, + 302, 0, + 303, 0, + -2, 89, +-1, 115, + 302, 0, + 303, 0, + -2, 90, +-1, 194, + 279, 0, + -2, 72, +-1, 195, + 280, 0, + -2, 73, +-1, 196, + 275, 0, + -2, 76, +-1, 312, + 41, 35, + -2, 0, + }; +# define YYNPROD 154 +# define YYLAST 2319 +int yyact[]={ + + 109, 106, 107, 164, 92, 104, 231, 105, 150, 92, + 21, 241, 68, 106, 107, 152, 230, 80, 25, 74, + 76, 242, 243, 82, 84, 56, 26, 93, 94, 326, + 31, 319, 134, 56, 58, 61, 69, 37, 157, 57, + 30, 104, 29, 317, 300, 92, 117, 119, 121, 131, + 246, 135, 299, 93, 94, 93, 16, 298, 79, 125, + 264, 59, 14, 11, 12, 13, 95, 104, 154, 104, + 155, 92, 212, 92, 71, 159, 123, 161, 83, 81, + 75, 166, 158, 168, 160, 170, 26, 163, 38, 270, + 167, 126, 169, 200, 171, 172, 173, 174, 217, 260, + 73, 205, 222, 312, 239, 156, 31, 89, 124, 56, + 58, 61, 26, 37, 89, 57, 30, 3, 29, 89, + 26, 89, 89, 32, 72, 201, 89, 329, 100, 101, + 93, 94, 213, 214, 215, 216, 327, 59, 220, 100, + 101, 93, 94, 95, 104, 322, 89, 225, 92, 99, + 98, 97, 96, 123, 95, 104, 318, 316, 306, 92, + 67, 26, 26, 26, 38, 89, 280, 233, 297, 31, + 294, 237, 56, 58, 61, 267, 37, 290, 57, 30, + 320, 29, 245, 26, 223, 124, 89, 14, 11, 12, + 13, 100, 101, 93, 94, 265, 26, 282, 256, 32, + 59, 301, 98, 97, 96, 221, 95, 104, 176, 257, + 258, 92, 206, 100, 261, 93, 94, 89, 234, 162, + 236, 151, 100, 101, 93, 94, 269, 38, 95, 104, + 273, 275, 295, 92, 283, 96, 284, 95, 104, 286, + 139, 288, 92, 289, 204, 291, 141, 202, 158, 138, + 66, 137, 89, 24, 54, 65, 46, 53, 66, 26, + 199, 208, 32, 18, 19, 22, 23, 268, 129, 296, + 20, 49, 70, 51, 52, 63, 149, 89, 287, 302, + 60, 48, 36, 45, 39, 62, 310, 209, 325, 56, + 50, 89, 266, 203, 8, 33, 7, 34, 35, 314, + 313, 204, 211, 315, 202, 276, 244, 56, 89, 89, + 31, 128, 2, 56, 58, 61, 324, 37, 274, 57, + 30, 25, 29, 9, 240, 165, 328, 89, 330, 24, + 54, 65, 46, 53, 66, 17, 87, 88, 85, 86, + 331, 59, 308, 309, 56, 311, 55, 49, 78, 51, + 52, 63, 235, 47, 41, 89, 60, 48, 36, 45, + 39, 62, 44, 42, 43, 15, 50, 10, 38, 323, + 5, 33, 210, 34, 35, 31, 207, 90, 56, 58, + 61, 6, 37, 272, 57, 30, 4, 29, 1, 100, + 101, 93, 94, 54, 65, 46, 53, 66, 0, 0, + 26, 97, 96, 32, 95, 104, 59, 0, 0, 92, + 49, 0, 51, 52, 63, 0, 0, 0, 28, 60, + 48, 36, 45, 39, 62, 227, 0, 0, 229, 50, + 232, 0, 152, 38, 33, 31, 34, 35, 56, 58, + 61, 0, 37, 0, 57, 30, 0, 29, 108, 110, + 111, 112, 113, 114, 115, 0, 0, 238, 64, 0, + 0, 263, 0, 0, 0, 26, 59, 0, 32, 87, + 88, 85, 86, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 31, 38, 0, 56, 58, 61, 0, 37, + 0, 57, 30, 0, 29, 279, 0, 281, 0, 0, + 0, 0, 0, 0, 271, 140, 143, 144, 145, 146, + 147, 148, 0, 59, 153, 26, 0, 0, 32, 0, + 0, 285, 0, 293, 54, 65, 46, 53, 66, 0, + 0, 0, 0, 0, 0, 0, 277, 0, 0, 278, + 38, 49, 262, 51, 52, 63, 0, 0, 0, 307, + 60, 48, 36, 45, 39, 62, 91, 303, 103, 304, + 50, 0, 0, 0, 0, 33, 0, 34, 35, 0, + 0, 0, 26, 0, 0, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, + 65, 46, 53, 66, 0, 0, 0, 0, 0, 0, + 228, 0, 0, 0, 0, 0, 49, 0, 51, 52, + 63, 0, 0, 0, 0, 60, 48, 36, 45, 39, + 62, 0, 0, 0, 0, 50, 0, 0, 0, 0, + 33, 31, 34, 35, 56, 58, 61, 40, 37, 259, + 57, 30, 0, 29, 0, 0, 0, 0, 0, 54, + 65, 46, 53, 66, 0, 0, 0, 0, 77, 0, + 0, 0, 59, 0, 0, 0, 49, 0, 51, 52, + 63, 0, 0, 0, 0, 60, 48, 36, 45, 39, + 62, 0, 0, 127, 0, 50, 133, 0, 0, 38, + 33, 0, 34, 35, 142, 142, 142, 142, 142, 142, + 0, 0, 0, 142, 0, 0, 54, 65, 46, 53, + 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 26, 0, 49, 32, 51, 52, 63, 0, 103, + 0, 0, 60, 48, 36, 45, 39, 62, 0, 0, + 0, 0, 50, 0, 0, 0, 0, 33, 31, 34, + 35, 56, 58, 61, 0, 37, 224, 57, 30, 0, + 29, 0, 0, 0, 0, 0, 218, 0, 0, 0, + 102, 0, 0, 0, 100, 101, 93, 94, 0, 59, + 0, 0, 0, 0, 99, 98, 97, 96, 0, 95, + 104, 0, 0, 0, 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 31, 0, 38, 56, 58, 61, + 0, 37, 219, 57, 30, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 59, 0, 0, 26, 0, + 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 54, 65, 46, 53, 66, + 0, 31, 38, 0, 56, 58, 61, 0, 37, 0, + 57, 30, 49, 29, 51, 52, 63, 0, 0, 0, + 0, 60, 48, 36, 45, 39, 62, 0, 0, 192, + 0, 50, 59, 0, 26, 0, 33, 32, 34, 35, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, + 0, 31, 0, 0, 56, 58, 61, 0, 37, 0, + 57, 30, 0, 29, 0, 0, 0, 0, 0, 0, + 0, 102, 0, 0, 321, 100, 101, 93, 94, 190, + 0, 26, 59, 0, 32, 99, 98, 97, 96, 0, + 95, 104, 0, 0, 91, 92, 103, 0, 0, 0, + 0, 0, 54, 65, 46, 53, 66, 0, 0, 38, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, + 0, 51, 52, 63, 0, 0, 0, 0, 60, 48, + 36, 45, 39, 62, 0, 0, 0, 255, 50, 0, + 91, 26, 103, 33, 32, 34, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 54, 65, + 46, 53, 66, 0, 31, 0, 0, 56, 58, 61, + 0, 37, 0, 57, 30, 49, 29, 51, 52, 63, + 0, 0, 0, 0, 60, 48, 36, 45, 39, 62, + 0, 0, 188, 0, 50, 59, 0, 0, 0, 33, + 0, 34, 35, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 54, 65, 46, 53, 66, + 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 49, 0, 51, 52, 63, 91, 0, 103, + 0, 60, 48, 36, 45, 39, 62, 0, 0, 0, + 0, 50, 0, 0, 26, 0, 33, 32, 34, 35, + 0, 0, 31, 0, 0, 56, 58, 61, 0, 37, + 0, 57, 30, 0, 29, 54, 65, 46, 53, 66, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 186, 0, 49, 59, 51, 52, 63, 0, 0, 0, + 0, 60, 48, 36, 45, 39, 62, 0, 102, 0, + 0, 50, 100, 101, 93, 94, 33, 0, 34, 35, + 38, 0, 99, 98, 97, 96, 0, 95, 104, 0, + 0, 0, 92, 0, 0, 31, 0, 0, 56, 58, + 61, 0, 37, 0, 57, 30, 0, 29, 0, 0, + 0, 0, 26, 0, 102, 32, 0, 0, 100, 101, + 93, 94, 0, 184, 0, 0, 59, 0, 99, 98, + 97, 96, 0, 95, 104, 0, 0, 0, 92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 54, 65, + 46, 53, 66, 38, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 49, 0, 51, 52, 63, + 0, 0, 0, 0, 60, 48, 36, 45, 39, 62, + 0, 0, 0, 0, 50, 26, 0, 0, 32, 33, + 0, 34, 35, 31, 0, 0, 56, 58, 61, 0, + 37, 0, 57, 30, 0, 29, 0, 0, 0, 0, + 0, 102, 0, 0, 0, 100, 101, 93, 94, 0, + 0, 182, 0, 0, 59, 99, 98, 97, 96, 0, + 95, 104, 0, 0, 0, 92, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 54, 65, 46, 53, + 66, 38, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 49, 0, 51, 52, 63, 0, 0, + 0, 0, 60, 48, 36, 45, 39, 62, 0, 0, + 0, 0, 50, 26, 0, 0, 32, 33, 0, 34, + 35, 0, 0, 0, 0, 0, 31, 0, 0, 56, + 58, 61, 0, 37, 0, 57, 30, 0, 29, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, + 65, 46, 53, 66, 180, 0, 0, 59, 0, 0, + 0, 0, 0, 0, 0, 0, 49, 0, 51, 52, + 63, 0, 0, 0, 0, 60, 48, 36, 45, 39, + 62, 0, 0, 0, 38, 50, 0, 0, 0, 0, + 33, 0, 34, 35, 31, 0, 0, 56, 58, 61, + 0, 37, 0, 57, 30, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 26, 0, 0, 32, + 0, 0, 178, 0, 0, 59, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 54, 65, 46, + 53, 66, 38, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 0, 51, 52, 63, 0, + 0, 0, 0, 60, 48, 36, 45, 39, 62, 0, + 0, 0, 0, 50, 26, 0, 0, 32, 33, 0, + 34, 35, 0, 0, 0, 0, 0, 31, 0, 0, + 56, 58, 61, 0, 37, 0, 57, 30, 0, 29, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 122, 0, 0, 0, 0, 59, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 54, 65, 46, 53, 66, 38, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 49, 0, 51, + 52, 63, 0, 0, 0, 0, 60, 48, 36, 45, + 39, 62, 0, 0, 0, 0, 50, 26, 0, 0, + 32, 33, 31, 34, 35, 56, 58, 61, 0, 37, + 0, 57, 30, 0, 29, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 54, 65, + 46, 53, 66, 59, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 49, 0, 51, 52, 63, + 0, 0, 0, 0, 60, 48, 36, 45, 39, 62, + 38, 0, 120, 0, 50, 0, 0, 0, 0, 33, + 0, 34, 35, 0, 0, 0, 0, 0, 31, 0, + 0, 56, 58, 61, 0, 37, 118, 57, 30, 0, + 29, 0, 26, 0, 0, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 54, 65, 46, 53, 66, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, + 51, 52, 63, 0, 0, 0, 0, 60, 48, 36, + 45, 39, 62, 0, 0, 0, 0, 50, 26, 0, + 0, 32, 33, 31, 34, 35, 56, 58, 61, 0, + 37, 0, 57, 30, 0, 29, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 54, 65, 46, 53, + 66, 38, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 49, 0, 51, 52, 63, 0, 0, + 0, 0, 60, 48, 36, 45, 39, 62, 0, 0, + 0, 0, 50, 26, 0, 0, 32, 33, 31, 34, + 35, 56, 58, 61, 0, 37, 0, 57, 30, 0, + 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, + 0, 0, 54, 65, 46, 53, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, + 0, 51, 52, 63, 0, 0, 38, 0, 60, 48, + 36, 45, 39, 62, 0, 0, 0, 0, 50, 0, + 0, 0, 0, 33, 0, 34, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, + 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 116, 54, 65, 46, + 53, 66, 0, 0, 0, 0, 0, 0, 130, 0, + 136, 0, 0, 0, 49, 0, 51, 52, 63, 0, + 0, 0, 0, 60, 48, 36, 45, 39, 62, 0, + 0, 0, 0, 50, 0, 0, 0, 0, 33, 0, + 34, 35, 0, 0, 0, 0, 0, 0, 0, 175, + 0, 177, 179, 181, 183, 185, 187, 189, 191, 193, + 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 132, 65, 46, 53, 66, 0, 0, 226, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, + 0, 51, 52, 63, 0, 0, 0, 0, 60, 48, + 36, 45, 39, 62, 0, 0, 0, 0, 50, 0, + 0, 0, 0, 33, 0, 34, 35, 0, 247, 0, + 248, 0, 249, 0, 250, 0, 251, 0, 252, 0, + 253, 0, 254, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 175, 0, 0, 0, 175, 0, 0, 175, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 305 }; +int yypact[]={ + + -1000, -1000, -1000, -200, -1000, -1000, -1000, -1000, -1000, -3, + -1000, -97, -221, 15, -1000, -1000, -1000, 65, 60, 40, + 308, -255, 39, 38, -1000, 70, -1000, 1056, -289, 1820, + 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1725, 1649, 1554, + -15, -1000, -1000, -32, -1000, 271, -1000, 228, 1915, -225, + 1820, 211, 209, 200, -1000, -1000, -11, -11, -11, -11, + -11, -11, 1820, 181, -281, -11, -1000, -37, -1000, -37, + 46, -1000, -1000, 1820, -37, 1820, -37, 179, 73, -1000, + -37, 1820, -37, 1820, -37, 1820, 1820, 1820, 1820, 1820, + -1000, 1820, 1451, 1383, 1280, 1182, 1109, 1011, 898, 838, + 1820, 1820, 1820, 1820, 1820, 2, -1000, -1000, -301, -1000, + -301, -301, -301, -301, -1000, -1000, -228, 260, 10, 168, + -1000, 243, -53, 1820, 1820, 1820, 1820, -25, 253, 781, + -228, -1000, 165, 62, -1000, -1000, -228, 143, 725, 1820, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 136, -1000, + 78, 1820, -272, 1820, -1000, -1000, -1000, 126, 78, -255, + 311, -255, 1820, 203, 45, -1000, -1000, 283, -249, 265, + -249, 78, 78, 78, 78, 1056, -75, 1056, 1820, -295, + 1820, -290, 1820, -226, 1820, -254, 1820, -151, 1820, -57, + 1820, 110, 1820, -88, -228, -66, -140, 959, -295, 158, + 1820, 1820, 608, 8, -1000, 1820, 459, -1000, -1000, 402, + -1000, -65, -1000, 102, 233, 82, 208, 1820, -34, -1000, + 260, 342, 277, -1000, -1000, 264, 505, -1000, 136, 125, + 1820, 157, -1000, -37, -1000, -37, -1000, 260, -37, 1820, + -37, -1000, -37, 137, -37, -1000, -1000, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1820, 1820, 77, 173, -1000, + 1820, 75, -1000, -68, -1000, -1000, -73, -1000, -81, 142, + 1820, -1000, -1000, 260, -1000, 260, -1000, -1000, 1820, 117, + -1000, -1000, 1820, -255, -255, -37, -255, 44, -249, -1000, + 1820, -249, 676, 116, -1000, -82, 63, -1000, -1000, -1000, + -1000, -94, 121, -1000, -1000, 913, -1000, 104, -1000, -1000, + -255, -1000, 73, -1000, 247, -1000, -1000, -1000, -1000, -1000, + -96, -1000, -1000, -1000, 95, -37, 86, -37, -249, -1000, + -1000, -1000 }; +int yypgo[]={ + + 0, 388, 386, 381, 377, 293, 376, 372, 0, 117, + 370, 367, 365, 3, 11, 8, 2039, 418, 647, 364, + 363, 362, 354, 353, 325, 276, 458, 38, 346, 323, + 58, 312, 296, 294 }; +int yyr1[]={ + + 0, 31, 1, 8, 4, 9, 9, 9, 10, 10, + 10, 10, 24, 24, 24, 24, 24, 24, 14, 14, + 14, 12, 12, 12, 12, 30, 30, 11, 11, 11, + 11, 11, 11, 11, 11, 13, 13, 27, 27, 29, + 29, 2, 2, 2, 3, 3, 32, 33, 33, 15, + 15, 28, 28, 28, 28, 28, 28, 28, 28, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 25, 25, 23, 18, + 19, 20, 21, 22, 26, 26, 26, 26, 5, 5, + 6, 6, 7, 7 }; +int yyr2[]={ + + 0, 1, 5, 9, 1, 1, 5, 5, 5, 2, + 5, 7, 3, 3, 7, 7, 7, 7, 1, 5, + 13, 13, 13, 9, 9, 1, 5, 15, 15, 11, + 11, 17, 15, 21, 7, 1, 2, 1, 2, 1, + 2, 3, 3, 3, 7, 5, 7, 7, 5, 7, + 2, 7, 11, 9, 13, 13, 7, 5, 9, 7, + 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 11, + 7, 3, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 7, 5, 7, 5, 7, 7, 3, 3, + 9, 11, 3, 3, 3, 11, 13, 13, 11, 9, + 11, 13, 17, 3, 3, 7, 9, 5, 5, 9, + 11, 9, 11, 3, 5, 3, 5, 5, 3, 7, + 7, 9, 9, 13, 2, 2, 1, 3, 5, 5, + 5, 5, 5, 5, 3, 3, 3, 3, 5, 3, + 5, 3, 7, 5 }; +int yychk[]={ + + -1000, -1, -31, -9, -2, -10, -3, -32, -33, -29, + -11, 263, 264, 265, 262, -12, 59, -24, 266, 267, + 273, -8, 268, 269, 256, -15, 123, -16, -17, 45, + 43, 33, 126, 298, 300, 301, 285, 40, 91, 287, + -18, -22, -20, -19, -21, 286, 259, -23, 284, 274, + 293, 276, 277, 260, 257, -28, 36, 42, 37, 64, + 283, 38, 288, 278, -26, 258, 261, 257, -8, 257, + 257, 59, 59, 40, -8, 40, -8, -18, 40, -30, + 272, 40, -8, 40, -8, 268, 269, 266, 267, 44, + -4, 61, 299, 281, 282, 294, 292, 291, 290, 289, + 279, 280, 275, 63, 295, 296, 302, 303, -17, -8, + -17, -17, -17, -17, -17, -17, -16, -15, 41, -15, + 93, -15, 59, 91, 123, 91, 123, -18, 40, 40, + -16, -8, 257, -18, 257, -8, -16, 40, 40, 40, + -26, 257, -18, -26, -26, -26, -26, -26, -26, -25, + -15, 40, 296, -26, -8, -8, 59, -27, -15, -8, + -15, -8, 40, -15, -13, -24, -8, -15, -8, -15, + -8, -15, -15, -15, -15, -16, -9, -16, 61, -16, + 61, -16, 61, -16, 61, -16, 61, -16, 61, -16, + 61, -16, 61, -16, -16, -16, -16, -16, -16, 258, + 91, 123, 44, -5, 41, 91, 44, -6, 93, 44, + -7, 59, 125, -15, -15, -15, -15, 123, -18, 41, + -15, 40, 40, 41, 41, -15, -16, -25, -26, -25, + 288, 278, -25, 41, -30, 41, -30, -15, -5, 59, + 41, -14, 270, 271, 41, -14, 125, -16, -16, -16, + -16, -16, -16, -16, -16, 58, 40, -15, -15, 41, + 91, -15, 93, 59, 125, 93, 59, 93, 59, -15, + 123, -5, 41, -15, 41, -15, 41, 41, 44, -25, + 41, -25, 40, -8, -8, -5, -8, -27, -8, -8, + 40, -8, -16, -25, 93, 59, -15, 93, 125, 125, + 125, 59, -15, -5, -5, -16, 41, -25, -30, -30, + -8, -30, 59, -14, -15, -14, 41, 125, 93, 125, + 59, 41, 41, -30, -13, 41, 125, 41, -8, 41, + -8, -14 }; +int yydef[]={ + + 1, -2, 5, -2, 6, 7, 41, 42, 43, 0, + 9, 0, 0, 0, 40, 8, 10, 0, 0, 0, + 0, -2, 0, 0, 12, 13, 4, 50, 81, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -2, 99, 102, 103, 104, 0, 113, 114, 0, 123, + 125, 128, 0, 0, -2, 135, 0, 0, 0, 0, + 0, 0, 136, 0, 0, 0, 147, 0, 45, 0, + 0, 48, 11, 37, 0, 0, 0, 0, -2, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 87, 88, 82, 146, + 83, 84, 85, 86, -2, -2, 91, 0, 93, 0, + 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 117, 118, 134, 98, 124, 126, 127, 0, 0, 0, + 139, 144, 145, 143, 141, 140, 142, 138, 136, 57, + 137, 136, 0, 136, 44, 46, 47, 0, 38, 25, + 0, 25, 0, 13, 0, 36, 26, 0, 18, 0, + 18, 14, 15, 16, 17, 49, 39, 59, 0, 68, + 0, 69, 0, 70, 0, 71, 0, 74, 0, 75, + 0, 77, 0, 78, -2, -2, -2, 0, 80, 0, + 0, 0, 0, 92, 149, 0, 0, 94, 151, 0, + 96, 0, 97, 0, 0, 0, 0, 0, 0, 115, + 0, 0, 0, 129, 130, 0, 0, 51, 136, 0, + 136, 0, 56, 0, 29, 0, 30, 0, 0, 37, + 0, 23, 0, 0, 0, 24, 3, 60, 61, 62, + 63, 64, 65, 66, 67, 0, 136, 0, 0, 148, + 0, 0, 150, 0, 153, 100, 0, 109, 0, 0, + 0, 116, 119, 0, 121, 0, 131, 132, 0, 0, + 58, 53, 136, 25, 25, 0, 25, 0, 18, 19, + 0, 18, 79, 0, 101, 0, 0, 108, 152, 105, + 110, 0, 0, 120, 122, 0, 52, 0, 27, 28, + 25, 32, -2, 21, 0, 22, 55, 106, 107, 111, + 0, 133, 54, 31, 0, 0, 0, 0, 18, 112, + 33, 20 }; +typedef struct { char *t_name; int t_val; } yytoktype; +#ifndef YYDEBUG +# define YYDEBUG 0 /* don't allow debugging */ +#endif + +#if YYDEBUG + +yytoktype yytoks[] = +{ + "{", 123, + ")", 41, + "WORD", 257, + "METHOD", 258, + "THING", 259, + "PMFUNC", 260, + "PRIVATEREF", 261, + "LABEL", 262, + "FORMAT", 263, + "SUB", 264, + "PACKAGE", 265, + "WHILE", 266, + "UNTIL", 267, + "IF", 268, + "UNLESS", 269, + "ELSE", 270, + "ELSIF", 271, + "CONTINUE", 272, + "FOR", 273, + "LOOPEX", 274, + "DOTDOT", 275, + "FUNC0", 276, + "FUNC1", 277, + "FUNC", 278, + "RELOP", 279, + "EQOP", 280, + "MULOP", 281, + "ADDOP", 282, + "DOLSHARP", 283, + "DO", 284, + "LOCAL", 285, + "DELETE", 286, + "HASHBRACK", 287, + "LSTOP", 288, + ",", 44, + "=", 61, + "?", 63, + ":", 58, + "OROR", 289, + "ANDAND", 290, + "BITOROP", 291, + "BITANDOP", 292, + "UNIOP", 293, + "SHIFTOP", 294, + "MATCHOP", 295, + "ARROW", 296, + "!", 33, + "~", 126, + "UMINUS", 297, + "REFGEN", 298, + "POWOP", 299, + "PREINC", 300, + "PREDEC", 301, + "POSTINC", 302, + "POSTDEC", 303, + "(", 40, + "-unknown-", -1 /* ends search */ +}; + +char * yyreds[] = +{ + "-no such reduction-", + "prog : /* empty */", + "prog : lineseq", + "block : '{' remember lineseq '}'", + "remember : /* empty */", + "lineseq : /* empty */", + "lineseq : lineseq decl", + "lineseq : lineseq line", + "line : label cond", + "line : loop", + "line : label ';'", + "line : label sideff ';'", + "sideff : error", + "sideff : expr", + "sideff : expr IF expr", + "sideff : expr UNLESS expr", + "sideff : expr WHILE expr", + "sideff : expr UNTIL expr", + "else : /* empty */", + "else : ELSE block", + "else : ELSIF '(' expr ')' block else", + "cond : IF '(' expr ')' block else", + "cond : UNLESS '(' expr ')' block else", + "cond : IF block block else", + "cond : UNLESS block block else", + "cont : /* empty */", + "cont : CONTINUE block", + "loop : label WHILE '(' texpr ')' block cont", + "loop : label UNTIL '(' expr ')' block cont", + "loop : label WHILE block block cont", + "loop : label UNTIL block block cont", + "loop : label FOR scalar '(' expr crp block cont", + "loop : label FOR '(' expr crp block cont", + "loop : label FOR '(' nexpr ';' texpr ';' nexpr ')' block", + "loop : label block cont", + "nexpr : /* empty */", + "nexpr : sideff", + "texpr : /* empty */", + "texpr : expr", + "label : /* empty */", + "label : LABEL", + "decl : format", + "decl : subrout", + "decl : package", + "format : FORMAT WORD block", + "format : FORMAT block", + "subrout : SUB WORD block", + "package : PACKAGE WORD ';'", + "package : PACKAGE ';'", + "expr : expr ',' sexpr", + "expr : sexpr", + "listop : LSTOP indirob listexpr", + "listop : FUNC '(' indirob listexpr ')'", + "listop : indirob ARROW LSTOP listexpr", + "listop : indirob ARROW FUNC '(' listexpr ')'", + "listop : term ARROW METHOD '(' listexpr ')'", + "listop : METHOD indirob listexpr", + "listop : LSTOP listexpr", + "listop : FUNC '(' listexpr ')'", + "sexpr : sexpr '=' sexpr", + "sexpr : sexpr POWOP '=' sexpr", + "sexpr : sexpr MULOP '=' sexpr", + "sexpr : sexpr ADDOP '=' sexpr", + "sexpr : sexpr SHIFTOP '=' sexpr", + "sexpr : sexpr BITANDOP '=' sexpr", + "sexpr : sexpr BITOROP '=' sexpr", + "sexpr : sexpr ANDAND '=' sexpr", + "sexpr : sexpr OROR '=' sexpr", + "sexpr : sexpr POWOP sexpr", + "sexpr : sexpr MULOP sexpr", + "sexpr : sexpr ADDOP sexpr", + "sexpr : sexpr SHIFTOP sexpr", + "sexpr : sexpr RELOP sexpr", + "sexpr : sexpr EQOP sexpr", + "sexpr : sexpr BITANDOP sexpr", + "sexpr : sexpr BITOROP sexpr", + "sexpr : sexpr DOTDOT sexpr", + "sexpr : sexpr ANDAND sexpr", + "sexpr : sexpr OROR sexpr", + "sexpr : sexpr '?' sexpr ':' sexpr", + "sexpr : sexpr MATCHOP sexpr", + "sexpr : term", + "term : '-' term", + "term : '+' term", + "term : '!' term", + "term : '~' term", + "term : REFGEN term", + "term : term POSTINC", + "term : term POSTDEC", + "term : PREINC term", + "term : PREDEC term", + "term : LOCAL sexpr", + "term : '(' expr crp", + "term : '(' ')'", + "term : '[' expr crb", + "term : '[' ']'", + "term : HASHBRACK expr crhb", + "term : HASHBRACK ';' '}'", + "term : scalar", + "term : star", + "term : scalar '[' expr ']'", + "term : term ARROW '[' expr ']'", + "term : hsh", + "term : ary", + "term : arylen", + "term : scalar '{' expr ';' '}'", + "term : term ARROW '{' expr ';' '}'", + "term : '(' expr crp '[' expr ']'", + "term : '(' ')' '[' expr ']'", + "term : ary '[' expr ']'", + "term : ary '{' expr ';' '}'", + "term : DELETE scalar '{' expr ';' '}'", + "term : DELETE '(' scalar '{' expr ';' '}' ')'", + "term : THING", + "term : amper", + "term : amper '(' ')'", + "term : amper '(' expr crp", + "term : DO sexpr", + "term : DO block", + "term : DO WORD '(' ')'", + "term : DO WORD '(' expr crp", + "term : DO scalar '(' ')'", + "term : DO scalar '(' expr crp", + "term : LOOPEX", + "term : LOOPEX WORD", + "term : UNIOP", + "term : UNIOP block", + "term : UNIOP sexpr", + "term : FUNC0", + "term : FUNC0 '(' ')'", + "term : FUNC1 '(' ')'", + "term : FUNC1 '(' expr ')'", + "term : PMFUNC '(' sexpr ')'", + "term : PMFUNC '(' sexpr ',' sexpr ')'", + "term : WORD", + "term : listop", + "listexpr : /* empty */", + "listexpr : expr", + "amper : '&' indirob", + "scalar : '$' indirob", + "ary : '@' indirob", + "hsh : '%' indirob", + "arylen : DOLSHARP indirob", + "star : '*' indirob", + "indirob : WORD", + "indirob : scalar", + "indirob : block", + "indirob : PRIVATEREF", + "crp : ',' ')'", + "crp : ')'", + "crb : ',' ']'", + "crb : ']'", + "crhb : ',' ';' '}'", + "crhb : ';' '}'", +}; +#endif /* YYDEBUG */ +#line 1 "/usr/lib/yaccpar" +/* @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10 */ + +/* +** Skeleton parser driver for yacc output +*/ + +/* +** yacc user known macros and defines +*/ +#define YYERROR goto yyerrlab +#define YYACCEPT { free(yys); free(yyv); return(0); } +#define YYABORT { free(yys); free(yyv); return(1); } +#define YYBACKUP( newtoken, newvalue )\ +{\ + if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\ + {\ + yyerror( "syntax error - cannot backup" );\ + goto yyerrlab;\ + }\ + yychar = newtoken;\ + yystate = *yyps;\ + yylval = newvalue;\ + goto yynewstate;\ +} +#define YYRECOVERING() (!!yyerrflag) +#ifndef YYDEBUG +# define YYDEBUG 1 /* make debugging available */ +#endif + +/* +** user known globals +*/ +int yydebug; /* set to 1 to get debugging */ + +/* +** driver internal defines +*/ +#define YYFLAG (-1000) + +/* +** static variables used by the parser +*/ +static YYSTYPE *yyv; /* value stack */ +static int *yys; /* state stack */ + +static YYSTYPE *yypv; /* top of value stack */ +static int *yyps; /* top of state stack */ + +static int yystate; /* current state */ +static int yytmp; /* extra var (lasts between blocks) */ + +int yynerrs; /* number of errors */ + +int yyerrflag; /* error recovery flag */ +int yychar; /* current input token number */ + + +/* +** yyparse - return 0 if worked, 1 if syntax error not recovered from +*/ +int +yyparse() +{ + register YYSTYPE *yypvt; /* top of value stack for $vars */ + unsigned yymaxdepth = YYMAXDEPTH; + + /* + ** Initialize externals - yyparse may be called more than once + */ + yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE)); + yys = (int*)malloc(yymaxdepth*sizeof(int)); + if (!yyv || !yys) + { + yyerror( "out of memory" ); + return(1); + } + yypv = &yyv[-1]; + yyps = &yys[-1]; + yystate = 0; + yytmp = 0; + yynerrs = 0; + yyerrflag = 0; + yychar = -1; + + goto yystack; + { + register YYSTYPE *yy_pv; /* top of value stack */ + register int *yy_ps; /* top of state stack */ + register int yy_state; /* current state */ + register int yy_n; /* internal state number info */ + + /* + ** get globals into registers. + ** branch to here only if YYBACKUP was called. + */ + yynewstate: + yy_pv = yypv; + yy_ps = yyps; + yy_state = yystate; + goto yy_newstate; + + /* + ** get globals into registers. + ** either we just started, or we just finished a reduction + */ + yystack: + yy_pv = yypv; + yy_ps = yyps; + yy_state = yystate; + + /* + ** top of for (;;) loop while no reductions done + */ + yy_stack: + /* + ** put a state and value onto the stacks + */ +#if YYDEBUG + /* + ** if debugging, look up token value in list of value vs. + ** name pairs. 0 and negative (-1) are special values. + ** Note: linear search is used since time is not a real + ** consideration while debugging. + */ + if ( yydebug ) + { + register int yy_i; + + (void)printf( "State %d, token ", yy_state ); + if ( yychar == 0 ) + (void)printf( "end-of-file\n" ); + else if ( yychar < 0 ) + (void)printf( "-none-\n" ); + else + { + for ( yy_i = 0; yytoks[yy_i].t_val >= 0; + yy_i++ ) + { + if ( yytoks[yy_i].t_val == yychar ) + break; + } + (void)printf( "%s\n", yytoks[yy_i].t_name ); + } + } +#endif /* YYDEBUG */ + if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */ + { + /* + ** reallocate and recover. Note that pointers + ** have to be reset, or bad things will happen + */ + int yyps_index = (yy_ps - yys); + int yypv_index = (yy_pv - yyv); + int yypvt_index = (yypvt - yyv); + yymaxdepth += YYMAXDEPTH; + yyv = (YYSTYPE*)realloc((char*)yyv, + yymaxdepth * sizeof(YYSTYPE)); + yys = (int*)realloc((char*)yys, + yymaxdepth * sizeof(int)); + if (!yyv || !yys) + { + yyerror( "yacc stack overflow" ); + return(1); + } + yy_ps = yys + yyps_index; + yy_pv = yyv + yypv_index; + yypvt = yyv + yypvt_index; + } + *yy_ps = yy_state; + *++yy_pv = yyval; + + /* + ** we have a new state - find out what to do + */ + yy_newstate: + if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG ) + goto yydefault; /* simple state */ +#if YYDEBUG + /* + ** if debugging, need to mark whether new token grabbed + */ + yytmp = yychar < 0; +#endif + if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) ) + yychar = 0; /* reached EOF */ +#if YYDEBUG + if ( yydebug && yytmp ) + { + register int yy_i; + + (void)printf( " *** Received token " ); + if ( yychar == 0 ) + (void)printf( "end-of-file\n" ); + else if ( yychar < 0 ) + (void)printf( "-none-\n" ); + else + { + for ( yy_i = 0; yytoks[yy_i].t_val >= 0; + yy_i++ ) + { + if ( yytoks[yy_i].t_val == yychar ) + break; + } + (void)printf( "%s\n", yytoks[yy_i].t_name ); + } + } +#endif /* YYDEBUG */ + if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) ) + goto yydefault; + if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/ + { + yychar = -1; + yyval = yylval; + yy_state = yy_n; + if ( yyerrflag > 0 ) + yyerrflag--; + goto yy_stack; + } + + yydefault: + if ( ( yy_n = yydef[ yy_state ] ) == -2 ) + { +#if YYDEBUG + yytmp = yychar < 0; +#endif + if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) ) + yychar = 0; /* reached EOF */ +#if YYDEBUG + if ( yydebug && yytmp ) + { + register int yy_i; + + (void)printf( " *** Received token " ); + if ( yychar == 0 ) + (void)printf( "end-of-file\n" ); + else if ( yychar < 0 ) + (void)printf( "-none-\n" ); + else + { + for ( yy_i = 0; + yytoks[yy_i].t_val >= 0; + yy_i++ ) + { + if ( yytoks[yy_i].t_val + == yychar ) + { + break; + } + } + (void)printf( "%s\n", yytoks[yy_i].t_name ); + } + } +#endif /* YYDEBUG */ + /* + ** look through exception table + */ + { + register int *yyxi = yyexca; + + while ( ( *yyxi != -1 ) || + ( yyxi[1] != yy_state ) ) + { + yyxi += 2; + } + while ( ( *(yyxi += 2) >= 0 ) && + ( *yyxi != yychar ) ) + ; + if ( ( yy_n = yyxi[1] ) < 0 ) + YYACCEPT; + } + } + + /* + ** check for syntax error + */ + if ( yy_n == 0 ) /* have an error */ + { + /* no worry about speed here! */ + switch ( yyerrflag ) + { + case 0: /* new error */ + yyerror( "syntax error" ); + goto skip_init; + yyerrlab: + /* + ** get globals into registers. + ** we have a user generated syntax type error + */ + yy_pv = yypv; + yy_ps = yyps; + yy_state = yystate; + yynerrs++; + skip_init: + case 1: + case 2: /* incompletely recovered error */ + /* try again... */ + yyerrflag = 3; + /* + ** find state where "error" is a legal + ** shift action + */ + while ( yy_ps >= yys ) + { + yy_n = yypact[ *yy_ps ] + YYERRCODE; + if ( yy_n >= 0 && yy_n < YYLAST && + yychk[yyact[yy_n]] == YYERRCODE) { + /* + ** simulate shift of "error" + */ + yy_state = yyact[ yy_n ]; + goto yy_stack; + } + /* + ** current state has no shift on + ** "error", pop stack + */ +#if YYDEBUG +# define _POP_ "Error recovery pops state %d, uncovers state %d\n" + if ( yydebug ) + (void)printf( _POP_, *yy_ps, + yy_ps[-1] ); +# undef _POP_ +#endif + yy_ps--; + yy_pv--; + } + /* + ** there is no state on stack with "error" as + ** a valid shift. give up. + */ + YYABORT; + case 3: /* no shift yet; eat a token */ +#if YYDEBUG + /* + ** if debugging, look up token in list of + ** pairs. 0 and negative shouldn't occur, + ** but since timing doesn't matter when + ** debugging, it doesn't hurt to leave the + ** tests here. + */ + if ( yydebug ) + { + register int yy_i; + + (void)printf( "Error recovery discards " ); + if ( yychar == 0 ) + (void)printf( "token end-of-file\n" ); + else if ( yychar < 0 ) + (void)printf( "token -none-\n" ); + else + { + for ( yy_i = 0; + yytoks[yy_i].t_val >= 0; + yy_i++ ) + { + if ( yytoks[yy_i].t_val + == yychar ) + { + break; + } + } + (void)printf( "token %s\n", + yytoks[yy_i].t_name ); + } + } +#endif /* YYDEBUG */ + if ( yychar == 0 ) /* reached EOF. quit */ + YYABORT; + yychar = -1; + goto yy_newstate; + } + }/* end if ( yy_n == 0 ) */ + /* + ** reduction by production yy_n + ** put stack tops, etc. so things right after switch + */ +#if YYDEBUG + /* + ** if debugging, print the string that is the user's + ** specification of the reduction which is just about + ** to be done. + */ + if ( yydebug ) + (void)printf( "Reduce by (%d) \"%s\"\n", + yy_n, yyreds[ yy_n ] ); +#endif + yytmp = yy_n; /* value to switch over */ + yypvt = yy_pv; /* $vars top of value stack */ + /* + ** Look in goto table for next state + ** Sorry about using yy_state here as temporary + ** register variable, but why not, if it works... + ** If yyr2[ yy_n ] doesn't have the low order bit + ** set, then there is no action to be done for + ** this reduction. So, no saving & unsaving of + ** registers done. The only difference between the + ** code just after the if and the body of the if is + ** the goto yy_stack in the body. This way the test + ** can be made before the choice of what to do is needed. + */ + { + /* length of production doubled with extra bit */ + register int yy_len = yyr2[ yy_n ]; + + if ( !( yy_len & 01 ) ) + { + yy_len >>= 1; + yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */ + yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] + + *( yy_ps -= yy_len ) + 1; + if ( yy_state >= YYLAST || + yychk[ yy_state = + yyact[ yy_state ] ] != -yy_n ) + { + yy_state = yyact[ yypgo[ yy_n ] ]; + } + goto yy_stack; + } + yy_len >>= 1; + yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */ + yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] + + *( yy_ps -= yy_len ) + 1; + if ( yy_state >= YYLAST || + yychk[ yy_state = yyact[ yy_state ] ] != -yy_n ) + { + yy_state = yyact[ yypgo[ yy_n ] ]; + } + } + /* save until reenter driver code */ + yystate = yy_state; + yyps = yy_ps; + yypv = yy_pv; + } + /* + ** code supplied by user is placed in this switch + */ + switch( yytmp ) + { + +case 1: +# line 100 "perly.y" +{ +#if defined(YYDEBUG) && defined(DEBUGGING) + yydebug = (debug & 1); +#endif + expect = XBLOCK; + } break; +case 2: +# line 107 "perly.y" +{ if (in_eval) { + eval_root = newUNOP(OP_LEAVEEVAL, 0, yypvt[-0].opval); + eval_start = linklist(eval_root); + eval_root->op_next = 0; + peep(eval_start); + } + else + main_root = block_head(yypvt[-0].opval, &main_start); + } break; +case 3: +# line 119 "perly.y" +{ yyval.opval = scalarseq(yypvt[-1].opval); + if (copline > (line_t)yypvt[-3].ival) + copline = yypvt[-3].ival; + leave_scope(yypvt[-2].ival); + pad_leavemy(comppadnamefill); + expect = XBLOCK; } break; +case 4: +# line 128 "perly.y" +{ yyval.ival = savestack_ix; SAVEINT(comppadnamefill); } break; +case 5: +# line 132 "perly.y" +{ yyval.opval = Nullop; } break; +case 6: +# line 134 "perly.y" +{ yyval.opval = yypvt[-1].opval; } break; +case 7: +# line 136 "perly.y" +{ yyval.opval = append_list(OP_LINESEQ, yypvt[-1].opval, yypvt[-0].opval); pad_reset(); } break; +case 8: +# line 140 "perly.y" +{ yyval.opval = newSTATEOP(0, yypvt[-1].pval, yypvt[-0].opval); } break; +case 10: +# line 143 "perly.y" +{ if (yypvt[-1].pval != Nullch) { + yyval.opval = newSTATEOP(0, yypvt[-1].pval, newOP(OP_NULL, 0)); + } + else { + yyval.opval = Nullop; + copline = NOLINE; + } + expect = XBLOCK; } break; +case 11: +# line 152 "perly.y" +{ yyval.opval = newSTATEOP(0, yypvt[-2].pval, yypvt[-1].opval); + expect = XBLOCK; } break; +case 12: +# line 157 "perly.y" +{ yyval.opval = Nullop; } break; +case 13: +# line 159 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 14: +# line 161 "perly.y" +{ yyval.opval = newLOGOP(OP_AND, 0, yypvt[-0].opval, yypvt[-2].opval); } break; +case 15: +# line 163 "perly.y" +{ yyval.opval = newLOGOP(OP_OR, 0, yypvt[-0].opval, yypvt[-2].opval); } break; +case 16: +# line 165 "perly.y" +{ yyval.opval = newLOOPOP(0, 1, scalar(yypvt[-0].opval), yypvt[-2].opval); } break; +case 17: +# line 167 "perly.y" +{ yyval.opval = newLOOPOP(0, 1, invert(scalar(yypvt[-0].opval)), yypvt[-2].opval);} break; +case 18: +# line 171 "perly.y" +{ yyval.opval = Nullop; } break; +case 19: +# line 173 "perly.y" +{ yyval.opval = scope(yypvt[-0].opval); } break; +case 20: +# line 175 "perly.y" +{ copline = yypvt[-5].ival; + yyval.opval = newCONDOP(0, yypvt[-3].opval, scope(yypvt[-1].opval), yypvt[-0].opval); } break; +case 21: +# line 180 "perly.y" +{ copline = yypvt[-5].ival; + yyval.opval = newCONDOP(0, yypvt[-3].opval, scope(yypvt[-1].opval), yypvt[-0].opval); } break; +case 22: +# line 183 "perly.y" +{ copline = yypvt[-5].ival; + yyval.opval = newCONDOP(0, + invert(scalar(yypvt[-3].opval)), scope(yypvt[-1].opval), yypvt[-0].opval); } break; +case 23: +# line 187 "perly.y" +{ copline = yypvt[-3].ival; + yyval.opval = newCONDOP(0, scope(yypvt[-2].opval), scope(yypvt[-1].opval), yypvt[-0].opval); } break; +case 24: +# line 190 "perly.y" +{ copline = yypvt[-3].ival; + yyval.opval = newCONDOP(0, invert(scalar(scope(yypvt[-2].opval))), + scope(yypvt[-1].opval), yypvt[-0].opval); } break; +case 25: +# line 196 "perly.y" +{ yyval.opval = Nullop; } break; +case 26: +# line 198 "perly.y" +{ yyval.opval = scope(yypvt[-0].opval); } break; +case 27: +# line 202 "perly.y" +{ copline = yypvt[-5].ival; + yyval.opval = newSTATEOP(0, yypvt[-6].pval, + newWHILEOP(0, 1, Nullop, yypvt[-3].opval, yypvt[-1].opval, yypvt[-0].opval) ); } break; +case 28: +# line 206 "perly.y" +{ copline = yypvt[-5].ival; + yyval.opval = newSTATEOP(0, yypvt[-6].pval, + newWHILEOP(0, 1, Nullop, + invert(scalar(yypvt[-3].opval)), yypvt[-1].opval, yypvt[-0].opval) ); } break; +case 29: +# line 211 "perly.y" +{ copline = yypvt[-3].ival; + yyval.opval = newSTATEOP(0, yypvt[-4].pval, + newWHILEOP(0, 1, Nullop, + scope(yypvt[-2].opval), yypvt[-1].opval, yypvt[-0].opval) ); } break; +case 30: +# line 216 "perly.y" +{ copline = yypvt[-3].ival; + yyval.opval = newSTATEOP(0, yypvt[-4].pval, + newWHILEOP(0, 1, Nullop, + invert(scalar(scope(yypvt[-2].opval))), yypvt[-1].opval, yypvt[-0].opval)); } break; +case 31: +# line 221 "perly.y" +{ yyval.opval = newFOROP(0, yypvt[-7].pval, yypvt[-6].ival, ref(yypvt[-5].opval, OP_ENTERLOOP), + yypvt[-3].opval, yypvt[-1].opval, yypvt[-0].opval); } break; +case 32: +# line 224 "perly.y" +{ yyval.opval = newFOROP(0, yypvt[-6].pval, yypvt[-5].ival, Nullop, yypvt[-3].opval, yypvt[-1].opval, yypvt[-0].opval); } break; +case 33: +# line 227 "perly.y" +{ copline = yypvt[-8].ival; + yyval.opval = append_elem(OP_LINESEQ, + newSTATEOP(0, yypvt[-9].pval, scalar(yypvt[-6].opval)), + newSTATEOP(0, yypvt[-9].pval, + newWHILEOP(0, 1, Nullop, + scalar(yypvt[-4].opval), yypvt[-0].opval, scalar(yypvt[-2].opval)) )); } break; +case 34: +# line 234 "perly.y" +{ yyval.opval = newSTATEOP(0, + yypvt[-2].pval, newWHILEOP(0, 1, Nullop, Nullop, yypvt[-1].opval, yypvt[-0].opval)); } break; +case 35: +# line 239 "perly.y" +{ yyval.opval = Nullop; } break; +case 37: +# line 244 "perly.y" +{ (void)scan_num("1"); yyval.opval = yylval.opval; } break; +case 39: +# line 249 "perly.y" +{ yyval.pval = Nullch; } break; +case 41: +# line 254 "perly.y" +{ yyval.ival = 0; } break; +case 42: +# line 256 "perly.y" +{ yyval.ival = 0; } break; +case 43: +# line 258 "perly.y" +{ yyval.ival = 0; } break; +case 44: +# line 262 "perly.y" +{ newFORM(yypvt[-2].ival, yypvt[-1].opval, yypvt[-0].opval); } break; +case 45: +# line 264 "perly.y" +{ newFORM(yypvt[-1].ival, Nullop, yypvt[-0].opval); } break; +case 46: +# line 268 "perly.y" +{ newSUB(yypvt[-2].ival, yypvt[-1].opval, yypvt[-0].opval); } break; +case 47: +# line 272 "perly.y" +{ package(yypvt[-1].opval); } break; +case 48: +# line 274 "perly.y" +{ package(Nullop); } break; +case 49: +# line 278 "perly.y" +{ yyval.opval = append_elem(OP_LIST, yypvt[-2].opval, yypvt[-0].opval); } break; +case 51: +# line 283 "perly.y" +{ yyval.opval = convert(yypvt[-2].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yypvt[-1].opval), yypvt[-0].opval) ); } break; +case 52: +# line 286 "perly.y" +{ yyval.opval = convert(yypvt[-4].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yypvt[-2].opval), yypvt[-1].opval) ); } break; +case 53: +# line 289 "perly.y" +{ yyval.opval = convert(yypvt[-1].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yypvt[-3].opval), yypvt[-0].opval) ); } break; +case 54: +# line 292 "perly.y" +{ yyval.opval = convert(yypvt[-3].ival, OPf_STACKED, + prepend_elem(OP_LIST, newGVREF(yypvt[-5].opval), yypvt[-1].opval) ); } break; +case 55: +# line 295 "perly.y" +{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, + prepend_elem(OP_LIST, newMETHOD(yypvt[-5].opval,yypvt[-3].opval), yypvt[-1].opval)); } break; +case 56: +# line 298 "perly.y" +{ yyval.opval = convert(OP_ENTERSUBR, OPf_STACKED|OPf_SPECIAL, + prepend_elem(OP_LIST, newMETHOD(yypvt[-1].opval,yypvt[-2].opval), yypvt[-0].opval)); } break; +case 57: +# line 301 "perly.y" +{ yyval.opval = convert(yypvt[-1].ival, 0, yypvt[-0].opval); } break; +case 58: +# line 303 "perly.y" +{ yyval.opval = convert(yypvt[-3].ival, 0, yypvt[-1].opval); } break; +case 59: +# line 307 "perly.y" +{ yyval.opval = newASSIGNOP(OPf_STACKED, yypvt[-2].opval, yypvt[-0].opval); } break; +case 60: +# line 309 "perly.y" +{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, + ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +case 61: +# line 312 "perly.y" +{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, + ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +case 62: +# line 315 "perly.y" +{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, + ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval));} break; +case 63: +# line 318 "perly.y" +{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, + ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +case 64: +# line 321 "perly.y" +{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, + ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +case 65: +# line 324 "perly.y" +{ yyval.opval = newBINOP(yypvt[-2].ival, OPf_STACKED, + ref(scalar(yypvt[-3].opval), yypvt[-2].ival), scalar(yypvt[-0].opval)); } break; +case 66: +# line 327 "perly.y" +{ yyval.opval = newLOGOP(OP_ANDASSIGN, 0, + ref(scalar(yypvt[-3].opval), OP_ANDASSIGN), + newUNOP(OP_SASSIGN, 0, scalar(yypvt[-0].opval))); } break; +case 67: +# line 331 "perly.y" +{ yyval.opval = newLOGOP(OP_ORASSIGN, 0, + ref(scalar(yypvt[-3].opval), OP_ORASSIGN), + newUNOP(OP_SASSIGN, 0, scalar(yypvt[-0].opval))); } break; +case 68: +# line 337 "perly.y" +{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +case 69: +# line 339 "perly.y" +{ if (yypvt[-1].ival != OP_REPEAT) + scalar(yypvt[-2].opval); + yyval.opval = newBINOP(yypvt[-1].ival, 0, yypvt[-2].opval, scalar(yypvt[-0].opval)); } break; +case 70: +# line 343 "perly.y" +{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +case 71: +# line 345 "perly.y" +{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +case 72: +# line 347 "perly.y" +{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +case 73: +# line 349 "perly.y" +{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +case 74: +# line 351 "perly.y" +{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +case 75: +# line 353 "perly.y" +{ yyval.opval = newBINOP(yypvt[-1].ival, 0, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval)); } break; +case 76: +# line 355 "perly.y" +{ yyval.opval = newRANGE(yypvt[-1].ival, scalar(yypvt[-2].opval), scalar(yypvt[-0].opval));} break; +case 77: +# line 357 "perly.y" +{ yyval.opval = newLOGOP(OP_AND, 0, yypvt[-2].opval, yypvt[-0].opval); } break; +case 78: +# line 359 "perly.y" +{ yyval.opval = newLOGOP(OP_OR, 0, yypvt[-2].opval, yypvt[-0].opval); } break; +case 79: +# line 361 "perly.y" +{ yyval.opval = newCONDOP(0, yypvt[-4].opval, yypvt[-2].opval, yypvt[-0].opval); } break; +case 80: +# line 363 "perly.y" +{ yyval.opval = bind_match(yypvt[-1].ival, yypvt[-2].opval, yypvt[-0].opval); } break; +case 81: +# line 365 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 82: +# line 369 "perly.y" +{ yyval.opval = newUNOP(OP_NEGATE, 0, scalar(yypvt[-0].opval)); } break; +case 83: +# line 371 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 84: +# line 373 "perly.y" +{ yyval.opval = newUNOP(OP_NOT, 0, scalar(yypvt[-0].opval)); } break; +case 85: +# line 375 "perly.y" +{ yyval.opval = newUNOP(OP_COMPLEMENT, 0, scalar(yypvt[-0].opval));} break; +case 86: +# line 377 "perly.y" +{ yyval.opval = newUNOP(OP_REFGEN, 0, ref(yypvt[-0].opval, OP_REFGEN)); } break; +case 87: +# line 379 "perly.y" +{ yyval.opval = newUNOP(OP_POSTINC, 0, + ref(scalar(yypvt[-1].opval), OP_POSTINC)); } break; +case 88: +# line 382 "perly.y" +{ yyval.opval = newUNOP(OP_POSTDEC, 0, + ref(scalar(yypvt[-1].opval), OP_POSTDEC)); } break; +case 89: +# line 385 "perly.y" +{ yyval.opval = newUNOP(OP_PREINC, 0, + ref(scalar(yypvt[-0].opval), OP_PREINC)); } break; +case 90: +# line 388 "perly.y" +{ yyval.opval = newUNOP(OP_PREDEC, 0, + ref(scalar(yypvt[-0].opval), OP_PREDEC)); } break; +case 91: +# line 391 "perly.y" +{ yyval.opval = localize(yypvt[-0].opval,yypvt[-1].ival); } break; +case 92: +# line 393 "perly.y" +{ yyval.opval = sawparens(yypvt[-1].opval); } break; +case 93: +# line 395 "perly.y" +{ yyval.opval = newNULLLIST(); } break; +case 94: +# line 397 "perly.y" +{ yyval.opval = newANONLIST(yypvt[-1].opval); } break; +case 95: +# line 399 "perly.y" +{ yyval.opval = newANONLIST(Nullop); } break; +case 96: +# line 401 "perly.y" +{ yyval.opval = newANONHASH(yypvt[-1].opval); } break; +case 97: +# line 403 "perly.y" +{ yyval.opval = newANONHASH(Nullop); } break; +case 98: +# line 405 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 99: +# line 407 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 100: +# line 409 "perly.y" +{ yyval.opval = newBINOP(OP_AELEM, 0, oopsAV(yypvt[-3].opval), scalar(yypvt[-1].opval)); } break; +case 101: +# line 411 "perly.y" +{ yyval.opval = newBINOP(OP_AELEM, 0, + scalar(ref(newAVREF(yypvt[-4].opval),OP_RV2AV)), + scalar(yypvt[-1].opval));} break; +case 102: +# line 415 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 103: +# line 417 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 104: +# line 419 "perly.y" +{ yyval.opval = newUNOP(OP_AV2ARYLEN, 0, ref(yypvt[-0].opval, OP_AV2ARYLEN));} break; +case 105: +# line 421 "perly.y" +{ yyval.opval = newBINOP(OP_HELEM, 0, oopsHV(yypvt[-4].opval), jmaybe(yypvt[-2].opval)); + expect = XOPERATOR; } break; +case 106: +# line 424 "perly.y" +{ yyval.opval = newBINOP(OP_HELEM, 0, + scalar(ref(newHVREF(yypvt[-5].opval),OP_RV2HV)), + jmaybe(yypvt[-2].opval)); + expect = XOPERATOR; } break; +case 107: +# line 429 "perly.y" +{ yyval.opval = newSLICEOP(0, yypvt[-1].opval, yypvt[-4].opval); } break; +case 108: +# line 431 "perly.y" +{ yyval.opval = newSLICEOP(0, yypvt[-1].opval, Nullop); } break; +case 109: +# line 433 "perly.y" +{ yyval.opval = prepend_elem(OP_ASLICE, + newOP(OP_PUSHMARK, 0), + list( + newLISTOP(OP_ASLICE, 0, + list(yypvt[-1].opval), + ref(yypvt[-3].opval, OP_ASLICE)))); } break; +case 110: +# line 440 "perly.y" +{ yyval.opval = prepend_elem(OP_HSLICE, + newOP(OP_PUSHMARK, 0), + list( + newLISTOP(OP_HSLICE, 0, + list(yypvt[-2].opval), + ref(oopsHV(yypvt[-4].opval), OP_HSLICE)))); + expect = XOPERATOR; } break; +case 111: +# line 448 "perly.y" +{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yypvt[-4].opval), jmaybe(yypvt[-2].opval)); + expect = XOPERATOR; } break; +case 112: +# line 451 "perly.y" +{ yyval.opval = newBINOP(OP_DELETE, 0, oopsHV(yypvt[-5].opval), jmaybe(yypvt[-3].opval)); + expect = XOPERATOR; } break; +case 113: +# line 454 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 114: +# line 456 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, 0, + scalar(yypvt[-0].opval)); } break; +case 115: +# line 459 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, scalar(yypvt[-2].opval)); } break; +case 116: +# line 461 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_STACKED, + list(prepend_elem(OP_LIST, scalar(yypvt[-3].opval), yypvt[-1].opval))); } break; +case 117: +# line 464 "perly.y" +{ yyval.opval = newUNOP(OP_DOFILE, 0, scalar(yypvt[-0].opval)); + allgvs = TRUE;} break; +case 118: +# line 467 "perly.y" +{ yyval.opval = newUNOP(OP_NULL, OPf_SPECIAL, scope(yypvt[-0].opval)); } break; +case 119: +# line 469 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yypvt[-2].opval))), newNULLLIST()))); } break; +case 120: +# line 473 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yypvt[-3].opval))), + yypvt[-1].opval))); } break; +case 121: +# line 478 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yypvt[-2].opval))), newNULLLIST())));} break; +case 122: +# line 482 "perly.y" +{ yyval.opval = newUNOP(OP_ENTERSUBR, OPf_SPECIAL|OPf_STACKED, + list(prepend_elem(OP_LIST, + scalar(newCVREF(scalar(yypvt[-3].opval))), + yypvt[-1].opval))); } break; +case 123: +# line 487 "perly.y" +{ yyval.opval = newOP(yypvt[-0].ival, OPf_SPECIAL); } break; +case 124: +# line 489 "perly.y" +{ yyval.opval = newPVOP(yypvt[-1].ival, 0, + savestr(SvPVnx(((SVOP*)yypvt[-0].opval)->op_sv))); + op_free(yypvt[-0].opval); } break; +case 125: +# line 493 "perly.y" +{ yyval.opval = newOP(yypvt[-0].ival, 0); } break; +case 126: +# line 495 "perly.y" +{ yyval.opval = newUNOP(yypvt[-1].ival, 0, yypvt[-0].opval); } break; +case 127: +# line 497 "perly.y" +{ yyval.opval = newUNOP(yypvt[-1].ival, 0, yypvt[-0].opval); } break; +case 128: +# line 499 "perly.y" +{ yyval.opval = newOP(yypvt[-0].ival, 0); } break; +case 129: +# line 501 "perly.y" +{ yyval.opval = newOP(yypvt[-2].ival, 0); } break; +case 130: +# line 503 "perly.y" +{ yyval.opval = newOP(yypvt[-2].ival, OPf_SPECIAL); } break; +case 131: +# line 505 "perly.y" +{ yyval.opval = newUNOP(yypvt[-3].ival, 0, yypvt[-1].opval); } break; +case 132: +# line 507 "perly.y" +{ yyval.opval = pmruntime(yypvt[-3].opval, yypvt[-1].opval, Nullop); } break; +case 133: +# line 509 "perly.y" +{ yyval.opval = pmruntime(yypvt[-5].opval, yypvt[-3].opval, yypvt[-1].opval); } break; +case 136: +# line 515 "perly.y" +{ yyval.opval = newNULLLIST(); } break; +case 137: +# line 517 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 138: +# line 521 "perly.y" +{ yyval.opval = newCVREF(yypvt[-0].opval); } break; +case 139: +# line 525 "perly.y" +{ yyval.opval = newSVREF(yypvt[-0].opval); } break; +case 140: +# line 529 "perly.y" +{ yyval.opval = newAVREF(yypvt[-0].opval); } break; +case 141: +# line 533 "perly.y" +{ yyval.opval = newHVREF(yypvt[-0].opval); } break; +case 142: +# line 537 "perly.y" +{ yyval.opval = newAVREF(yypvt[-0].opval); } break; +case 143: +# line 541 "perly.y" +{ yyval.opval = newGVREF(yypvt[-0].opval); } break; +case 144: +# line 545 "perly.y" +{ yyval.opval = scalar(yypvt[-0].opval); } break; +case 145: +# line 547 "perly.y" +{ yyval.opval = scalar(yypvt[-0].opval); } break; +case 146: +# line 549 "perly.y" +{ yyval.opval = scalar(scope(yypvt[-0].opval)); } break; +case 147: +# line 552 "perly.y" +{ yyval.opval = yypvt[-0].opval; } break; +case 148: +# line 556 "perly.y" +{ yyval.ival = 1; } break; +case 149: +# line 558 "perly.y" +{ yyval.ival = 0; } break; +case 150: +# line 562 "perly.y" +{ yyval.ival = 1; } break; +case 151: +# line 564 "perly.y" +{ yyval.ival = 0; } break; +case 152: +# line 568 "perly.y" +{ yyval.ival = 1; } break; +case 153: +# line 570 "perly.y" +{ yyval.ival = 0; } break; + } + goto yystack; /* reset registers in driver code */ +} diff --git a/perly.fixer b/perly.fixer index 58ea1a5923..8dc533efc1 100755 --- a/perly.fixer +++ b/perly.fixer @@ -10,6 +10,13 @@ input=$1 output=$2 tmp=/tmp/f$$ +if test -f perly.c.diff; then + cp $input $output + patch -F3 <perly.c.diff + rm -rf $input + exit +fi + plan="unknown" # Test for BSD 4.3 version. @@ -1,55 +1,56 @@ - -typedef union { +#define WORD 257 +#define METHOD 258 +#define THING 259 +#define PMFUNC 260 +#define PRIVATEREF 261 +#define LABEL 262 +#define FORMAT 263 +#define SUB 264 +#define PACKAGE 265 +#define WHILE 266 +#define UNTIL 267 +#define IF 268 +#define UNLESS 269 +#define ELSE 270 +#define ELSIF 271 +#define CONTINUE 272 +#define FOR 273 +#define LOOPEX 274 +#define DOTDOT 275 +#define FUNC0 276 +#define FUNC1 277 +#define FUNC 278 +#define RELOP 279 +#define EQOP 280 +#define MULOP 281 +#define ADDOP 282 +#define DOLSHARP 283 +#define DO 284 +#define LOCAL 285 +#define DELETE 286 +#define HASHBRACK 287 +#define NOAMP 288 +#define LSTOP 289 +#define OROR 290 +#define ANDAND 291 +#define BITOROP 292 +#define BITANDOP 293 +#define UNIOP 294 +#define SHIFTOP 295 +#define MATCHOP 296 +#define ARROW 297 +#define UMINUS 298 +#define REFGEN 299 +#define POWOP 300 +#define PREINC 301 +#define PREDEC 302 +#define POSTINC 303 +#define POSTDEC 304 +typedef union { I32 ival; char *pval; OP *opval; GV *gvval; } YYSTYPE; extern YYSTYPE yylval; -# define WORD 257 -# define METHOD 258 -# define THING 259 -# define PMFUNC 260 -# define LABEL 261 -# define FORMAT 262 -# define SUB 263 -# define PACKAGE 264 -# define WHILE 265 -# define UNTIL 266 -# define IF 267 -# define UNLESS 268 -# define ELSE 269 -# define ELSIF 270 -# define CONTINUE 271 -# define FOR 272 -# define LOOPEX 273 -# define DOTDOT 274 -# define FUNC0 275 -# define FUNC1 276 -# define FUNC 277 -# define RELOP 278 -# define EQOP 279 -# define MULOP 280 -# define ADDOP 281 -# define DOLSHARP 282 -# define DO 283 -# define LOCAL 284 -# define DELETE 285 -# define HASHBRACK 286 -# define LSTOP 287 -# define OROR 288 -# define ANDAND 289 -# define BITOROP 290 -# define BITANDOP 291 -# define UNIOP 292 -# define SHIFTOP 293 -# define MATCHOP 294 -# define ARROW 295 -# define UMINUS 296 -# define REFGEN 297 -# define POWOP 298 -# define PREINC 299 -# define PREDEC 300 -# define POSTINC 301 -# define POSTDEC 302 extern YYSTYPE yylval; diff --git a/perly.h.yacc b/perly.h.yacc new file mode 100644 index 0000000000..579cc44cb2 --- /dev/null +++ b/perly.h.yacc @@ -0,0 +1,56 @@ + +typedef union { + I32 ival; + char *pval; + OP *opval; + GV *gvval; +} YYSTYPE; +extern YYSTYPE yylval; +# define WORD 257 +# define METHOD 258 +# define THING 259 +# define PMFUNC 260 +# define PRIVATEREF 261 +# define LABEL 262 +# define FORMAT 263 +# define SUB 264 +# define PACKAGE 265 +# define WHILE 266 +# define UNTIL 267 +# define IF 268 +# define UNLESS 269 +# define ELSE 270 +# define ELSIF 271 +# define CONTINUE 272 +# define FOR 273 +# define LOOPEX 274 +# define DOTDOT 275 +# define FUNC0 276 +# define FUNC1 277 +# define FUNC 278 +# define RELOP 279 +# define EQOP 280 +# define MULOP 281 +# define ADDOP 282 +# define DOLSHARP 283 +# define DO 284 +# define LOCAL 285 +# define DELETE 286 +# define HASHBRACK 287 +# define LSTOP 288 +# define OROR 289 +# define ANDAND 290 +# define BITOROP 291 +# define BITANDOP 292 +# define UNIOP 293 +# define SHIFTOP 294 +# define MATCHOP 295 +# define ARROW 296 +# define UMINUS 297 +# define REFGEN 298 +# define POWOP 299 +# define PREINC 300 +# define PREDEC 301 +# define POSTINC 302 +# define POSTDEC 303 +extern YYSTYPE yylval; @@ -56,14 +56,14 @@ %token <ival> '{' ')' -%token <opval> WORD METHOD THING PMFUNC +%token <opval> WORD METHOD THING PMFUNC PRIVATEREF %token <pval> LABEL %token <ival> FORMAT SUB PACKAGE %token <ival> WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR %token <ival> LOOPEX DOTDOT %token <ival> FUNC0 FUNC1 FUNC %token <ival> RELOP EQOP MULOP ADDOP -%token <ival> DOLSHARP DO LOCAL DELETE HASHBRACK +%token <ival> DOLSHARP DO LOCAL DELETE HASHBRACK NOAMP %type <ival> prog decl format remember crp crb crhb %type <opval> block lineseq line loop cond nexpr else @@ -111,7 +111,7 @@ prog : /* NULL */ peep(eval_start); } else - main_root = block_head(scalar($2), &main_start); + main_root = block_head($2, &main_start); } ; @@ -119,13 +119,13 @@ block : '{' remember lineseq '}' { $$ = scalarseq($3); if (copline > (line_t)$1) copline = $1; - if (savestack_ix > $2) - leave_scope($2); + leave_scope($2); + pad_leavemy(comppadnamefill); expect = XBLOCK; } ; remember: /* NULL */ /* in case they push a package name */ - { $$ = savestack_ix; } + { $$ = savestack_ix; SAVEINT(comppadnamefill); } ; lineseq : /* NULL */ @@ -162,9 +162,9 @@ sideff : error | expr UNLESS expr { $$ = newLOGOP(OP_OR, 0, $3, $1); } | expr WHILE expr - { $$ = newLOOPOP(0, 1, scalar($3), $1, Nullop); } + { $$ = newLOOPOP(0, 1, scalar($3), $1); } | expr UNTIL expr - { $$ = newLOOPOP(0, 1, invert(scalar($3)), $1, Nullop);} + { $$ = newLOOPOP(0, 1, invert(scalar($3)), $1);} ; else : /* NULL */ @@ -266,10 +266,14 @@ format : FORMAT WORD block subrout : SUB WORD block { newSUB($1, $2, $3); } + | SUB WORD ';' + { newSUB($1, $2, Nullop); } ; package : PACKAGE WORD ';' { package($2); } + | PACKAGE ';' + { package(Nullop); } ; expr : expr ',' sexpr @@ -386,7 +390,7 @@ term : '-' term %prec UMINUS { $$ = newUNOP(OP_PREDEC, 0, ref(scalar($2), OP_PREDEC)); } | LOCAL sexpr %prec UNIOP - { $$ = localize($2); } + { $$ = localize($2,$1); } | '(' expr crp { $$ = sawparens($2); } | '(' ')' @@ -458,6 +462,10 @@ term : '-' term %prec UMINUS | amper '(' expr crp { $$ = newUNOP(OP_ENTERSUBR, OPf_STACKED, list(prepend_elem(OP_LIST, scalar($1), $3))); } + | NOAMP WORD listexpr + { $$ = newUNOP(OP_ENTERSUBR, OPf_STACKED, + list(prepend_elem(OP_LIST, + newCVREF(scalar($2)), $3))); } | DO sexpr %prec UNIOP { $$ = newUNOP(OP_DOFILE, 0, scalar($2)); allgvs = TRUE;} @@ -546,6 +554,8 @@ indirob : WORD | block { $$ = scalar(scope($1)); } + | PRIVATEREF + { $$ = $1; } ; crp : ',' ')' @@ -69,6 +69,15 @@ PP(pp_null) return NORMAL; } +PP(pp_stub) +{ + dSP; + if (GIMME != G_ARRAY) { + XPUSHs(&sv_undef); + } + RETURN; +} + PP(pp_scalar) { return NORMAL; @@ -106,11 +115,6 @@ PP(pp_wantarray) RETPUSHNO; } -PP(pp_word) -{ - DIE("PP_WORD"); -} - PP(pp_const) { dSP; @@ -151,7 +155,7 @@ PP(pp_gvsv) { dSP; EXTEND(sp,1); - if (op->op_flags & OPf_LOCAL) + if (op->op_flags & OPf_INTRO) PUSHs(save_scalar(cGVOP->op_gv)); else PUSHs(GvSV(cGVOP->op_gv)); @@ -165,6 +169,39 @@ PP(pp_gv) RETURN; } +PP(pp_padsv) +{ + dSP; dTARGET; + XPUSHs(TARG); + if ((op->op_flags & (OPf_INTRO|OPf_SPECIAL)) == OPf_INTRO) + SvOK_off(TARG); + RETURN; +} + +PP(pp_padav) +{ + dSP; dTARGET; + XPUSHs(TARG); + if ((op->op_flags & (OPf_INTRO|OPf_SPECIAL)) == OPf_INTRO) + av_clear(TARG); + if (op->op_flags & OPf_LVAL) + RETURN; + PUTBACK; + return pp_rv2av(); +} + +PP(pp_padhv) +{ + dSP; dTARGET; + XPUSHs(TARG); + if ((op->op_flags & (OPf_INTRO|OPf_SPECIAL)) == OPf_INTRO) + hv_clear(TARG, FALSE); + if (op->op_flags & OPf_LVAL) + RETURN; + PUTBACK; + return pp_rv2hv(); +} + PP(pp_pushre) { dSP; @@ -183,10 +220,13 @@ PP(pp_rv2gv) DIE("Not a glob reference"); } else { - if (SvTYPE(sv) != SVt_PVGV) + if (SvTYPE(sv) != SVt_PVGV) { + if (!SvOK(sv)) + DIE(no_usym); sv = (SV*)gv_fetchpv(SvPVn(sv), TRUE); + } } - if (op->op_flags & OPf_LOCAL) { + if (op->op_flags & OPf_INTRO) { GP *ogp = GvGP(sv); SSCHECK(3); @@ -232,11 +272,14 @@ PP(pp_rv2sv) } } else { - if (SvTYPE(sv) != SVt_PVGV) + if (SvTYPE(sv) != SVt_PVGV) { + if (!SvOK(sv)) + DIE(no_usym); sv = (SV*)gv_fetchpv(SvPVn(sv), TRUE); + } sv = GvSV(sv); } - if (op->op_flags & OPf_LOCAL) + if (op->op_flags & OPf_INTRO) SETs(save_scalar((GV*)TOPs)); else SETs(sv); @@ -492,7 +535,7 @@ do_readline() SvCUR(sv)++; for (tmps = SvPV(sv); *tmps; tmps++) if (!isALPHA(*tmps) && !isDIGIT(*tmps) && - index("$&*(){}[]'\";\\|?<>~`", *tmps)) + strchr("$&*(){}[]'\";\\|?<>~`", *tmps)) break; if (*tmps && stat(SvPV(sv), &statbuf) < 0) { POPs; /* Unmatched wildcard? Chuck it... */ @@ -576,7 +619,7 @@ PP(pp_regcomp) { if (!global && rx) regfree(rx); pm->op_pmregexp = Null(REGEXP*); /* crucial if regcomp aborts */ - pm->op_pmregexp = regcomp(t, t+SvCUR(tmpstr), + pm->op_pmregexp = regcomp(t, t + SvCUROK(tmpstr), pm->op_pmflags & PMf_FOLD); if (!pm->op_pmregexp->prelen && curpm) pm = curpm; @@ -601,17 +644,12 @@ PP(pp_match) register char *s; char *strend; SV *tmpstr; - char *myhint = hint; I32 global; I32 safebase; char *truebase; register REGEXP *rx = pm->op_pmregexp; I32 gimme = GIMME; - hint = Nullch; - global = pm->op_pmflags & PMf_GLOBAL; - safebase = (gimme == G_ARRAY) || global; - if (op->op_flags & OPf_STACKED) TARG = POPs; else { @@ -619,7 +657,7 @@ PP(pp_match) EXTEND(SP,1); } s = SvPVn(TARG); - strend = s + SvCUR(TARG); + strend = s + SvCUROK(TARG); if (!s) DIE("panic: do_match"); @@ -634,6 +672,18 @@ PP(pp_match) rx = pm->op_pmregexp; } truebase = t = s; + if (global = pm->op_pmflags & PMf_GLOBAL) { + rx->startp[0] = 0; + if (SvTYPE(TARG) >= SVt_PVMG && SvMAGIC(TARG)) { + MAGIC* mg = mg_find(TARG, 'g'); + if (mg && mg->mg_ptr) { + rx->startp[0] = mg->mg_ptr; + rx->endp[0] = mg->mg_ptr + mg->mg_len; + } + } + } + safebase = (gimme == G_ARRAY) || global; + play_it_again: if (global && rx->startp[0]) { t = s = rx->endp[0]; @@ -642,19 +692,7 @@ play_it_again: if (s > strend) goto nope; } - if (myhint) { - if (myhint < s || myhint > strend) - DIE("panic: hint in do_match"); - s = myhint; - if (rx->regback >= 0) { - s -= rx->regback; - if (s < t) - s = t; - } - else - s = t; - } - else if (pm->op_pmshort) { + if (pm->op_pmshort) { if (pm->op_pmflags & PMf_SCANFIRST) { if (SvSCREAM(TARG)) { if (screamfirst[BmRARE(pm->op_pmshort)] < 0) @@ -706,13 +744,8 @@ play_it_again: pm->op_pmflags |= PMf_USED; goto gotcha; } - else { - if (global) - rx->startp[0] = Nullch; - if (gimme == G_ARRAY) - RETURN; - RETPUSHNO; - } + else + goto ret_no; /*NOTREACHED*/ gotcha: @@ -741,6 +774,17 @@ play_it_again: RETURN; } else { + if (global) { + MAGIC* mg = 0; + if (SvTYPE(TARG) >= SVt_PVMG && SvMAGIC(TARG)) + mg = mg_find(TARG, 'g'); + if (!mg) { + sv_magic(TARG, (SV*)0, 'g', Nullch, 0); + mg = mg_find(TARG, 'g'); + } + mg->mg_ptr = rx->startp[0]; + mg->mg_len = rx->endp[0] - rx->startp[0]; + } RETPUSHYES; } @@ -770,9 +814,19 @@ yup: RETPUSHYES; nope: - rx->startp[0] = Nullch; if (pm->op_pmshort) ++BmUSEFUL(pm->op_pmshort); + +ret_no: + if (global) { + if (SvTYPE(TARG) >= SVt_PVMG && SvMAGIC(TARG)) { + MAGIC* mg = mg_find(TARG, 'g'); + if (mg) { + mg->mg_ptr = 0; + mg->mg_len = 0; + } + } + } if (gimme == G_ARRAY) RETURN; RETPUSHNO; @@ -810,7 +864,7 @@ PP(pp_subst) if (!pm || !s) DIE("panic: do_subst"); - strend = s + SvCUR(TARG); + strend = s + SvCUROK(TARG); maxiters = (strend - s) + 10; if (!rx->prelen && curpm) { @@ -819,20 +873,7 @@ PP(pp_subst) } safebase = ((!rx || !rx->nparens) && !sawampersand); orig = m = s; - if (hint) { - if (hint < s || hint > strend) - DIE("panic: hint in do_match"); - s = hint; - hint = Nullch; - if (rx->regback >= 0) { - s -= rx->regback; - if (s < m) - s = m; - } - else - s = m; - } - else if (pm->op_pmshort) { + if (pm->op_pmshort) { if (pm->op_pmflags & PMf_SCANFIRST) { if (SvSCREAM(TARG)) { if (screamfirst[BmRARE(pm->op_pmshort)] < 0) @@ -871,7 +912,7 @@ PP(pp_subst) once = !(rpm->op_pmflags & PMf_GLOBAL); if (rpm->op_pmflags & PMf_CONST) { /* known replacement string? */ c = SvPVn(dstr); - clen = SvCUR(dstr); + clen = SvCUROK(dstr); if (clen <= rx->minlen) { /* can do inplace substitution */ if (regexec(rx, s, strend, orig, 0, @@ -1165,7 +1206,7 @@ PP(pp_aassign) if (*relem) sv_setsv(tmpstr,*relem); /* value */ *(relem++) = tmpstr; - (void)hv_store(hash,tmps,SvCUR(sv),tmpstr,0); + (void)hv_store(hash,tmps,SvCUROK(sv),tmpstr,0); } } break; @@ -1320,7 +1361,7 @@ PP(pp_undef) RETPUSHUNDEF; sv = POPs; - if (SvREADONLY(sv)) + if (!sv || SvREADONLY(sv)) RETPUSHUNDEF; switch (SvTYPE(sv)) { @@ -1330,7 +1371,7 @@ PP(pp_undef) av_undef((AV*)sv); break; case SVt_PVHV: - hv_undef((HV*)sv); + hv_undef((HV*)sv, TRUE); break; case SVt_PVCV: { CV *cv = (CV*)sv; @@ -1365,7 +1406,7 @@ PP(pp_study) I32 retval; s = (unsigned char*)(SvPVn(TARG)); - pos = SvCUR(TARG); + pos = SvCUROK(TARG); if (lastscream) SvSCREAM_off(lastscream); lastscream = TARG; @@ -1557,11 +1598,8 @@ PP(pp_repeat) SvNOK_off(TARG); sv_free(tmpstr); } - else { - if (dowarn && SvPOK(SP[1]) && !looks_like_number(SP[1])) - warn("Right operand of x is not numeric"); + else sv_setsv(TARG, &sv_no); - } PUSHTARG; } RETURN; @@ -1645,15 +1683,7 @@ PP(pp_ge) PP(pp_eq) { - dSP; double value; - - if (dowarn) { - if ((!SvNIOK(SP[ 0]) && !looks_like_number(SP[ 0])) || - (!SvNIOK(SP[-1]) && !looks_like_number(SP[-1])) ) - warn("Possible use of == on string value"); - } - - value = POPn; + dSP; dPOPnv; SETs((TOPn == value) ? &sv_yes : &sv_no); RETURN; } @@ -2023,7 +2053,7 @@ PP(pp_substr) pos = POPi - arybase; sv = POPs; tmps = SvPVn(sv); /* force conversion to string */ - curlen = SvCUR(sv); + curlen = SvCUROK(sv); if (pos < 0) pos += curlen + arybase; if (pos < 0 || pos > curlen) @@ -2059,17 +2089,18 @@ PP(pp_vec) unsigned char *s = (unsigned char*)SvPVn(src); unsigned long retnum; I32 len; + I32 srclen = SvCUROK(src); offset *= size; /* turn into bit offset */ len = (offset + size + 7) / 8; if (offset < 0 || size < 1) retnum = 0; - else if (!lvalue && len > SvCUR(src)) + else if (!lvalue && len > srclen) retnum = 0; else { - if (len > SvCUR(src)) { + if (len > srclen) { SvGROW(src, len); - (void)memzero(SvPV(src) + SvCUR(src), len - SvCUR(src)); + (void)memzero(SvPV(src) + srclen, len - srclen); SvCUR_set(src, len); } s = (unsigned char*)SvPVn(src); @@ -2109,6 +2140,7 @@ PP(pp_index) I32 retval; char *tmps; char *tmps2; + I32 biglen; if (MAXARG < 3) offset = 0; @@ -2117,12 +2149,13 @@ PP(pp_index) little = POPs; big = POPs; tmps = SvPVn(big); + biglen = SvCUROK(big); if (offset < 0) offset = 0; - else if (offset > SvCUR(big)) - offset = SvCUR(big); + else if (offset > biglen) + offset = biglen; if (!(tmps2 = fbm_instr((unsigned char*)tmps + offset, - (unsigned char*)tmps + SvCUR(big), little))) + (unsigned char*)tmps + biglen, little))) retval = -1 + arybase; else retval = tmps2 - tmps + arybase; @@ -2148,15 +2181,15 @@ PP(pp_rindex) tmps2 = SvPVn(little); tmps = SvPVn(big); if (MAXARG < 3) - offset = SvCUR(big); + offset = SvCUROK(big); else - offset = SvIVn(offstr) - arybase + SvCUR(little); + offset = SvIVn(offstr) - arybase + SvCUROK(little); if (offset < 0) offset = 0; - else if (offset > SvCUR(big)) - offset = SvCUR(big); + else if (offset > SvCUROK(big)) + offset = SvCUROK(big); if (!(tmps2 = rninstr(tmps, tmps + offset, - tmps2, tmps2 + SvCUR(little)))) + tmps2, tmps2 + SvCUROK(little)))) retval = -1 + arybase; else retval = tmps2 - tmps + arybase; @@ -2360,7 +2393,7 @@ PP(pp_formline) I32 itemsize; I32 fieldsize; I32 lines = 0; - bool chopspace = (index(chopset, ' ') != Nullch); + bool chopspace = (strchr(chopset, ' ') != Nullch); char *chophere; char *linemark; char *formmark; @@ -2444,7 +2477,7 @@ PP(pp_formline) case FF_CHECKNL: s = SvPVn(sv); - itemsize = SvCUR(sv); + itemsize = SvCUROK(sv); if (itemsize > fieldsize) itemsize = fieldsize; send = chophere = s + itemsize; @@ -2460,7 +2493,7 @@ PP(pp_formline) case FF_CHECKCHOP: s = SvPVn(sv); - itemsize = SvCUR(sv); + itemsize = SvCUROK(sv); if (itemsize > fieldsize) itemsize = fieldsize; send = chophere = s + itemsize; @@ -2474,7 +2507,7 @@ PP(pp_formline) else { if (*s & ~31) gotsome = TRUE; - if (index(chopset, *s)) + if (strchr(chopset, *s)) chophere = s + 1; } s++; @@ -2521,7 +2554,7 @@ PP(pp_formline) case FF_LINEGLOB: s = SvPVn(sv); - itemsize = SvCUR(sv); + itemsize = SvCUROK(sv); if (itemsize) { gotsome = TRUE; send = s + itemsize; @@ -2592,7 +2625,7 @@ PP(pp_formline) break; case FF_MORE: - if (SvCUR(sv)) { + if (SvCUROK(sv)) { arg = fieldsize - itemsize; if (arg) { fieldsize -= arg; @@ -2712,7 +2745,7 @@ PP(pp_uc) SETs(sv); } s = SvPVn(sv); - send = s + SvCUR(sv); + send = s + SvCUROK(sv); while (s < send) { if (isascii(*s) && islower(*s)) *s = toupper(*s); @@ -2735,7 +2768,7 @@ PP(pp_lc) SETs(sv); } s = SvPVn(sv); - send = s + SvCUR(sv); + send = s + SvCUROK(sv); while (s < send) { if (isascii(*s) && isupper(*s)) *s = tolower(*s); @@ -2757,21 +2790,33 @@ PP(pp_rv2av) if (SvTYPE(av) != SVt_PVAV) DIE("Not an array reference"); if (op->op_flags & OPf_LVAL) { - if (op->op_flags & OPf_LOCAL) + if (op->op_flags & OPf_INTRO) av = (AV*)save_svref(sv); PUSHs((SV*)av); RETURN; } } else { - if (SvTYPE(sv) != SVt_PVGV) - sv = (SV*)gv_fetchpv(SvPVn(sv), TRUE); - av = GvAVn(sv); - if (op->op_flags & OPf_LVAL) { - if (op->op_flags & OPf_LOCAL) - av = save_ary(sv); - PUSHs((SV*)av); - RETURN; + if (SvTYPE(sv) == SVt_PVAV) { + av = (AV*)sv; + if (op->op_flags & OPf_LVAL) { + PUSHs((SV*)av); + RETURN; + } + } + else { + if (SvTYPE(sv) != SVt_PVGV) { + if (!SvOK(sv)) + DIE(no_usym); + sv = (SV*)gv_fetchpv(SvPVn(sv), TRUE); + } + av = GvAVn(sv); + if (op->op_flags & OPf_LVAL) { + if (op->op_flags & OPf_INTRO) + av = save_ary(sv); + PUSHs((SV*)av); + RETURN; + } } } @@ -2808,10 +2853,10 @@ PP(pp_aelem) if (op->op_flags & OPf_LVAL) { svp = av_fetch(av, elem, TRUE); if (!svp || *svp == &sv_undef) - DIE("Assignment to non-creatable value, subscript %d", elem); - if (op->op_flags & OPf_LOCAL) + DIE(no_aelem, elem); + if (op->op_flags & OPf_INTRO) save_svref(svp); - else if (!SvOK(*svp)) { + else if (SvTYPE(*svp) == SVt_NULL) { if (op->op_private == OP_RV2HV) { sv_free(*svp); *svp = (SV*)newHV(COEFFSIZE); @@ -2842,8 +2887,8 @@ PP(pp_aslice) if (lval) { svp = av_fetch(av, elem, TRUE); if (!svp || *svp == &sv_undef) - DIE("Assignment to non-creatable value, subscript \"%d\"",elem); - if (op->op_flags & OPf_LOCAL) + DIE(no_aelem, elem); + if (op->op_flags & OPf_INTRO) save_svref(svp); } else { @@ -2912,7 +2957,7 @@ PP(pp_delete) DIE("Not an associative array reference"); } tmps = SvPVn(tmpsv); - sv = hv_delete(hv, tmps, SvCUR(tmpsv)); + sv = hv_delete(hv, tmps, SvCUROK(tmpsv)); if (!sv) RETPUSHUNDEF; PUSHs(sv); @@ -2931,21 +2976,33 @@ PP(pp_rv2hv) if (SvTYPE(hv) != SVt_PVHV) DIE("Not an associative array reference"); if (op->op_flags & OPf_LVAL) { - if (op->op_flags & OPf_LOCAL) + if (op->op_flags & OPf_INTRO) hv = (HV*)save_svref(sv); SETs((SV*)hv); RETURN; } } else { - if (SvTYPE(sv) != SVt_PVGV) - sv = (SV*)gv_fetchpv(SvPVn(sv), TRUE); - hv = GvHVn(sv); - if (op->op_flags & OPf_LVAL) { - if (op->op_flags & OPf_LOCAL) - hv = save_hash(sv); - SETs((SV*)hv); - RETURN; + if (SvTYPE(sv) == SVt_PVHV) { + hv = (HV*)sv; + if (op->op_flags & OPf_LVAL) { + SETs((SV*)hv); + RETURN; + } + } + else { + if (SvTYPE(sv) != SVt_PVGV) { + if (!SvOK(sv)) + DIE(no_usym); + sv = (SV*)gv_fetchpv(SvPVn(sv), TRUE); + } + hv = GvHVn(sv); + if (op->op_flags & OPf_LVAL) { + if (op->op_flags & OPf_INTRO) + hv = save_hash(sv); + SETs((SV*)hv); + RETURN; + } } } @@ -2973,16 +3030,16 @@ PP(pp_helem) SV** svp; SV *keysv = POPs; char *key = SvPVn(keysv); - I32 keylen = SvPOK(keysv) ? SvCUR(keysv) : 0; + I32 keylen = SvCUROK(keysv); HV *hv = (HV*)POPs; if (op->op_flags & OPf_LVAL) { svp = hv_fetch(hv, key, keylen, TRUE); if (!svp || *svp == &sv_undef) - DIE("Assignment to non-creatable value, subscript \"%s\"", key); - if (op->op_flags & OPf_LOCAL) + DIE(no_helem, key); + if (op->op_flags & OPf_INTRO) save_svref(svp); - else if (!SvOK(*svp)) { + else if (SvTYPE(*svp) == SVt_NULL) { if (op->op_private == OP_RV2HV) { sv_free(*svp); *svp = (SV*)newHV(COEFFSIZE); @@ -3009,13 +3066,13 @@ PP(pp_hslice) while (++MARK <= SP) { char *key = SvPVnx(*MARK); - I32 keylen = SvPOK(*MARK) ? SvCUR(*MARK) : 0; + I32 keylen = SvCUROK(*MARK); if (lval) { svp = hv_fetch(hv, key, keylen, TRUE); if (!svp || *svp == &sv_undef) - DIE("Assignment to non-creatable value, subscript \"%s\"", key); - if (op->op_flags & OPf_LOCAL) + DIE(no_helem, key); + if (op->op_flags & OPf_INTRO) save_svref(svp); } else { @@ -3039,9 +3096,9 @@ PP(pp_unpack) SV *sv; register char *pat = SvPVn(lstr); register char *s = SvPVn(rstr); - char *strend = s + SvCUR(rstr); + char *strend = s + SvCUROK(rstr); char *strbeg = s; - register char *patend = pat + SvCUR(lstr); + register char *patend = pat + SvCUROK(lstr); I32 datumtype; register I32 len; register I32 bits; @@ -3070,7 +3127,7 @@ PP(pp_unpack) if (GIMME != G_ARRAY) { /* arrange to do first one only */ /*SUPPRESS 530*/ for (patend = pat; !isALPHA(*patend) || *patend == 'x'; patend++) ; - if (index("aAbBhH", *patend) || *pat == '%') { + if (strchr("aAbBhH", *patend) || *pat == '%') { patend++; while (isDIGIT(*patend) || *patend == '*') patend++; @@ -3602,8 +3659,8 @@ PP(pp_unpack) } if (checksum) { sv = NEWSV(42, 0); - if (index("fFdD", datumtype) || - (checksum > 32 && index("iIlLN", datumtype)) ) { + if (strchr("fFdD", datumtype) || + (checksum > 32 && strchr("iIlLN", datumtype)) ) { double modf(); double trouble; @@ -3671,10 +3728,11 @@ PP(pp_pack) register SV *cat = TARG; register I32 items; register char *pat = SvPVnx(*++MARK); - register char *patend = pat + SvCUR(*MARK); + register char *patend = pat + SvCUROK(*MARK); register I32 len; I32 datumtype; SV *fromstr; + I32 fromlen; /*SUPPRESS 442*/ static char *null10 = "\0\0\0\0\0\0\0\0\0\0"; static char *space10 = " "; @@ -3701,7 +3759,7 @@ PP(pp_pack) #define NEXTFROM (items-- > 0 ? *MARK++ : &sv_no) datumtype = *pat++; if (*pat == '*') { - len = index("@Xxu", datumtype) ? 0 : items; + len = strchr("@Xxu", datumtype) ? 0 : items; pat++; } else if (isDIGIT(*pat)) { @@ -3743,13 +3801,14 @@ PP(pp_pack) case 'a': fromstr = NEXTFROM; aptr = SvPVn(fromstr); + fromlen = SvCUROK(fromstr); if (pat[-1] == '*') - len = SvCUR(fromstr); - if (SvCUR(fromstr) > len) + len = fromlen; + if (fromlen > len) sv_catpvn(cat, aptr, len); else { - sv_catpvn(cat, aptr, SvCUR(fromstr)); - len -= SvCUR(fromstr); + sv_catpvn(cat, aptr, fromlen); + len -= fromlen; if (datumtype == 'A') { while (len >= 10) { sv_catpvn(cat, space10, 10); @@ -3775,15 +3834,16 @@ PP(pp_pack) fromstr = NEXTFROM; saveitems = items; aptr = SvPVn(fromstr); + fromlen = SvCUROK(fromstr); if (pat[-1] == '*') - len = SvCUR(fromstr); + len = fromlen; pat = aptr; aint = SvCUR(cat); SvCUR(cat) += (len+7)/8; SvGROW(cat, SvCUR(cat) + 1); aptr = SvPV(cat) + aint; - if (len > SvCUR(fromstr)) - len = SvCUR(fromstr); + if (len > fromlen) + len = fromlen; aint = len; items = 0; if (datumtype == 'B') { @@ -3833,15 +3893,16 @@ PP(pp_pack) fromstr = NEXTFROM; saveitems = items; aptr = SvPVn(fromstr); + fromlen = SvCUROK(fromstr); if (pat[-1] == '*') - len = SvCUR(fromstr); + len = fromlen; pat = aptr; aint = SvCUR(cat); SvCUR(cat) += (len+1)/2; SvGROW(cat, SvCUR(cat) + 1); aptr = SvPV(cat) + aint; - if (len > SvCUR(fromstr)) - len = SvCUR(fromstr); + if (len > fromlen) + len = fromlen; aint = len; items = 0; if (datumtype == 'H') { @@ -4010,21 +4071,21 @@ PP(pp_pack) case 'u': fromstr = NEXTFROM; aptr = SvPVn(fromstr); - aint = SvCUR(fromstr); - SvGROW(cat, aint * 4 / 3); + fromlen = SvCUROK(fromstr); + SvGROW(cat, fromlen * 4 / 3); if (len <= 1) len = 45; else len = len / 3 * 3; - while (aint > 0) { + while (fromlen > 0) { I32 todo; - if (aint > len) + if (fromlen > len) todo = len; else - todo = aint; + todo = fromlen; doencodes(cat, aptr, todo); - aint -= todo; + fromlen -= todo; aptr += todo; } break; @@ -4041,9 +4102,10 @@ PP(pp_split) { dSP; dTARG; AV *ary; - register I32 limit = POPi; - register char *s = SvPVn(TOPs); - char *strend = s + SvCURx(POPs); + register I32 limit = POPi; /* note, negative is forever */ + SV *sv = POPs; + register char *s = SvPVn(sv); + char *strend = s + SvCUROK(sv); register PMOP *pm = (PMOP*)POPs; register SV *dstr; register char *m; @@ -4309,12 +4371,12 @@ PP(pp_anonhash) SvREFCNT(hv) = 0; while (MARK < SP) { SV* key = *++MARK; - SV* val; char *tmps; + SV *val = NEWSV(46, 0); if (MARK < SP) - val = *++MARK; + sv_setsv(val, *++MARK); tmps = SvPV(key); - (void)hv_store(hv,tmps,SvCUR(key),val,0); + (void)hv_store(hv,tmps,SvCUROK(key),val,0); } SP = ORIGMARK; XPUSHs((SV*)hv); @@ -4660,7 +4722,7 @@ PP(pp_sort) if (GIMME != G_ARRAY) { SP = MARK; - RETSETUNDEF; + RETPUSHUNDEF; } if (op->op_flags & OPf_STACKED) { @@ -4673,14 +4735,21 @@ PP(pp_sort) } else { cv = sv_2cv(*++MARK, &stash, &gv, 0); - if (!cv) { + if (!(cv && CvROOT(cv))) { if (gv) { SV *tmpstr = sv_mortalcopy(&sv_undef); gv_efullname(tmpstr, gv); + if (CvUSERSUB(cv)) + DIE("Usersub \"%s\" called in sort", SvPV(tmpstr)); DIE("Undefined sort subroutine \"%s\" called", SvPV(tmpstr)); } - DIE("Undefined subroutine in sort"); + if (cv) { + if (CvUSERSUB(cv)) + DIE("Usersub called in sort"); + DIE("Undefined subroutine in sort"); + } + DIE("Not a subroutine reference in sort"); } sortcop = CvSTART(cv); SAVESPTR(CvROOT(cv)->op_ppaddr); @@ -4766,17 +4835,18 @@ PP(pp_reverse) dTARGET; if (SP - MARK > 1) - do_join(TARG, sv_no, MARK, SP); + do_join(TARG, &sv_no, MARK, SP); else sv_setsv(TARG, *SP); up = SvPVn(TARG); - if (SvCUR(TARG) > 1) { + if (SvCUROK(TARG) > 1) { down = SvPV(TARG) + SvCUR(TARG) - 1; while (down > up) { tmp = *up; *up++ = *down; *down-- = tmp; } + SvPOK_only(TARG); } SP = MARK + 1; SETTARG; @@ -5141,7 +5211,7 @@ PP(pp_method) if (!gv) { /* nothing cached */ char *name = SvPV(((SVOP*)cLOGOP->op_other)->op_sv); - if (index(name, '\'')) + if (strchr(name, '\'')) gv = gv_fetchpv(name, FALSE); else gv = gv_fetchmethod(SvSTASH(ob),name); @@ -5170,12 +5240,14 @@ PP(pp_entersubr) ENTER; SAVETMPS; - if (!cv) { + if (!(cv && (CvROOT(cv) || CvUSERSUB(cv)))) { if (gv) { SV *tmpstr = sv_mortalcopy(&sv_undef); gv_efullname(tmpstr, gv); DIE("Undefined subroutine \"%s\" called",SvPV(tmpstr)); } + if (cv) + DIE("Undefined subroutine called"); DIE("Not a subroutine reference"); } if ((op->op_private & OPpSUBR_DB) && !CvUSERSUB(cv)) { @@ -5199,6 +5271,8 @@ PP(pp_entersubr) } else { I32 gimme = GIMME; + AV* padlist = CvPADLIST(cv); + SV** svp = AvARRAY(padlist); push_return(op->op_next); PUSHBLOCK(cx, CXt_SUB, MARK - 1); PUSHSUB(cx); @@ -5211,17 +5285,30 @@ PP(pp_entersubr) if (CvDEPTH(cv) >= 2) { /* save temporaries on recursion? */ if (CvDEPTH(cv) == 100 && dowarn) warn("Deep recursion on subroutine \"%s\"",GvENAME(gv)); - if (CvDEPTH(cv) > AvFILL(CvPADLIST(cv))) { + if (CvDEPTH(cv) > AvFILL(padlist)) { AV *newpad = newAV(); - I32 ix = AvFILL((AV*)*av_fetch(CvPADLIST(cv), 1, FALSE)); - while (ix > 0) - av_store(newpad, ix--, NEWSV(0,0)); - av_store(CvPADLIST(cv), CvDEPTH(cv), (SV*)newpad); - AvFILL(CvPADLIST(cv)) = CvDEPTH(cv); + I32 ix = AvFILL((AV*)svp[1]); + svp = AvARRAY(svp[0]); + while (ix > 0) { + if (svp[ix]) { + char *name = SvPV(svp[ix]); /* XXX */ + if (*name == '@') + av_store(newpad, ix--, newAV()); + else if (*name == '%') + av_store(newpad, ix--, newHV(COEFFSIZE)); + else + av_store(newpad, ix--, NEWSV(0,0)); + } + else + av_store(newpad, ix--, NEWSV(0,0)); + } + av_store(padlist, CvDEPTH(cv), (SV*)newpad); + AvFILL(padlist) = CvDEPTH(cv); + svp = AvARRAY(padlist); } } SAVESPTR(curpad); - curpad = AvARRAY((AV*)*av_fetch(CvPADLIST(cv),CvDEPTH(cv),FALSE)); + curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]); RETURNOP(CvSTART(cv)); } } @@ -5272,13 +5359,15 @@ PP(pp_caller) SV *sv; I32 count = 0; - if (cxix < 0) - DIE("There is no caller"); if (MAXARG) count = POPi; + EXTEND(SP, 6); for (;;) { - if (cxix < 0) + if (cxix < 0) { + if (GIMME != G_ARRAY) + RETPUSHUNDEF; RETURN; + } nextcxix = dopoptosub(cxix - 1); if (DBsub && nextcxix >= 0 && cxstack[nextcxix].blk_sub.cv == GvCV(DBsub)) @@ -5288,7 +5377,11 @@ PP(pp_caller) cxix = nextcxix; } cx = &cxstack[cxix]; - EXTEND(SP, 6); + if (cx->blk_oldcop == &compiling) { + if (GIMME != G_ARRAY) + RETPUSHUNDEF; + RETURN; + } if (GIMME != G_ARRAY) { dTARGET; @@ -5364,7 +5457,7 @@ PP(pp_warn) char *tmps; if (SP - MARK != 1) { dTARGET; - do_join(TARG, sv_no, MARK, SP); + do_join(TARG, &sv_no, MARK, SP); tmps = SvPVn(TARG); SP = MARK + 1; } @@ -5373,6 +5466,7 @@ PP(pp_warn) } if (!tmps || !*tmps) { SV *error = GvSV(gv_fetchpv("@", TRUE)); + SvUPGRADE(error, SVt_PV); if (SvCUR(error)) sv_catpv(error, "\t...caught"); tmps = SvPVn(error); @@ -5389,7 +5483,7 @@ PP(pp_die) char *tmps; if (SP - MARK != 1) { dTARGET; - do_join(TARG, sv_no, MARK, SP); + do_join(TARG, &sv_no, MARK, SP); tmps = SvPVn(TARG); SP = MARK + 1; } @@ -5398,6 +5492,7 @@ PP(pp_die) } if (!tmps || !*tmps) { SV *error = GvSV(gv_fetchpv("@", TRUE)); + SvUPGRADE(error, SVt_PV); if (SvCUR(error)) sv_catpv(error, "\t...propagated"); tmps = SvPVn(error); @@ -5427,7 +5522,7 @@ PP(pp_lineseq) return NORMAL; } -PP(pp_curcop) +PP(pp_nextstate) { curcop = (COP*)op; #ifdef TAINT @@ -5438,6 +5533,50 @@ PP(pp_curcop) return NORMAL; } +PP(pp_dbstate) +{ + curcop = (COP*)op; +#ifdef TAINT + tainted = 0; /* Each statement is presumed innocent */ +#endif + stack_sp = stack_base + cxstack[cxstack_ix].blk_oldsp; + free_tmps(); + + if (op->op_private || SvIVn(DBsingle) || SvIVn(DBsignal) || SvIVn(DBtrace)) + { + SV **sp; + register CV *cv; + register CONTEXT *cx; + I32 gimme = GIMME; + I32 hasargs; + GV *gv; + + ENTER; + SAVETMPS; + + hasargs = 0; + gv = DBgv; + cv = GvCV(gv); + sp = stack_sp; + *++sp = Nullsv; + + if (!cv) + DIE("No DB'DB routine defined"); + + push_return(op->op_next); + PUSHBLOCK(cx, CXt_SUB, sp - 1); + PUSHSUB(cx); + CvDEPTH(cv)++; + if (CvDEPTH(cv) >= 2) + DIE("DB'DB called recursively"); + SAVESPTR(curpad); + curpad = AvARRAY((AV*)*av_fetch(CvPADLIST(cv),1,FALSE)); + RETURNOP(CvSTART(cv)); + } + else + return NORMAL; +} + PP(pp_unstack) { I32 oldsave; @@ -5747,15 +5886,15 @@ OP **opstack; if (op->op_flags & OPf_KIDS) { /* First try all the kids at this level, since that's likeliest. */ for (kid = cUNOP->op_first; kid; kid = kid->op_sibling) { - if (kid->op_type == OP_CURCOP && kCOP->cop_label && + if (kid->op_type == OP_NEXTSTATE && kCOP->cop_label && strEQ(kCOP->cop_label, label)) return kid; } for (kid = cUNOP->op_first; kid; kid = kid->op_sibling) { if (kid == lastgotoprobe) continue; - if (kid->op_type == OP_CURCOP) { - if (ops > opstack && ops[-1]->op_type == OP_CURCOP) + if (kid->op_type == OP_NEXTSTATE) { + if (ops > opstack && ops[-1]->op_type == OP_NEXTSTATE) *ops = kid; else *ops++ = kid; @@ -5931,12 +6070,16 @@ PP(pp_open) { dSP; dTARGET; GV *gv; - dPOPss; + SV *sv; char *tmps; + if (MAXARG > 1) + sv = POPs; + else + sv = GvSV(TOPs); gv = (GV*)POPs; tmps = SvPVn(sv); - if (do_open(gv, tmps, SvCUR(sv))) { + if (do_open(gv, tmps, SvCUROK(sv))) { GvIO(gv)->lines = 0; PUSHi( (I32)forkprocess ); } @@ -7170,7 +7313,7 @@ PP(pp_ssockopt) switch (optype) { case OP_GSOCKOPT: SvCUR_set(sv, 256); - SvPOK_on(sv); + SvPOK_only(sv); if (getsockopt(fd, lvl, optname, SvPV(sv), (int*)&SvCUR(sv)) < 0) goto nuts2; PUSHs(sv); @@ -7285,7 +7428,7 @@ PP(pp_stat) #endif laststatval = stat(SvPVn(statname), &statcache); if (laststatval < 0) { - if (dowarn && index(SvPVn(statname), '\n')) + if (dowarn && strchr(SvPVn(statname), '\n')) warn(warn_nl, "stat"); max = 0; } @@ -7667,7 +7810,7 @@ PP(pp_fttext) really_filename: i = open(SvPVn(sv), 0); if (i < 0) { - if (dowarn && index(SvPVn(sv), '\n')) + if (dowarn && strchr(SvPVn(sv), '\n')) warn(warn_nl, "open"); RETPUSHUNDEF; } @@ -8660,7 +8803,8 @@ SV *sv; while (s && s < send) { SV *tmpstr = NEWSV(85,0); - t = index(s, '\n'); + sv_upgrade(tmpstr, SVt_PVMG); + t = strchr(s, '\n'); if (t) t++; else @@ -8687,7 +8831,11 @@ doeval() SAVEINT(padix); SAVESPTR(curpad); SAVESPTR(comppad); + SAVESPTR(comppadname); + SAVEINT(comppadnamefill); comppad = newAV(); + comppadname = newAV(); + comppadnamefill = -1; av_push(comppad, Nullsv); curpad = AvARRAY(comppad); padix = 0; @@ -8699,12 +8847,18 @@ doeval() SAVESPTR(curstash); curstash = newstash; } + SAVESPTR(beginav); + beginav = 0; /* try to compile it */ eval_root = Nullop; error_count = 0; curcop = &compiling; + rs = "\n"; + rslen = 1; + rschar = '\n'; + rspara = 0; if (yyparse() || error_count || !eval_root) { SV **newsp; I32 gimme; @@ -8722,14 +8876,27 @@ doeval() } if (optype == OP_REQUIRE) DIE("%s", SvPVnx(GvSV(gv_fetchpv("@",TRUE)))); + rs = nrs; + rslen = nrslen; + rschar = nrschar; + rspara = (nrslen == 2); RETPUSHUNDEF; } + rs = nrs; + rslen = nrslen; + rschar = nrschar; + rspara = (nrslen == 2); compiling.cop_line = 0; DEBUG_x(dump_eval(eval_root, eval_start)); /* compiled okay, so do it */ + if (beginav) { + calllist(beginav); + av_free(beginav); + beginav = 0; + } sv_setpv(GvSV(gv_fetchpv("@",TRUE)),""); RETURNOP(eval_start); } @@ -8753,6 +8920,7 @@ PP(pp_require) sv_setpv(linestr,""); + SAVESPTR(rsfp); /* in case we're in a BEGIN */ tmpname = savestr(name); if (*tmpname == '/' || (*tmpname == '.' && @@ -8890,6 +9058,7 @@ PP(pp_leaveeval) } op_free(eroot); av_free(comppad); + av_free(comppadname); LEAVE; sv_setpv(GvSV(gv_fetchpv("@",TRUE)),""); @@ -9300,10 +9469,10 @@ PP(pp_gservent) PP(pp_shostent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - SETi( sethostent(TOPi) ); - RETURN; + sethostent(TOPi); + RETSETYES; #else DIE(no_sock_func, "sethostent"); #endif @@ -9311,10 +9480,10 @@ PP(pp_shostent) PP(pp_snetent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - SETi( setnetent(TOPi) ); - RETURN; + setnetent(TOPi); + RETSETYES; #else DIE(no_sock_func, "setnetent"); #endif @@ -9322,10 +9491,10 @@ PP(pp_snetent) PP(pp_sprotoent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - SETi( setprotoent(TOPi) ); - RETURN; + setprotoent(TOPi); + RETSETYES; #else DIE(no_sock_func, "setprotoent"); #endif @@ -9333,10 +9502,10 @@ PP(pp_sprotoent) PP(pp_sservent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - SETi( setservent(TOPi) ); - RETURN; + setservent(TOPi); + RETSETYES; #else DIE(no_sock_func, "setservent"); #endif @@ -9344,10 +9513,11 @@ PP(pp_sservent) PP(pp_ehostent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - XPUSHi( endhostent() ); - RETURN; + endhostent(); + EXTEND(sp,1); + RETPUSHYES; #else DIE(no_sock_func, "endhostent"); #endif @@ -9355,10 +9525,11 @@ PP(pp_ehostent) PP(pp_enetent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - XPUSHi( endnetent() ); - RETURN; + endnetent(); + EXTEND(sp,1); + RETPUSHYES; #else DIE(no_sock_func, "endnetent"); #endif @@ -9366,10 +9537,11 @@ PP(pp_enetent) PP(pp_eprotoent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - XPUSHi( endprotoent() ); - RETURN; + endprotoent(); + EXTEND(sp,1); + RETPUSHYES; #else DIE(no_sock_func, "endprotoent"); #endif @@ -9377,10 +9549,11 @@ PP(pp_eprotoent) PP(pp_eservent) { - dSP; dTARGET; + dSP; #ifdef HAS_SOCKET - XPUSHi( endservent() ); - RETURN; + endservent(); + EXTEND(sp,1); + RETPUSHYES; #else DIE(no_sock_func, "endservent"); #endif @@ -79,7 +79,7 @@ #define TOPp (SvPVn(TOPs)) #define TOPn (SvNVn(TOPs)) #define TOPi ((int)SvIVn(TOPs)) -#define TOPl ((long)SvNVn(TOPs)) +#define TOPl ((long)SvIVn(TOPs)) /* Go to some pains in the rare event that we must extend the stack. */ #define EXTEND(p,n) do { if (stack_max - p < (n)) { \ diff --git a/predump b/predump new file mode 100644 index 0000000000..272c3734c9 --- /dev/null +++ b/predump @@ -0,0 +1,41 @@ + SV *sv; + GV* tmpgv; + + /* initialize everything that won't change if we undump */ + + if (siggv = gv_fetchpv("SIG",allgvs)) { + HV *hv; + SvMULTI_on(siggv); + hv = GvHVn(siggv); + hv_magic(hv, siggv, 'S'); + + /* initialize signal stack */ + signalstack = newAV(); + av_store(signalstack, 32, Nullsv); + av_clear(signalstack); + AvREAL_off(signalstack); + } + + magicalize("!#?^~=-%.+&*()<>,\\/[|`':\004\t\020\024\027\006"); + + ampergv = gv_fetchpv("&",allgvs); + leftgv = gv_fetchpv("`",allgvs); + rightgv = gv_fetchpv("'",allgvs); + sawampersand = (ampergv || leftgv || rightgv); + if (tmpgv = gv_fetchpv(":",allgvs)) + sv_setpv(GvSV(tmpgv),chopset); + + /* these aren't necessarily magical */ + if (tmpgv = gv_fetchpv("\014",allgvs)) { + sv_setpv(GvSV(tmpgv),"\f"); + formfeed = GvSV(tmpgv); + } + if (tmpgv = gv_fetchpv(";",allgvs)) + sv_setpv(GvSV(tmpgv),"\034"); + if (tmpgv = gv_fetchpv("]",allgvs)) { + sv = GvSV(tmpgv); + sv_upgrade(sv, SVt_PVNV); + sv_setpv(sv,rcsid); + SvNV(sv) = atof(patchlevel); + SvNOK_on(sv); + } @@ -1,139 +1,141 @@ -OP * CopDBadd P((OP *cur)); -OP * add_label P((char *lbl, OP *cmd)); -OP * addcond P((OP *cmd, OP *arg)); -OP * addflags P((I32 i, I32 flags, OP *arg)); -OP * addloop P((OP *cmd, OP *arg)); -OP * append_elem P((I32 optype, OP *head, OP *tail)); -OP * append_list P((I32 optype, OP *head, OP *tail)); -I32 apply P((I32 type, SV **mark, SV **sp)); -void av_clear P((AV *ar)); -AV * av_fake P((I32 size, SV **strp)); -SV ** av_fetch P((AV *ar, I32 key, I32 lval)); -void av_fill P((AV *ar, I32 fill)); -void av_free P((AV *ar)); -I32 av_len P((AV *ar)); -AV * av_make P((I32 size, SV **strp)); -SV * av_pop P((AV *ar)); -void av_popnulls P((AV *ar)); -bool av_push P((AV *ar, SV *val)); -SV * av_shift P((AV *ar)); -SV ** av_store P((AV *ar, I32 key, SV *val)); -void av_undef P((AV *ar)); -void av_unshift P((AV *ar, I32 num)); -OP * bind_match P((I32 type, OP *left, OP *pat)); -OP * block_head P((OP *tail)); -I32 cando P((I32 bit, I32 effective, struct stat *statbufp)); -unsigned long cast_ulong P((double f)); -void checkcomma P((char *s, char *name, char *what)); -I32 chsize P((int fd, off_t length)); -OP * convert P((I32 optype, I32 flags, OP *op)); -OP * cop_to_arg P((OP *cmd)); -I32 copyopt P((OP *cmd, OP *which)); -void cpy7bit P((char *d, char *s, I32 l)); -char * cpytill P((char *to, char *from, char *fromend, I32 delim, I32 *retlen)); -void cryptfilter P((FILE *fil)); -void cryptswitch P((void)); -void deb P((char *pat, ...)); -void deb_growlevel P((void)); -OP * die P((const char* pat, ...)); -OP * die_where P((char *message)); -void do_accept P((SV *sv, GV *ngv, GV *ggv)); -bool do_aexec P((SV *really, SV **mark, SV **sp)); -void do_chop P((SV *astr, SV *sv)); -bool do_close P((GV *gv, bool explicit)); -int do_ctl P((I32 optype, GV *gv, I32 func, SV *argstr)); -bool do_eof P((GV *gv)); -bool do_exec P((char *cmd)); -void do_execfree P((void)); -SV * do_fttext P((OP *arg, SV *sv)); -I32 do_ipcctl P((I32 optype, SV **mark, SV **sp)); -I32 do_ipcget P((I32 optype, SV **mark, SV **sp)); -void do_join P((SV *sv, SV *del, SV **mark, SV **sp)); -OP * do_kv P((SV*,OP*,I32)); -I32 do_msgrcv P((SV **mark, SV **sp)); -I32 do_msgsnd P((SV **mark, SV **sp)); -bool do_open P((GV *gv, char *name, I32 len)); -void do_pipe P((SV *sv, GV *rgv, GV *wgv)); -bool do_print P((SV *sv, FILE *fp)); -I32 do_repeatary P((SV*,OP*,I32)); -bool do_seek P((GV *gv, long pos, int whence)); -I32 do_semop P((SV **mark, SV **sp)); -I32 do_shmio P((I32 optype, SV **mark, SV **sp)); -void do_sprintf P((SV *sv, int len, SV **sarg)); -OP * do_subr P((void)); -long do_tell P((GV *gv)); -I32 do_trans P((SV *sv, OP *arg)); -void do_vecset P((SV *sv)); -void do_vop P((I32 optype, SV *sv, SV *left, SV *right)); -void do_write P((struct Outrec *orec, GV *gv)); -void dump_all P((void)); -void dump_cop P((OP *cmd, OP *alt)); -void dump_eval P((OP *root, OP *start)); - dump_fds P((char *s)); -void dump_flags P((char *b, U32 flags)); -void dump_gv P((GV *gv)); -void dump_op P((OP *arg)); -void dump_pm P((PM *pm)); +OP* CopDBadd P((OP* cur)); +OP* add_label P((char* lbl, OP* cmd)); +OP* addcond P((OP* cmd, OP* arg)); +OP* addflags P((I32 i, I32 flags, OP* arg)); +OP* addloop P((OP* cmd, OP* arg)); +OP* append_elem P((I32 optype, OP* head, OP* tail)); +OP* append_list P((I32 optype, LISTOP* first, LISTOP* last)); +I32 apply P((I32 type, SV** mark, SV** sp)); +void av_clear P((AV* ar)); +AV* av_fake P((I32 size, SV** strp)); +SV** av_fetch P((AV* ar, I32 key, I32 lval)); +void av_fill P((AV* ar, I32 fill)); +void av_free P((AV* ar)); +I32 av_len P((AV* ar)); +AV* av_make P((I32 size, SV** strp)); +SV* av_pop P((AV* ar)); +void av_popnulls P((AV* ar)); +bool av_push P((AV* ar, SV* val)); +SV* av_shift P((AV* ar)); +SV** av_store P((AV* ar, I32 key, SV* val)); +void av_undef P((AV* ar)); +void av_unshift P((AV* ar, I32 num)); +OP* bind_match P((I32 type, OP* left, OP* pat)); +OP* block_head P((OP* o, OP** startp)); +void calllist P((AV* list)); +I32 cando P((I32 bit, I32 effective, struct stat* statbufp)); +unsigned long cast_ulong P((double f)); +void checkcomma P((char* s, char* name, char* what)); +I32 chsize P((int fd, off_t length)); +OP* convert P((I32 optype, I32 flags, OP* op)); +OP* cop_to_arg P((OP* cmd)); +I32 copyopt P((OP* cmd, OP* which)); +void cpy7bit P((char* d, char* s, I32 l)); +char* cpytill P((char* to, char* from, char* fromend, I32 delim, I32* retlen)); +void cryptfilter P((FILE* fil)); +void cryptswitch P((void)); +void deb P((va_alist)); +void deb_growlevel P((void)); +OP* die P((va_alist)); +OP* die_where P((char* message)); +void do_accept P((SV* sv, GV* ngv, GV* ggv)); +bool do_aexec P((SV* really, SV** mark, SV** sp)); +void do_chop P((SV* astr, SV* sv)); +bool do_close P((GV* gv, bool explicit)); +int do_ctl P((I32 optype, GV* gv, I32 func, SV* argstr)); +bool do_eof P((GV* gv)); +bool do_exec P((char* cmd)); +void do_execfree P((void)); +SV* do_fttext P((OP* arg, SV* sv)); +I32 do_ipcctl P((I32 optype, SV** mark, SV** sp)); +I32 do_ipcget P((I32 optype, SV** mark, SV** sp)); +void do_join P((SV* sv, SV* del, SV** mark, SV** sp)); +OP* do_kv P(()); +I32 do_msgrcv P((SV** mark, SV** sp)); +I32 do_msgsnd P((SV** mark, SV** sp)); +bool do_open P((GV* gv, char* name, I32 len)); +void do_pipe P((SV* sv, GV* rgv, GV* wgv)); +bool do_print P((SV* sv, FILE* fp)); +bool do_seek P((GV* gv, long pos, int whence)); +I32 do_semop P((SV** mark, SV** sp)); +I32 do_shmio P((I32 optype, SV** mark, SV** sp)); +void do_sprintf P((SV* sv, int len, SV** sarg)); +OP* do_subr P((void)); +long do_tell P((GV* gv)); +I32 do_trans P((SV* sv, OP* arg)); +void do_vecset P((SV* sv)); +void do_vop P((I32 optype, SV* sv, SV* left, SV* right)); +void do_write P((struct Outrec* orec, GV* gv)); +void dump_all P((void)); +void dump_cop P((OP* cmd, OP* alt)); +void dump_eval P(()); + dump_fds P((char* s)); +void dump_flags P((char* b, U32 flags)); +void dump_gv P((GV* gv)); +void dump_op P((OP* arg)); +void dump_pm P((PMOP* pm)); +void dump_sub P((GV* gv)); dup2 P((int oldfd, int newfd)); -void fbm_compile P((SV *sv, I32 iflag)); -char * fbm_instr P((unsigned char *big, unsigned char *bigend, SV *littlestr)); -IO * fetch_io P((OP* op, I32 num)); -GV * fetch_gv P((OP* op, I32 num)); -OP * flatten P((OP *arg)); -void force_ident P((char *s)); -char * force_word P((char *s)); -OP * forcelist P((OP *arg)); +void fbm_compile P((SV* sv, I32 iflag)); +char* fbm_instr P((unsigned char* big, unsigned char* bigend, SV* littlestr)); +IO* fetch_io P((OP* op, I32 num)); +GV* fetch_gv P((OP* op, I32 num)); +OP* flatten P((OP* arg)); +void force_ident P((char* s)); +char* force_word P((char* s, int token)); +OP* forcelist P((OP* arg)); void free_tmps P((void)); -OP * gen_constant_list P((OP *op)); +OP* gen_constant_list P((OP* op)); I32 getgimme P((OP*op)); void gp_free P((GV* gv)); -GP * gp_ref P((GP* gp)); -GV * gv_AVadd P((GV *gv)); -GV * gv_HVadd P((GV *gv)); -void gv_check P((I32 min, I32 max)); -void gv_efullname P((SV *sv, GV *gv)); -GV * gv_fetchfile P((char *name)); -GV * gv_fetchmethod P((HV* stash, char *name)); -GV * gv_fetchpv P((char *name, I32 add)); -void gv_fullname P((SV *sv, GV *gv)); -STRLEN gv_len P((SV *sv)); -SV * gv_str P((SV *sv)); -OP * gv_to_op P((I32 atype, GV *gv)); -void he_delayfree P((HE *hent)); -void he_free P((HE *hent)); -void hoistmust P((PM *pm)); -void hv_clear P((HV *tb, I32 dodbm)); -void hv_dbmclose P((HV *tb)); -bool hv_dbmopen P((HV *tb, char *fname, int mode)); -bool hv_dbmstore P((HV *tb, char *key, U32 klen, SV *sv)); -SV * hv_delete P((HV *tb, char *key, U32 klen)); -SV ** hv_fetch P((HV *tb, char *key, U32 klen, I32 lval)); -void hv_free P((HV *tb, I32 dodbm)); -I32 hv_iterinit P((HV *tb)); -char * hv_iterkey P((HE *entry, I32 *retlen)); -HE * hv_iternext P((HV *tb)); -SV * hv_iterval P((HV *tb, HE *entry)); -void hv_magic P((SV *sv, GV *gv, I32 how)); -SV ** hv_store P((HV *tb, char *key, U32 klen, SV *val, U32 hash)); -void hv_undef P((HV *tb, I32 dodbm)); -I32 ibcmp P((char *a, char *b, I32 len)); -I32 ingroup P((int testgid, I32 effective)); -char * instr P((char *big, char *little)); -OP * invert P((OP *cmd)); -OP * jmaybe P((OP *arg)); -I32 keyword P((char *d)); -void leave_scope P((I32 base)); -OP * linklist P((OP *op)); -OP * list P((OP *o)); -OP * listkids P((OP *o)); -OP * localize P((OP *arg)); -I32 looks_like_number P((SV *sv)); -OP * loopscope P((OP *o)); -I32 lop P((I32 f, char *s)); +GP* gp_ref P((GP* gp)); +GV* gv_AVadd P((GV* gv)); +GV* gv_HVadd P((GV* gv)); +void gv_check P((I32 min, I32 max)); +void gv_efullname P((SV* sv, GV* gv)); +GV* gv_fetchfile P((char* name)); +GV* gv_fetchmethod P((HV* stash, char* name)); +GV* gv_fetchpv P((char* name, I32 add)); +void gv_fullname P((SV* sv, GV* gv)); +STRLEN gv_len P((SV* sv)); +SV* gv_str P((SV* sv)); +OP* gv_to_op P((I32 atype, GV* gv)); +void he_delayfree P((HE* hent)); +void he_free P((HE* hent)); +void hoistmust P((PMOP* pm)); +void hv_clear P((HV* tb, I32 dodbm)); +void hv_dbmclose P((HV* tb)); +bool hv_dbmopen P((HV* tb, char* fname, int mode)); +bool hv_dbmstore P((HV* tb, char* key, U32 klen, SV* sv)); +SV* hv_delete P((HV* tb, char* key, U32 klen)); +SV** hv_fetch P((HV* tb, char* key, U32 klen, I32 lval)); +void hv_free P((HV* tb, I32 dodbm)); +I32 hv_iterinit P((HV* tb)); +char* hv_iterkey P((HE* entry, I32* retlen)); +HE* hv_iternext P((HV* tb)); +SV* hv_iterval P((HV* tb, HE* entry)); +void hv_magic P((HV* hv, GV* gv, I32 how)); +SV** hv_store P((HV* tb, char* key, U32 klen, SV* val, U32 hash)); +void hv_undef P((HV* tb, I32 dodbm)); +I32 ibcmp P((char* a, char* b, I32 len)); +I32 ingroup P((int testgid, I32 effective)); +char* instr P((char* big, char* little)); +OP* invert P((OP* cmd)); +OP* jmaybe P((OP* arg)); +I32 keyword P((char* d, I32 len)); +void leave_scope P((I32 base)); +OP* linklist P((OP* op)); +OP* list P((OP* o)); +OP* listkids P((OP* o)); +OP* localize P((OP* arg, I32 lexical)); +I32 looks_like_number P((SV* sv)); +OP* loopscope P((OP* o)); +I32 lop P((I32 f, char* s)); int magic_get P((SV* sv, MAGIC* mg)); int magic_getarylen P((SV* sv, MAGIC* mg)); int magic_getglob P((SV* sv, MAGIC* mg)); int magic_getuvar P((SV* sv, MAGIC* mg)); +U32 magic_len P((SV* sv, MAGIC* mg)); int magic_set P((SV* sv, MAGIC* mg)); int magic_setarylen P((SV* sv, MAGIC* mg)); int magic_setbm P((SV* sv, MAGIC* mg)); @@ -141,212 +143,221 @@ int magic_setdbline P((SV* sv, MAGIC* mg)); int magic_setdbm P((SV* sv, MAGIC* mg)); int magic_setenv P((SV* sv, MAGIC* mg)); int magic_setglob P((SV* sv, MAGIC* mg)); +int magic_setmglob P((SV* sv, MAGIC* mg)); int magic_setsig P((SV* sv, MAGIC* mg)); int magic_setsubstr P((SV* sv, MAGIC* mg)); int magic_setuvar P((SV* sv, MAGIC* mg)); int magic_setvec P((SV* sv, MAGIC* mg)); -void magicalize P((char *list)); -void magicname P((char *sym, char *name, I32 namlen)); - main P((int argc, char **argv, char **env)); -MALLOCPTRTYPE * malloc P((MEM_SIZE nbytes)); -OP * maybeforcelist P((I32 optype, OP *arg)); -char * mess P((char *pat, ...)); -int mg_clear P((SV *sv)); -int mg_free P((SV *sv, char type)); -int mg_freeall P((SV *sv)); -int mg_get P((SV *sv)); -U32 mg_len P((SV *sv)); -int mg_set P((SV *sv)); -char * moreswitches P((char *s)); -void mstats P((char *s)); -char * my_bcopy P((char *from, char *to, I32 len)); -char * my_bzero P((char *loc, I32 len)); -void my_exit P((I32 status)); -I32 my_lstat P((OP *arg, SV *sv)); -I32 my_memcmp P((unsigned char *s1, unsigned char *s2, I32 len)); -I32 my_pclose P((FILE *ptr)); -FILE * my_pfiopen P((FILE *fil, VOID (*func)())); -FILE * my_popen P((char *cmd, char *mode)); -void my_setenv P((char *nam, char *val)); -I32 my_stat P((OP *arg, SV *sv)); -short my_swap P((short s)); -void my_unexec P((void)); -OP * newANONLIST P((OP *op)); -OP * newANONHASH P((OP *op)); -OP * newASSIGNOP P((I32 flags, OP *left, OP *right)); -OP * newBINOP P((I32 optype, I32 flags, OP *left, OP *right)); -OP * newCONDOP P((I32 flags, OP *expr, OP *true, OP *false)); -void newFORM P((OP *name, OP *block)); -OP * newFOROP P((I32 flags, char *label, line_t forline, OP* scalar, OP* expr, OP*block, OP*cont)); -HV * newHV P((U32 lookat)); -OP * newLOGOP P((I32 optype, I32 flags, OP *left, OP *right)); -OP * newLOOPOP P((I32 flags, I32 debuggable, OP *expr, OP *block, OP *cont)); -OP * newMETHOD P((OP *ref, OP* name)); -OP * newNAMEOP P((OP *o)); -OP * newNULLLIST P((void)); -OP * newOP P((I32 optype, I32 flags)); -OP * newRANGE P((I32 flags, OP *left, OP *right)); -OP * newSLICEOP P((I32 flags, OP *subscript, OP *list)); -OP * newSTATEOP P((I32 flags, char *label, OP *o)); -void newSUB P((OP *name, OP *block)); -OP * newUNOP P((I32 optype, I32 flags, OP *child)); -AV * newAV P((void)); -OP * newAVREF P((OP *o)); -OP * newBINOP P((I32 type, I32 flags, OP *first, OP *last)); -OP * newCVREF P((OP *o)); -OP * newGVOP P((I32 type, I32 flags, GV *gv)); -GV * newGVgen P((void)); -OP * newGVREF P((OP *o)); -OP * newHVREF P((OP *o)); -HV * newHV P((U32 lookat)); -IO * newIO P((void)); -OP * newLISTOP P((I32 type, I32 flags, first, last)); -OP * newPMOP P((I32 type, I32 flags)); -OP * newPVOP P((I32 type, I32 flags, PV *pv)); +void magicalize P((char* list)); +void magicname P((char* sym, char* name, I32 namlen)); + main P((int argc, char** argv, char** env)); +#ifndef STANDARD_C +MALLOCPTRTYPE* malloc P((MEM_SIZE nbytes)); +#endif +OP* maybeforcelist P((I32 optype, OP* arg)); +char* mess P((char* pat, ...)); +int mg_clear P((SV* sv)); +MAGIC* mg_find P((SV* sv, char type)); +int mg_free P((SV* sv, char type)); +int mg_freeall P((SV* sv)); +int mg_get P((SV* sv)); +U32 mg_len P((SV* sv)); +int mg_set P((SV* sv)); +char* moreswitches P((char* s)); +void mstats P((char* s)); +char* my_bcopy P((char* from, char* to, I32 len)); +char* my_bzero P((char* loc, I32 len)); +void my_exit P((I32 status)); +I32 my_lstat P(()); +I32 my_memcmp P((unsigned char* s1, unsigned char* s2, I32 len)); +I32 my_pclose P((FILE* ptr)); +FILE* my_pfiopen P((FILE* fil, VOID (*func)())); +FILE* my_popen P((char* cmd, char* mode)); +void my_setenv P((char* nam, char* val)); +I32 my_stat P(()); +short my_swap P((short s)); +void my_unexec P((void)); +OP* newANONLIST P((OP* op)); +OP* newANONHASH P((OP* op)); +OP* newASSIGNOP P((I32 flags, OP* left, OP* right)); +OP* newBINOP P((I32 optype, I32 flags, OP* left, OP* right)); +OP* newCONDOP P((I32 flags, OP* expr, OP* true, OP* false)); +void newFORM P((I32 floor, OP* op, OP* block)); +OP* newFOROP P((I32 flags, char* label, line_t forline, OP* scalar, OP* expr, OP*block, OP*cont)); +HV* newHV P((U32 lookat)); +OP* newLOGOP P((I32 optype, I32 flags, OP* left, OP* right)); +OP* newLOOPOP P((I32 flags, I32 debuggable, OP* expr, OP* block)); +OP* newMETHOD P((OP* ref, OP* name)); +OP* newNAMEOP P((OP* o)); +OP* newNULLLIST P((void)); +OP* newOP P((I32 optype, I32 flags)); +OP* newRANGE P((I32 flags, OP* left, OP* right)); +OP* newSLICEOP P((I32 flags, OP* subscript, OP* list)); +OP* newSTATEOP P((I32 flags, char* label, OP* o)); +void newSUB P((I32 floor, OP* op, OP* block)); +OP* newUNOP P((I32 optype, I32 flags, OP* child)); +AV* newAV P((void)); +OP* newAVREF P((OP* o)); +OP* newBINOP P((I32 type, I32 flags, OP* first, OP* last)); +OP* newCVREF P((OP* o)); +OP* newGVOP P((I32 type, I32 flags, GV* gv)); +GV* newGVgen P((void)); +OP* newGVREF P((OP* o)); +OP* newHVREF P((OP* o)); +HV* newHV P((U32 lookat)); +IO* newIO P((void)); +OP* newLISTOP P((I32 type, I32 flags, OP* first, OP* last)); +OP* newPMOP P((I32 type, I32 flags)); +OP* newPVOP P((I32 type, I32 flags, char* pv)); #ifdef LEAKTEST -SV * newSV P((I32 x, STRLEN len)); +SV* newSV P((I32 x, STRLEN len)); #else -SV * newSV P((STRLEN len)); +SV* newSV P((STRLEN len)); #endif -OP * newSVREF P((OP *o)); -OP * newSVOP P((I32 type, I32 flags, SV *sv)); -SV * newSViv P((I32 i)); -SV * newSVnv P((double n)); -SV * newSVpv P((char *s, STRLEN len)); -SV * newSVsv P((SV *old)); -OP * newUNOP P((I32 type, I32 flags, OP *first)); -FILE * nextargv P((GV *gv)); -char * ninstr P((char *big, char *bigend, char *little, char *lend)); -char * nsavestr P((char *sv, I32 len)); -void op_behead P((OP *arg)); -OP * op_fold_const P((OP *arg)); -void op_free P((OP *arg)); -void op_optimize P((OP *cmd, I32 fliporflop, I32 acmd)); -OP * over P((GV *eachgv, OP *cmd)); -PADOFFSET pad_alloc P((void)); -SV * pad_sv P((PADOFFSET po)); +OP* newSVREF P((OP* o)); +OP* newSVOP P((I32 type, I32 flags, SV* sv)); +SV* newSViv P((I32 i)); +SV* newSVnv P((double n)); +SV* newSVpv P((char* s, STRLEN len)); +SV* newSVsv P((SV* old)); +OP* newUNOP P((I32 type, I32 flags, OP* first)); +FILE* nextargv P((GV* gv)); +char* ninstr P((char* big, char* bigend, char* little, char* lend)); +char* nsavestr P((char* sv, I32 len)); +void op_behead P((OP* arg)); +OP* op_fold_const P((OP* arg)); +void op_free P((OP* arg)); +void op_optimize P((OP* cmd, I32 fliporflop, I32 acmd)); +OP* over P((GV* eachgv, OP* cmd)); +PADOFFSET pad_alloc P((I32 optype, char tmptype)); +PADOFFSET pad_allocmy P((char* name)); +PADOFFSET pad_findmy P((char* name)); +void pad_leavemy P((I32 fill)); +SV* pad_sv P((PADOFFSET po)); void pad_free P((PADOFFSET po)); void pad_reset P((void)); void pad_swipe P((PADOFFSET po)); -OP * parse_list P((SV *sv)); -void peep P((OP *op)); -Interpreter * perl_alloc P((void)); -I32 perl_callback P((char *subname, I32 sp, I32 gimme, I32 hasargs, I32 numargs)); -I32 perl_callv P((char *subname, I32 sp, I32 gimme, char **argv)); -void perl_construct P((Interpreter *sv_interp)); -void perl_destruct P((Interpreter *sv_interp)); -void perl_free P((Interpreter *sv_interp)); -I32 perl_parse P((Interpreter *sv_interp, int argc, char **argv, char **env)); -I32 perl_run P((Interpreter *sv_interp)); -void pidgone P((int pid, int status)); -OP * pmruntime P((OP *pm, OP *expr)); -OP * pop_return P((void)); -OP * prepend_elem P((I32 optype, OP *head, OP *tail)); +OP* parse_list P((SV* sv)); +void peep P((OP* op)); +PerlInterpreter* perl_alloc P((void)); +I32 perl_callback P((char* subname, I32 sp, I32 gimme, I32 hasargs, I32 numargs)); +I32 perl_callv P((char* subname, I32 sp, I32 gimme, char** argv)); +void perl_construct P((PerlInterpreter* sv_interp)); +void perl_destruct P((PerlInterpreter* sv_interp)); +void perl_free P((PerlInterpreter* sv_interp)); +I32 perl_parse P((PerlInterpreter* sv_interp, int argc, char** argv, char** env)); +I32 perl_run P((PerlInterpreter* sv_interp)); +void pidgone P((int pid, int status)); +OP* pmruntime P((OP* pm, OP* expr, OP* repl)); +OP* pop_return P((void)); +OP* prepend_elem P((I32 optype, OP* head, OP* tail)); void push_return P((OP* op)); -void pv_grow P((char **strptr, I32 *curlen, I32 newlen)); -OP * rcatmaybe P((OP *arg)); -regexp * regcomp P((char *exp, char *xend, I32 fold)); -OP * ref P((OP *op, I32 type)); -OP * refkids P((OP *op, I32 type)); -void regdump P((regexp *r)); -I32 regexec P((regexp *prog, char *stringarg, char *strend, char *strbeg, I32 minend, SV *screamer, I32 safebase)); -void regfree P((struct regexp *r)); -char * regnext P((char *p)); -char * regprop P((char *op)); +void pv_grow P((char** strptr, I32* curlen, I32 newlen)); +OP* rcatmaybe P((OP* arg)); +regexp* regcomp P((char* exp, char* xend, I32 fold)); +OP* ref P((OP* op, I32 type)); +OP* refkids P((OP* op, I32 type)); +void regdump P((regexp* r)); +I32 regexec P((regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, I32 safebase)); +void regfree P((struct regexp* r)); +char* regnext P((char* p)); +char* regprop P((char* op)); void reinit_lexer P((void)); -void repeatcpy P((char *to, char *from, I32 len, I32 count)); -char * rninstr P((char *big, char *bigend, char *little, char *lend)); -void run_format P((struct Outrec *orec, FF *fcmd)); +void repeatcpy P((char* to, char* from, I32 len, I32 count)); +char* rninstr P((char* big, char* bigend, char* little, char* lend)); +void run_format P((struct Outrec* orec, FF* fcmd)); #ifndef safemalloc -void safefree P((char *where)); -char * safemalloc P((MEM_SIZE size)); -char * saferealloc P((char *where, unsigned long size)); +void safefree P((char* where)); +char* safemalloc P((MEM_SIZE size)); +char* saferealloc P((char* where, unsigned long size)); #endif -void safexfree P((char *where)); -char * safexmalloc P((I32 x, MEM_SIZE size)); -char * safexrealloc P((char *where, MEM_SIZE size)); -I32 same_dirent P((char *a, char *b)); +void safexfree P((char* where)); +char* safexmalloc P((I32 x, MEM_SIZE size)); +char* safexrealloc P((char* where, MEM_SIZE size)); +I32 same_dirent P((char* a, char* b)); void savestack_grow P((void)); -void save_aptr P((AV **aptr)); -AV * save_ary P((GV *gv)); -HV * save_hash P((GV *gv)); -void save_hptr P((HV **hptr)); -void save_I32 P((I32 *intp)); -void save_int P((int *intp)); -void save_item P((SV *item)); -void save_lines P((AV *array, SV *sv)); -void save_list P((SV **sarg, I32 maxsarg)); -void save_nogv P((GV *gv)); -SV * save_scalar P((GV *gv)); -void save_sptr P((SV **sptr)); -SV * save_svref P((SV **sptr)); -char * savestr P((char *sv)); -OP * sawparens P((OP *o)); -OP * scalar P((OP *o)); -OP * scalarkids P((OP *op)); -OP * scalarseq P((OP *o)); -OP * scalarvoid P((OP *op)); -char * scan_formline P((char *s)); -unsigned long scan_hex P((char *start, I32 len, I32 *retlen)); -char * scan_heredoc P((char *s)); -char * scan_inputsymbol P((char *s)); -char * scan_ident P((char *s, char *send, char *dest)); -char * scan_num P((char *s)); -unsigned long scan_oct P((char *start, I32 len, I32 *retlen)); -char * scan_pat P((char *s)); -void scan_prefix P((PM *pm, char *string, I32 len)); -char * scan_str P((char *start)); -char * scan_subst P((char *start)); -char * scan_trans P((char *start)); -OP * scope P((OP *o)); -char * screaminstr P((SV *bigstr, SV *littlestr)); -I32 setenv_getix P((char *nam)); -char * skipspace P((char *s)); -AV * sv_2av P((SV *sv, STASH **st, GV **gvp, I32 lref)); -CV * sv_2cv P((SV *sv, STASH **st, GV **gvp, I32 lref)); -HV * sv_2hv P((SV *sv, STASH **st, GV **gvp, I32 lref)); -I32 sv_2iv P((SV *sv)); -SV * sv_2mortal P((SV *sv)); -double sv_2nv P((SV *sv)); -char * sv_2pv P((SV *sv)); -char * sv_append_till P((SV *sv, char *from, char *fromend, I32 delim, char *keeplist)); -int sv_backoff P((SV *sv)); -void sv_catpv P((SV *sv, char *ptr)); -void sv_catpvn P((SV *sv, char *ptr, STRLEN len)); -void sv_catsv P((SV *dstr, SV *sstr)); -void sv_chop P((SV *sv, char *ptr)); -void sv_clear P((SV *sv)); -I32 sv_cmp P((SV *str1, SV *str2)); -void sv_dec P((SV *sv)); -I32 sv_eq P((SV *str1, SV *str2)); -void sv_free P((SV *sv)); -char * sv_gets P((SV *sv, FILE *fp, I32 append)); -char * sv_grow P((SV *sv, unsigned long newlen)); -void sv_inc P((SV *sv)); -void sv_insert P((SV *bigstr, STRLEN offset, STRLEN len, char *little, STRLEN littlelen)); -SV * sv_interp P((SV *sv, SV *src, I32 sp)); -void sv_intrpcompile P((SV *src)); -STRLEN sv_len P((SV *sv)); -void sv_magic P((SV *sv, SV *sv, char how, char *name, STRLEN namlen)); -SV * sv_mortalcopy P((SV *oldstr)); -SV * sv_ref P((SV *sv)); -void sv_replace P((SV *sv, SV *nstr)); -void sv_reset P((char *s, HV *stash)); -void sv_setiv P((SV *sv, I32 num)); -void sv_setnv P((SV *sv, double num)); -void sv_setpv P((SV *sv, char *ptr)); -void sv_setpvn P((SV *sv, char *ptr, STRLEN len)); -void sv_setsv P((SV *dstr, SV *sstr)); -void taint_env P((void)); -void taint_proper P((char *f, char *s)); -I32 uni P((I32 f, char *s)); -I32 unlnk P((char *f)); -I32 userinit P((void)); -I32 wait4pid P((int pid, int *statusp, int flags)); -void warn P((const char* pat, ...)); -I32 whichsig P((char *sig)); -void while_io P((OP *cmd)); -OP * wopt P((OP *cmd)); -int yyerror P((char *s)); -int yylex P((void)); -int yyparse P((void)); +void save_aptr P((AV** aptr)); +AV* save_ary P((GV* gv)); +HV* save_hash P((GV* gv)); +void save_hptr P((HV** hptr)); +void save_I32 P((I32* intp)); +void save_int P((int* intp)); +void save_item P((SV* item)); +void save_lines P((AV* array, SV* sv)); +void save_list P((SV** sarg, I32 maxsarg)); +void save_nogv P((GV* gv)); +SV* save_scalar P((GV* gv)); +void save_sptr P((SV** sptr)); +SV* save_svref P((SV** sptr)); +char* savestr P((char* sv)); +OP* sawparens P((OP* o)); +OP* scalar P((OP* o)); +OP* scalarkids P((OP* op)); +OP* scalarseq P((OP* o)); +OP* scalarvoid P((OP* op)); +char* scan_formline P((char* s)); +unsigned long scan_hex P((char* start, I32 len, I32* retlen)); +char* scan_heredoc P((char* s)); +char* scan_inputsymbol P((char* s)); +char* scan_ident P((char* s, char* send, char* dest, I32 ck_uni)); +char* scan_num P((char* s)); +unsigned long scan_oct P((char* start, I32 len, I32* retlen)); +char* scan_pat P((char* s)); +void scan_prefix P((PMOP* pm, char* string, I32 len)); +char* scan_str P((char* start)); +char* scan_subst P((char* start)); +char* scan_trans P((char* start)); +OP* scope P((OP* o)); +char* screaminstr P((SV* bigstr, SV* littlestr)); +I32 setenv_getix P((char* nam)); +char* skipspace P((char* s)); +CV* sv_2cv P((SV* sv, HV** st, GV** gvp, I32 lref)); +I32 sv_2iv P((SV* sv)); +SV* sv_2mortal P((SV* sv)); +double sv_2nv P((SV* sv)); +char* sv_2pv P((SV* sv)); +char* sv_append_till P((SV* sv, char* from, char* fromend, I32 delim, char* keeplist)); +int sv_backoff P((SV* sv)); +void sv_catpv P((SV* sv, char* ptr)); +void sv_catpvn P((SV* sv, char* ptr, STRLEN len)); +void sv_catsv P((SV* dstr, SV* sstr)); +void sv_chop P((SV* sv, char* ptr)); +void sv_clear P((SV* sv)); +I32 sv_cmp P((SV* str1, SV* str2)); +void sv_dec P((SV* sv)); +I32 sv_eq P((SV* str1, SV* str2)); +void sv_free P((SV* sv)); +char* sv_gets P((SV* sv, FILE* fp, I32 append)); +#ifndef DOSISH +char* sv_grow P((SV* sv, I32 newlen)); +#else +char* sv_grow P((SV* sv, unsigned long newlen)); +#endif +void sv_inc P((SV* sv)); +void sv_insert P((SV* bigstr, STRLEN offset, STRLEN len, char* little, STRLEN littlelen)); +SV* sv_interp P((SV* sv, SV* src, I32 sp)); +void sv_intrpcompile P((SV* src)); +STRLEN sv_len P((SV* sv)); +void sv_magic P((SV* sv, SV* obj, char how, char* name, STRLEN namlen)); +SV* sv_mortalcopy P((SV* oldstr)); +SV* sv_ref P((SV* sv)); +void sv_replace P((SV* sv, SV* nstr)); +void sv_reset P((char* s, HV* stash)); +void sv_setiv P((SV* sv, I32 num)); +void sv_setnv P((SV* sv, double num)); +void sv_setpv P((SV* sv, char* ptr)); +void sv_setpvn P((SV* sv, char* ptr, STRLEN len)); +void sv_setsv P((SV* dstr, SV* sstr)); +void taint_env P((void)); +void taint_proper P((char* f, char* s)); +I32 uni P((I32 f, char* s)); +I32 unlnk P((char* f)); +I32 userinit P((void)); +I32 wait4pid P((int pid, int* statusp, int flags)); +void warn P((va_alist)); +I32 whichsig P((char* sig)); +void while_io P((OP* cmd)); +OP* wopt P((OP* cmd)); +int yyerror P((char* s)); +int yylex P((void)); +int yyparse P((void)); @@ -236,7 +236,7 @@ I32 fold; else sv_upgrade(r->regstart, SVt_PVBM); } - else if ((exp = index(simple,OP(first))) && exp > simple) + else if ((exp = strchr(simple,OP(first))) && exp > simple) r->regstclass = first; else if (OP(first) == BOUND || OP(first) == NBOUND) r->regstclass = first; @@ -309,7 +309,7 @@ I32 fold; else curback += *OPERAND(first); } - else if (index(varies,OP(scan))) { + else if (strchr(varies,OP(scan))) { curback = -30000; len = 0; if (SvCUR(longish) > SvCUR(longest)) { @@ -318,13 +318,13 @@ I32 fold; } sv_setpvn(longish,"",0); if (OP(scan) == PLUS && - index(simple,OP(NEXTOPER(scan)))) + strchr(simple,OP(NEXTOPER(scan)))) minlen++; else if (OP(scan) == CURLY && - index(simple,OP(NEXTOPER(scan)+4))) + strchr(simple,OP(NEXTOPER(scan)+4))) minlen += ARG1(scan); } - else if (index(simple,OP(scan))) { + else if (strchr(simple,OP(scan))) { curback++; minlen++; len = 0; @@ -91,7 +91,7 @@ GV *gv; SSPUSHINT(SAVEt_SV); sv = GvSV(gv) = NEWSV(0,0); - if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(sv)) { + if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv)) { sv_upgrade(sv, SvTYPE(osv)); SvMAGIC(sv) = SvMAGIC(osv); localizing = TRUE; @@ -293,6 +293,7 @@ U32 mt; SvNV(sv) = nv; SvMAGIC(sv) = magic; SvSTASH(sv) = stash; + GvGP(sv) = 0; GvNAME(sv) = 0; GvNAMELEN(sv) = 0; GvSTASH(sv) = 0; @@ -354,10 +355,14 @@ register SV *sv; break; case SVt_NULL: - return "UNDEF"; + strcpy(t,"UNDEF"); + return tokenbuf; case SVt_REF: - strcpy(t, "\\"); - t += strlen(t); + *t++ = '\\'; + if (t - tokenbuf > 10) { + strcpy(tokenbuf + 3,"..."); + return tokenbuf; + } sv = (SV*)SvANY(sv); goto retry; case SVt_IV: @@ -538,8 +543,15 @@ register SV *sv; sv_upgrade(sv, SVt_PVIV); if (SvNOK(sv)) SvIV(sv) = (I32)SvNV(sv); - else if (SvPOK(sv) && SvLEN(sv)) + else if (SvPOK(sv) && SvLEN(sv)) { + if (dowarn && !looks_like_number(sv)) { + if (op) + warn("Argument wasn't numeric for \"%s\"",op_name[op->op_type]); + else + warn("Argument wasn't numeric"); + } SvIV(sv) = atol(SvPV(sv)); + } else { if (dowarn) warn("Use of uninitialized variable"); @@ -573,10 +585,20 @@ register SV *sv; } else if (SvTYPE(sv) < SVt_PVNV) sv_upgrade(sv, SVt_PVNV); - if (SvPOK(sv) && SvLEN(sv)) - SvNV(sv) = atof(SvPV(sv)); - else if (SvIOK(sv)) + if (SvIOK(sv) && + (!SvPOK(sv) || !strchr(SvPV(sv),'.') || !looks_like_number(sv))) + { SvNV(sv) = (double)SvIV(sv); + } + else if (SvPOK(sv) && SvLEN(sv)) { + if (dowarn && !SvIOK(sv) && !looks_like_number(sv)) { + if (op) + warn("Argument wasn't numeric for \"%s\"",op_name[op->op_type]); + else + warn("Argument wasn't numeric"); + } + SvNV(sv) = atof(SvPV(sv)); + } else { if (dowarn) warn("Use of uninitialized variable"); @@ -946,45 +968,6 @@ register char *ptr; SvTDOWN(sv); } -char * -sv_append_till(sv,from,fromend,delim,keeplist) -register SV *sv; -register char *from; -register char *fromend; -register I32 delim; -char *keeplist; -{ - register char *to; - register STRLEN len; - - if (SvREADONLY(sv)) - fatal(no_modify); - if (!from) - return Nullch; - len = fromend - from; - if (!SvUPGRADE(sv, SVt_PV)) - return 0; - SvGROW(sv, SvCUR(sv) + len + 1); - SvPOK_only(sv); /* validate pointer */ - to = SvPV(sv)+SvCUR(sv); - for (; from < fromend; from++,to++) { - if (*from == '\\' && from+1 < fromend && delim != '\\') { - if (!keeplist) - *to++ = *from++; - else if (from[1] && index(keeplist,from[1])) - *to++ = *from++; - else - from++; - } - else if (*from == delim) - break; - *to = *from; - } - *to = '\0'; - SvCUR_set(sv, to - SvPV(sv)); - return from; -} - SV * #ifdef LEAKTEST newSV(x,len) @@ -1049,7 +1032,13 @@ STRLEN namlen; case 'e': mg->mg_virtual = &vtbl_envelem; break; + case 'g': + mg->mg_virtual = &vtbl_mglob; + break; case 'L': + mg->mg_virtual = 0; + break; + case 'l': mg->mg_virtual = &vtbl_dbline; break; case 'S': @@ -1174,6 +1163,13 @@ register SV *nsv; fatal(no_modify); if (SvREFCNT(nsv) != 1) warn("Reference miscount in sv_replace()"); + if (SvMAGICAL(sv)) { + SvUPGRADE(nsv, SVt_PVMG); + SvMAGIC(nsv) = SvMAGIC(sv); + SvMAGICAL_on(nsv); + SvMAGICAL_off(sv); + SvMAGIC(sv) = 0; + } SvREFCNT(sv) = 0; sv_clear(sv); StructCopy(nsv,sv,SV); @@ -1358,7 +1354,7 @@ register SV *sv; return 0; if (SvMAGICAL(sv)) - return mg_len(sv, SvMAGIC(sv)); + return mg_len(sv); if (!(SvPOK(sv))) { (void)sv_2pv(sv); @@ -1527,9 +1523,11 @@ I32 append; ptr = fp->_ptr; for (;;) { screamer: - while (--cnt >= 0) { /* this */ /* eat */ - if ((*bp++ = *ptr++) == newline) /* really */ /* dust */ - goto thats_all_folks; /* screams */ /* sed :-) */ + if (cnt > 0) { + while (--cnt >= 0) { /* this */ /* eat */ + if ((*bp++ = *ptr++) == newline) /* really */ /* dust */ + goto thats_all_folks; /* screams */ /* sed :-) */ + } } if (shortbuffered) { /* oh well, must extend */ @@ -1957,7 +1955,7 @@ I32 lref; CV *cv; if (!sv) - return Nullcv; + return *gvp = Nullgv, Nullcv; switch (SvTYPE(sv)) { case SVt_REF: cv = (CV*)SvANY(sv); @@ -363,6 +363,8 @@ struct xpvfm { do { assert(SvTYPE(sv) >= SVt_PV); \ (((XPV*) SvANY(sv))->xpv_cur = val - SvPV(sv)); } while (0) +#define SvCUROK(sv) (SvPOK(sv) ? SvCUR(sv) : 0) + #define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare #define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful #define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous diff --git a/sv_append_till b/sv_append_till new file mode 100644 index 0000000000..c2299ea692 --- /dev/null +++ b/sv_append_till @@ -0,0 +1,39 @@ +char * +sv_append_till(sv,from,fromend,delim,keeplist) +register SV *sv; +register char *from; +register char *fromend; +register I32 delim; +char *keeplist; +{ + register char *to; + register STRLEN len; + + if (SvREADONLY(sv)) + fatal(no_modify); + if (!from) + return Nullch; + len = fromend - from; + if (!SvUPGRADE(sv, SVt_PV)) + return 0; + SvGROW(sv, SvCUR(sv) + len + 1); + SvPOK_only(sv); /* validate pointer */ + to = SvPV(sv)+SvCUR(sv); + for (; from < fromend; from++,to++) { + if (*from == '\\' && from+1 < fromend && delim != '\\') { + if (!keeplist) + *to++ = *from++; + else if (from[1] && index(keeplist,from[1])) + *to++ = *from++; + else + from++; + } + else if (*from == delim) + break; + *to = *from; + } + *to = '\0'; + SvCUR_set(sv, to - SvPV(sv)); + return from; +} + diff --git a/t/cmd/subval.t b/t/cmd/subval.t index 90345f2c65..3c1ffb89ea 100755 --- a/t/cmd/subval.t +++ b/t/cmd/subval.t @@ -35,32 +35,32 @@ sub foo6 { print "1..34\n"; -if (do foo1(0) eq '0') {print "ok 1\n";} else {print "not ok 1 $foo\n";} -if (do foo1(1) eq 'true2') {print "ok 2\n";} else {print "not ok 2\n";} -if (do foo2(0) eq 'true3') {print "ok 3\n";} else {print "not ok 3\n";} -if (do foo2(1) eq 'true2') {print "ok 4\n";} else {print "not ok 4\n";} +if (&foo1(0) eq '0') {print "ok 1\n";} else {print "not ok 1 $foo\n";} +if (&foo1(1) eq 'true2') {print "ok 2\n";} else {print "not ok 2\n";} +if (&foo2(0) eq 'true3') {print "ok 3\n";} else {print "not ok 3\n";} +if (&foo2(1) eq 'true2') {print "ok 4\n";} else {print "not ok 4\n";} -if (do foo3(0) eq 'true2') {print "ok 5\n";} else {print "not ok 5\n";} -if (do foo3(1) eq '1') {print "ok 6\n";} else {print "not ok 6\n";} -if (do foo4(0) eq 'true2') {print "ok 7\n";} else {print "not ok 7\n";} -if (do foo4(1) eq 'true3') {print "ok 8\n";} else {print "not ok 8\n";} +if (&foo3(0) eq 'true2') {print "ok 5\n";} else {print "not ok 5\n";} +if (&foo3(1) eq '1') {print "ok 6\n";} else {print "not ok 6\n";} +if (&foo4(0) eq 'true2') {print "ok 7\n";} else {print "not ok 7\n";} +if (&foo4(1) eq 'true3') {print "ok 8\n";} else {print "not ok 8\n";} -if (do foo5(0) eq '0') {print "ok 9\n";} else {print "not ok 9\n";} -if (do foo5(1) eq 'true2') {print "ok 10\n";} else {print "not ok 10\n";} -if (do foo6(0) eq 'true2') {print "ok 11\n";} else {print "not ok 11\n";} -if (do foo6(1) eq '1') {print "ok 12\n";} else {print "not ok 12 $x\n";} +if (&foo5(0) eq '0') {print "ok 9\n";} else {print "not ok 9\n";} +if (&foo5(1) eq 'true2') {print "ok 10\n";} else {print "not ok 10\n";} +if (&foo6(0) eq 'true2') {print "ok 11\n";} else {print "not ok 11\n";} +if (&foo6(1) eq '1') {print "ok 12\n";} else {print "not ok 12 $x\n";} # Now test to see that recursion works using a Fibonacci number generator sub fib { - local($arg) = @_; - local($foo); + my($arg) = @_; + my($foo); $level++; if ($arg <= 2) { $foo = 1; } else { - $foo = do fib($arg-1) + do fib($arg-2); + $foo = &fib($arg-1) + &fib($arg-2); } $level--; $foo; @@ -70,7 +70,7 @@ sub fib { for ($i = 1; $i <= 10; $i++) { $foo = $i + 12; - if (do fib($i) == $good[$i]) { + if (&fib($i) == $good[$i]) { print "ok $foo\n"; } else { diff --git a/t/foo b/t/foo deleted file mode 100755 index 9070e7874c..0000000000 --- a/t/foo +++ /dev/null @@ -1,8 +0,0 @@ -#!./perl - -$_ = 'aaabbbccc'; -if (/(a+b+c+)/ && $1 eq 'aaabbbccc') { - print "ok 14\n"; -} else { - print "not ok 14\n"; -} diff --git a/t/op/local.t b/t/op/local.t index 5f007fd4f6..043201072d 100755 --- a/t/op/local.t +++ b/t/op/local.t @@ -19,7 +19,7 @@ $b = "ok 6\n"; $c = "ok 7\n"; $d = "ok 8\n"; -print do foo("ok 1\n","ok 2\n"); +print &foo("ok 1\n","ok 2\n"); print $a,$b,$c,$d,$x,$y; @@ -40,6 +40,6 @@ $a = "ok 15\n"; @c = "ok 17\n"; $d{''} = "ok 18\n"; -print do foo2("ok 11\n","ok 12\n"); +print &foo2("ok 11\n","ok 12\n"); print $a,@b,@c,%d,$x,$y; diff --git a/t/op/my.t b/t/op/my.t new file mode 100755 index 0000000000..4ce020f206 --- /dev/null +++ b/t/op/my.t @@ -0,0 +1,46 @@ +#!./perl + +# $RCSfile: local.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:04 $ + +print "1..20\n"; + +sub foo { + my($a, $b) = @_; + my $c; + my $d; + $c = "ok 3\n"; + $d = "ok 4\n"; + { my($a,$c) = ("ok 9\n", "ok 10\n"); ($x, $y) = ($a, $c); } + print $a, $b; + $c . $d; +} + +$a = "ok 5\n"; +$b = "ok 6\n"; +$c = "ok 7\n"; +$d = "ok 8\n"; + +print &foo("ok 1\n","ok 2\n"); + +print $a,$b,$c,$d,$x,$y; + +# same thing, only with arrays and associative arrays + +sub foo2 { + my($a, @b) = @_; + my(@c, %d); + @c = "ok 13\n"; + $d{''} = "ok 14\n"; + { my($a,@c) = ("ok 19\n", "ok 20\n"); ($x, $y) = ($a, @c); } + print $a, @b; + $c[0] . $d{''}; +} + +$a = "ok 15\n"; +@b = "ok 16\n"; +@c = "ok 17\n"; +$d{''} = "ok 18\n"; + +print &foo2("ok 11\n","ok 12\n"); + +print $a,@b,@c,%d,$x,$y; diff --git a/t/op/ref.t b/t/op/ref.t index cace1e14bd..b0619cbc2c 100755 --- a/t/op/ref.t +++ b/t/op/ref.t @@ -81,14 +81,14 @@ $refref = \%whatever; $refref->{"key"} = $ref; print $refref->{"key"}->[2]->[0] == 3 ? "ok 20\n" : "not ok 20\n"; -# Test to see if anonymous subarrays sprint into existence. +# Test to see if anonymous subarrays spring into existence. $spring[5]->[0] = 123; $spring[5]->[1] = 456; push(@{$spring[5]}, 789); print join(':',@{$spring[5]}) eq "123:456:789" ? "ok 21\n" : "not ok 21\n"; -# Test to see if anonymous subhashes sprint into existence. +# Test to see if anonymous subhashes spring into existence. @{$spring2{"foo"}} = (1,2,3); $spring2{"foo"}->[3] = 4; @@ -187,6 +187,10 @@ reinit_lexer() lex_inwhat = 0; oldoldbufptr = oldbufptr = bufptr = SvPVn(linestr); bufend = bufptr + SvCUR(linestr); + rs = "\n"; + rslen = 1; + rschar = '\n'; + rspara = 0; } char * @@ -403,7 +407,7 @@ sublex_done() { if (!lex_starts++) { expect = XOPERATOR; - yylval.opval = (OP*)newSVOP(OP_CONST, 0, NEWSV(94,1)); + yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv("",0)); return THING; } @@ -494,7 +498,7 @@ char *start; *d++ = *s++; continue; } - if (*s && index(leave, *s)) { + if (*s && strchr(leave, *s)) { *d++ = '\\'; *d++ = *s++; continue; @@ -505,7 +509,7 @@ char *start; *--s = '$'; break; } - if (lex_inwhat != OP_TRANS && *s && index("lLuUE", *s)) { + if (lex_inwhat != OP_TRANS && *s && strchr("lLuUE", *s)) { --s; break; } @@ -617,7 +621,7 @@ register char *s; int weight = 2; /* let's weigh the evidence */ char seen[256]; unsigned char un_char = 0, last_un_char; - char *send = index(s,']'); + char *send = strchr(s,']'); char tmpbuf[512]; if (!send) /* has to be an expression */ @@ -650,8 +654,8 @@ register char *s; weight -= 10; } else if (*s == '$' && s[1] && - index("[#!%*<>()-=",s[1])) { - if (/*{*/ index("])} =",s[2])) + strchr("[#!%*<>()-=",s[1])) { + if (/*{*/ strchr("])} =",s[2])) weight -= 10; else weight -= 1; @@ -660,11 +664,11 @@ register char *s; case '\\': un_char = 254; if (s[1]) { - if (index("wds]",s[1])) + if (strchr("wds]",s[1])) weight += 100; else if (seen['\''] || seen['"']) weight += 1; - else if (index("rnftbxcav",s[1])) + else if (strchr("rnftbxcav",s[1])) weight += 40; else if (isDIGIT(s[1])) { weight += 40; @@ -678,13 +682,13 @@ register char *s; case '-': if (s[1] == '\\') weight += 50; - if (index("aA01! ",last_un_char)) + if (strchr("aA01! ",last_un_char)) weight += 30; - if (index("zZ79~",s[1])) + if (strchr("zZ79~",s[1])) weight += 30; break; default: - if (!isALNUM(last_un_char) && !index("$@&",last_un_char) && + if (!isALNUM(last_un_char) && !strchr("$@&",last_un_char) && isALPHA(*s) && s[1] && isALPHA(s[1])) { char *d = tmpbuf; while (isALPHA(*s)) @@ -856,7 +860,7 @@ yylex() retry: DEBUG_p( { - if (index(s,'\n')) + if (strchr(s,'\n')) fprintf(stderr,"Tokener at %s",s); else fprintf(stderr,"Tokener at %s\n",s); @@ -897,10 +901,10 @@ yylex() if (perldb) { char *pdb = getenv("PERLDB"); + sv_catpv(linestr,"BEGIN{"); sv_catpv(linestr, pdb ? pdb : "require 'perldb.pl'"); - sv_catpv(linestr, ";"); + sv_catpv(linestr, "}"); } - sv_catpv(linestr, "&BEGIN if defined &BEGIN;"); if (minus_n || minus_p) { sv_catpv(linestr, "LINE: while (<>) {"); if (minus_l) @@ -947,6 +951,7 @@ yylex() if (perldb) { SV *sv = NEWSV(85,0); + sv_upgrade(sv, SVt_PVMG); sv_setsv(sv,linestr); av_store(GvAV(curcop->cop_filegv),(I32)curcop->cop_line,sv); } @@ -1140,8 +1145,29 @@ yylex() case '%': if (expect != XOPERATOR) { - s = scan_ident(s, bufend, tokenbuf, TRUE); - force_ident(tokenbuf); + s = scan_ident(s, bufend, tokenbuf + 1, TRUE); + if (tokenbuf[1]) { + tokenbuf[0] = '%'; + if (in_my) { + if (strchr(tokenbuf,'\'')) + fatal("\"my\" variable %s can't be in a package",tokenbuf); + nextval[nexttoke].opval = newOP(OP_PADHV, 0); + nextval[nexttoke].opval->op_targ = pad_allocmy(tokenbuf); + force_next(PRIVATEREF); + TERM('%'); + } + if (!strchr(tokenbuf,'\'')) { + if (tmp = pad_findmy(tokenbuf)) { + nextval[nexttoke].opval = newOP(OP_PADHV, 0); + nextval[nexttoke].opval->op_targ = tmp; + force_next(PRIVATEREF); + TERM('%'); + } + } + force_ident(tokenbuf + 1); + } + else + PREREF('%'); TERM('%'); } ++s; @@ -1184,10 +1210,13 @@ yylex() lex_brackets++; if (expect == XTERM) OPERATOR(HASHBRACK); + else if (expect == XREF) + expect = XTERM; + else + expect = XBLOCK; yylval.ival = curcop->cop_line; if (isSPACE(*s) || *s == '#') copline = NOLINE; /* invalidate current command line number */ - expect = XBLOCK; TOKEN('{'); case '}': rightbracket: @@ -1256,7 +1285,7 @@ yylex() OPERATOR('!'); case '<': if (expect != XOPERATOR) { - if (s[1] != '<' && !index(s,'>')) + if (s[1] != '<' && !strchr(s,'>')) check_uni(); if (s[1] == '<') s = scan_heredoc(s); @@ -1295,9 +1324,47 @@ yylex() force_ident(tokenbuf); TERM(DOLSHARP); } - s = scan_ident(s, bufend, tokenbuf, FALSE); - if (*tokenbuf) - force_ident(tokenbuf); + s = scan_ident(s, bufend, tokenbuf+1, FALSE); + if (tokenbuf[1]) { + tokenbuf[0] = '$'; + if (dowarn && *s == '[') { + char *t; + for (t = s+1; isSPACE(*t) || isALNUM(*t) || *t == '$'; t++) ; + if (*t++ == ',') { + bufptr = skipspace(bufptr); + while (t < bufend && *t != ']') t++; + warn("Multidimensional syntax %.*s not supported", + t-bufptr+1, bufptr); + } + } + if (in_my) { + if (strchr(tokenbuf,'\'')) + fatal("\"my\" variable %s can't be in a package",tokenbuf); + nextval[nexttoke].opval = newOP(OP_PADSV, 0); + nextval[nexttoke].opval->op_targ = pad_allocmy(tokenbuf); + force_next(PRIVATEREF); + } + else if (!strchr(tokenbuf,'\'')) { + I32 optype = OP_PADSV; + if (*s == '[') { + tokenbuf[0] = '@'; + optype = OP_PADAV; + } + else if (*s == '{') { + tokenbuf[0] = '%'; + optype = OP_PADHV; + } + if (tmp = pad_findmy(tokenbuf)) { + nextval[nexttoke].opval = newOP(optype, 0); + nextval[nexttoke].opval->op_targ = tmp; + force_next(PRIVATEREF); + } + else + force_ident(tokenbuf+1); + } + else + force_ident(tokenbuf+1); + } else PREREF('$'); expect = XOPERATOR; @@ -1311,20 +1378,52 @@ yylex() while (isSPACE(*oldoldbufptr)) oldoldbufptr++; if (*oldoldbufptr == 'p' && strnEQ(oldoldbufptr,"print",5)) { - if (index("&*<%", *s) && isIDFIRST(s[1])) + if (strchr("&*<%", *s) && isIDFIRST(s[1])) expect = XTERM; /* e.g. print $fh &sub */ else if (*s == '.' && isDIGIT(s[1])) expect = XTERM; /* e.g. print $fh .3 */ - else if (index("/?-+", *s) && !isSPACE(s[1])) + else if (strchr("/?-+", *s) && !isSPACE(s[1])) expect = XTERM; /* e.g. print $fh -1 */ } } TOKEN('$'); case '@': - s = scan_ident(s, bufend, tokenbuf, FALSE); - if (*tokenbuf) - force_ident(tokenbuf); + s = scan_ident(s, bufend, tokenbuf+1, FALSE); + if (tokenbuf[1]) { + tokenbuf[0] = '@'; + if (in_my) { + if (strchr(tokenbuf,'\'')) + fatal("\"my\" variable %s can't be in a package",tokenbuf); + nextval[nexttoke].opval = newOP(OP_PADAV, 0); + nextval[nexttoke].opval->op_targ = pad_allocmy(tokenbuf); + force_next(PRIVATEREF); + TERM('@'); + } + else if (!strchr(tokenbuf,'\'')) { + I32 optype = OP_PADAV; + if (*s == '{') { + tokenbuf[0] = '%'; + optype = OP_PADHV; + } + if (tmp = pad_findmy(tokenbuf)) { + nextval[nexttoke].opval = newOP(optype, 0); + nextval[nexttoke].opval->op_targ = tmp; + force_next(PRIVATEREF); + TERM('@'); + } + } + if (dowarn && *s == '[') { + char *t; + for (t = s+1; isSPACE(*t) || isALNUM(*t) || *t == '$'; t++) ; + if (*t++ == ']') { + bufptr = skipspace(bufptr); + warn("Scalar value %.*s better written as $%.*s", + t-bufptr, bufptr, t-bufptr-1, bufptr+1); + } + } + force_ident(tokenbuf+1); + } else PREREF('@'); TERM('@'); @@ -1440,60 +1539,69 @@ yylex() switch (tmp = keyword(tokenbuf, d - tokenbuf)) { default: /* not a keyword */ - just_a_word: - while (*s == '\'' && isIDFIRST(s[1])) { - *d++ = *s++; - SNARFWORD; - } - if (expect == XBLOCK) { /* special case: start of statement */ - yylval.pval = savestr(tokenbuf); - while (isSPACE(*s)) s++; - if (*s == ':') { - s++; - CLINE; - OPERATOR(LABEL); + just_a_word: { + GV *gv; + while (*s == '\'' && isIDFIRST(s[1])) { + *d++ = *s++; + SNARFWORD; } - } - expect = XOPERATOR; - if (oldoldbufptr && oldoldbufptr < bufptr) { - if (oldoldbufptr == last_lop) { - expect = XTERM; + if (expect == XBLOCK) { /* special case: start of statement */ + while (isSPACE(*s)) s++; + if (*s == ':') { + yylval.pval = savestr(tokenbuf); + s++; + CLINE; + TOKEN(LABEL); + } + } + gv = gv_fetchpv(tokenbuf,FALSE); + if (gv && GvCV(gv)) { + nextval[nexttoke].opval = + (OP*)newSVOP(OP_CONST, 0, newSVpv(tokenbuf,0)); + nextval[nexttoke].opval->op_private = OPpCONST_BARE; + force_next(WORD); + TERM(NOAMP); + } + expect = XOPERATOR; + if (oldoldbufptr && oldoldbufptr < bufptr) { + if (oldoldbufptr == last_lop) { + expect = XTERM; + CLINE; + yylval.opval = (OP*)newSVOP(OP_CONST, 0, + newSVpv(tokenbuf,0)); + yylval.opval->op_private = OPpCONST_BARE; + for (d = tokenbuf; *d && isLOWER(*d); d++) ; + if (dowarn && !*d) + warn( + "\"%s\" may clash with future reserved word", + tokenbuf ); + TOKEN(WORD); + } + } + while (s < bufend && isSPACE(*s)) + s++; + if (*s == '(') { CLINE; - yylval.opval = (OP*)newSVOP(OP_CONST, 0, - newSVpv(tokenbuf,0)); - yylval.opval->op_private = OPpCONST_BARE; - for (d = tokenbuf; *d && isLOWER(*d); d++) ; - if (dowarn && !*d) - warn( - "\"%s\" may clash with future reserved word", - tokenbuf ); - TOKEN(WORD); + nextval[nexttoke].opval = + (OP*)newSVOP(OP_CONST, 0, newSVpv(tokenbuf,0)); + nextval[nexttoke].opval->op_private = OPpCONST_BARE; + force_next(WORD); + TERM('&'); } - } - while (s < bufend && isSPACE(*s)) - s++; -#ifdef OLD - if (*s == '(') { CLINE; - nextval[nexttoke].opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(tokenbuf,0)); - nextval[nexttoke].opval->op_private = OPpCONST_BARE; - force_next(WORD); - LOP( OP_ENTERSUBR ); + yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(tokenbuf,0)); + yylval.opval->op_private = OPpCONST_BARE; + + if (*s == '$' || *s == '{') + PREBLOCK(METHOD); + + for (d = tokenbuf; *d && isLOWER(*d); d++) ; + if (dowarn && !*d) + warn( + "\"%s\" may clash with future reserved word", + tokenbuf ); + TOKEN(WORD); } -#endif - CLINE; - yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(tokenbuf,0)); - yylval.opval->op_private = OPpCONST_BARE; - - if (*s == '$' || *s == '{') - PREBLOCK(METHOD); - - for (d = tokenbuf; *d && isLOWER(*d); d++) ; - if (dowarn && !*d) - warn( - "\"%s\" may clash with future reserved word", - tokenbuf ); - TOKEN(WORD); case KEY___LINE__: case KEY___FILE__: { @@ -1533,11 +1641,9 @@ yylex() case KEY_BEGIN: case KEY_END: s = skipspace(s); - if (minus_p || minus_n || *s == '{' ) { - nextval[nexttoke].opval = - (OP*)newSVOP(OP_CONST, 0, newSVpv(tokenbuf,0)); - force_next(WORD); - OPERATOR(SUB); + if (expect == XBLOCK && (minus_p || minus_n || *s == '{' )) { + s = bufptr; + goto really_sub; } goto just_a_word; @@ -1589,6 +1695,9 @@ yylex() LOP(OP_CRYPT); case KEY_chmod: + s = skipspace(s); + if (dowarn && *s != '0' && isDIGIT(*s)) + warn("chmod: mode argument is missing initial 0"); LOP(OP_CHMOD); case KEY_chown: @@ -1796,6 +1905,9 @@ yylex() case KEY_getlogin: FUN0(OP_GETLOGIN); + case KEY_glob: + UNI(OP_GLOB); + case KEY_hex: UNI(OP_HEX); @@ -1831,6 +1943,7 @@ yylex() UNI(OP_LCFIRST); case KEY_local: + yylval.ival = 0; OPERATOR(LOCAL); case KEY_length: @@ -1876,6 +1989,11 @@ yylex() case KEY_msgsnd: LOP(OP_MSGSND); + case KEY_my: + in_my = TRUE; + yylval.ival = 1; + OPERATOR(LOCAL); + case KEY_next: LOOPX(OP_NEXT); @@ -1883,6 +2001,15 @@ yylex() Eop(OP_SNE); case KEY_open: + s = skipspace(s); + if (isIDFIRST(*s)) { + char *t; + for (d = s; isALNUM(*d); d++) ; + t = skipspace(d); + if (strchr("|&*+-=!?:.", *t)) + warn("Precedence problem: open %.*s should be open(%.*s)", + d-s,s, d-s,s); + } LOP(OP_OPEN); case KEY_ord: @@ -1973,6 +2100,14 @@ yylex() case KEY_readdir: UNI(OP_READDIR); + case KEY_readline: + set_csh(); + UNI(OP_READLINE); + + case KEY_readpipe: + set_csh(); + UNI(OP_BACKTICK); + case KEY_rewinddir: UNI(OP_REWINDDIR); @@ -2118,13 +2253,18 @@ yylex() case KEY_format: case KEY_sub: + really_sub: yylval.ival = savestack_ix; /* restore stuff on reduce */ save_I32(&subline); save_item(subname); SAVEINT(padix); SAVESPTR(curpad); SAVESPTR(comppad); + SAVESPTR(comppadname); + SAVEINT(comppadnamefill); comppad = newAV(); + comppadname = newAV(); + comppadnamefill = -1; av_push(comppad, Nullsv); curpad = AvARRAY(comppad); padix = 0; @@ -2145,7 +2285,7 @@ yylex() else sv_setpv(subname,"?"); - if (tmp == KEY_sub) + if (tmp != KEY_format) PREBLOCK(SUB); in_format = 2; @@ -2214,6 +2354,9 @@ yylex() LOP(OP_UTIME); case KEY_umask: + s = skipspace(s); + if (dowarn && *s != '0' && isDIGIT(*s)) + warn("umask: argument is missing initial 0"); UNI(OP_UMASK); case KEY_unshift: @@ -2278,6 +2421,7 @@ I32 len; break; case 'B': if (strEQ(d,"BEGIN")) return KEY_BEGIN; + break; case 'b': if (strEQ(d,"bless")) return KEY_bless; if (strEQ(d,"bind")) return KEY_bind; @@ -2467,6 +2611,7 @@ I32 len; if (strEQ(d,"grep")) return KEY_grep; if (strEQ(d,"goto")) return KEY_goto; if (strEQ(d,"getc")) return KEY_getc; + if (strEQ(d,"glob")) return KEY_glob; break; case 6: if (strEQ(d,"gmtime")) return KEY_gmtime; @@ -2538,6 +2683,9 @@ I32 len; case 'm': switch (len) { case 1: return KEY_m; + case 2: + if (strEQ(d,"my")) return KEY_my; + break; case 5: if (strEQ(d,"mkdir")) return KEY_mkdir; break; @@ -2625,6 +2773,8 @@ I32 len; break; case 8: if (strEQ(d,"readlink")) return KEY_readlink; + if (strEQ(d,"readline")) return KEY_readline; + if (strEQ(d,"readpipe")) return KEY_readpipe; break; case 9: if (strEQ(d,"rewinddir")) return KEY_rewinddir; @@ -2823,10 +2973,10 @@ char *what; char *w; if (dowarn && *s == ' ' && s[1] == '(') { - w = index(s,')'); + w = strchr(s,')'); if (w) for (w++; *w && isSPACE(*w); w++) ; - if (!w || !*w || !index(";|}", *w)) /* an advisory hack only... */ + if (!w || !*w || !strchr(";|}", *w)) /* an advisory hack only... */ warn("%s (...) interpreted as function",name); } while (s < bufend && isSPACE(*s)) @@ -2895,10 +3045,10 @@ I32 ck_uni; } else if (ck_uni) check_uni(); - if (s < send); + if (s < send) *d = *s++; d[1] = '\0'; - if (*d == '^' && (isUPPER(*s) || index("[\\]^_?", *s))) { + if (*d == '^' && (isUPPER(*s) || strchr("[\\]^_?", *s))) { if (*s == 'D') debug |= 32768; *d = *s++ ^ 64; @@ -2925,7 +3075,7 @@ I32 ck_uni; } else { s = bracket; /* let the parser handle it */ - *d = '\0'; + *dest = '\0'; } } else if (lex_state == LEX_INTERPNORMAL && !lex_brackets && !intuit_more(s)) @@ -2968,7 +3118,7 @@ I32 len; e = d; break; case '\\': - if (d[1] && index("wWbB0123456789sSdDlLuUExc",d[1])) { + if (d[1] && strchr("wWbB0123456789sSdDlLuUExc",d[1])) { e = d; break; } @@ -3196,7 +3346,7 @@ char *start; if (s[-1] == *start) s--; - s = scan_str(s, SCAN_TR|SCAN_REPL); + s = scan_str(s); if (!s) { if (lex_stuff) sv_free(lex_stuff); @@ -3242,7 +3392,7 @@ register char *s; d = tokenbuf; if (!rsfp) *d++ = '\n'; - if (*s && index("`'\"",*s)) { + if (*s && strchr("`'\"",*s)) { term = *s++; s = cpytill(d,s,bufend,term,&len); if (s < bufend) @@ -3306,6 +3456,7 @@ register char *s; if (perldb) { SV *sv = NEWSV(88,0); + sv_upgrade(sv, SVt_PVMG); sv_setsv(sv,linestr); av_store(GvAV(curcop->cop_filegv), (I32)curcop->cop_line,sv); @@ -3392,23 +3543,53 @@ char * scan_str(start) char *start; { - SV *tmpstr; + SV *sv; char *tmps; register char *s = start; register char term = *s; + register char *to; + I32 brackets = 1; CLINE; multi_start = curcop->cop_line; multi_open = term; - if (term && (tmps = index("([{< )]}> )]}>",term))) + if (term && (tmps = strchr("([{< )]}> )]}>",term))) term = tmps[5]; multi_close = term; - tmpstr = NEWSV(87,80); - SvSTORAGE(tmpstr) = term; - s = sv_append_till(tmpstr, s+1, bufend, term, Nullch); + sv = NEWSV(87,80); + sv_upgrade(sv, SVt_PV); + SvSTORAGE(sv) = term; + SvPOK_only(sv); /* validate pointer */ + s++; + for (;;) { + SvGROW(sv, SvCUR(sv) + (bufend - s) + 1); + to = SvPV(sv)+SvCUR(sv); + if (multi_open == multi_close) { + for (; s < bufend; s++,to++) { + if (*s == '\\' && s+1 < bufend && term != '\\') + *to++ = *s++; + else if (*s == term) + break; + *to = *s; + } + } + else { + for (; s < bufend; s++,to++) { + if (*s == '\\' && s+1 < bufend && term != '\\') + *to++ = *s++; + else if (*s == term && --brackets <= 0) + break; + else if (*s == multi_open) + brackets++; + *to = *s; + } + } + *to = '\0'; + SvCUR_set(sv, to - SvPV(sv)); + + if (s < bufend) break; /* string ends on this line? */ - while (s >= bufend) { /* multiple line string? */ if (!rsfp || !(oldoldbufptr = oldbufptr = s = sv_gets(linestr, rsfp, 0))) { curcop->cop_line = multi_start; @@ -3418,23 +3599,23 @@ char *start; if (perldb) { SV *sv = NEWSV(88,0); + sv_upgrade(sv, SVt_PVMG); sv_setsv(sv,linestr); av_store(GvAV(curcop->cop_filegv), (I32)curcop->cop_line, sv); } bufend = SvPV(linestr) + SvCUR(linestr); - s = sv_append_till(tmpstr, s, bufend, term, Nullch); } multi_end = curcop->cop_line; s++; - if (SvCUR(tmpstr) + 5 < SvLEN(tmpstr)) { - SvLEN_set(tmpstr, SvCUR(tmpstr) + 1); - Renew(SvPV(tmpstr), SvLEN(tmpstr), char); + if (SvCUR(sv) + 5 < SvLEN(sv)) { + SvLEN_set(sv, SvCUR(sv) + 1); + Renew(SvPV(sv), SvLEN(sv), char); } if (lex_stuff) - lex_repl = tmpstr; + lex_repl = sv; else - lex_stuff = tmpstr; + lex_stuff = sv; return s; } @@ -3448,6 +3629,7 @@ char *start; double value; SV *sv; I32 floatit; + char *lastub = 0; switch (*s) { default: @@ -3506,11 +3688,16 @@ char *start; d = tokenbuf; floatit = FALSE; while (isDIGIT(*s) || *s == '_') { - if (*s == '_') - s++; + if (*s == '_') { + if (dowarn && lastub && s - lastub != 3) + warn("Misplaced _"); + lastub = ++s; + } else *d++ = *s++; } + if (dowarn && lastub && s - lastub != 3) + warn("Misplaced _"); if (*s == '.' && s[1] != '.') { floatit = TRUE; *d++ = *s++; @@ -3521,7 +3708,7 @@ char *start; *d++ = *s++; } } - if (*s && index("eE",*s) && index("+-0123456789",s[1])) { + if (*s && strchr("eE",*s) && strchr("+-0123456789",s[1])) { floatit = TRUE; s++; *d++ = 'e'; /* At least some Mach atof()s don't grok 'E' */ @@ -3563,7 +3750,7 @@ register char *s; break; } if (in_eval && !rsfp) { - eol = index(s,'\n'); + eol = strchr(s,'\n'); if (!eol++) eol = bufend; } diff --git a/usub/tus b/usub/tus new file mode 100755 index 0000000000..8b22e1f261 --- /dev/null +++ b/usub/tus @@ -0,0 +1,488 @@ +#!/usr/bin/perl +# $Header$ + +$usage = "Usage: tus [-a] [-s] [-c] typemap file.us\n"; +die $usage unless (@ARGV >= 2 && @ARGV <= 6); + +SWITCH: while ($ARGV[0] =~ /^-/) { + $flag = shift @ARGV; + $aflag = 1, next SWITCH if $flag =~ /^-a$/; + $spat = $1, next SWITCH if $flag =~ /^-s(.*)$/; + $cflag = 1, next SWITCH if $flag =~ /^-c$/; + $eflag = 1, next SWITCH if $flag =~ /^-e$/; + die $usage; +} + +$typemap = shift @ARGV; +open(TYPEMAP, $typemap) || die "cannot open $typemap\n"; +while (<TYPEMAP>) { + next if /^\s*$/ || /^#/; + chop; + ($typename, $kind) = split(/\t+/, $_, 2); + $type_kind{$typename} = $kind; +} +close(TYPEMAP); + +%input_expr = (JUNK, split(/\n(T_\w*)\s*\n/, <<'T_END')); + +T_INT + $var = (int)str_gnum($arg) +T_ENUM + $var = ($type)str_gnum($arg) +T_U_INT + $var = (unsigned int)str_gnum($arg) +T_SHORT + $var = (short)str_gnum($arg) +T_U_SHORT + $var = (unsigned short)str_gnum($arg) +T_LONG + $var = (long)str_gnum($arg) +T_U_LONG + $var = (unsigned long)str_gnum($arg) +T_CHAR + $var = (char)*str_get($arg) +T_U_CHAR + $var = (unsigned char)str_gnum($arg) +T_FLOAT + $var = (float)str_gnum($arg) +T_DOUBLE + $var = str_gnum($arg) +T_STRING + $var = str_get($arg) +T_PTR + $var = ($type)(unsigned long)str_gnum($arg) +T_OPAQUE + $var NOT IMPLEMENTED +T_OPAQUEPTR + $var = ($type)str_get($arg) +T_PACKED + $var = US_unpack_$ntype($arg) +T_PACKEDARRAY + $var = US_unpack_$ntype($arg) +T_REF + if (ref_ok($arg, \"${ntype}\")) + $var = *(${ntype}Ptr)$arg->str_magic->str_u.str_stab; + else + Tthrow(InvalidX(\"$var is not of type ${ntype}\")) +T_REFPTR + if (ref_ok($arg, \"$subtype\")) + $var = ($ntype)$arg->str_magic->str_u.str_stab; + else + Tthrow(InvalidX(\"$var is not of type $subtype\")) +T_DATAUNIT + $var = DataUnit(U32($arg->str_cur), (Octet*)$arg->str_ptr) +T_CALLBACK + $var = make_perl_cb_$type($arg) +T_ARRAY + $var = $ntype(items -= $argoff); + U32 ix_$var = $argoff; + while (items--) { + DO_ARRAY_ELEM; + } +T_PLACEHOLDER +T_END + +$* = 1; %output_expr = (JUNK, split(/^(T_\w*)\s*\n/, <<'T_END')); $* = 0; +T_INT + str_numset($arg, (double)$var); +T_ENUM + str_numset($arg, (double)(int)$var); +T_U_INT + str_numset($arg, (double)$var); +T_SHORT + str_numset($arg, (double)$var); +T_U_SHORT + str_numset($arg, (double)$var); +T_LONG + str_numset($arg, (double)$var); +T_U_LONG + str_numset($arg, (double)$var); +T_CHAR + str_set($arg, (char *)&$var, 1); +T_U_CHAR + str_numset($arg, (double)$var); +T_FLOAT + str_numset($arg, (double)$var); +T_DOUBLE + str_numset($arg, $var); +T_STRING + str_set($arg, $var); +T_PTR + str_numset($arg, (double)(unsigned long)$var); +T_OPAQUE + str_nset($arg, (char *)&$var, sizeof($var)); +T_OPAQUEPTR + str_nset($arg, (char *)$var, sizeof(*$var)), XFree((char *)$var); +T_PACKED + US_pack_$ntype($arg, $var); +T_PACKEDARRAY + US_pack_$ntype($arg, $var, count_$ntype); +T_REF + ref_construct($arg, \"${ntype}\", US_service_$ntype, + ($var ? (void*)new $ntype($var) : 0)); +T_REFPTR + NOT IMPLEMENTED +T_DATAUNIT + str_nset($arg, $var.chp(), $var.size()); +T_CALLBACK + str_nset($arg, $var.context.value().chp(), + $var.context.value().size()); +T_ARRAY + ST_EXTEND($var.size); + for (U32 ix_$var = 0; ix_$var < $var.size; ix_$var++) { + ST(ix_$var) = str_mortal(&str_undef); + DO_ARRAY_ELEM + } + sp += $var.size - 1; +T_END + +$uvfile = shift @ARGV; +open(F, $uvfile) || die "cannot open $uvfile\n"; + +if ($eflag) { + print qq|#include "cfm/basic.h"\n|; +} + +while (<F>) { + last if ($Module, $foo, $Package, $foo1, $Prefix) = + /^MODULE\s*=\s*(\w+)(\s+PACKAGE\s*=\s*(\w+))?(\s+PREFIX\s*=\s*(.+))?$/; + print $_; +} +$Pack = $Package; +$Package .= "'" if defined $Package && $Package ne ""; +$/ = ""; + +while (<F>) { + # parse paragraph + chop; + next if /^\s*$/; + next if /^(#.*\n?)+$/; + if (/^MODULE\s*=\s*(\w+)(\s+PACKAGE\s*=\s*(\w+))?(\s+PREFIX\s*=\s*(.+))?$/) { + $Module = $1; + $foo = $2; + $Package = $3; + $Pack = $Package; + $foo1 = $4; + $Prefix = $5; + $Package .= "'" if defined $Package && $Package ne ""; + next; + } + split(/[\t ]*\n/); + + # initialize info arrays + undef(%args_match); + undef(%var_types); + undef(%var_addr); + undef(%defaults); + undef($class); + undef($static); + undef($elipsis); + + # extract return type, function name and arguments + $ret_type = shift(@_); + if ($ret_type =~ /^static\s+(.*)$/) { + $static = 1; + $ret_type = $1; + } + $func_header = shift(@_); + ($func_name, $orig_args) = $func_header =~ /^([\w:]+)\s*\((.*)\)$/; + if ($func_name =~ /(.*)::(.*)/) { + $class = $1; + $func_name = $2; + } + ($pname = $func_name) =~ s/^($Prefix)?/$Package/; + push(@Func_name, "${Pack}_$func_name"); + push(@Func_pname, $pname); + @args = split(/\s*,\s*/, $orig_args); + if (defined($class) && !defined($static)) { + unshift(@args, "THIS"); + $orig_args = "THIS, $orig_args"; + $orig_args =~ s/^THIS, $/THIS/; + } + $orig_args =~ s/"/\\"/g; + $min_args = $num_args = @args; + foreach $i (0..$num_args-1) { + if ($args[$i] =~ s/\.\.\.//) { + $elipsis = 1; + $min_args--; + if ($args[i] eq '' && $i == $num_args - 1) { + pop(@args); + last; + } + } + if ($args[$i] =~ /([^=]*\S)\s*=\s*(.*)/) { + $min_args--; + $args[$i] = $1; + $defaults{$args[$i]} = $2; + $defaults{$args[$i]} =~ s/"/\\"/g; + } + } + if (defined($class) && !defined($static)) { + $func_args = join(", ", @args[1..$#args]); + } else { + $func_args = join(", ", @args); + } + @args_match{@args} = 1..@args; + + # print function header + print <<"EOF" if $aflag; +static int +US_${Pack}_$func_name(int, int sp, int items) +EOF + print <<"EOF" if !$aflag; +static int +US_${Pack}_$func_name(ix, sp, items) +register int ix; +register int sp; +register int items; +EOF + print <<"EOF" if $elipsis; +{ + if (items < $min_args) { + fatal("Usage: $pname($orig_args)"); + } +EOF + print <<"EOF" if !$elipsis; +{ + if (items < $min_args || items > $num_args) { + fatal("Usage: $pname($orig_args)"); + } +EOF + +# Now do a block of some sort. + +$condnum = 0; +if (!@_) { + @_ = "CLEANUP:"; +} +while (@_) { + if ($_[0] =~ s/^\s*CASE\s*:\s*//) { + $cond = shift(@_); + if ($condnum == 0) { + print " if ($cond)\n"; + } + elsif ($cond ne '') { + print " else if ($cond)\n"; + } + else { + print " else\n"; + } + $condnum++; + } + + print <<"EOF" if $eflag; + TRY { +EOF + print <<"EOF" if !$eflag; + { +EOF + + # do initialization of input variables + $thisdone = 0; + $retvaldone = 0; + while ($_ = shift(@_)) { + last if /^\s*NOT_IMPLEMENTED_YET/; + last if /^\s*(CODE|OUTPUT|CLEANUP|CASE)\s*:/; + ($var_type, $var_name, $var_init) = + /\s*([^\t]+)\s*([^\s=]+)\s*(=.*)?/; + if ($var_name =~ /^&/) { + $var_name =~ s/^&//; + $var_addr{$var_name} = 1; + } + $thisdone |= $var_name eq "THIS"; + $retvaldone |= $var_name eq "RETVAL"; + $var_types{$var_name} = $var_type; + print "\t" . &map_type($var_type); + $var_num = $args_match{$var_name}; + if ($var_addr{$var_name}) { + $func_args =~ s/\b($var_name)\b/&\1/; + } + if ($var_init !~ /^=\s*NO_INIT\s*$/) { + if ($var_init !~ /^\s*$/) { + &output_init($var_type, $var_num, + "$var_name $var_init"); + } elsif ($var_num) { + # generate initialization code + &generate_init($var_type, $var_num, $var_name); + } else { + print ";\n"; + } + } else { + print "\t$var_name;\n"; + } + } + if (!$thisdone && defined($class) && !defined($static)) { + print "\t$class *"; + $var_types{"THIS"} = "$class *"; + &generate_init("$class *", 1, "THIS"); + } + + # do code + if (/^\s*NOT_IMPLEMENTED_YET/) { + print "\nfatal(\"$pname: not implemented yet\");\n"; + } else { + if ($ret_type ne "void") { + print "\t" . &map_type($ret_type) . "\tRETVAL;\n" + if !$retvaldone; + $args_match{"RETVAL"} = 0; + $var_types{"RETVAL"} = $ret_type; + } + if (/^\s*CODE:/) { + while ($_ = shift(@_)) { + last if /^\s*(OUTPUT|CLEANUP|CASE)\s*:/; + print "$_\n"; + } + } else { + print "\n\t"; + if ($ret_type ne "void") { + print "RETVAL = (".&map_type($ret_type).")"; + } + if (defined($static)) { + print "$class::"; + } elsif (defined($class)) { + print "THIS->"; + } + if (defined($spat) && $func_name =~ /^($spat)(.*)$/) { + $func_name = $2; + } + print "$func_name($func_args);\n"; + &generate_output($ret_type, 0, "RETVAL") + unless $ret_type eq "void"; + } + } + + # do output variables + if (/^\s*OUTPUT\s*:/) { + while ($_ = shift(@_)) { + last if /^\s*CLEANUP\s*:/; + s/^\s+//; + ($outarg, $outcode) = split(/\t+/); + if ($outcode) { + print "\t$outcode\n"; + } else { + die "$outarg not an argument" + unless defined($args_match{$outarg}); + $var_num = $args_match{$outarg}; + &generate_output($var_types{$outarg}, $var_num, + $outarg); + } + } + } + # do cleanup + if (/^\s*CLEANUP\s*:/) { + while ($_ = shift(@_)) { + last if /^\s*CASE\s*:/; + print "$_\n"; + } + } + # print function trailer + print <<EOF if $eflag; + } + BEGHANDLERS + CATCHALL + fatal("%s: %s\\tpropagated", Xname, Xreason); + ENDHANDLERS +EOF + print <<EOF if !$eflag; + } +EOF + if (/^\s*CASE\s*:/) { + unshift(@_, $_); + } +} + print <<EOF; + return sp; +} + +EOF +} + +# print initialization routine +print qq/extern "C"\n/ if $cflag; +print <<"EOF"; +void init_$Module() +{ +EOF + +for (@Func_name) { + $pname = shift(@Func_pname); + print " make_usub(\"$pname\", 0, US_$_, __FILE__);\n"; +} +print "}\n"; + +sub output_init { + local($type, $num, $init) = @_; + local($arg) = "ST($num)"; + + eval "print \" $init\n\""; +} + +sub generate_init { + local($type, $num, $var) = @_; + local($arg) = "ST($num)"; + local($argoff) = $num - 1; + local($ntype); + + die "$type not in typemap" if !defined($type_kind{$type}); + ($ntype = $type) =~ s/\s*\*/Ptr/g; + $subtype = $ntype; + $subtype =~ s/Ptr$//; + $subtype =~ s/Array$//; + $expr = $input_expr{$type_kind{$type}}; + if ($expr =~ /DO_ARRAY_ELEM/) { + $subexpr = $input_expr{$type_kind{$subtype}}; + $subexpr =~ s/ntype/subtype/g; + $subexpr =~ s/\$arg/ST(ix_$var)/g; + $subexpr =~ s/\n\t/\n\t\t/g; + $subexpr =~ s/is not of (.*")/[arg %d] is not of $1, ix_$var + 1/g; + $subexpr =~ s/\$var/$var[ix_$var - $argoff]/; + $expr =~ s/DO_ARRAY_ELEM/$subexpr/; + } + if (defined($defaults{$var})) { + $expr =~ s/(\t+)/$1 /g; + $expr =~ s/ /\t/g; + eval "print \"\t$var;\n\tif (items < $num)\n\t $var = $defaults{$var};\n\telse {\n$expr;\n\t}\n\""; + } elsif ($expr !~ /^\t\$var =/) { + eval "print \"\t$var;\n$expr;\n\""; + } else { + eval "print \"$expr;\n\""; + } +} + +sub generate_output { + local($type, $num, $var) = @_; + local($arg) = "ST($num)"; + local($argoff) = $num - 1; + local($ntype); + + if ($type =~ /^array\(([^,]*),(.*)\)/) { + print "\tstr_nset($arg, (char *)$var, $2 * sizeof($1)), XFree((char *)$var);\n"; + } else { + die "$type not in typemap" if !defined($type_kind{$type}); + ($ntype = $type) =~ s/\s*\*/Ptr/g; + $ntype =~ s/\(\)//g; + $subtype = $ntype; + $subtype =~ s/Ptr$//; + $subtype =~ s/Array$//; + $expr = $output_expr{$type_kind{$type}}; + if ($expr =~ /DO_ARRAY_ELEM/) { + $subexpr = $output_expr{$type_kind{$subtype}}; + $subexpr =~ s/ntype/subtype/g; + $subexpr =~ s/\$arg/ST(ix_$var)/g; + $subexpr =~ s/\$var/${var}[ix_$var]/g; + $subexpr =~ s/\n\t/\n\t\t/g; + $expr =~ s/DO_ARRAY_ELEM\n/$subexpr/; + } + eval "print qq\f$expr\f"; + } +} + +sub map_type { + local($type) = @_; + + if ($type =~ /^array\(([^,]*),(.*)\)/) { + return "$1 *"; + } else { + return $type; + } +} diff --git a/usub/tuv b/usub/tuv new file mode 100755 index 0000000000..aab9a0f5e4 --- /dev/null +++ b/usub/tuv @@ -0,0 +1,161 @@ +#!/usr/bin/perl +# $Header$ + +$usage = "Usage: tuv [-a] [-c] typemap file.uv\n"; +die $usage unless (@ARGV >= 2 && @ARGV <= 4); + +SWITCH: while ($ARGV[0] =~ /^-/) { + $flag = shift @ARGV; + $aflag = 1, next SWITCH if $flag =~ /^-a$/; + $cflag = 1, next SWITCH if $flag =~ /^-c$/; + die $usage; +} + +$typemap = shift @ARGV; +open(TYPEMAP, $typemap) || die "cannot open $typemap\n"; +while (<TYPEMAP>) { + next if /^\s*$/ || /^#/; + chop; + ($typename, $kind) = split(/\t+/); + $type_kind{$typename} = $kind; +} +close(TYPEMAP); + +$uvfile = shift @ARGV; +open(F, $uvfile) || die "cannot open $uvfile\n"; +#($uvoutfile = $uvfile) =~ s|^.*/([^/]*).us$|\1.c| ; +#print "uvoutfile is $uvoutfile\n"; + +#open(FOUT, ">$uvoutfile") || die "cannot open $uvoutfile\n"; +#select(FOUT); + +while (<F>) { + last if ($Module, $foo, $Package, $foo1, $Prefix) = + /^MODULE\s*=\s*(\w+)(\s+PACKAGE\s*=\s*(\w+))?(\s+PREFIX\s*=\s*(\w+))?/; + print $_; +} +$Package .= "'" if defined $Package && $Package ne ""; +print <<EOF; +static struct varinfo varinfo [] = { +EOF + +while (<F>) { + next if /^s*$/ || /^#/; + if (/^MODULE\s*=\s*(\w+)(\s+PACKAGE\s*=\s*(\w+))?(\s+PREFIX\s*=\s*(\w+))?/) { + $Module = $1; + $foo = $2; + $Package = $3; + $foo1 = $4; + $Prefix = $5; + $Package .= "'" if defined $Package && $Package ne ""; + next; + } + chop; + $func = undef; + ($var, $kind, $store, $read) = split(/\t+/); + die "$kind not defined in typemap\n" if !defined($type_kind{$kind}); + $flags = "0"; + if ($store =~ /FUNC=(.*)/) { + $flags .= "|VI_FUNC"; + $func = $1; + } elsif ($store eq "VAR") { + $flags .= "|VI_VARIABLE"; + } elsif ($store ne "VAL") { + die "$var storage class not VAL, VAR or FUNC\n"; + } + if ($read eq "READWRITE") { + $flags .= "|VI_READWRITE"; + } elsif ($read ne "READONLY") { + die "$var access class not READONLY or READWRITE\n"; + } + SIZE: { + $type_kind = $type_kind{$kind}; + $size = 0; + do {$size = "sizeof(int)"; last SIZE; } + if ($type_kind eq "T_INT"); + do {$size = "sizeof($kind)"; last SIZE; } + if ($type_kind eq "T_ENUM"); + do {$size = "sizeof(unsigned int)"; last SIZE; } + if ($type_kind eq "T_U_INT"); + do {$size = "sizeof(short)"; last SIZE; } + if ($type_kind eq "T_SHORT"); + do {$size = "sizeof(unsigned short)"; last SIZE; } + if ($type_kind eq "T_U_SHORT"); + do {$size = "sizeof(long)"; last SIZE; } + if ($type_kind eq "T_LONG"); + do {$size = "sizeof(unsigned long)"; last SIZE; } + if ($type_kind eq "T_U_LONG"); + do {$size = "sizeof(char)"; last SIZE; } + if ($type_kind eq "T_CHAR"); + do {$size = "sizeof(unsigned char)"; last SIZE; } + if ($type_kind eq "T_U_CHAR"); + do {$size = "0"; last SIZE; } + if ($type_kind eq "T_STRING"); + do {$size = "sizeof(char *)"; last SIZE; } + if ($type_kind eq "T_PTR"); + do {$size = "sizeof($kind)"; last SIZE; } + if ($type_kind eq "T_OPAQUE"); + } + ($name = $var) =~ s/^$Prefix//; + print " { \"$Package$name\", $type_kind, $flags, $size, "; + if ($store =~ /FUNC/) { + print "(char *)$func, 0.0 },\n"; + } elsif ($store eq "VAR") { + print "(char *)&$var, 0.0 },\n"; + } elsif ($type_kind eq "T_FLOAT" || $type_kind eq "T_DOUBLE") { + print "0, $var },\n"; + } else { + print "(char *)$var, 0.0 },\n"; + } +} +print <<EOF if $aflag; +}; + +static unsigned long varinfolen = sizeof(varinfo)/sizeof(*varinfo); + +static int UV_val(int ix, STR *str) +{ + return common_UV_val(varinfo, varinfolen, ix, str); +} + +static int UV_set(int ix, STR *str) +{ + return common_UV_set(varinfo, varinfolen, ix, str); +} +EOF +print <<EOF if !$aflag; +}; + +static unsigned long varinfolen = sizeof(varinfo)/sizeof(*varinfo); + +static int UV_val(ix, str) +int ix; +STR *str; +{ + return common_UV_val(varinfo, varinfolen, ix, str); +} + +static int UV_set(ix, str) +int ix; +STR *str; +{ + return common_UV_set(varinfo, varinfolen, ix, str); +} + +EOF +print qq/extern "C"\n/ if $cflag; +print <<EOF; +void init_$Module() +{ + int i; + struct ufuncs uf; + + uf.uf_set = UV_set; + uf.uf_val = UV_val; + for (i = 0; i < varinfolen; i++) { + uf.uf_index = i; + magicname(varinfo[i].vname, (char *)&uf, sizeof uf); + } +} + +EOF diff --git a/usub/typemap b/usub/typemap new file mode 100644 index 0000000000..c11403b6df --- /dev/null +++ b/usub/typemap @@ -0,0 +1,228 @@ +# $Header$ +# basic C types +int T_INT +unsigned T_U_INT +unsigned int T_U_INT +long T_LONG +unsigned long T_U_LONG +short T_SHORT +unsigned short T_U_SHORT +char T_CHAR +char * T_STRING +unsigned char * T_STRING +caddr_t T_STRING +unsigned long * T_OPAQUEPTR +char ** T_PACKED +void * T_PTR + +I32 T_LONG +I16 T_SHORT +U32 T_U_LONG +U16 T_U_SHORT +Result T_U_CHAR +Boolean T_U_CHAR +double T_DOUBLE + +# +#################################### XLIB SECTION +# + +# basic X types +Atom T_U_LONG +Atom * T_OPAQUEPTR +Bool T_INT +KeyCode T_U_LONG +Status T_INT +Time T_U_LONG +VisualID T_U_LONG +XID T_U_LONG +GC T_PTR +Display * T_PTR +Screen * T_PTR +Visual * T_PTR +XImage * T_PTR +Region T_PTR + +# things that are XIDs +Colormap T_U_LONG +Cursor T_U_LONG +Drawable T_U_LONG +Font T_U_LONG +GContext T_U_LONG +KeySym T_U_LONG +KeySym * T_OPAQUEPTR +Pixmap T_U_LONG +Pixmap * T_OPAQUEPTR +Window T_U_LONG +Window * T_OPAQUEPTR + +# X resource manager types +XrmDatabase T_PTR +XrmQuark T_INT +XrmQuarkList T_OPAQUEPTR +XrmName T_INT +XrmNameList T_OPAQUEPTR +XrmClass T_INT +XrmClassList T_OPAQUEPTR +XrmRepresentation T_INT +XrmString T_STRING +XrmBinding T_ENUM +XrmBindingList T_OPAQUEPTR +XrmOptionKind T_ENUM +XrmSearchList T_OPAQUEPTR + +# context manager types +XContext T_INT + +# Xlib data structures +XArc * T_OPAQUEPTR +XCharStruct T_OPAQUE +XCharStruct * T_OPAQUEPTR +XColor T_OPAQUE +XColor * T_OPAQUEPTR +XComposeStatus * T_OPAQUEPTR +XEvent T_OPAQUE +XEvent * T_OPAQUEPTR +XFontStruct T_OPAQUE +XFontStruct * T_PTR +XGCValues * T_OPAQUEPTR +XIconSize * T_OPAQUEPTR +XKeyboardControl * T_OPAQUEPTR +XKeyboardState T_OPAQUE +XModifierKeymap * T_PTR +XPoint T_OPAQUE +XPoint * T_OPAQUEPTR +XRectangle T_OPAQUE +XRectangle * T_OPAQUEPTR +XSegment * T_OPAQUEPTR +XSetWindowAttributes * T_OPAQUEPTR +XSizeHints T_OPAQUE +XSizeHints * T_OPAQUEPTR +XStandardColormap T_OPAQUE +XStandardColormap * T_OPAQUEPTR +XTimeCoord * T_OPAQUEPTR +XVisualInfo T_OPAQUE +XVisualInfo * T_OPAQUEPTR +XWindowAttributes T_OPAQUE +XWindowAttributes * T_OPAQUEPTR +XWindowChanges * T_OPAQUEPTR +XWMHints * T_OPAQUEPTR + +# these data types must be handled specially +#XrmValue T_OPAQUE +#XrmValue * T_OPAQUEPTR +#XrmOptionDescList T_OPAQUEPTR +#XClassHint T_OPAQUE +#XClassHint * T_OPAQUEPTR +#XHostAddress * T_OPAQUEPTR +#XTextItem * T_OPAQUEPTR +#XTextItem16 * T_OPAQUEPTR +#XTextProperty T_OPAQUE +#XTextProperty * T_OPAQUEPTR + +# +#################################### PARCPLACE OI SECTION +# + +# basic OI types +OI_alignment T_ENUM +OI_bevel_style T_ENUM +OI_bool T_ENUM +OI_charset T_ENUM +OI_char_encode_type T_ENUM +OI_configure_mask T_ENUM +OI_drop_type T_ENUM +OI_ef_char_chk_status T_ENUM +OI_ef_entry_chk_status T_ENUM +OI_ef_mode T_ENUM +OI_enhance T_ENUM +OI_gravity T_ENUM +OI_gauge_ends T_ENUM +OI_gauge_ticks T_ENUM +OI_layout T_INT +OI_menu_cell_type T_ENUM +OI_mnemonic_style T_ENUM +OI_model_type T_ENUM +OI_mt_char_chk_status T_ENUM +OI_mt_entry_chk_status T_ENUM +OI_mt_mode T_ENUM +OI_number T_SHORT +OI_number * T_OPAQUEPTR +OI_orient T_ENUM +OI_pic_type T_ENUM +OI_pic_pixel T_ENUM +OI_psn_type T_ENUM +OI_rm_db T_ENUM +OI_sav_rst_typ T_ENUM +OI_scroll_event T_ENUM +OI_size_track T_ENUM +OI_slider_current T_ENUM +OI_slider_ends T_ENUM +OI_slider_ticks T_ENUM +OI_stat T_ENUM +OI_state T_ENUM +OI_wm_state T_ENUM +PIXEL T_LONG + +# OI classes +OI_abbr_menu * T_PTR +OI_animate_item * T_PTR +OI_app_window * T_PTR +OI_base_text * T_PTR +OI_box * T_PTR +OI_button_menu * T_PTR +OI_command_dialog_box * T_PTR +OI_excl_menu * T_PTR +OI_excl_check_menu * T_PTR +OI_excl_rect_menu * T_PTR +OI_basic_menu * T_PTR +OI_class * T_PTR +OI_connection * T_PTR +OI_ctlr_1d * T_PTR +OI_d_tech * T_PTR +OI_d_tech ** T_OPAQUEPTR +OI_dialog_box * T_PTR +OI_display_1d * T_PTR +OI_entry_field * T_PTR +OI_error_dialog_box * T_PTR +OI_excl_menu * T_PTR +OI_file_dialog_box * T_PTR +OI_gauge * T_PTR +OI_glyph * T_PTR +OI_help * T_PTR +OI_info_dialog_box * T_PTR +OI_menu * T_PTR +OI_menu_cell * T_PTR +OI_menu_cell ** T_OPAQUEPTR +OI_menu_spec * T_PACKED +OI_message_dialog_box * T_PTR +OI_ms_dialog_box * T_PTR +OI_multi_text * T_PTR +OI_panner * T_PTR +OI_pic_spec_mask * T_PTR +OI_pic_spec_mask ** T_OPAQUEPTR +OI_poly_menu * T_PTR +OI_poly_check_menu * T_PTR +OI_poly_rect_menu * T_PTR +OI_prompt_dialog_box * T_PTR +OI_question_dialog_box * T_PTR +OI_scroll_bar * T_PTR +OI_scroll_box * T_PTR +OI_scroll_menu * T_PTR +OI_scroll_text * T_PTR +OI_select_dialog_box * T_PTR +OI_separator * T_PTR +OI_seq_entry_field * T_PTR +OI_slider * T_PTR +OI_static_text * T_PTR +OI_translation_table * T_PTR +OI_warn_dialog_box * T_PTR +OI_work_dialog_box * T_PTR + +# +#################################### XPM SECTION +# +XpmAttributes * T_PACKED +XpmColorSymbol * T_PACKED +XpmExtension * T_PACKED + @@ -24,14 +24,14 @@ * * Revision 4.0.1.3 91/11/05 19:18:26 lwall * patch11: safe malloc code now integrated into Perl's malloc when possible - * patch11: index("little", "longer string") could visit faraway places + * patch11: strchr("little", "longer string") could visit faraway places * patch11: warn '-' x 10000 dumped core * patch11: forked exec on non-existent program now issues a warning * * Revision 4.0.1.2 91/06/07 12:10:42 lwall * patch4: new copyright notice * patch4: made some allowances for "semi-standard" C - * patch4: index() could blow up searching for null string + * patch4: strchr() could blow up searching for null string * patch4: taintchecks could improperly modify parent in vfork() * patch4: exec would close files even if you cleared close-on-exec flag * @@ -1501,8 +1501,8 @@ same_dirent(a,b) char *a; char *b; { - char *fa = rindex(a,'/'); - char *fb = rindex(b,'/'); + char *fa = strrchr(a,'/'); + char *fb = strrchr(b,'/'); struct stat tmpstatbuf1; struct stat tmpstatbuf2; #ifndef MAXPATHLEN @@ -1564,7 +1564,7 @@ I32 *retlen; register unsigned long retval = 0; char *tmp; - while (len-- && *s && (tmp = index(hexdigit, *s))) { + while (len-- && *s && (tmp = strchr(hexdigit, *s))) { retval <<= 4; retval |= (tmp - hexdigit) & 15; s++; diff --git a/x2p/find2perl.SH b/x2p/find2perl.SH index 324ec12654..582a9924ad 100755 --- a/x2p/find2perl.SH +++ b/x2p/find2perl.SH @@ -22,6 +22,10 @@ echo "Extracting find2perl (with variable substitutions)" rm -f find2perl $spitshell >find2perl <<!GROK!THIS! #!$bin/perl +# +# Modified September 26, 1993 to provide proper handling of years after 1999 +# Tom Link <tml+@pitt.edu> +# University of Pittsburgh eval 'exec $bin/perl -S \$0 \${1+"\$@"}' if \$running_under_some_shell; @@ -346,7 +350,7 @@ sub ls { ($sec,$min,$hour,$mday,$mon,$year) = localtime($mtime); $moname = $moname[$mon]; if (-M _ > 365.25 / 2) { - $timeyear = '19' . $year; + $timeyear = $year + 1900; } else { $timeyear = sprintf("%02d:%02d", $hour, $min); |