summaryrefslogtreecommitdiff
path: root/Source/Dafny/Cloner.cs
diff options
context:
space:
mode:
authorGravatar leino <unknown>2014-08-27 14:34:43 -0700
committerGravatar leino <unknown>2014-08-27 14:34:43 -0700
commit012d65fe24eba7545bd7bc5f1c9cf8b69fc369e7 (patch)
treef93c49a5e7afea5378110cb2431406569cc7bf4e /Source/Dafny/Cloner.cs
parentc797efff6e6eb38a991ced512fe028fa979f19eb (diff)
parent68f0dda698c929864058fa89f81e39cc2a3a811d (diff)
Merge, and refactored bit in Cloner into class ClonerButDropMethodBodies.
Diffstat (limited to 'Source/Dafny/Cloner.cs')
-rw-r--r--Source/Dafny/Cloner.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/Dafny/Cloner.cs b/Source/Dafny/Cloner.cs
index 615ef596..8ec51b82 100644
--- a/Source/Dafny/Cloner.cs
+++ b/Source/Dafny/Cloner.cs
@@ -9,6 +9,9 @@ namespace Microsoft.Dafny
{
class Cloner
{
+ public Cloner() {
+ }
+
public ModuleDefinition CloneModuleDefinition(ModuleDefinition m, string name) {
ModuleDefinition nw;
if (m is DefaultModuleDecl) {
@@ -23,6 +26,7 @@ namespace Microsoft.Dafny
nw.Height = m.Height;
return nw;
}
+
public TopLevelDecl CloneDeclaration(TopLevelDecl d, ModuleDefinition m) {
Contract.Requires(d != null);
Contract.Requires(m != null);
@@ -451,7 +455,7 @@ namespace Microsoft.Dafny
return c;
}
- public BlockStmt CloneBlockStmt(BlockStmt stmt) {
+ public virtual BlockStmt CloneBlockStmt(BlockStmt stmt) {
if (stmt == null) {
return null;
} else {
@@ -645,6 +649,17 @@ namespace Microsoft.Dafny
}
}
+ class ClonerButDropMethodBodies : Cloner
+ {
+ public ClonerButDropMethodBodies()
+ : base() {
+ }
+
+ public override BlockStmt CloneBlockStmt(BlockStmt stmt) {
+ return null;
+ }
+ }
+
/// <summary>
/// Subclass of Cloner that collects some common functionality between CoLemmaPostconditionSubstituter and
/// CoLemmaBodyCloner.