On Mon, 2005-03-07 at 11:59, Palit, Nilanjan wrote:
> > From: John Macdonald [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, March 07, 2005 12:50 PM
> 
> > Precedence has nothing to do with it.  The issue is how the
> > tokenizer breaks the input sequence '+++' into operator tokens.
> 
> Absolutely. The trickier version of the same question is when both sides
> of the '+++' are variables:
> 
> $y=$x+++$z
> 
> That's when you need to know that parsing is done left to right

As far as I'm aware, that's still a tokenizer issue. You're not touching
the parser until you figure out what tokens "+++" make up, and once
you've determined that, the precedence no longer matters (i.e., there's
only one way to interpret TOK<$x> TOK<++> TOK<+> TOK<$z>. Now, if the
tokenizer were handing back TOK<$x> TOK<+> TOK<+> TOK<+> TOK<$z>, that
would be a different matter, but it's not.

Of course, Perl's parser and tokenizer are deeply incestuous, but that's
the general idea.

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to