summaryrefslogtreecommitdiff
path: root/Source/ModelViewer/DataModel.cs
diff options
context:
space:
mode:
authorGravatar MichalMoskal <unknown>2011-01-26 02:22:07 +0000
committerGravatar MichalMoskal <unknown>2011-01-26 02:22:07 +0000
commitd10092583e4f3ee31772300ca097a616ca2713a2 (patch)
treede5015aa4b934b38e12101873f2a9ca0101832ee /Source/ModelViewer/DataModel.cs
parentd50a591fabea54378ae073b705869c05ccfc5f61 (diff)
Right-clicking on a state allows to display the source code for it
Diffstat (limited to 'Source/ModelViewer/DataModel.cs')
-rw-r--r--Source/ModelViewer/DataModel.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/ModelViewer/DataModel.cs b/Source/ModelViewer/DataModel.cs
index 57729e4d..807158e2 100644
--- a/Source/ModelViewer/DataModel.cs
+++ b/Source/ModelViewer/DataModel.cs
@@ -42,9 +42,38 @@ namespace Microsoft.Boogie.ModelViewer
IEnumerable<string> SortFields(IEnumerable<IDisplayNode> fields);
}
+ public class SourceLocation
+ {
+ public string Header;
+ public string RichTextContent;
+ public int Location;
+
+ public static void RtfAppend(StringBuilder sb, char c, ref int pos)
+ {
+ pos++;
+ switch (c) {
+ case '\r': pos--; break;
+ case '\\': sb.Append("\\\\"); break;
+ case '\n': sb.Append("\\par\n"); break;
+ case '{': sb.Append("\\{"); break;
+ case '}': sb.Append("\\}"); break;
+ default: sb.Append(c); break;
+ }
+ }
+
+ public static void RtfAppendStateIdx(StringBuilder sb, string label, ref int pos)
+ {
+ label += ".";
+ pos += label.Length;
+ sb.Append(@"{\sub\cf5\highlight4 ").Append(label).Append("}");
+ }
+
+ }
+
public interface IState
{
string Name { get; }
+ SourceLocation ShowSource();
IEnumerable<IDisplayNode> Nodes { get; }
}
@@ -94,6 +123,13 @@ namespace Microsoft.Boogie.ModelViewer
{
get { return children; }
}
+
+
+ public SourceLocation ShowSource()
+ {
+ return null;
+ }
+
}
public abstract class DisplayNode : IDisplayNode