News for hackers. Stuff that matters.
Re:Ask HN: Which one is better for writing a SQL parser? by bayareaguy on Saturday May 30, 2009 @11:57AM (#633782)
I've used all of those at different times and for simple stuff they will all work. I'd recommend picking whichever of YACC, Lemon or Antlr builds easily on your platform and is the least displeasing to others you expect may need to trace through the code.

Oh and if for some reason you end up using flex somewhere, don't forget to specify the "-8" option to ensure it generates an 8-bit clean scanner.

Re:Ask HN: Which one is better for writing a SQL parser? by liuliu on Saturday May 30, 2009 @12:38PM (#633828)
one may stuck me to use yacc is that can yacc make a func like : query_t parse(const char* str) and do the parse part thread-safe?
Re:Ask HN: Which one is better for writing a SQL parser? by bayareaguy on Saturday May 30, 2009 @01:13PM (#633861)
Recent YACC's such as Bison support pure reentrant parsers. Here's a reference: http://dinosaur.compilertools.net/bison/bison_6.html#SEC56
Re:Ask HN: Which one is better for writing a SQL parser? by flashgordon on Saturday May 30, 2009 @10:43PM (#634343)
make sure you check the licences... different licences apply to yacc and bison generated parsers...