diff options
author | 2010-12-10 01:35:27 +0000 | |
---|---|---|
committer | 2010-12-10 01:35:27 +0000 | |
commit | c78b9efc4d974dded811e1964cf4459fc22f3aec (patch) | |
tree | e4ba4ad1d01bb44568b0b9097f78607b3912fc5c /Source/Core/AbsyCmd.cs | |
parent | c06446c8cc5f1ffe12b24d3ae192c2a17cd1ee01 (diff) |
Add ToString() overrides to help in debugging
Diffstat (limited to 'Source/Core/AbsyCmd.cs')
-rw-r--r-- | Source/Core/AbsyCmd.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/AbsyCmd.cs b/Source/Core/AbsyCmd.cs index 125e33f6..363578e5 100644 --- a/Source/Core/AbsyCmd.cs +++ b/Source/Core/AbsyCmd.cs @@ -1018,6 +1018,17 @@ namespace Microsoft.Boogie { kv.Typecheck(tc);
}
}
+
+ [Pure]
+ public override string ToString()
+ {
+ Contract.Ensures(Contract.Result<string>() != null);
+ System.IO.StringWriter buffer = new System.IO.StringWriter();
+ using (TokenTextWriter stream = new TokenTextWriter("<buffer>", buffer, false)) {
+ this.Emit(stream, 0);
+ }
+ return buffer.ToString();
+ }
}
public class CommentCmd : Cmd // just a convenience for debugging
|