public override void PerformAfter(SwitchFunction node) { if (node == null) { throw new ArgumentNullException("node"); } m_inMSAccessSwitch = false; m_sql.Append(')'); }
public override void PerformBefore(SwitchFunction node) { if (node == null) { throw new ArgumentNullException("node"); } m_sql.Append("Switch("); m_inMSAccessSwitch = true; }
SwitchFunction MakeSwitch(CaseExpression caseExpr) { if (caseExpr == null) { throw new ArgumentNullException("caseExpr"); } IExpression left = caseExpr.Case; SwitchFunction switchFunc = new SwitchFunction(); CaseAlternative alt = caseExpr.Alternatives; if (alt == null) { throw new InvalidOperationException("CASE has no alternatives."); } // branch expressions will be tailored through caseExpr.Alternatives if (left != null) { while (alt != null) { alt.When = new Expression(left.Clone(), ExpressionOperator.Equal, alt.When); CaseAlternative next = alt.Next; alt.Next = null; switchFunc.Add(alt); alt = next; } } else { switchFunc.Alternatives = alt; } IExpression elseExpr = caseExpr.Else; if (elseExpr != null) { // elseExpr will be tailored through caseExpr.Else CaseAlternative last = new CaseAlternative( new Expression( new IntegerValue(1), ExpressionOperator.Equal, new IntegerValue(1)), elseExpr); switchFunc.Add(last); } return(switchFunc); }
public INode Clone() { SwitchFunction switchFunction = new SwitchFunction(); if (m_alternatives != null) { switchFunction.Alternatives = (CaseAlternative)(m_alternatives.Clone()); } return(switchFunction); }
public virtual void PerformAfter(SwitchFunction node) { }
public virtual void PerformBefore(SwitchFunction node) { }
public override void PerformAfter(SwitchFunction node) { PopKnownParent(node); }
public override void PerformBefore(SwitchFunction node) { PushParent(node); }