1 /* 2 * Copyright 2015-2018 HuntLabs.cn 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 module hunt.sql.dialect.mysql.visitor.MySqlASTVisitor; 17 18 import hunt.sql.ast.SQLExpr; 19 import hunt.sql.ast.statement.SQLAlterCharacter; 20 import hunt.sql.dialect.mysql.ast.MySqlForceIndexHint; 21 import hunt.sql.dialect.mysql.ast.MySqlIgnoreIndexHint; 22 import hunt.sql.dialect.mysql.ast.MySqlKey; 23 import hunt.sql.dialect.mysql.ast.MySqlPrimaryKey; 24 import hunt.sql.dialect.mysql.ast.MySqlUnique; 25 import hunt.sql.dialect.mysql.ast.MySqlUseIndexHint; 26 import hunt.sql.dialect.mysql.ast.MysqlForeignKey; 27 import hunt.sql.dialect.mysql.ast.clause.MySqlCaseStatement; 28 // import hunt.sql.dialect.mysql.ast.clause.MySqlCaseStatement.MySqlWhenStatement; 29 import hunt.sql.dialect.mysql.ast.clause.MySqlCursorDeclareStatement; 30 import hunt.sql.dialect.mysql.ast.clause.MySqlDeclareConditionStatement; 31 import hunt.sql.dialect.mysql.ast.clause.MySqlDeclareHandlerStatement; 32 import hunt.sql.dialect.mysql.ast.clause.MySqlDeclareStatement; 33 import hunt.sql.dialect.mysql.ast.clause.MySqlIterateStatement; 34 import hunt.sql.dialect.mysql.ast.clause.MySqlLeaveStatement; 35 import hunt.sql.dialect.mysql.ast.clause.MySqlRepeatStatement; 36 import hunt.sql.dialect.mysql.ast.clause.MySqlSelectIntoStatement; 37 import hunt.sql.dialect.mysql.ast.expr.MySqlCharExpr; 38 import hunt.sql.dialect.mysql.ast.expr.MySqlExtractExpr; 39 import hunt.sql.dialect.mysql.ast.expr.MySqlMatchAgainstExpr; 40 import hunt.sql.dialect.mysql.ast.expr.MySqlOrderingExpr; 41 import hunt.sql.dialect.mysql.ast.expr.MySqlOutFileExpr; 42 import hunt.sql.dialect.mysql.ast.expr.MySqlUserName; 43 import hunt.sql.dialect.mysql.ast.statement; 44 import hunt.sql.visitor.SQLASTVisitor; 45 46 public interface MySqlASTVisitor : SQLASTVisitor { 47 bool visit(MySqlTableIndex x); 48 49 void endVisit(MySqlTableIndex x); 50 51 bool visit(MySqlKey x); 52 53 void endVisit(MySqlKey x); 54 55 bool visit(MySqlPrimaryKey x); 56 57 void endVisit(MySqlPrimaryKey x); 58 59 bool visit(MySqlUnique x); 60 61 void endVisit(MySqlUnique x); 62 63 bool visit(MysqlForeignKey x); 64 65 void endVisit(MysqlForeignKey x); 66 67 void endVisit(MySqlExtractExpr x); 68 69 bool visit(MySqlExtractExpr x); 70 71 void endVisit(MySqlMatchAgainstExpr x); 72 73 bool visit(MySqlMatchAgainstExpr x); 74 75 void endVisit(MySqlPrepareStatement x); 76 77 bool visit(MySqlPrepareStatement x); 78 79 void endVisit(MySqlExecuteStatement x); 80 81 bool visit(MysqlDeallocatePrepareStatement x); 82 83 void endVisit(MysqlDeallocatePrepareStatement x); 84 85 bool visit(MySqlExecuteStatement x); 86 87 void endVisit(MySqlDeleteStatement x); 88 89 bool visit(MySqlDeleteStatement x); 90 91 void endVisit(MySqlInsertStatement x); 92 93 bool visit(MySqlInsertStatement x); 94 95 void endVisit(MySqlLoadDataInFileStatement x); 96 97 bool visit(MySqlLoadDataInFileStatement x); 98 99 void endVisit(MySqlLoadXmlStatement x); 100 101 bool visit(MySqlLoadXmlStatement x); 102 103 void endVisit(MySqlShowColumnsStatement x); 104 105 bool visit(MySqlShowColumnsStatement x); 106 107 void endVisit(MySqlShowDatabasesStatement x); 108 109 bool visit(MySqlShowDatabasesStatement x); 110 111 void endVisit(MySqlShowWarningsStatement x); 112 113 bool visit(MySqlShowWarningsStatement x); 114 115 void endVisit(MySqlShowStatusStatement x); 116 117 bool visit(MySqlShowStatusStatement x); 118 119 void endVisit(MySqlShowAuthorsStatement x); 120 121 bool visit(MySqlShowAuthorsStatement x); 122 123 void endVisit(CobarShowStatus x); 124 125 bool visit(CobarShowStatus x); 126 127 void endVisit(MySqlKillStatement x); 128 129 bool visit(MySqlKillStatement x); 130 131 void endVisit(MySqlBinlogStatement x); 132 133 bool visit(MySqlBinlogStatement x); 134 135 void endVisit(MySqlResetStatement x); 136 137 bool visit(MySqlResetStatement x); 138 139 void endVisit(MySqlCreateUserStatement x); 140 141 bool visit(MySqlCreateUserStatement x); 142 143 void endVisit(MySqlCreateUserStatement.UserSpecification x); 144 145 bool visit(MySqlCreateUserStatement.UserSpecification x); 146 147 void endVisit(MySqlPartitionByKey x); 148 149 bool visit(MySqlPartitionByKey x); 150 151 bool visit(MySqlSelectQueryBlock x); 152 153 void endVisit(MySqlSelectQueryBlock x); 154 155 bool visit(MySqlOutFileExpr x); 156 157 void endVisit(MySqlOutFileExpr x); 158 159 bool visit(MySqlExplainStatement x); 160 161 void endVisit(MySqlExplainStatement x); 162 163 bool visit(MySqlUpdateStatement x); 164 165 void endVisit(MySqlUpdateStatement x); 166 167 bool visit(MySqlSetTransactionStatement x); 168 169 void endVisit(MySqlSetTransactionStatement x); 170 171 bool visit(MySqlShowBinaryLogsStatement x); 172 173 void endVisit(MySqlShowBinaryLogsStatement x); 174 175 bool visit(MySqlShowMasterLogsStatement x); 176 177 void endVisit(MySqlShowMasterLogsStatement x); 178 179 bool visit(MySqlShowCharacterSetStatement x); 180 181 void endVisit(MySqlShowCharacterSetStatement x); 182 183 bool visit(MySqlShowCollationStatement x); 184 185 void endVisit(MySqlShowCollationStatement x); 186 187 bool visit(MySqlShowBinLogEventsStatement x); 188 189 void endVisit(MySqlShowBinLogEventsStatement x); 190 191 bool visit(MySqlShowContributorsStatement x); 192 193 void endVisit(MySqlShowContributorsStatement x); 194 195 bool visit(MySqlShowCreateDatabaseStatement x); 196 197 void endVisit(MySqlShowCreateDatabaseStatement x); 198 199 bool visit(MySqlShowCreateEventStatement x); 200 201 void endVisit(MySqlShowCreateEventStatement x); 202 203 bool visit(MySqlShowCreateFunctionStatement x); 204 205 void endVisit(MySqlShowCreateFunctionStatement x); 206 207 bool visit(MySqlShowCreateProcedureStatement x); 208 209 void endVisit(MySqlShowCreateProcedureStatement x); 210 211 bool visit(MySqlShowCreateTableStatement x); 212 213 void endVisit(MySqlShowCreateTableStatement x); 214 215 bool visit(MySqlShowCreateTriggerStatement x); 216 217 void endVisit(MySqlShowCreateTriggerStatement x); 218 219 bool visit(MySqlShowCreateViewStatement x); 220 221 void endVisit(MySqlShowCreateViewStatement x); 222 223 bool visit(MySqlShowEngineStatement x); 224 225 void endVisit(MySqlShowEngineStatement x); 226 227 bool visit(MySqlShowEnginesStatement x); 228 229 void endVisit(MySqlShowEnginesStatement x); 230 231 bool visit(MySqlShowErrorsStatement x); 232 233 void endVisit(MySqlShowErrorsStatement x); 234 235 bool visit(MySqlShowEventsStatement x); 236 237 void endVisit(MySqlShowEventsStatement x); 238 239 bool visit(MySqlShowFunctionCodeStatement x); 240 241 void endVisit(MySqlShowFunctionCodeStatement x); 242 243 bool visit(MySqlShowFunctionStatusStatement x); 244 245 void endVisit(MySqlShowFunctionStatusStatement x); 246 247 bool visit(MySqlShowGrantsStatement x); 248 249 void endVisit(MySqlShowGrantsStatement x); 250 251 bool visit(MySqlUserName x); 252 253 void endVisit(MySqlUserName x); 254 255 bool visit(MySqlShowIndexesStatement x); 256 257 void endVisit(MySqlShowIndexesStatement x); 258 259 bool visit(MySqlShowKeysStatement x); 260 261 void endVisit(MySqlShowKeysStatement x); 262 263 bool visit(MySqlShowMasterStatusStatement x); 264 265 void endVisit(MySqlShowMasterStatusStatement x); 266 267 bool visit(MySqlShowOpenTablesStatement x); 268 269 void endVisit(MySqlShowOpenTablesStatement x); 270 271 bool visit(MySqlShowPluginsStatement x); 272 273 void endVisit(MySqlShowPluginsStatement x); 274 275 bool visit(MySqlShowPrivilegesStatement x); 276 277 void endVisit(MySqlShowPrivilegesStatement x); 278 279 bool visit(MySqlShowProcedureCodeStatement x); 280 281 void endVisit(MySqlShowProcedureCodeStatement x); 282 283 bool visit(MySqlShowProcedureStatusStatement x); 284 285 void endVisit(MySqlShowProcedureStatusStatement x); 286 287 bool visit(MySqlShowProcessListStatement x); 288 289 void endVisit(MySqlShowProcessListStatement x); 290 291 bool visit(MySqlShowProfileStatement x); 292 293 void endVisit(MySqlShowProfileStatement x); 294 295 bool visit(MySqlShowProfilesStatement x); 296 297 void endVisit(MySqlShowProfilesStatement x); 298 299 bool visit(MySqlShowRelayLogEventsStatement x); 300 301 void endVisit(MySqlShowRelayLogEventsStatement x); 302 303 bool visit(MySqlShowSlaveHostsStatement x); 304 305 void endVisit(MySqlShowSlaveHostsStatement x); 306 307 bool visit(MySqlShowSlaveStatusStatement x); 308 309 void endVisit(MySqlShowSlaveStatusStatement x); 310 311 bool visit(MySqlShowTableStatusStatement x); 312 313 void endVisit(MySqlShowTableStatusStatement x); 314 315 bool visit(MySqlShowTriggersStatement x); 316 317 void endVisit(MySqlShowTriggersStatement x); 318 319 bool visit(MySqlShowVariantsStatement x); 320 321 void endVisit(MySqlShowVariantsStatement x); 322 323 bool visit(MySqlRenameTableStatement.Item x); 324 325 void endVisit(MySqlRenameTableStatement.Item x); 326 327 bool visit(MySqlRenameTableStatement x); 328 329 void endVisit(MySqlRenameTableStatement x); 330 331 bool visit(MySqlUseIndexHint x); 332 333 void endVisit(MySqlUseIndexHint x); 334 335 bool visit(MySqlIgnoreIndexHint x); 336 337 void endVisit(MySqlIgnoreIndexHint x); 338 339 bool visit(MySqlLockTableStatement x); 340 341 void endVisit(MySqlLockTableStatement x); 342 343 bool visit(MySqlLockTableStatement.Item x); 344 345 void endVisit(MySqlLockTableStatement.Item x); 346 347 bool visit(MySqlUnlockTablesStatement x); 348 349 void endVisit(MySqlUnlockTablesStatement x); 350 351 bool visit(MySqlForceIndexHint x); 352 353 void endVisit(MySqlForceIndexHint x); 354 355 bool visit(MySqlAlterTableChangeColumn x); 356 357 void endVisit(MySqlAlterTableChangeColumn x); 358 359 bool visit(MySqlAlterTableOption x); 360 361 void endVisit(MySqlAlterTableOption x); 362 363 bool visit(MySqlCreateTableStatement x); 364 365 void endVisit(MySqlCreateTableStatement x); 366 367 bool visit(MySqlHelpStatement x); 368 369 void endVisit(MySqlHelpStatement x); 370 371 bool visit(MySqlCharExpr x); 372 373 void endVisit(MySqlCharExpr x); 374 375 bool visit(MySqlAlterTableModifyColumn x); 376 377 void endVisit(MySqlAlterTableModifyColumn x); 378 379 bool visit(MySqlAlterTableDiscardTablespace x); 380 381 void endVisit(MySqlAlterTableDiscardTablespace x); 382 383 bool visit(MySqlAlterTableImportTablespace x); 384 385 void endVisit(MySqlAlterTableImportTablespace x); 386 387 bool visit(MySqlCreateTableStatement.TableSpaceOption x); 388 389 void endVisit(MySqlCreateTableStatement.TableSpaceOption x); 390 391 bool visit(MySqlAnalyzeStatement x); 392 393 void endVisit(MySqlAnalyzeStatement x); 394 395 bool visit(MySqlAlterUserStatement x); 396 397 void endVisit(MySqlAlterUserStatement x); 398 399 bool visit(MySqlOptimizeStatement x); 400 401 void endVisit(MySqlOptimizeStatement x); 402 403 bool visit(MySqlHintStatement x); 404 405 void endVisit(MySqlHintStatement x); 406 407 bool visit(MySqlOrderingExpr x); 408 409 void endVisit(MySqlOrderingExpr x); 410 411 bool visit(MySqlCaseStatement x); 412 413 void endVisit(MySqlCaseStatement x); 414 415 bool visit(MySqlDeclareStatement x); 416 417 void endVisit(MySqlDeclareStatement x); 418 419 bool visit(MySqlSelectIntoStatement x); 420 421 void endVisit(MySqlSelectIntoStatement x); 422 423 bool visit(MySqlCaseStatement.MySqlWhenStatement x); 424 425 void endVisit(MySqlCaseStatement.MySqlWhenStatement x); 426 427 bool visit(MySqlLeaveStatement x); 428 429 void endVisit(MySqlLeaveStatement x); 430 431 bool visit(MySqlIterateStatement x); 432 433 void endVisit(MySqlIterateStatement x); 434 435 bool visit(MySqlRepeatStatement x); 436 437 void endVisit(MySqlRepeatStatement x); 438 439 bool visit(MySqlCursorDeclareStatement x); 440 441 void endVisit(MySqlCursorDeclareStatement x); 442 443 bool visit(MySqlUpdateTableSource x); 444 445 void endVisit(MySqlUpdateTableSource x); 446 447 bool visit(MySqlAlterTableAlterColumn x); 448 449 void endVisit(MySqlAlterTableAlterColumn x); 450 451 bool visit(MySqlSubPartitionByKey x); 452 453 void endVisit(MySqlSubPartitionByKey x); 454 455 bool visit(MySqlSubPartitionByList x); 456 457 void endVisit(MySqlSubPartitionByList x); 458 459 bool visit(MySqlDeclareHandlerStatement x); 460 461 void endVisit(MySqlDeclareHandlerStatement x); 462 463 bool visit(MySqlDeclareConditionStatement x); 464 465 void endVisit(MySqlDeclareConditionStatement x); 466 467 bool visit(MySqlFlushStatement x); 468 469 void endVisit(MySqlFlushStatement x); 470 471 bool visit(MySqlEventSchedule x); 472 void endVisit(MySqlEventSchedule x); 473 474 bool visit(MySqlCreateEventStatement x); 475 void endVisit(MySqlCreateEventStatement x); 476 477 bool visit(MySqlCreateAddLogFileGroupStatement x); 478 void endVisit(MySqlCreateAddLogFileGroupStatement x); 479 480 bool visit(MySqlCreateServerStatement x); 481 void endVisit(MySqlCreateServerStatement x); 482 483 bool visit(MySqlCreateTableSpaceStatement x); 484 void endVisit(MySqlCreateTableSpaceStatement x); 485 486 bool visit(MySqlAlterEventStatement x); 487 void endVisit(MySqlAlterEventStatement x); 488 489 bool visit(MySqlAlterLogFileGroupStatement x); 490 void endVisit(MySqlAlterLogFileGroupStatement x); 491 492 bool visit(MySqlAlterServerStatement x); 493 void endVisit(MySqlAlterServerStatement x); 494 495 bool visit(MySqlAlterTablespaceStatement x); 496 void endVisit(MySqlAlterTablespaceStatement x); 497 498 bool visit(MySqlShowDatabasePartitionStatusStatement x); 499 void endVisit(MySqlShowDatabasePartitionStatusStatement x); 500 501 bool visit(MySqlChecksumTableStatement x); 502 void endVisit(MySqlChecksumTableStatement x); 503 504 } //