001package gudusoft.gsqlparser.nodes;
002
003/**
004 * List of declare variable
005*/
006
007public class TDeclareVariableList extends TParseTreeNodeList <TDeclareVariable> {
008
009    public TDeclareVariableList()
010    {
011    }
012
013    public void addDeclareVariable(TDeclareVariable Item)
014    {
015        addElement(Item);
016    }
017
018    public TDeclareVariable getDeclareVariable(int position)
019    {
020        if (position < size())
021        {
022            return (TDeclareVariable)elementAt(position);
023        }else{
024        return null;
025        }
026    }
027
028    public void setTypeAndDefaultValueOfEachVariable(TTypeName ptype,TExpression pexpr){
029        TDeclareVariable v = null;
030        for(int i=0;i<size();i++){
031            v = this.getDeclareVariable(i);
032            v.setDatatype(ptype);
033            v.setDefaultValue(pexpr);
034       }
035    }
036
037    void addParseTreeNode(Object arg1){
038        addDeclareVariable((TDeclareVariable)arg1);
039    }
040
041    public void accept(TParseTreeVisitor v){
042        v.preVisit(this);
043        v.postVisit(this);
044    }
045//
046//    public void acceptChildren(TParseTreeVisitor v){
047//        v.preVisit(this);
048//        for(int i=0;i<this.size();i++){
049//            this.getDeclareVariable(i) .acceptChildren(v);
050//        }
051//        v.postVisit(this);
052//    }
053}