protected void Write(CiExpr expr) { if (expr is CiConstExpr) { WriteConst(((CiConstExpr)expr).Value); } else if (expr is CiConstAccess) { WriteName(((CiConstAccess)expr).Const); } else if (expr is CiVarAccess) { Write((CiVarAccess)expr); } else if (expr is CiFieldAccess) { Write((CiFieldAccess)expr); } else if (expr is CiPropertyAccess) { Write((CiPropertyAccess)expr); } else if (expr is CiArrayAccess) { Write((CiArrayAccess)expr); } else if (expr is CiMethodCall) { Write((CiMethodCall)expr); } else if (expr is CiUnaryExpr) { Write((CiUnaryExpr)expr); } else if (expr is CiCondNotExpr) { Write((CiCondNotExpr)expr); } else if (expr is CiPostfixExpr) { Write((CiPostfixExpr)expr); } else if (expr is CiBinaryExpr) { Write((CiBinaryExpr)expr); } else if (expr is CiCondExpr) { Write((CiCondExpr)expr); } else if (expr is CiBinaryResourceExpr) { Write((CiBinaryResourceExpr)expr); } else if (expr is CiNewExpr) { WriteNew(((CiNewExpr)expr).NewType); } else if (expr is CiCoercion) { Write((CiCoercion)expr); } else { throw new ArgumentException(expr.ToString()); } }
protected void Write(CiExpr expr) { if (expr is CiConstExpr) WriteConst(((CiConstExpr) expr).Value); else if (expr is CiConstAccess) WriteName(((CiConstAccess) expr).Const); else if (expr is CiVarAccess) Write((CiVarAccess) expr); else if (expr is CiFieldAccess) Write((CiFieldAccess) expr); else if (expr is CiPropertyAccess) Write((CiPropertyAccess) expr); else if (expr is CiArrayAccess) Write((CiArrayAccess) expr); else if (expr is CiMethodCall) Write((CiMethodCall) expr); else if (expr is CiUnaryExpr) Write((CiUnaryExpr) expr); else if (expr is CiCondNotExpr) Write((CiCondNotExpr) expr); else if (expr is CiPostfixExpr) Write((CiPostfixExpr) expr); else if (expr is CiBinaryExpr) Write((CiBinaryExpr) expr); else if (expr is CiCondExpr) Write((CiCondExpr) expr); else if (expr is CiBinaryResourceExpr) Write((CiBinaryResourceExpr) expr); else if (expr is CiNewExpr) WriteNew(((CiNewExpr) expr).NewType); else if (expr is CiCoercion) Write((CiCoercion) expr); else throw new ArgumentException(expr.ToString()); }