From 1db9296da33686ae51028eea404462342b24ebf8 Mon Sep 17 00:00:00 2001 From: MichalMoskal Date: Tue, 15 Feb 2011 21:38:34 +0000 Subject: Add VCExprNAry.UniformArguments property to return arguments of nested And/Or nodes. --- Source/VCExpr/VCExprAST.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Source/VCExpr/VCExprAST.cs') diff --git a/Source/VCExpr/VCExprAST.cs b/Source/VCExpr/VCExprAST.cs index 74505150..49440ff0 100644 --- a/Source/VCExpr/VCExprAST.cs +++ b/Source/VCExpr/VCExprAST.cs @@ -915,6 +915,19 @@ namespace Microsoft.Boogie.VCExprAST { internal static readonly List/*!*/ EMPTY_TYPE_LIST = new List(); internal static readonly List/*!*/ EMPTY_VCEXPR_LIST = new List(); + public IEnumerable UniformArguments + { + get + { + var enumerator = new VCExprNAryUniformOpEnumerator(this); + while (enumerator.MoveNext()) { + VCExprNAry naryExpr = enumerator.Current as VCExprNAry; + if (naryExpr == null || !naryExpr.Op.Equals(this.Op)) { + yield return (VCExpr)enumerator.Current; + } + } + } + } } // We give specialised implementations for nullary, unary and binary expressions -- cgit v1.2.3