summaryrefslogtreecommitdiff
path: root/Source/Core/Absy.cs
diff options
context:
space:
mode:
authorGravatar akashlal <unknown>2014-09-25 10:19:52 +0530
committerGravatar akashlal <unknown>2014-09-25 10:19:52 +0530
commit9897cb74c1f9e7139b9a1d890aca4168cfd95326 (patch)
tree7ea0da76e890e258986589fe2c802baf30bd9c7c /Source/Core/Absy.cs
parentaca88ae4e5431df0c8e3c1c7cd8b8d98f37ff280 (diff)
Lets have a setter for TopLevelDeclarations as well
Diffstat (limited to 'Source/Core/Absy.cs')
-rw-r--r--Source/Core/Absy.cs22
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/Core/Absy.cs b/Source/Core/Absy.cs
index 30333259..d5abda9b 100644
--- a/Source/Core/Absy.cs
+++ b/Source/Core/Absy.cs
@@ -446,10 +446,16 @@ namespace Microsoft.Boogie {
public IEnumerable<Declaration> TopLevelDeclarations
{
- get
- {
- return topLevelDeclarations;
- }
+ get
+ {
+ return topLevelDeclarations;
+ }
+
+ set
+ {
+ ClearTopLevelDeclarations();
+ AddTopLevelDeclarations(value);
+ }
}
public void AddTopLevelDeclaration(Declaration decl)
@@ -468,6 +474,14 @@ namespace Microsoft.Boogie {
this.globalVariablesCache = null;
}
+ public void RemoveTopLevelDeclaration(Declaration decl)
+ {
+ Contract.Requires(!TopLevelDeclarationsAreFrozen);
+
+ topLevelDeclarations.Remove(decl);
+ this.globalVariablesCache = null;
+ }
+
public void RemoveTopLevelDeclarations(Predicate<Declaration> match)
{
Contract.Requires(!TopLevelDeclarationsAreFrozen);