logical/conditional expressions parsing in ANTLR

597 views Asked by At

Are there any grammar rules available for evaluating the logical/conditional expressions? I want to parse between, Like, exists, IN expressions using ANTLR.

1

There are 1 answers

0
Gerino On BEST ANSWER

Well, there are existing grammars for Antlr3 (and 4 as well) for most common languages, including ISO SQL and some specific flavours (like PL/SQL, mySQL): http://www.antlr3.org/grammar/list.html

I admit I didn't check myself, but I'd expect them to be able to parse mentioned logical operations.

I did write my own Antlr (4) grammar for an arcane SQL flavour, it's fairly simple. I unfortunately don't have access to it anymore, but I might be able to help if you get stuck.