Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I used Flex/Bison for writing my first interpreter, and I definitely recommended for beginners. I think when you're starting out, it's more important to focus on writing a proper grammar and traversing the AST than to do all the lexing/parsing by hand. Plus, it makes it easier to rapidly prototype your language when you're still in the design phase, and the Flex/Bison files serve as a form of documentation.

That said, now that my language's grammar is stable and I have a better understanding of lexing and parsing, I'm thinking about ditching Flex/Bison, mainly to achieve more descriptive error messages.



I found the lemon parser generator distributed with the source to sqlite3 to be far easier to use than bison.

http://www.hwaci.com/sw/lemon/


This looks really interesting, thanks.

I've playing with PLY* for fun, but I'd like to try something else in C without going back to flex/bison.

* http://www.dabeaz.com/ply/




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: