If you want to build a parser, you need to have rules defined that will determine what need to be parsed. If you have such a rule already in place please share it with us. We can convert that rule into technical solution.

For example if the rule says "A table is one which is after the keyword FROM and ends with space" then this can easily be converted into a technical solution using a regular expression or using conventional substr and instr. But will it logically return the table name that is valid is still a question.

I was thinking the same thing wright now. In my example when a parser get's to the keyword FROM and after that is a space and a word, that word is a name of my table that is being accessed with the operation SELECT.