Bart Lateur writes:
> I don't get it. What makes it so hard? If you see a "/" when you're
> expecting an operator, or end of statement, then it's division. If you
> were expecting an expression, it's a regex. Ain't it?

We're talking tokenizing vs parsing.  If I'm just getting back a
sequence of chunks, I haven't kept track of whether:
  /3*5/
is part of
  $x/3*5
(in which case the tokens are /, 3, and /), or
  if (/3*5/)
(in which case the tokens might well be /, 3*5, and /).

Making sense of tokens is what a parser does.  In theory.
If we can break a couple of these nasty incestuosities between
parser and tokenizer, we can make it possible to tokenize Perl
without having to parse as well.

Nat

Reply via email to