Matt Hellige | 15 Jan 23:31

Re: unordered stuff in the parser combinator

It's possible to write a permutation parser combinator in Haskell.
Here is the key:
  http://citeseer.ist.psu.edu/451549.html
It's not complex, but I haven't read the paper in depth, so I don't
know if it transfers trivially to Scala.

Matt

On Jan 15, 2008 4:02 PM, David Pollak
<feeder.of.the.bears@...> wrote:
> Howdy,
>
> I'm working on a grammar using the parser combinator.
>
> One of the challenges that I have is parsing stuff that must be present, but
> doesn't have to be in a particular order.  If I have 'dog', 'cat', 'fish'
> and 'moose' and my zoo is:
>
> zoo = (dog ~ cat ~ fish ~ moose) | (dog ~ fish ~ cat ~ moose) | (dog ~ fish
> ~ moose ~ cat) ...
>
> Is there a better way to express this?
>
> Thanks,
>
> David
>
> --
> lift, the secure, simple, powerful web framework http://liftweb.net
> Collaborative Task Management http://much4.us

--

-- 
Matt Hellige / matt@...
http://matt.immute.net


Gmane