On Fri, 15 Aug 2003, Andy Wardley wrote:

> Shevek wrote:
> > Yapp is a brilliant piece of code which I love both in architecture and
> > implementation, but it's desperately fucking slow. 
> 
> Slow at compiling the grammar or when running the parser that it builds?

Very slow at running. I don't really care about compile time.

> For TT3, I'm throwing away the Parse::Yapp generated grammar and writing
> a bastard hybrid of a predictive LL(1) and a recursive descent parser.
> Well, that's the design in my head at the moment.  Could be something
> totally different in half an hour... 

Please note that I am writing this without checking (I'm working on
security atm, and don't want to break my concentration by checking up
grammar tables). IANAL.

I think you have the advantage of being a strict type 2 grammar with no
precedence rules, and therefore LL(1) (or even LL(0) in this case?) is
quite sufficient. C (which I am parsing) is not LL(k) for any k, and that
is where LALR (as in Yapp) (or SLR?) is useful.

It might be interesting to write a parser generator for LL(k) grammars,
which would be at liberty to produce much faster code than Yapp since the
place Yapp is slow is where it's jumping up and down on the parse stack
all the time, and an LL parser does not have to do this.

I will be thinking about and working a lot more on this once my current
dissertation is done. In the meantime, nothing in the above mail is
guaranteed correct, free from unbiased opinion, or in conformance with UK
Data Protection or US Anti-Terrorism acts.

S.

-- 
Shevek                                    http://www.anarres.org/
I am the Borg.                         http://www.gothnicity.org/

Reply via email to