Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2004-12-24 18:16:04


David Abrahams wrote:
> Joel de Guzman wrote:
>
>
>>FYI, Spirit-2, being developed now, will focus on performance.
>>A limited test case shows a significant increase in speed. And,
>>yes, a deterministic parsing scheme (first/follow) is part of the
>>plan. Actually, you can already take advantage of deterministic
>>parsing using the current switch_p parsers or a technique we call
>>the "Nabialek trick". Surely, more deterministic schemes will be
>>in place.
>
>
> Is first/follow really linked to determinism? It seems to me that you
> can use first/follow sets to prune unproductive searches in a
> nondeterministic parse, too (?)

Right. First-follow makes a parser predictive and thus deterministic,
typically with one symbol lookahead (LL(1)). A strictly predictive
parser is a lot more restrictive in the grammars that one can use,
however. There's no way to make it parse adhoc grammars like the
C pre-processor or, ahem, c++. What I am inclined to do is to mix
determinism with classic spirit's non-determinism. Exactly the
recipe that you are alluding to.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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