IBoundExpr IUnboundExprVisitor<IBoundExpr>.Visit(WhileExpr expr) { var bound = new BoundWhileExpr(expr.Condition.Accept(this), expr.Body.Accept(this)); if (bound.Condition.Type != Decl.Bool) { throw new CompileException(expr.Position, String.Format( "Condition of while/do is returning type {0} but should be Bool.", bound.Condition.Type)); } if (bound.Body.Type != Decl.Unit) { throw new CompileException(expr.Position, String.Format( "Body of while/do is returning type {0} but should be Unit.", bound.Body.Type)); } return bound; }
public virtual IUnboundExpr Transform(WhileExpr expr) { return(expr); }
IUnboundExpr IUnboundExprVisitor <IUnboundExpr> .Visit(WhileExpr expr) { throw new NotImplementedException(); }