001package gudusoft.gsqlparser.stmt; 002 003import gudusoft.gsqlparser.*; 004import gudusoft.gsqlparser.nodes.TParseTreeVisitor; 005import gudusoft.gsqlparser.nodes.TRepeatSqlNode; 006import gudusoft.gsqlparser.nodes.TExpression; 007 008 009public class TRepeatStmt extends TBlockSqlStatement { 010 public TRepeatStmt(EDbVendor dbvendor){ 011 super(dbvendor); 012 sqlstatementtype = ESqlStatementType.sstRepeat ; 013 } 014 015 void buildsql() { 016 } 017 018 void clear() { 019 } 020 021 String getasprettytext() { 022 return ""; 023 } 024 025 void iterate(TVisitorAbs pvisitor) { 026 } 027 028 public int doParseStatement(TCustomSqlStatement psql) { 029 if (rootNode == null) return -1; 030 TRepeatSqlNode repeatSqlNode = (TRepeatSqlNode)rootNode; 031 super.doParseStatement(psql); 032 033 this.condition = repeatSqlNode.getCondition(); 034 setLabelName(repeatSqlNode.getLabelName()); 035 036 repeatSqlNode.getStmts().doParse(this,ESqlClause.unknown); 037 for(int i=0;i<repeatSqlNode.getStmts().size();i++){ 038 this.getBodyStatements().add(repeatSqlNode.getStmts().getStatementSqlNode(i).getStmt()); 039 } 040 041 return 0; 042 } 043 044 public TExpression getCondition() { 045 return condition; 046 } 047 048 private TExpression condition = null; 049 050 public void accept(TParseTreeVisitor v){ 051 v.preVisit(this); 052 v.postVisit(this); 053 } 054 055 public void acceptChildren(TParseTreeVisitor v){ 056 v.preVisit(this); 057 getBodyStatements().accept(v); 058 v.postVisit(this); 059 } 060 061 public void setCondition(TExpression condition) { 062 this.condition = condition; 063 } 064}