chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Question about the greediness of the lexgen egg's le


From: Ivan Raikov
Subject: Re: [Chicken-users] Question about the greediness of the lexgen egg's lex procedure
Date: Tue, 23 Oct 2012 10:03:55 +0900

Hello,

   Thanks for trying to use lexgen :-) The documentation is out of
date; while the initial design of lexgen did use the longest of
multiple possible matchings, it turned out to be difficult to control
the level of greediness if you wanted longest match only in some
situations, but not in others. So the current implementation is indeed
based on first possible match. I will update the documentation
accordingly.

   Ivan

On Mon, Oct 22, 2012 at 9:32 PM, Sam Hardwick <address@hidden> wrote:
> If I'm understanding things correctly, the lexgen egg's lex procedure is (at
> least in some cases) matching based of the order of specification (match the
> first possible thing), not on longest possible match. Can this be right? The
> documentation says
>
> "lex takes a pattern and a string, turns the string into a list of streams
> (containing one stream), applies the pattern, and returns the longest
> match."
>
>  I placed an example of what I mean at
> http://paste.call-cc.org/paste?id=8196b316bf50c18bb044870f95bbbebb00e5026d .
> Here, testpat1 will match "..." as one "." followed by an untokenizable
> remainder, whereas testpat2 will match "..." correctly in its entirety.
>
> Sam Hardwick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]