class TablesNamesFinder implements SelectVisitor, FromItemVisitor, ExpressionVisitor, ItemsListVisitor, SelectItemVisitor, StatementVisitor {

    public List<String> getTableList(Statement statement) {
        init();
        statement.accept(this);
        return tables;
    }

}