So I'm confused what the problem is.
you said that a rule is complete when it has
query (logical query)*
but you fed it
[abc and]
which translates to
query logical
which does not finish the (logical query) part
so you should create a exception/error because
it only partially filled out your requirement.
I expect there isn't a rule for
query logical (query logical)*
which is supposed to match an error of a missing query
so you can print out an error message about the missing query,
so ANTLR is creating an exception to handle what you didn't do yourself.
Dave Whitten