3 * Copyright (c) 1991-2002, 2003, 2004 Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 * 'I see,' laughed Strider. 'I look foul and feel fair. Is that it?
12 * All that is gold does not glitter, not all those who wander are lost.'
15 /* This file holds the grammar for the Perl language. If edited, you need
16 * to run regen_perly.pl, which re-creates the files perly.h, perly.tab
17 * and perly.act which are derived from this.
19 * The main job of of this grammar is to call the various newFOO()
20 * functions in op.c to build a syntax tree of OP structs.
21 * It relies on the lexer in toke.c to do the tokenizing.
24 /* Make the parser re-entrant. */
39 %token <opval> WORD METHOD FUNCMETH THING PMFUNC PRIVATEREF
40 %token <opval> FUNC0SUB UNIOPSUB LSTOPSUB
42 %token <ival> FORMAT SUB ANONSUB PACKAGE USE
43 %token <ival> WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR
44 %token <ival> GIVEN WHEN DEFAULT
45 %token <ival> LOOPEX DOTDOT
46 %token <ival> FUNC0 FUNC1 FUNC UNIOP LSTOP
47 %token <ival> RELOP EQOP MULOP ADDOP
48 %token <ival> DOLSHARP DO HASHBRACK NOAMP
49 %token <ival> LOCAL MY MYSUB REQUIRE
52 %type <ival> prog decl format startsub startanonsub startformsub mintro
53 %type <ival> progstart remember mremember '&' savescope mydefsv
54 %type <opval> block mblock lineseq line loop cond else
55 %type <opval> expr term subscripted scalar ary hsh arylen star amper sideff
56 %type <opval> argexpr nexpr texpr iexpr mexpr mnexpr miexpr
57 %type <opval> listexpr listexprcom indirob listop method
58 %type <opval> formname subname proto subbody cont my_scalar
59 %type <opval> subattrlist myattrlist mysubrout myattrterm myterm
60 %type <opval> termbinop termunop anonymous termdo
61 %type <opval> switch case
67 %left <ival> OROP DOROP
70 %nonassoc LSTOP LSTOPSUB
72 %right <ival> ASSIGNOP
81 %nonassoc UNIOP UNIOPSUB
87 %right '!' '~' UMINUS REFGEN
89 %nonassoc PREINC PREDEC POSTINC POSTDEC
97 /* The whole program */
100 { $$ = $1; newPROG(block_end($1,$2)); }
103 /* An ordinary block */
104 block : '{' remember lineseq '}'
105 { if (PL_copline > (line_t)$1)
106 PL_copline = (line_t)$1;
107 $$ = block_end($2, $3); }
110 remember: /* NULL */ /* start a full lexical scope */
111 { $$ = block_start(TRUE); }
114 mydefsv: /* NULL */ /* lexicalize $_ */
115 { $$ = (I32) allocmy("$_"); }
120 PL_expect = XSTATE; $$ = block_start(TRUE);
125 mblock : '{' mremember lineseq '}'
126 { if (PL_copline > (line_t)$1)
127 PL_copline = (line_t)$1;
128 $$ = block_end($2, $3); }
131 mremember: /* NULL */ /* start a partial lexical scope */
132 { $$ = block_start(FALSE); }
135 savescope: /* NULL */ /* remember stack pos in case of error */
136 { $$ = PL_savestack_ix; }
138 /* A collection of "lines" in the program */
143 | lineseq savescope line
145 $$ = append_list(OP_LINESEQ,
146 (LISTOP*)$1, (LISTOP*)$3);
147 PL_pad_reset_pending = TRUE;
148 if ($1 && $3) PL_hints |= HINT_BLOCK_SCOPE; }
151 /* A "line" in the program */
153 { $$ = newSTATEOP(0, $1, $2); }
154 | loop /* loops add their own labels */
155 | switch /* ... and so do switches */
158 { $$ = newSTATEOP(0, $1, $2); }
160 { if ($1 != Nullch) {
161 $$ = newSTATEOP(0, $1, newOP(OP_NULL, 0));
167 PL_expect = XSTATE; }
169 { $$ = newSTATEOP(0, $1, $2);
170 PL_expect = XSTATE; }
173 /* An expression which may have a side-effect */
179 { $$ = newLOGOP(OP_AND, 0, $3, $1); }
181 { $$ = newLOGOP(OP_OR, 0, $3, $1); }
183 { $$ = newLOOPOP(OPf_PARENS, 1, scalar($3), $1); }
185 { $$ = newLOOPOP(OPf_PARENS, 1, $3, $1);}
187 { $$ = newFOROP(0, Nullch, (line_t)$2,
188 Nullop, $3, $1, Nullop); }
191 /* else and elsif blocks */
195 { ($2)->op_flags |= OPf_PARENS; $$ = scope($2); }
196 | ELSIF '(' mexpr ')' mblock else
197 { PL_copline = (line_t)$1;
198 $$ = newCONDOP(0, $3, scope($5), $6);
199 PL_hints |= HINT_BLOCK_SCOPE; }
202 /* Real conditional expressions */
203 cond : IF '(' remember mexpr ')' mblock else
204 { PL_copline = (line_t)$1;
206 newCONDOP(0, $4, scope($6), $7)); }
207 | UNLESS '(' remember miexpr ')' mblock else
208 { PL_copline = (line_t)$1;
210 newCONDOP(0, $4, scope($6), $7)); }
213 /* Cases for a switch statement */
214 case : WHEN '(' remember mexpr ')' mblock
216 newWHENOP($4, scope($6))); }
218 { $$ = newWHENOP(0, scope($2)); }
221 /* Continue blocks */
228 /* Loops: while, until, for, and a bare block */
229 loop : label WHILE '(' remember texpr ')' mintro mblock cont
230 { PL_copline = (line_t)$2;
233 newWHILEOP(0, 1, (LOOP*)Nullop,
234 $2, $5, $8, $9, $7))); }
235 | label UNTIL '(' remember iexpr ')' mintro mblock cont
236 { PL_copline = (line_t)$2;
239 newWHILEOP(0, 1, (LOOP*)Nullop,
240 $2, $5, $8, $9, $7))); }
241 | label FOR MY remember my_scalar '(' mexpr ')' mblock cont
243 newFOROP(0, $1, (line_t)$2, $5, $7, $9, $10)); }
244 | label FOR scalar '(' remember mexpr ')' mblock cont
246 newFOROP(0, $1, (line_t)$2, mod($3, OP_ENTERLOOP),
248 | label FOR '(' remember mexpr ')' mblock cont
250 newFOROP(0, $1, (line_t)$2, Nullop, $5, $7, $8)); }
251 | label FOR '(' remember mnexpr ';' texpr ';' mintro mnexpr ')'
253 /* basically fake up an initialize-while lineseq */
255 PL_copline = (line_t)$2;
256 forop = newSTATEOP(0, $1,
257 newWHILEOP(0, 1, (LOOP*)Nullop,
261 forop = append_elem(OP_LINESEQ,
262 newSTATEOP(0, ($1?savepv($1):Nullch),
267 $$ = block_end($4, forop); }
268 | label block cont /* a block is a loop that happens once */
269 { $$ = newSTATEOP(0, $1,
270 newWHILEOP(0, 1, (LOOP*)Nullop,
271 NOLINE, Nullop, $2, $3, 0)); }
275 switch : label GIVEN '(' remember mydefsv mexpr ')' mblock
276 { PL_copline = (line_t) $2;
279 newGIVENOP($6, scope($8),
280 (PADOFFSET) $5) )); }
283 /* determine whether there are any new my declarations */
285 { $$ = (PL_min_intro_pending &&
286 PL_max_intro_pending >= PL_min_intro_pending);
289 /* Normal expression */
295 /* Boolean expression */
296 texpr : /* NULL means true */
297 { (void)scan_num("1", &yylval); $$ = yylval.opval; }
301 /* Inverted boolean expression */
303 { $$ = invert(scalar($1)); }
306 /* Expression with its own lexical scope */
308 { $$ = $1; intro_my(); }
312 { $$ = $1; intro_my(); }
316 { $$ = $1; intro_my(); }
319 /* Optional "MAIN:"-style loop labels */
325 /* Some kind of declaration - does not take part in the parse tree */
338 format : FORMAT startformsub formname block
339 { newFORM($2, $3, $4); }
342 formname: WORD { $$ = $1; }
343 | /* NULL */ { $$ = Nullop; }
346 /* Unimplemented "my sub foo { }" */
347 mysubrout: MYSUB startsub subname proto subattrlist subbody
348 { newMYSUB($2, $3, $4, $5, $6); }
351 /* Subroutine definition */
352 subrout : SUB startsub subname proto subattrlist subbody
353 { newATTRSUB($2, $3, $4, $5, $6); }
356 startsub: /* NULL */ /* start a regular subroutine scope */
357 { $$ = start_subparse(FALSE, 0); }
360 startanonsub: /* NULL */ /* start an anonymous subroutine scope */
361 { $$ = start_subparse(FALSE, CVf_ANON); }
364 startformsub: /* NULL */ /* start a format subroutine scope */
365 { $$ = start_subparse(TRUE, 0); }
368 /* Name of a subroutine - must be a bareword, could be special */
369 subname : WORD { const char *const name = SvPV_nolen_const(((SVOP*)$1)->op_sv);
370 if (strEQ(name, "BEGIN") || strEQ(name, "END")
371 || strEQ(name, "INIT") || strEQ(name, "CHECK"))
372 CvSPECIAL_on(PL_compcv);
376 /* Subroutine prototype */
382 /* Optional list of subroutine attributes */
383 subattrlist: /* NULL */
391 /* List of attributes for a "my" variable declaration */
392 myattrlist: COLONATTR THING
398 /* Subroutine body - either null or a block */
399 subbody : block { $$ = $1; }
400 | ';' { $$ = Nullop; PL_expect = XSTATE; }
403 package : PACKAGE WORD ';'
408 { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
409 WORD WORD listexpr ';'
410 { utilize($1, $2, $4, $5, $6); }
413 /* Ordinary expressions; logical combinations */
414 expr : expr ANDOP expr
415 { $$ = newLOGOP(OP_AND, 0, $1, $3); }
417 { $$ = newLOGOP($2, 0, $1, $3); }
419 { $$ = newLOGOP(OP_DOR, 0, $1, $3); }
420 | argexpr %prec PREC_LOW
423 /* Expressions are a list of terms joined by commas */
424 argexpr : argexpr ','
427 { $$ = append_elem(OP_LIST, $1, $3); }
428 | term %prec PREC_LOW
432 listop : LSTOP indirob argexpr /* map {...} @args or print $fh @args */
433 { $$ = convert($1, OPf_STACKED,
434 prepend_elem(OP_LIST, newGVREF($1,$2), $3) ); }
435 | FUNC '(' indirob expr ')' /* print ($fh @args */
436 { $$ = convert($1, OPf_STACKED,
437 prepend_elem(OP_LIST, newGVREF($1,$3), $4) ); }
438 | term ARROW method '(' listexprcom ')' /* $foo->bar(list) */
439 { $$ = convert(OP_ENTERSUB, OPf_STACKED,
441 prepend_elem(OP_LIST, scalar($1), $5),
442 newUNOP(OP_METHOD, 0, $3))); }
443 | term ARROW method /* $foo->bar */
444 { $$ = convert(OP_ENTERSUB, OPf_STACKED,
445 append_elem(OP_LIST, scalar($1),
446 newUNOP(OP_METHOD, 0, $3))); }
447 | METHOD indirob listexpr /* new Class @args */
448 { $$ = convert(OP_ENTERSUB, OPf_STACKED,
450 prepend_elem(OP_LIST, $2, $3),
451 newUNOP(OP_METHOD, 0, $1))); }
452 | FUNCMETH indirob '(' listexprcom ')' /* method $object (@args) */
453 { $$ = convert(OP_ENTERSUB, OPf_STACKED,
455 prepend_elem(OP_LIST, $2, $4),
456 newUNOP(OP_METHOD, 0, $1))); }
457 | LSTOP listexpr /* print @args */
458 { $$ = convert($1, 0, $2); }
459 | FUNC '(' listexprcom ')' /* print (@args) */
460 { $$ = convert($1, 0, $3); }
461 | LSTOPSUB startanonsub block /* sub f(&@); f { foo } ... */
462 { $3 = newANONATTRSUB($2, 0, Nullop, $3); }
463 listexpr %prec LSTOP /* ... @bar */
464 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
466 prepend_elem(OP_LIST, $3, $5), $1)); }
469 /* Names of methods. May use $object->$methodname */
474 /* Some kind of subscripted expression */
475 subscripted: star '{' expr ';' '}' /* *main::{something} */
476 /* In this and all the hash accessors, ';' is
477 * provided by the tokeniser */
478 { $$ = newBINOP(OP_GELEM, 0, $1, scalar($3));
479 PL_expect = XOPERATOR; }
480 | scalar '[' expr ']' /* $array[$element] */
481 { $$ = newBINOP(OP_AELEM, 0, oopsAV($1), scalar($3)); }
482 | term ARROW '[' expr ']' /* somearef->[$element] */
483 { $$ = newBINOP(OP_AELEM, 0,
484 ref(newAVREF($1),OP_RV2AV),
486 | subscripted '[' expr ']' /* $foo->[$bar]->[$baz] */
487 { $$ = newBINOP(OP_AELEM, 0,
488 ref(newAVREF($1),OP_RV2AV),
490 | scalar '{' expr ';' '}' /* $foo->{bar();} */
491 { $$ = newBINOP(OP_HELEM, 0, oopsHV($1), jmaybe($3));
492 PL_expect = XOPERATOR; }
493 | term ARROW '{' expr ';' '}' /* somehref->{bar();} */
494 { $$ = newBINOP(OP_HELEM, 0,
495 ref(newHVREF($1),OP_RV2HV),
497 PL_expect = XOPERATOR; }
498 | subscripted '{' expr ';' '}' /* $foo->[bar]->{baz;} */
499 { $$ = newBINOP(OP_HELEM, 0,
500 ref(newHVREF($1),OP_RV2HV),
502 PL_expect = XOPERATOR; }
503 | term ARROW '(' ')' /* $subref->() */
504 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
505 newCVREF(0, scalar($1))); }
506 | term ARROW '(' expr ')' /* $subref->(@args) */
507 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
508 append_elem(OP_LIST, $4,
509 newCVREF(0, scalar($1)))); }
511 | subscripted '(' expr ')' /* $foo->{bar}->(@args) */
512 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
513 append_elem(OP_LIST, $3,
514 newCVREF(0, scalar($1)))); }
515 | subscripted '(' ')' /* $foo->{bar}->() */
516 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
517 newCVREF(0, scalar($1))); }
518 | '(' expr ')' '[' expr ']' /* list slice */
519 { $$ = newSLICEOP(0, $5, $2); }
520 | '(' ')' '[' expr ']' /* empty list slice! */
521 { $$ = newSLICEOP(0, $4, Nullop); }
524 /* Binary operators between terms */
525 termbinop : term ASSIGNOP term /* $x = $y */
526 { $$ = newASSIGNOP(OPf_STACKED, $1, $2, $3); }
527 | term POWOP term /* $x ** $y */
528 { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
529 | term MULOP term /* $x * $y, $x x $y */
530 { if ($2 != OP_REPEAT)
532 $$ = newBINOP($2, 0, $1, scalar($3)); }
533 | term ADDOP term /* $x + $y */
534 { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
535 | term SHIFTOP term /* $x >> $y, $x << $y */
536 { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
537 | term RELOP term /* $x > $y, etc. */
538 { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
539 | term EQOP term /* $x == $y, $x eq $y */
540 { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
541 | term BITANDOP term /* $x & $y */
542 { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
543 | term BITOROP term /* $x | $y */
544 { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
545 | term DOTDOT term /* $x..$y, $x...$y */
546 { $$ = newRANGE($2, scalar($1), scalar($3));}
547 | term ANDAND term /* $x && $y */
548 { $$ = newLOGOP(OP_AND, 0, $1, $3); }
549 | term OROR term /* $x || $y */
550 { $$ = newLOGOP(OP_OR, 0, $1, $3); }
551 | term DORDOR term /* $x // $y */
552 { $$ = newLOGOP(OP_DOR, 0, $1, $3); }
553 | term MATCHOP term /* $x =~ /$y/ */
554 { $$ = bind_match($2, $1, $3); }
557 /* Unary operators and terms */
558 termunop : '-' term %prec UMINUS /* -$x */
559 { $$ = newUNOP(OP_NEGATE, 0, scalar($2)); }
560 | '+' term %prec UMINUS /* +$x */
563 { $$ = newUNOP(OP_NOT, 0, scalar($2)); }
565 { $$ = newUNOP(OP_COMPLEMENT, 0, scalar($2));}
566 | term POSTINC /* $x++ */
567 { $$ = newUNOP(OP_POSTINC, 0,
568 mod(scalar($1), OP_POSTINC)); }
569 | term POSTDEC /* $x-- */
570 { $$ = newUNOP(OP_POSTDEC, 0,
571 mod(scalar($1), OP_POSTDEC)); }
572 | PREINC term /* ++$x */
573 { $$ = newUNOP(OP_PREINC, 0,
574 mod(scalar($2), OP_PREINC)); }
575 | PREDEC term /* --$x */
576 { $$ = newUNOP(OP_PREDEC, 0,
577 mod(scalar($2), OP_PREDEC)); }
581 /* Constructors for anonymous data */
582 anonymous: '[' expr ']'
583 { $$ = newANONLIST($2); }
585 { $$ = newANONLIST(Nullop); }
586 | HASHBRACK expr ';' '}' %prec '(' /* { foo => "Bar" } */
587 { $$ = newANONHASH($2); }
588 | HASHBRACK ';' '}' %prec '(' /* { } (';' by tokener) */
589 { $$ = newANONHASH(Nullop); }
590 | ANONSUB startanonsub proto subattrlist block %prec '('
591 { $$ = newANONATTRSUB($2, $3, $4, $5); }
595 /* Things called with "do" */
596 termdo : DO term %prec UNIOP /* do $filename */
597 { $$ = dofile($2, $1); }
598 | DO block %prec '(' /* do { code */
599 { $$ = newUNOP(OP_NULL, OPf_SPECIAL, scope($2)); }
600 | DO WORD '(' ')' /* do somesub() */
601 { $$ = newUNOP(OP_ENTERSUB,
602 OPf_SPECIAL|OPf_STACKED,
603 prepend_elem(OP_LIST,
605 (OPpENTERSUB_AMPER<<8),
608 | DO WORD '(' expr ')' /* do somesub(@args) */
609 { $$ = newUNOP(OP_ENTERSUB,
610 OPf_SPECIAL|OPf_STACKED,
614 (OPpENTERSUB_AMPER<<8),
617 | DO scalar '(' ')' /* do $subref () */
618 { $$ = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED,
619 prepend_elem(OP_LIST,
620 scalar(newCVREF(0,scalar($2))), Nullop)); dep();}
621 | DO scalar '(' expr ')' /* do $subref (@args) */
622 { $$ = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED,
623 prepend_elem(OP_LIST,
625 scalar(newCVREF(0,scalar($2))))); dep();}
633 | term '?' term ':' term
634 { $$ = newCONDOP(0, $1, $3, $5); }
635 | REFGEN term /* \$x, \@y, \%z */
636 { $$ = newUNOP(OP_REFGEN, 0, mod($2,OP_REFGEN)); }
637 | myattrterm %prec UNIOP
639 | LOCAL term %prec UNIOP
640 { $$ = localize($2,$1); }
642 { $$ = sawparens($2); }
644 { $$ = sawparens(newNULLLIST()); }
653 | arylen %prec '(' /* $#x, $#{ something } */
654 { $$ = newUNOP(OP_AV2ARYLEN, 0, ref($1, OP_AV2ARYLEN));}
657 | ary '[' expr ']' /* array slice */
658 { $$ = prepend_elem(OP_ASLICE,
659 newOP(OP_PUSHMARK, 0),
660 newLISTOP(OP_ASLICE, 0,
662 ref($1, OP_ASLICE))); }
663 | ary '{' expr ';' '}' /* @hash{@keys} */
664 { $$ = prepend_elem(OP_HSLICE,
665 newOP(OP_PUSHMARK, 0),
666 newLISTOP(OP_HSLICE, 0,
668 ref(oopsHV($1), OP_HSLICE)));
669 PL_expect = XOPERATOR; }
673 { $$ = newUNOP(OP_ENTERSUB, 0, scalar($1)); }
674 | amper '(' ')' /* &foo() */
675 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar($1)); }
676 | amper '(' expr ')' /* &foo(@args) */
677 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
678 append_elem(OP_LIST, $3, scalar($1))); }
679 | NOAMP WORD listexpr /* foo(@args) */
680 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
681 append_elem(OP_LIST, $3, scalar($2))); }
682 | LOOPEX /* loop exiting command (goto, last, dump, etc) */
683 { $$ = newOP($1, OPf_SPECIAL);
684 PL_hints |= HINT_BLOCK_SCOPE; }
686 { $$ = newLOOPEX($1,$2); }
687 | NOTOP argexpr /* not $foo */
688 { $$ = newUNOP(OP_NOT, 0, scalar($2)); }
689 | UNIOP /* Unary op, $_ implied */
690 { $$ = newOP($1, 0); }
691 | UNIOP block /* eval { foo } */
692 { $$ = newUNOP($1, 0, $2); }
693 | UNIOP term /* Unary op */
694 { $$ = newUNOP($1, 0, $2); }
695 | REQUIRE /* require, $_ implied */
696 { $$ = newOP(OP_REQUIRE, $1 ? OPf_SPECIAL : 0); }
697 | REQUIRE term /* require Foo */
698 { $$ = newUNOP(OP_REQUIRE, $1 ? OPf_SPECIAL : 0, $2); }
699 | UNIOPSUB term /* Sub treated as unop */
700 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
701 append_elem(OP_LIST, $2, scalar($1))); }
702 | FUNC0 /* Nullary operator */
703 { $$ = newOP($1, 0); }
705 { $$ = newOP($1, 0); }
706 | FUNC0SUB /* Sub treated as nullop */
707 { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
709 | FUNC1 '(' ')' /* not () */
710 { $$ = $1 == OP_NOT ? newUNOP($1, 0, newSVOP(OP_CONST, 0, newSViv(0)))
711 : newOP($1, OPf_SPECIAL); }
712 | FUNC1 '(' expr ')' /* not($foo) */
713 { $$ = newUNOP($1, 0, $3); }
714 | PMFUNC '(' argexpr ')' /* m//, s///, tr/// */
715 { $$ = pmruntime($1, $3, 1); }
720 /* "my" declarations, with optional attributes */
721 myattrterm: MY myterm myattrlist
722 { $$ = my_attrs($2,$3); }
724 { $$ = localize($2,$1); }
727 /* Things that can be "my"'d */
728 myterm : '(' expr ')'
729 { $$ = sawparens($2); }
731 { $$ = sawparens(newNULLLIST()); }
740 /* Basic list expressions */
741 listexpr: /* NULL */ %prec PREC_LOW
743 | argexpr %prec PREC_LOW
747 listexprcom: /* NULL */
755 /* A little bit of trickery to make "for my $foo (@bar)" actually be
758 { PL_in_my = 0; $$ = my($1); }
762 { $$ = newCVREF($1,$2); }
766 { $$ = newSVREF($2); }
770 { $$ = newAVREF($2); }
774 { $$ = newHVREF($2); }
777 arylen : DOLSHARP indirob
778 { $$ = newAVREF($2); }
782 { $$ = newGVREF(0,$2); }
785 /* Indirect objects */
788 | scalar %prec PREC_LOW