public override void WriteTo(System.IO.TextWriter w) { Condition.WriteTo(w); w.Write(" ? "); TrueExpr.WriteTo(w); w.Write(" : "); FalseExpr.WriteTo(w); }
protected override IType ValidateExpr(Environment env) { ConditionExpr.Validate(env); ConditionExpr.AssertType(new BooleanType()); TrueExpr.Validate(env); FalseExpr.Validate(env); FalseExpr.AssertType(TrueExpr.Type); return(TrueExpr.Type); }
public TMonad Evaluate(IContext <TMonad> context) { var c = ConditionExpr.Evaluate(context); return(Monad.Bind(c, BindC)); TMonad BindC(object res) { return(res is bool b ? (b ? TrueExpr.Evaluate(context) : FalseExpr.Evaluate(context)) : Monad.Unit); } }
internal abstract T_Return VisitTrue(TrueExpr <T_Identifier> expression);
internal override CellTreeNode VisitTrue(TrueExpr <DomainConstraint <BoolLiteral, Constant> > expression) { return(_topLevelTree); }
internal override BoolExpr <DomainConstraint <BoolLiteral, Constant> > VisitTrue( TrueExpr <DomainConstraint <BoolLiteral, Constant> > expression) { return((BoolExpr <DomainConstraint <BoolLiteral, Constant> >)FalseExpr <DomainConstraint <BoolLiteral, Constant> > .Value); }
internal override int VisitTrue(TrueExpr <T_Identifier> expression) { return(0); }
internal override StringBuilder VisitTrue( TrueExpr <DomainConstraint <BoolLiteral, Constant> > expression) { this.m_builder.Append("True"); return(this.m_builder); }
internal override IEnumerable <TermExpr <DomainConstraint <BoolLiteral, Constant> > > VisitTrue( TrueExpr <DomainConstraint <BoolLiteral, Constant> > expression) { yield break; }
internal override DbExpression VisitTrue( TrueExpr <DomainConstraint <BoolLiteral, Constant> > expression) { return((DbExpression)DbExpressionBuilder.True); }
internal override bool VisitTrue( TrueExpr <DomainConstraint <BoolLiteral, Constant> > expression) { return(true); }
internal override DomainBoolExpr VisitTrue(TrueExpr <DomainConstraint> expression) { return(FalseExpr <DomainConstraint> .Value); }
public override string ToCode() { return ($"{Condition.ToCode()} {TokenValues.QuestionMark} {TrueExpr.ToCode()} {TokenValues.Colon} : {FalseExpr.ToCode()}"); }