[win32] integrate mainline
[p5sagit/p5-mst-13.2.git] / perly.y
1 /*    perly.y
2  *
3  *    Copyright (c) 1991-1997, Larry Wall
4  *
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.
7  *
8  */
9
10 /*
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.'
13  */
14
15 %{
16 #include "EXTERN.h"
17 #include "perl.h"
18
19 static void
20 dep(void)
21 {
22     deprecate("\"do\" to call subroutines");
23 }
24
25 %}
26
27 %start prog
28
29 %union {
30     I32 ival;
31     char *pval;
32     OP *opval;
33     GV *gvval;
34 }
35
36 %token <ival> '{' ')'
37
38 %token <opval> WORD METHOD FUNCMETH THING PMFUNC PRIVATEREF
39 %token <opval> FUNC0SUB UNIOPSUB LSTOPSUB
40 %token <pval> LABEL
41 %token <ival> FORMAT SUB ANONSUB PACKAGE USE
42 %token <ival> WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR
43 %token <ival> LOOPEX DOTDOT
44 %token <ival> FUNC0 FUNC1 FUNC UNIOP LSTOP
45 %token <ival> RELOP EQOP MULOP ADDOP
46 %token <ival> DOLSHARP DO HASHBRACK NOAMP
47 %token LOCAL MY
48
49 %type <ival> prog decl local format startsub startanonsub startformsub
50 %type <ival> remember mremember '&'
51 %type <opval> block mblock lineseq line loop cond else
52 %type <opval> expr term scalar ary hsh arylen star amper sideff
53 %type <opval> argexpr nexpr texpr iexpr mexpr mnexpr mtexpr miexpr
54 %type <opval> listexpr listexprcom indirob listop method
55 %type <opval> formname subname proto subbody cont my_scalar
56 %type <pval> label
57
58 %left <ival> OROP
59 %left ANDOP
60 %right NOTOP
61 %nonassoc LSTOP LSTOPSUB
62 %left ','
63 %right <ival> ASSIGNOP
64 %right '?' ':'
65 %nonassoc DOTDOT
66 %left OROR
67 %left ANDAND
68 %left <ival> BITOROP
69 %left <ival> BITANDOP
70 %nonassoc EQOP
71 %nonassoc RELOP
72 %nonassoc UNIOP UNIOPSUB
73 %left <ival> SHIFTOP
74 %left ADDOP
75 %left MULOP
76 %left <ival> MATCHOP
77 %right '!' '~' UMINUS REFGEN
78 %right <ival> POWOP
79 %nonassoc PREINC PREDEC POSTINC POSTDEC
80 %left ARROW
81 %left '('
82
83 %% /* RULES */
84
85 prog    :       /* NULL */
86                 {
87 #if defined(YYDEBUG) && defined(DEBUGGING)
88                     yydebug = (debug & 1);
89 #endif
90                     expect = XSTATE;
91                 }
92         /*CONTINUED*/   lineseq
93                         { newPROG($2); }
94         ;
95
96 block   :       '{' remember lineseq '}'
97                         { if (copline > (line_t)$1)
98                               copline = $1;
99                           $$ = block_end($2, $3); }
100         ;
101
102 remember:       /* NULL */      /* start a full lexical scope */
103                         { $$ = block_start(TRUE); }
104         ;
105
106 mblock  :       '{' mremember lineseq '}'
107                         { if (copline > (line_t)$1)
108                               copline = $1;
109                           $$ = block_end($2, $3); }
110         ;
111
112 mremember:      /* NULL */      /* start a partial lexical scope */
113                         { $$ = block_start(FALSE); }
114         ;
115
116 lineseq :       /* NULL */
117                         { $$ = Nullop; }
118         |       lineseq decl
119                         { $$ = $1; }
120         |       lineseq line
121                         {   $$ = append_list(OP_LINESEQ,
122                                 (LISTOP*)$1, (LISTOP*)$2);
123                             pad_reset_pending = TRUE;
124                             if ($1 && $2) hints |= HINT_BLOCK_SCOPE; }
125         ;
126
127 line    :       label cond
128                         { $$ = newSTATEOP(0, $1, $2); }
129         |       loop    /* loops add their own labels */
130         |       label ';'
131                         { if ($1 != Nullch) {
132                               $$ = newSTATEOP(0, $1, newOP(OP_NULL, 0));
133                             }
134                             else {
135                               $$ = Nullop;
136                               copline = NOLINE;
137                             }
138                             expect = XSTATE; }
139         |       label sideff ';'
140                         { $$ = newSTATEOP(0, $1, $2);
141                           expect = XSTATE; }
142         ;
143
144 sideff  :       error
145                         { $$ = Nullop; }
146         |       expr
147                         { $$ = $1; }
148         |       expr IF expr
149                         { $$ = newLOGOP(OP_AND, 0, $3, $1); }
150         |       expr UNLESS expr
151                         { $$ = newLOGOP(OP_OR, 0, $3, $1); }
152         |       expr WHILE expr
153                         { $$ = newLOOPOP(OPf_PARENS, 1, scalar($3), $1); }
154         |       expr UNTIL iexpr
155                         { $$ = newLOOPOP(OPf_PARENS, 1, $3, $1);}
156         ;
157
158 else    :       /* NULL */
159                         { $$ = Nullop; }
160         |       ELSE mblock
161                         { $$ = scope($2); }
162         |       ELSIF '(' mexpr ')' mblock else
163                         { copline = $1;
164                             $$ = newSTATEOP(0, Nullch,
165                                    newCONDOP(0, $3, scope($5), $6));
166                             hints |= HINT_BLOCK_SCOPE; }
167         ;
168
169 cond    :       IF '(' remember mexpr ')' mblock else
170                         { copline = $1;
171                             $$ = block_end($3,
172                                    newCONDOP(0, $4, scope($6), $7)); }
173         |       UNLESS '(' remember miexpr ')' mblock else
174                         { copline = $1;
175                             $$ = block_end($3,
176                                    newCONDOP(0, $4, scope($6), $7)); }
177         ;
178
179 cont    :       /* NULL */
180                         { $$ = Nullop; }
181         |       CONTINUE block
182                         { $$ = scope($2); }
183         ;
184
185 loop    :       label WHILE '(' remember mtexpr ')' mblock cont
186                         { copline = $2;
187                             $$ = block_end($4,
188                                    newSTATEOP(0, $1,
189                                      newWHILEOP(0, 1, (LOOP*)Nullop,
190                                                 $2, $5, $7, $8))); }
191         |       label UNTIL '(' remember miexpr ')' mblock cont
192                         { copline = $2;
193                             $$ = block_end($4,
194                                    newSTATEOP(0, $1,
195                                      newWHILEOP(0, 1, (LOOP*)Nullop,
196                                                 $2, $5, $7, $8))); }
197         |       label FOR MY remember my_scalar '(' mexpr ')' mblock cont
198                         { $$ = block_end($4,
199                                  newFOROP(0, $1, $2, $5, $7, $9, $10)); }
200         |       label FOR scalar '(' remember mexpr ')' mblock cont
201                         { $$ = block_end($5,
202                                  newFOROP(0, $1, $2, mod($3, OP_ENTERLOOP),
203                                           $6, $8, $9)); }
204         |       label FOR '(' remember mexpr ')' mblock cont
205                         { $$ = block_end($4,
206                                  newFOROP(0, $1, $2, Nullop, $5, $7, $8)); }
207         |       label FOR '(' remember mnexpr ';' mtexpr ';' mnexpr ')' mblock
208                         /* basically fake up an initialize-while lineseq */
209                         { OP *forop = append_elem(OP_LINESEQ,
210                                         scalar($5),
211                                         newWHILEOP(0, 1, (LOOP*)Nullop,
212                                                    $2, scalar($7),
213                                                    $11, scalar($9)));
214                           copline = $2;
215                           $$ = block_end($4, newSTATEOP(0, $1, forop)); }
216         |       label block cont  /* a block is a loop that happens once */
217                         { $$ = newSTATEOP(0, $1,
218                                  newWHILEOP(0, 1, (LOOP*)Nullop,
219                                             NOLINE, Nullop, $2, $3)); }
220         ;
221
222 nexpr   :       /* NULL */
223                         { $$ = Nullop; }
224         |       sideff
225         ;
226
227 texpr   :       /* NULL means true */
228                         { (void)scan_num("1"); $$ = yylval.opval; }
229         |       expr
230         ;
231
232 iexpr   :       expr
233                         { $$ = invert(scalar($1)); }
234         ;
235
236 mexpr   :       expr
237                         { $$ = $1; intro_my(); }
238         ;
239
240 mnexpr  :       nexpr
241                         { $$ = $1; intro_my(); }
242         ;
243
244 mtexpr  :       texpr
245                         { $$ = $1; intro_my(); }
246         ;
247
248 miexpr  :       iexpr
249                         { $$ = $1; intro_my(); }
250         ;
251
252 label   :       /* empty */
253                         { $$ = Nullch; }
254         |       LABEL
255         ;
256
257 decl    :       format
258                         { $$ = 0; }
259         |       subrout
260                         { $$ = 0; }
261         |       package
262                         { $$ = 0; }
263         |       use
264                         { $$ = 0; }
265         ;
266
267 format  :       FORMAT startformsub formname block
268                         { newFORM($2, $3, $4); }
269         ;
270
271 formname:       WORD            { $$ = $1; }
272         |       /* NULL */      { $$ = Nullop; }
273         ;
274
275 subrout :       SUB startsub subname proto subbody
276                         { newSUB($2, $3, $4, $5); }
277         ;
278
279 startsub:       /* NULL */      /* start a regular subroutine scope */
280                         { $$ = start_subparse(FALSE, 0); }
281         ;
282
283 startanonsub:   /* NULL */      /* start an anonymous subroutine scope */
284                         { $$ = start_subparse(FALSE, CVf_ANON); }
285         ;
286
287 startformsub:   /* NULL */      /* start a format subroutine scope */
288                         { $$ = start_subparse(TRUE, 0); }
289         ;
290
291 subname :       WORD    { char *name = SvPV(((SVOP*)$1)->op_sv, na);
292                           if (strEQ(name, "BEGIN") || strEQ(name, "END")
293                               || strEQ(name, "INIT"))
294                               CvUNIQUE_on(compcv);
295                           $$ = $1; }
296         ;
297
298 proto   :       /* NULL */
299                         { $$ = Nullop; }
300         |       THING
301         ;
302
303 subbody :       block   { $$ = $1; }
304         |       ';'     { $$ = Nullop; expect = XSTATE; }
305         ;
306
307 package :       PACKAGE WORD ';'
308                         { package($2); }
309         |       PACKAGE ';'
310                         { package(Nullop); }
311         ;
312
313 use     :       USE startsub
314                         { CvUNIQUE_on(compcv); /* It's a BEGIN {} */ }
315                     WORD WORD listexpr ';'
316                         { utilize($1, $2, $4, $5, $6); }
317         ;
318
319 expr    :       expr ANDOP expr
320                         { $$ = newLOGOP(OP_AND, 0, $1, $3); }
321         |       expr OROP expr
322                         { $$ = newLOGOP($2, 0, $1, $3); }
323         |       argexpr
324         ;
325
326 argexpr :       argexpr ','
327                         { $$ = $1; }
328         |       argexpr ',' term
329                         { $$ = append_elem(OP_LIST, $1, $3); }
330         |       term
331         ;
332
333 listop  :       LSTOP indirob argexpr
334                         { $$ = convert($1, OPf_STACKED,
335                                 prepend_elem(OP_LIST, newGVREF($1,$2), $3) ); }
336         |       FUNC '(' indirob expr ')'
337                         { $$ = convert($1, OPf_STACKED,
338                                 prepend_elem(OP_LIST, newGVREF($1,$3), $4) ); }
339         |       term ARROW method '(' listexprcom ')'
340                         { $$ = convert(OP_ENTERSUB, OPf_STACKED,
341                                 append_elem(OP_LIST,
342                                     prepend_elem(OP_LIST, scalar($1), $5),
343                                     newUNOP(OP_METHOD, 0, $3))); }
344         |       METHOD indirob listexpr
345                         { $$ = convert(OP_ENTERSUB, OPf_STACKED,
346                                 append_elem(OP_LIST,
347                                     prepend_elem(OP_LIST, $2, $3),
348                                     newUNOP(OP_METHOD, 0, $1))); }
349         |       FUNCMETH indirob '(' listexprcom ')'
350                         { $$ = convert(OP_ENTERSUB, OPf_STACKED,
351                                 append_elem(OP_LIST,
352                                     prepend_elem(OP_LIST, $2, $4),
353                                     newUNOP(OP_METHOD, 0, $1))); }
354         |       LSTOP listexpr
355                         { $$ = convert($1, 0, $2); }
356         |       FUNC '(' listexprcom ')'
357                         { $$ = convert($1, 0, $3); }
358         |       LSTOPSUB startanonsub block
359                         { $3 = newANONSUB($2, 0, $3); }
360                     listexpr            %prec LSTOP
361                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
362                                  append_elem(OP_LIST,
363                                    prepend_elem(OP_LIST, $3, $5), $1)); }
364         ;
365
366 method  :       METHOD
367         |       scalar
368         ;
369
370 term    :       term ASSIGNOP term
371                         { $$ = newASSIGNOP(OPf_STACKED, $1, $2, $3); }
372         |       term POWOP term
373                         { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
374         |       term MULOP term
375                         {   if ($2 != OP_REPEAT)
376                                 scalar($1);
377                             $$ = newBINOP($2, 0, $1, scalar($3)); }
378         |       term ADDOP term
379                         { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
380         |       term SHIFTOP term
381                         { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
382         |       term RELOP term
383                         { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
384         |       term EQOP term
385                         { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
386         |       term BITANDOP term
387                         { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
388         |       term BITOROP term
389                         { $$ = newBINOP($2, 0, scalar($1), scalar($3)); }
390         |       term DOTDOT term
391                         { $$ = newRANGE($2, scalar($1), scalar($3));}
392         |       term ANDAND term
393                         { $$ = newLOGOP(OP_AND, 0, $1, $3); }
394         |       term OROR term
395                         { $$ = newLOGOP(OP_OR, 0, $1, $3); }
396         |       term '?' term ':' term
397                         { $$ = newCONDOP(0, $1, $3, $5); }
398         |       term MATCHOP term
399                         { $$ = bind_match($2, $1, $3); }
400
401         |       '-' term %prec UMINUS
402                         { $$ = newUNOP(OP_NEGATE, 0, scalar($2)); }
403         |       '+' term %prec UMINUS
404                         { $$ = $2; }
405         |       '!' term
406                         { $$ = newUNOP(OP_NOT, 0, scalar($2)); }
407         |       '~' term
408                         { $$ = newUNOP(OP_COMPLEMENT, 0, scalar($2));}
409         |       REFGEN term
410                         { $$ = newUNOP(OP_REFGEN, 0, mod($2,OP_REFGEN)); }
411         |       term POSTINC
412                         { $$ = newUNOP(OP_POSTINC, 0,
413                                         mod(scalar($1), OP_POSTINC)); }
414         |       term POSTDEC
415                         { $$ = newUNOP(OP_POSTDEC, 0,
416                                         mod(scalar($1), OP_POSTDEC)); }
417         |       PREINC term
418                         { $$ = newUNOP(OP_PREINC, 0,
419                                         mod(scalar($2), OP_PREINC)); }
420         |       PREDEC term
421                         { $$ = newUNOP(OP_PREDEC, 0,
422                                         mod(scalar($2), OP_PREDEC)); }
423         |       local term      %prec UNIOP
424                         { $$ = localize($2,$1); }
425         |       '(' expr ')'
426                         { $$ = sawparens($2); }
427         |       '(' ')'
428                         { $$ = sawparens(newNULLLIST()); }
429         |       '[' expr ']'                            %prec '('
430                         { $$ = newANONLIST($2); }
431         |       '[' ']'                                 %prec '('
432                         { $$ = newANONLIST(Nullop); }
433         |       HASHBRACK expr ';' '}'                  %prec '('
434                         { $$ = newANONHASH($2); }
435         |       HASHBRACK ';' '}'                               %prec '('
436                         { $$ = newANONHASH(Nullop); }
437         |       ANONSUB startanonsub proto block                %prec '('
438                         { $$ = newANONSUB($2, $3, $4); }
439         |       scalar  %prec '('
440                         { $$ = $1; }
441         |       star '{' expr ';' '}'
442                         { $$ = newBINOP(OP_GELEM, 0, newGVREF(0,$1),
443                                         scalar($3)); }
444         |       star    %prec '('
445                         { $$ = $1; }
446         |       scalar '[' expr ']'     %prec '('
447                         { $$ = newBINOP(OP_AELEM, 0, oopsAV($1), scalar($3)); }
448         |       term ARROW '[' expr ']' %prec '('
449                         { $$ = newBINOP(OP_AELEM, 0,
450                                         ref(newAVREF($1),OP_RV2AV),
451                                         scalar($4));}
452         |       term '[' expr ']'       %prec '('
453                         { assertref($1); $$ = newBINOP(OP_AELEM, 0,
454                                         ref(newAVREF($1),OP_RV2AV),
455                                         scalar($3));}
456         |       hsh     %prec '('
457                         { $$ = $1; }
458         |       ary     %prec '('
459                         { $$ = $1; }
460         |       arylen  %prec '('
461                         { $$ = newUNOP(OP_AV2ARYLEN, 0, ref($1, OP_AV2ARYLEN));}
462         |       scalar '{' expr ';' '}' %prec '('
463                         { $$ = newBINOP(OP_HELEM, 0, oopsHV($1), jmaybe($3));
464                             expect = XOPERATOR; }
465         |       term ARROW '{' expr ';' '}'     %prec '('
466                         { $$ = newBINOP(OP_HELEM, 0,
467                                         ref(newHVREF($1),OP_RV2HV),
468                                         jmaybe($4));
469                             expect = XOPERATOR; }
470         |       term '{' expr ';' '}'   %prec '('
471                         { assertref($1); $$ = newBINOP(OP_HELEM, 0,
472                                         ref(newHVREF($1),OP_RV2HV),
473                                         jmaybe($3));
474                             expect = XOPERATOR; }
475         |       '(' expr ')' '[' expr ']'       %prec '('
476                         { $$ = newSLICEOP(0, $5, $2); }
477         |       '(' ')' '[' expr ']'    %prec '('
478                         { $$ = newSLICEOP(0, $4, Nullop); }
479         |       ary '[' expr ']'        %prec '('
480                         { $$ = prepend_elem(OP_ASLICE,
481                                 newOP(OP_PUSHMARK, 0),
482                                     newLISTOP(OP_ASLICE, 0,
483                                         list($3),
484                                         ref($1, OP_ASLICE))); }
485         |       ary '{' expr ';' '}'    %prec '('
486                         { $$ = prepend_elem(OP_HSLICE,
487                                 newOP(OP_PUSHMARK, 0),
488                                     newLISTOP(OP_HSLICE, 0,
489                                         list($3),
490                                         ref(oopsHV($1), OP_HSLICE)));
491                             expect = XOPERATOR; }
492         |       THING   %prec '('
493                         { $$ = $1; }
494         |       amper
495                         { $$ = newUNOP(OP_ENTERSUB, 0, scalar($1)); }
496         |       amper '(' ')'
497                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar($1)); }
498         |       amper '(' expr ')'
499                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
500                             append_elem(OP_LIST, $3, scalar($1))); }
501         |       NOAMP WORD listexpr
502                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
503                             append_elem(OP_LIST, $3, scalar($2))); }
504         |       DO term %prec UNIOP
505                         { $$ = newUNOP(OP_DOFILE, 0, scalar($2)); }
506         |       DO block        %prec '('
507                         { $$ = newUNOP(OP_NULL, OPf_SPECIAL, scope($2)); }
508         |       DO WORD '(' ')'
509                         { $$ = newUNOP(OP_ENTERSUB,
510                             OPf_SPECIAL|OPf_STACKED,
511                             prepend_elem(OP_LIST,
512                                 scalar(newCVREF(
513                                     (OPpENTERSUB_AMPER<<8),
514                                     scalar($2)
515                                 )),Nullop)); dep();}
516         |       DO WORD '(' expr ')'
517                         { $$ = newUNOP(OP_ENTERSUB,
518                             OPf_SPECIAL|OPf_STACKED,
519                             append_elem(OP_LIST,
520                                 $4,
521                                 scalar(newCVREF(
522                                     (OPpENTERSUB_AMPER<<8),
523                                     scalar($2)
524                                 )))); dep();}
525         |       DO scalar '(' ')'
526                         { $$ = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED,
527                             prepend_elem(OP_LIST,
528                                 scalar(newCVREF(0,scalar($2))), Nullop)); dep();}
529         |       DO scalar '(' expr ')'
530                         { $$ = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED,
531                             prepend_elem(OP_LIST,
532                                 $4,
533                                 scalar(newCVREF(0,scalar($2))))); dep();}
534         |       term ARROW '(' ')'      %prec '('
535                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
536                                    newCVREF(0, scalar($1))); }
537         |       term ARROW '(' expr ')' %prec '('
538                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
539                                    append_elem(OP_LIST, $4,
540                                        newCVREF(0, scalar($1)))); }
541         |       LOOPEX
542                         { $$ = newOP($1, OPf_SPECIAL);
543                             hints |= HINT_BLOCK_SCOPE; }
544         |       LOOPEX term
545                         { $$ = newLOOPEX($1,$2); }
546         |       NOTOP argexpr
547                         { $$ = newUNOP(OP_NOT, 0, scalar($2)); }
548         |       UNIOP
549                         { $$ = newOP($1, 0); }
550         |       UNIOP block
551                         { $$ = newUNOP($1, 0, $2); }
552         |       UNIOP term
553                         { $$ = newUNOP($1, 0, $2); }
554         |       UNIOPSUB term
555                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
556                             append_elem(OP_LIST, $2, scalar($1))); }
557         |       FUNC0
558                         { $$ = newOP($1, 0); }
559         |       FUNC0 '(' ')'
560                         { $$ = newOP($1, 0); }
561         |       FUNC0SUB
562                         { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
563                                 scalar($1)); }
564         |       FUNC1 '(' ')'
565                         { $$ = newOP($1, OPf_SPECIAL); }
566         |       FUNC1 '(' expr ')'
567                         { $$ = newUNOP($1, 0, $3); }
568         |       PMFUNC '(' term ')'
569                         { $$ = pmruntime($1, $3, Nullop); }
570         |       PMFUNC '(' term ',' term ')'
571                         { $$ = pmruntime($1, $3, $5); }
572         |       WORD
573         |       listop
574         ;
575
576 listexpr:       /* NULL */
577                         { $$ = Nullop; }
578         |       argexpr
579                         { $$ = $1; }
580         ;
581
582 listexprcom:    /* NULL */
583                         { $$ = Nullop; }
584         |       expr
585                         { $$ = $1; }
586         |       expr ','
587                         { $$ = $1; }
588         ;
589
590 local   :       LOCAL   { $$ = 0; }
591         |       MY      { $$ = 1; }
592         ;
593
594 my_scalar:      scalar
595                         { in_my = 0; $$ = my($1); }
596         ;
597
598 amper   :       '&' indirob
599                         { $$ = newCVREF($1,$2); }
600         ;
601
602 scalar  :       '$' indirob
603                         { $$ = newSVREF($2); }
604         ;
605
606 ary     :       '@' indirob
607                         { $$ = newAVREF($2); }
608         ;
609
610 hsh     :       '%' indirob
611                         { $$ = newHVREF($2); }
612         ;
613
614 arylen  :       DOLSHARP indirob
615                         { $$ = newAVREF($2); }
616         ;
617
618 star    :       '*' indirob
619                         { $$ = newGVREF(0,$2); }
620         ;
621
622 indirob :       WORD
623                         { $$ = scalar($1); }
624         |       scalar
625                         { $$ = scalar($1);  }
626         |       block
627                         { $$ = scope($1); }
628
629         |       PRIVATEREF
630                         { $$ = $1; }
631         ;
632
633 %% /* PROGRAM */