At 12:17 AM 4/20/2001 -0500, David L. Nicol wrote:
>Simon Cozens wrote:
> >
> > On Thu, Apr 12, 2001 at 05:39:12PM -0400, Dan Sugalski wrote:
> > > [We have FOO:BAR]
> > > While this is reasonably true (and reasonably reasonable) it's not 
> entirely
> > > to the point. If we're going to provide a mechanism to define the 
> syntax of
> > > a mini-language (or a maxi one, I suppose, though there are probably 
> better
> > > ways to do it) then the details of colons and constants and 
> what-have-yous
> > > are pretty close to irrelevant.
> >
> > No, I don't think so. The whole thing rests on the fact that class FOO 
> knows
> > how to parse string BAR. This, from the tokener's point of view, means that
> > class FOO has to tell us when string BAR actually *ends*.
>
>No it doesn't.  There are well-defined rules for when string BAR actually
>*ends* which are followed before FOO ever sees it.

No, not necessarily. Since we're opening the parser up for abuse, string 
delimiting rules may differ. Postscript delimits strings with parenthesis, 
for example.

> > For complex BAR (and
> > complex FOO) this could be, uh, complex. It means that our parser would 
> have
> > to call out to other routines - which can presumably be defined in Perl 
> - to
> > assist in parsing Perl code. And hey, if BAR can be defined in Perl, it 
> can be
> > defined on-the-fly. Oh dear.
> >
> > Not impossible by any means, but *by no means* irrelevant.
>
>
>No.

Well, maybe.

>Recursive parsing is not needed.  We have the HERE string, which can
>  include anything in with the rest of the code, by looking for the
>  end-token.  The perl5 Inline module works that way.

I'm not a parser guy by any means (unfortunately) but we have the distinct 
possibility of completely replacing all of the parser rules after token X 
appears, whatever that token might be. (Heck, we may have the possibility 
of replacing the entire parser) There's no guarantee the non-perl-6 section 
will have a nice end-delimiter for us to find. Granted that won't be the 
case all the time, but it's certainly quite feasable. We might not even be 
able to rely on perl's definition of a token. (Or whitespace for that 
matter--Whitespace isn't just whitespace in python mode)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to