3 ms·
I read through the whole thing, but there's something about the writing style which I think makes it rather difficult to follow; even the Dragon Book was more s
by userbinator 12y ago
I read through the whole thing, but there's something about the writing style which I think makes it rather difficult to follow; even the Dragon Book was more straightforward.
If I'm not mistaken, this article describes the same thing, and it was far easier to read:
https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
- agumonkey 12y agoTalking about the shunting yard algorithm, it's funny how often trains and railroads have inspired programming concepts. Parsing, concurrency and recently Scott Wlaschin describe monads through railways http://fsharpforfunandprofit.com/posts/recipe-part2/ http://fsharpforfunandprofit.com/posts/recipe-part2/. ps: while searching for Wlaschin talk I stumbled upon that https://www.google.com/search?q=monad+railway+equipment https://www.google.com/search?q=monad+railway+equipment #rimshot
- abecedarius 12y agoThe Pratt/TDOP scheme is a decentralized or OO way to organize the same idea. I coded them both, at https://github.com/darius/sketchbook/blob/master/parsing/precedence_climbing.py https://github.com/darius/sketchbook/blob/master/parsing/pre... and https://github.com/darius/sketchbook/blob/master/parsing/pratt.py https://github.com/darius/sketchbook/blob/master/parsing/pra... (My Pratt is smaller than my precedence-climbing here because I ended up actually using the latter, so it got some extras added.)
- eliben 12y agoIt took me a number of readings before I figured it out, back in the day. I summarized my understanding in http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing http://eli.thegreenplace.net/2010/01/02/top-down-operator-pr... -- hope it's helpful
- elFarto 12y agoI found http://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/ http://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-e... really useful as well.