On Sunday 14 September 2008 08:29:14 pm Richard Fateman wrote:
> You might find it interesting to develop a grammar.
I've never studied grammars at all. Its interesting,
but takes time, we'll see...
> I believe there is no context-free grammar for the Mathematica language,
> and thus in particular it is not LL(n) for any n, nor is it
> LR(n) or LALR(n). The MockMMA parser is mostly recursive descent
> but with a number of special cases. If the Perl recursive descent
> parser is slow, it is presumably because Perl is slow. There is nothing
> inherently slow about recursive descent parsing.
>From digging around it seems the possible reasons are: perl
is generally slower than lisp; the particular parser
generator is not efficient; the way users lay out rules is
not efficient (ie, put uncommon matches first).
I'm not sure it will be enough but RecDescent supposedly facilitates
hacks to get around an imperfect grammar, which is one reason
I am looking at it. Anyway this is all vaporware right now...