News for hackers. Stuff that matters.
Re:Just Write the Parser by jtolmar on Wednesday October 21, 2020 @05:14PM (#24852262)
I'd highly recommend looking at a few toy parser projects, like this and Crafting Interpreters (which are both recursive decent, with very different styles), writing however much of a typical parser you think makes sense "for fun," and then saving that somewhere you can get at it.

Writing a parser from scratch is kind of an obnoxious hurdle, but if you have some code you're already familiar with that you can copy-paste in and modify to your purposes, that's a lot more accessible.

(Also hats off to this author for making a parser so damn terse.)

Re:Just Write the Parser by swyx on Thursday October 22, 2020 @06:01AM (#24856405)
what is "recursive decent"?
Re:Just Write the Parser by newlikeice on Thursday October 22, 2020 @10:15AM (#24858250)
man can dig hole. while digging one hole he finds two holes. he Diggs the one hole till he finds the bottom. climbs up to where he found the two the proceeds down the other hole. till he finds two more holes and then digs to the bottom of the first hole he finds until he hits bottom there. he descends until he hits bottom or digs through the earth. one hole at a time.

the digging is just the way your language constructs itself into different elements spread out like directories and sub-directories.

Re:Just Write the Parser by swyx on Thursday October 22, 2020 @02:38PM (#24861635)
ah. i was thrown off by the typo. i thought you were complimenting their decency.