3 ms·
No. Precedence climbing is the same algorithm as Pratt parsing with basically just terminology and minor code structure differences: http://www.oilshell.org/blo
by jsmith45 4y ago
No. Precedence climbing is the same algorithm as Pratt parsing with basically just terminology and minor code structure differences: http://www.oilshell.org/blog/2016/11/01.html http://www.oilshell.org/blog/2016/11/01.html
The alternative is to lay out your BNF grammar fully, directly encoding precedence and associativity, and then map that to functions to implement. This can be done, but is more of a pain to maintain, and has no real benefit other than more closely matching automata theory.
- olliej 4y agoOh yeah I know the horror of the full BNF tree - they’re all yacc and bison support the last time I used them for anything