5 ms·
http://www.lispworks.com/documentation/HyperSpec/Body/02_b.htm http://www.lispworks.com/documentation/HyperSpec/Body/02_b.h... That's the algorithm for the com
by drblast 8y ago
http://www.lispworks.com/documentation/HyperSpec/Body/02_b.htm http://www.lispworks.com/documentation/HyperSpec/Body/02_b.h...
That's the algorithm for the common lisp reader. Writing a recursive descent parser based on that spec is fairly straightforward.
And once you hand write your own recursive descent parser you'll probably not want to give up the control that gives you to a parser generator. Yuck.
- deleted 8y ago[deleted]
- _d8fd 8y agoI was playing with a parser generator last summer, and it was immensely frustrating to bump into bugs it had & features it lacked. In the end, it was much easier easier to write the entire parser myself. So if I understand the point you're making, I agree that giving up control can suck!
- Jugglerofworlds 8y agoYou should check out parser combinators. I've also used parser generators in the past and experienced similar frustrations. Parser combinators are just so much easier to use.
- atomical 8y agoHey, I saw your comment on ketamine but couldn't reply. Are you still taking it?
- andrepd 8y agoAnd then you will write a parser generator with Parsec and you will not want to give up the ease compared to writing your own recursive descent parser :)
- fiddlerwoaroof 8y agoYeah, parser combinators are basically magic, and not in an “overly clever code that you’ll regret later” sense. And, while a Haskell-style type system makes them nicer, they work really well in dynamically typed languages too. (e.g. https://github.com/drewc/smug https://github.com/drewc/smug )
- pjc50 8y agoI'd love a good parser generator to save me writing recursive descent ones roughly annually in my career, but the ones I've encountered are awful.