This is a huge task. We inherited the SQL engine from OrientDB. It was originally developed with JavaCC. Unfortunately JavaCC is poorly supported nowadays and has some issues with complex grammar (huge usage of LOOKAHEAD).
Since the new Cypher parser and lexer work pretty well, why not converting our old SQL parser with ANTLR latest version?