summaryrefslogtreecommitdiff
path: root/Source/ModelViewer/VccProvider.cs
diff options
context:
space:
mode:
authorGravatar MichalMoskal <unknown>2010-12-10 23:24:10 +0000
committerGravatar MichalMoskal <unknown>2010-12-10 23:24:10 +0000
commiteb578c1e126eab19c17ce463903e55f96264826e (patch)
treefa21033d76a0b93f4b4ef3b73138dff2e118457a /Source/ModelViewer/VccProvider.cs
parent8c47d4c8084b1bd9c76c0198f3112ee7b3c0ec40 (diff)
Rework the namer interface a bit
Diffstat (limited to 'Source/ModelViewer/VccProvider.cs')
-rw-r--r--Source/ModelViewer/VccProvider.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/ModelViewer/VccProvider.cs b/Source/ModelViewer/VccProvider.cs
index 0a8430f0..9f1449d2 100644
--- a/Source/ModelViewer/VccProvider.cs
+++ b/Source/ModelViewer/VccProvider.cs
@@ -44,13 +44,12 @@ namespace Microsoft.Boogie.ModelViewer.Vcc
Dictionary<Model.Element, string> typeName = new Dictionary<Model.Element, string>();
Dictionary<Model.Element, string> literalName = new Dictionary<Model.Element, string>();
public List<StateNode> states = new List<StateNode>();
- public readonly ViewOptions viewOpts;
Dictionary<int, string> fileNameMapping = new Dictionary<int, string>();
public VccModel(Model m, ViewOptions opts)
+ : base(opts)
{
- viewOpts = opts;
model = m;
f_ptr_to = m.MkFunc("$ptr_to", 1);
f_spec_ptr_to = m.MkFunc("$spec_ptr_to", 1);
@@ -250,7 +249,7 @@ namespace Microsoft.Boogie.ModelViewer.Vcc
return null;
}
- protected override string LiteralName(Model.Element elt)
+ private string LiteralName(Model.Element elt)
{
string r;
@@ -263,7 +262,7 @@ namespace Microsoft.Boogie.ModelViewer.Vcc
return r;
}
- return base.LiteralName(elt);
+ return null;
}
public Model.Element LocalType(string localName)
@@ -668,19 +667,26 @@ namespace Microsoft.Boogie.ModelViewer.Vcc
if (fld != null) {
var tp = vm.f_field_type.TryEval(fld);
if (tp != null) {
- return vm.TypeName(tp);
+ var n = vm.TryTypeName(tp);
+ if (n != null)
+ return n;
}
}
return "";
}
- protected override string CanonicalBaseName(Model.Element elt)
+ protected override string CanonicalBaseName(Model.Element elt, out NameSeqSuffix suff)
{
- var name = base.CanonicalBaseName(elt);
+ var lit = this.LiteralName(elt);
+ if (lit != null) {
+ suff = NameSeqSuffix.None;
+ return lit;
+ }
+
+ var name = base.CanonicalBaseName(elt, out suff);
name = CanonicalBaseNameCore(name, elt);
- if (viewOpts.DebugMode)
- name += string.Format("({0})", elt);
+
return name;
}