develooper Front page | perl.perl6.compiler | Postings from November 2005

Re: Recent news about PGE

Thread Previous
From:
Autrijus Tang
Date:
November 6, 2005 16:05
Subject:
Re: Recent news about PGE
Message ID:
1912f0e20511060837x1c0f3679ycfed4cf802b81e56@mail.gmail.com
On 11/6/05, Patrick R. Michaud <pmichaud@pobox.com> wrote:
> First, for null input, PGE (and p6rules) will likely parse this
> by returning a Match object indicating "false", and attempting
> to compile that object will probably return a null subroutine.

Yes, that sounds sane.

> The other case is when there's an operator requiring a term
> and such a term isn't found -- i.e., an invalid expression such
> as  "$a + 5 *".  I can either have pge return the portion that
> successfully matches (i.e., the "$a + 5" part), return a false
> Match object, or throw an exception.  At the moment I'm in
> favor of returning the portion that successfully matches, similar
> to what a rec-descent parser would do.

This too, as you can trivially concat the OPTable parser with an
explicit end-of-string marker.

> > As a workaround, I special-cased m:// and m:P5// in Pugs, which may
> > be useful anyway, as split(//, $string) is quite common.
>
> If I read S05 correctly, that now has to be  split(/<?null>/, $string).

Indeed.  It's fortunate that there is a split('', $string) form. ;-)

Empty rules are now an error in Pugs.  Thanks for the correction!

/Autrijus/

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About