summaryrefslogtreecommitdiff
path: root/Source/ModelViewer/Namer.cs
diff options
context:
space:
mode:
authorGravatar MichalMoskal <unknown>2010-11-06 01:21:11 +0000
committerGravatar MichalMoskal <unknown>2010-11-06 01:21:11 +0000
commit6f9978cce118489f6f76d8c08321bae2b599d4e1 (patch)
tree4aacec933d45ce6cda817f76be9521da98135c52 /Source/ModelViewer/Namer.cs
parent2538b1f5708027a85b9a3857d94c9d53648bcc3b (diff)
Add find find uses and find aliases facilities
Diffstat (limited to 'Source/ModelViewer/Namer.cs')
-rw-r--r--Source/ModelViewer/Namer.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/ModelViewer/Namer.cs b/Source/ModelViewer/Namer.cs
index afbcf4ee..8c36de3c 100644
--- a/Source/ModelViewer/Namer.cs
+++ b/Source/ModelViewer/Namer.cs
@@ -9,6 +9,7 @@ namespace Microsoft.Boogie.ModelViewer
{
protected Dictionary<string, int> baseNameUse = new Dictionary<string, int>();
protected Dictionary<Model.Element, string> canonicalName = new Dictionary<Model.Element, string>();
+ protected Dictionary<string, Model.Element> invCanonicalName = new Dictionary<string, Model.Element>();
protected Dictionary<Model.Element, string> localValue = new Dictionary<Model.Element, string>();
// Elements (other than integers and Booleans) get canonical names of the form
@@ -62,9 +63,18 @@ namespace Microsoft.Boogie.ModelViewer
baseNameUse[baseName] = cnt;
}
canonicalName.Add(elt, res);
+ invCanonicalName.Add(res, elt);
return res;
}
+ public virtual Model.Element FindElement(string canonicalName)
+ {
+ Model.Element res;
+ if (invCanonicalName.TryGetValue(canonicalName, out res))
+ return res;
+ return null;
+ }
+
public virtual string PathName(IEnumerable<IDisplayNode> path)
{
return path.Select(n => n.Name).Concat(".");