in reply to Re^2: On modules
in thread On modules

Recursive descent (the methodology) is the right way to do this sort of thing
No, this is apparently the problem. RD is great for some things, but not for this. There's a reason that gcc is not RD, but LALR. Again, I'm a bear of very little brane about this, but when TheDamian explained it to me, it made sense at the time. It doesn't matter how fast you speed it up: something with 22 levels of precedence should be parsed with LALR (if it can), not RD.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^4: On modules
by samizdat (Vicar) on Aug 22, 2005 at 12:51 UTC
    What I appear to have implemented is a homebrew 'Packrat Parser', which is RD with a modifiable context stack. I think that the recursive nature of my problem, in which any given non-operator element might itself be another whole expression, function, or if-then-else statement, leads me to some form of cascading procedural solution.

    I'll go back and reread my Pigeon (lex & yacc) book and see if I can find some Aho to see if I can grok this more deeply. The whole subject is worth understanding thoroughly.

    Thanks for your comments, merlyn!