I am looking for the best solution for a LALR parser generator for C++ that will allow me to generate really good error messages. I really hate the syntax errors that MySQL generates and I want to take the parser in it and replace it with a "lint" checker that will tell me more than just
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a from users' at line 1
I have used YACC/LEX and BISON/FLEX. It has to work on Mac or Linux.
Why do you require LALR? One of the benefits of LL(k) parsers is that they can often make it easier to generate clear error messages. Most grammars that can be parsed by an LALR parser can be easily refactored to be parsable by an LL(k) parser.
ANTLR is a popular LL(k) parser generator that can generate C++ (as well as a number of other languages). From Chapter 10 of The Definitive ANTLR Reference:
Many grammars are also available for ANTLR, including a MySQL grammar.