001package gudusoft.gsqlparser.stmt;
002
003
004import gudusoft.gsqlparser.EDbObjectType;
005import gudusoft.gsqlparser.EDbVendor;
006import gudusoft.gsqlparser.ESqlStatementType;
007import gudusoft.gsqlparser.TCustomSqlStatement;
008import gudusoft.gsqlparser.nodes.TDummy;
009import gudusoft.gsqlparser.nodes.TObjectName;
010import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
011
012public class TDropStmt extends TCustomSqlStatement {
013
014    private TObjectName dbObjectName;
015    private EDbObjectType dbObjectType;
016
017    public TObjectName getDbObjectName() {
018        return dbObjectName;
019    }
020
021    public EDbObjectType getDbObjectType() {
022        return dbObjectType;
023    }
024
025
026    public TDropStmt(EDbVendor dbvendor) {
027        super(dbvendor);
028        sqlstatementtype = ESqlStatementType.sstDrop;
029    }
030
031    public int doParseStatement(TCustomSqlStatement psql) {
032        if (rootNode == null) return -1;
033        super.doParseStatement(psql);
034        TDummy dummy = (TDummy)rootNode;
035        dbObjectName = (TObjectName)dummy.node1;
036        dbObjectType = dummy.objectType;
037        if (dbObjectName != null){
038            dbObjectName.setDbObjectTypeDirectly(dbObjectType);
039        }
040
041
042        return 0;
043    }
044
045    public void accept(TParseTreeVisitor v){
046        v.preVisit(this);
047        v.postVisit(this);
048    }
049
050    public void acceptChildren(TParseTreeVisitor v){
051        v.preVisit(this);
052        v.postVisit(this);
053    }
054
055
056}