001package gudusoft.gsqlparser.nodes;
002
003import gudusoft.gsqlparser.ESqlClause;
004import gudusoft.gsqlparser.stmt.TSelectSqlStatement;
005import gudusoft.gsqlparser.TSourceToken;
006import gudusoft.gsqlparser.TCustomSqlStatement;
007
008/**
009 * @deprecated As of v1.4.3.3, replaced by {@link TExpression}
010*/
011public class TInExpr extends TParseTreeNode {
012    private TSelectSqlNode subQueryNode = null;
013    private TSelectSqlStatement subQuery = null;
014    private TGroupingExpressionItemList groupingExpressionItemList = null;
015    private TSourceToken st = null;
016    private TObjectName obj = null;
017    private TExpression func_expr = null;
018    private TExpressionList exprList = null;
019
020    public TExpressionList getExprList() {
021        return exprList;
022    }
023
024    public TExpression getFunc_expr() {
025        return func_expr;
026    }
027
028    public TGroupingExpressionItemList getGroupingExpressionItemList() {
029        return groupingExpressionItemList;
030    }
031
032    public TSelectSqlStatement getSubQuery() {
033
034        return subQuery;
035    }
036
037    public void init(Object arg1)
038    {
039       if (arg1 instanceof TSelectSqlNode){
040           subQueryNode = (TSelectSqlNode)arg1;
041       } else
042       if (arg1 instanceof TGroupingExpressionItemList){
043           groupingExpressionItemList = (TGroupingExpressionItemList)arg1;
044       } else
045       if (arg1 instanceof TObjectName){
046           obj = (TObjectName)arg1;
047       }else if (arg1 instanceof  TExpression){
048           func_expr = (TExpression)arg1;
049       }else if (arg1 instanceof  TExpressionList){
050           exprList = (TExpressionList)arg1;
051       }else{
052           st = (TSourceToken)arg1;
053       }
054
055    }
056
057    public void doParse(TCustomSqlStatement psql, ESqlClause plocation){
058        if (subQueryNode != null){
059            if (subQuery == null){
060                subQuery = new TSelectSqlStatement(psql.dbvendor);
061                subQuery.rootNode = subQueryNode;
062            }
063            subQuery.doParseStatement(psql);
064       }else
065       if (groupingExpressionItemList != null){
066           groupingExpressionItemList.doParse(psql,plocation);
067       }else if (func_expr != null){
068            func_expr.doParse(psql,plocation);
069       }else if (exprList != null){
070            exprList.doParse(psql,plocation);
071       }
072    }
073
074    public void accept(TParseTreeVisitor v){
075        v.preVisit(this);
076        v.postVisit(this);
077    }
078
079    public void acceptChildren(TParseTreeVisitor v){
080        v.preVisit(this);
081        if(subQuery != null){
082            subQuery.accept(v);
083        }
084
085        if (getGroupingExpressionItemList() != null){
086            getGroupingExpressionItemList().accept(v);
087        }
088
089        if(func_expr != null){
090            func_expr.accept(v);
091        }
092
093        v.postVisit(this);
094    }
095
096}