Boost logo

Boost :

From: John Max Skaller (skaller_at_[hidden])
Date: 2001-05-30 10:45:52


joel de guzman wrote:
>
> From: "John Max Skaller" :
>
> > > Spirit has virtually all the set operators
> >
> > This may not be natural. Consider the grammar:
> >
> > int = digit *
> > float = digit + ["." digit *]
> >
> > where [] means 'optional'. Using 'set' operators,
> > I have to write
> >
> > int = digit *
> > float = digit+ ["." digit*] - int
>
> Spirit resolves this with the Longest directive.
> There's your maximal munch stuff.

        This has nothing to do with longest parse.
It has to do with non-disjoint sets.

> Priorities can resolve this ambiguity.
>
> Spirit has a default priority rule. Alternatives are short-circuited.

        Right. This is natural for RD.
(Take the first possible match).

-- 
John (Max) Skaller, mailto:skaller_at_[hidden]
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk