in reply to Re^2: Where does $4 come from here?
in thread Where does $4 come from here?

But in this production, there're only 3 elements on the right hand side, and I don't see what $4 refers to...

Ok, here is more guessing, if we're talking about GRAMPROG  remember stmtseq and

remember: /* NULL */ /* start a full lexical scope */ { $$ = block_start(TRUE); } ; stmtseq : /* NULL */ { $$ = (OP*)NULL; } | stmtseq fullstmt { $$ = op_append_list(OP_LINESEQ, $1, $2); PL_pad_reset_pending = TRUE; if ($1 && $2) PL_hints |= HINT_BLOCK_SCOPE; } ;
then surely $$ = op_append_list(OP_LINESEQ, $1, $2); becomes $2, $3, $4, right?

:)

Replies are listed 'Best First'.
Re^4: Where does $4 come from here?
by PerlOnTheWay (Monk) on Jul 27, 2011 at 08:17 UTC

    No, that's not how yacc works AFAIK...