1

I am new to ANTLR, I got SQLite grammar from Github and I am able to generate the Lexer and Parser for that in Java.

I am trying to parse the SQL statement and trying to get Table names and Column names out, but I am getting the total Statement values when I am using the parser methods.

Can you help me out with the process I need to follow to get Table names and column names?

1 Answers1

0

If you don't stick to Antlr you could use JSqlParser, which is based on JavaCC. Here is an example of how to achieve table and column names retrieval:

Parsing table and column names from SQL/HQL Java

It should be of no importance, which parser generator you are using, right?

wumpz
  • 8,257
  • 3
  • 30
  • 25