001package gudusoft.gsqlparser.stmt.mysql; 002 003import gudusoft.gsqlparser.*; 004import gudusoft.gsqlparser.nodes.*; 005 006 007public class TShowIndexStmt extends TCustomMySQLStmt { 008 009 private TObjectName tableName; 010 private TObjectName dbName; 011 012 public TObjectName getDbName() { 013 return dbName; 014 } 015 016 private TExpression whereCondition; 017 018 public TObjectName getTableName() { 019 return tableName; 020 } 021 022 public TExpression getWhereCondition() { 023 return whereCondition; 024 } 025 026 public TShowIndexStmt (EDbVendor dbvendor){ 027 super(dbvendor); 028 sqlstatementtype = ESqlStatementType.sstmysqlshowindex ; 029 } 030 031 void buildsql() { 032 } 033 034 void clear() { 035 } 036 037 String getasprettytext() { 038 return ""; 039 } 040 041 void iterate(TVisitorAbs pvisitor) { 042 } 043 044 045 public int doParseStatement(TCustomSqlStatement psql) { 046 if (rootNode == null) return -1; 047 super.doParseStatement(psql); 048 TDummy node = (TDummy)rootNode; 049 tableName = (TObjectName)node.node1; 050 if (node.node2 != null){ 051 whereCondition = ((TWhereClause)node.node2).getCondition(); 052 whereCondition.doParse(this, ESqlClause.where); 053 } 054 if (node.node3 != null){ 055 this.dbName = (TObjectName) ((TDummy)(node.node3)).node1; 056 } 057 058 return 0; 059 } 060 061 public void accept(TParseTreeVisitor v){ 062 v.preVisit(this); 063 v.postVisit(this); 064 } 065 066 public void acceptChildren(TParseTreeVisitor v){ 067 v.preVisit(this); 068 v.postVisit(this); 069 } 070 071}