summaryrefslogtreecommitdiff
path: root/BCT
diff options
context:
space:
mode:
authorGravatar t-espave <unknown>2011-08-05 16:53:53 -0700
committerGravatar t-espave <unknown>2011-08-05 16:53:53 -0700
commit3f2f6602aaac740808fa88363d782897b6128fd0 (patch)
treef0af33a4f7d61d9beae1c09a4abd7822f0a58b86 /BCT
parentad3d0b71e79f1943a0f2eb8792592075af44d5e4 (diff)
(phone bct) nav graph building (mostly) automated
Diffstat (limited to 'BCT')
-rw-r--r--BCT/BytecodeTranslator/HeapFactory.cs5
-rw-r--r--BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs5
-rw-r--r--BCT/BytecodeTranslator/TranslationHelper.cs1
-rw-r--r--BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt4
-rw-r--r--BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt4
-rw-r--r--BCT/TranslationPlugins/PhoneControlsPlugin.cs9
6 files changed, 27 insertions, 1 deletions
diff --git a/BCT/BytecodeTranslator/HeapFactory.cs b/BCT/BytecodeTranslator/HeapFactory.cs
index d1c6ec84..29c4727e 100644
--- a/BCT/BytecodeTranslator/HeapFactory.cs
+++ b/BCT/BytecodeTranslator/HeapFactory.cs
@@ -508,12 +508,14 @@ var isControlChecked: [Ref]bool;
procedure {:inline 1} System.Windows.Controls.Control.set_IsEnabled$System.Boolean($this: Ref, value$in: bool);
implementation System.Windows.Controls.Control.set_IsEnabled$System.Boolean($this: Ref, value$in: bool) {
+ $Exception:=null;
isControlEnabled[$this] := value$in;
}
procedure {:inline 1} System.Windows.Controls.Control.get_IsEnabled($this: Ref) returns ($result: Ref);
implementation System.Windows.Controls.Control.get_IsEnabled($this: Ref) returns ($result: Ref) {
var enabledness: bool;
+ $Exception:=null;
enabledness := isControlEnabled[$this];
$result := Box2Ref(Bool2Box(enabledness));
}
@@ -521,7 +523,7 @@ implementation System.Windows.Controls.Control.get_IsEnabled($this: Ref) returns
procedure {:inline 1} System.Windows.Controls.Primitives.ToggleButton.set_IsChecked$System.Nullable$System.Boolean$($this: Ref, value$in: Ref);
implementation System.Windows.Controls.Primitives.ToggleButton.set_IsChecked$System.Nullable$System.Boolean$($this: Ref, value$in: Ref) {
var check: bool;
-
+ $Exception:=null;
check := Box2Bool(Ref2Box(value$in));
isControlChecked[$this] := check;
}
@@ -529,6 +531,7 @@ implementation System.Windows.Controls.Primitives.ToggleButton.set_IsChecked$Sys
procedure {:inline 1} System.Windows.Controls.Primitives.ToggleButton.get_IsChecked($this: Ref) returns ($result: Ref);
implementation System.Windows.Controls.Primitives.ToggleButton.get_IsChecked($this: Ref) returns ($result: Ref) {
var isChecked: bool;
+ $Exception:=null;
isChecked := isControlChecked[$this];
$result := Box2Ref(Bool2Box(isChecked));
}
diff --git a/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs b/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs
index 2d3533aa..4dd1b9ac 100644
--- a/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs
+++ b/BCT/BytecodeTranslator/Phone/PhoneNavigationTraverser.cs
@@ -51,6 +51,7 @@ namespace BytecodeTranslator.Phone {
Type = host.PlatformType.SystemString,
Target = new TargetExpression() {
Type = host.PlatformType.SystemString,
+ // TODO unify code for current uri fieldreference
Definition = new FieldReference() {
ContainingType = PhoneCodeHelper.instance().getMainAppTypeReference(),
IsStatic=true,
@@ -233,6 +234,7 @@ namespace BytecodeTranslator.Phone {
Type = host.PlatformType.SystemString,
Target = new TargetExpression() {
Type = host.PlatformType.SystemString,
+ // TODO unify code for current uri fieldreference
Definition = new FieldReference() {
ContainingType = PhoneCodeHelper.instance().getMainAppTypeReference(),
IsStatic= true,
@@ -264,6 +266,7 @@ namespace BytecodeTranslator.Phone {
Type = host.PlatformType.SystemString,
Target = new TargetExpression() {
Type = host.PlatformType.SystemString,
+ // TODO unify code for current uri fieldreference
Definition = new FieldReference() {
ContainingType = PhoneCodeHelper.instance().getMainAppTypeReference(),
IsStatic= true,
@@ -307,6 +310,7 @@ namespace BytecodeTranslator.Phone {
if (typeDefinition.isPhoneApplicationClass(host)) {
NamespaceTypeDefinition mutableTypeDef = typeDefinition as NamespaceTypeDefinition;
if (mutableTypeDef != null) {
+ // TODO unify code for current uri fieldreference
FieldDefinition fieldDef = new FieldDefinition() {
ContainingTypeDefinition= mutableTypeDef,
InternFactory= host.InternFactory,
@@ -315,6 +319,7 @@ namespace BytecodeTranslator.Phone {
Type= host.PlatformType.SystemString,
Visibility= TypeMemberVisibility.Public,
};
+ PhoneCodeHelper.CurrentURIFieldDefinition = fieldDef;
mutableTypeDef.Fields.Add(fieldDef);
}
}
diff --git a/BCT/BytecodeTranslator/TranslationHelper.cs b/BCT/BytecodeTranslator/TranslationHelper.cs
index 924aba5e..0ddd8417 100644
--- a/BCT/BytecodeTranslator/TranslationHelper.cs
+++ b/BCT/BytecodeTranslator/TranslationHelper.cs
@@ -156,6 +156,7 @@ namespace BytecodeTranslator {
s = s.Replace(']', '$');
s = s.Replace('|', '$');
s = s.Replace('+', '$');
+ s = s.Replace('’', '$');
s = GetRidOfSurrogateCharacters(s);
return s;
}
diff --git a/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt b/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt
index 59d9be9b..0ea68d94 100644
--- a/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt
+++ b/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt
@@ -324,6 +324,7 @@ procedure {:inline 1} System.Windows.Controls.Control.set_IsEnabled$System.Boole
implementation System.Windows.Controls.Control.set_IsEnabled$System.Boolean($this: Ref, value$in: bool)
{
+ $Exception:=null;
isControlEnabled[$this] := value$in;
}
@@ -337,6 +338,7 @@ implementation System.Windows.Controls.Control.get_IsEnabled($this: Ref) returns
{
var enabledness: bool;
+ $Exception:=null;
enabledness := isControlEnabled[$this];
$result := Box2Ref(Bool2Box(enabledness));
}
@@ -351,6 +353,7 @@ implementation System.Windows.Controls.Primitives.ToggleButton.set_IsChecked$Sys
{
var check: bool;
+ $Exception:=null;
check := Box2Bool(Ref2Box(value$in));
isControlChecked[$this] := check;
}
@@ -365,6 +368,7 @@ implementation System.Windows.Controls.Primitives.ToggleButton.get_IsChecked($th
{
var isChecked: bool;
+ $Exception:=null;
isChecked := isControlChecked[$this];
$result := Box2Ref(Bool2Box(isChecked));
}
diff --git a/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt b/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt
index d93b6815..6c7ba975 100644
--- a/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt
+++ b/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt
@@ -322,6 +322,7 @@ procedure {:inline 1} System.Windows.Controls.Control.set_IsEnabled$System.Boole
implementation System.Windows.Controls.Control.set_IsEnabled$System.Boolean($this: Ref, value$in: bool)
{
+ $Exception:=null;
isControlEnabled[$this] := value$in;
}
@@ -335,6 +336,7 @@ implementation System.Windows.Controls.Control.get_IsEnabled($this: Ref) returns
{
var enabledness: bool;
+ $Exception:=null;
enabledness := isControlEnabled[$this];
$result := Box2Ref(Bool2Box(enabledness));
}
@@ -349,6 +351,7 @@ implementation System.Windows.Controls.Primitives.ToggleButton.set_IsChecked$Sys
{
var check: bool;
+ $Exception:=null;
check := Box2Bool(Ref2Box(value$in));
isControlChecked[$this] := check;
}
@@ -363,6 +366,7 @@ implementation System.Windows.Controls.Primitives.ToggleButton.get_IsChecked($th
{
var isChecked: bool;
+ $Exception:=null;
isChecked := isControlChecked[$this];
$result := Box2Ref(Bool2Box(isChecked));
}
diff --git a/BCT/TranslationPlugins/PhoneControlsPlugin.cs b/BCT/TranslationPlugins/PhoneControlsPlugin.cs
index daa7c345..01900007 100644
--- a/BCT/TranslationPlugins/PhoneControlsPlugin.cs
+++ b/BCT/TranslationPlugins/PhoneControlsPlugin.cs
@@ -388,5 +388,14 @@ namespace TranslationPlugins {
return null;
}
}
+
+ public IEnumerable<string> getPageXAMLFilenames() {
+ HashSet<string> pageXAMLs = new HashSet<string>();
+ foreach (string name in this.pageStructureInfo.Keys) {
+ pageXAMLs.Add(pageStructureInfo[name].PageXAML);
+ }
+
+ return pageXAMLs;
+ }
}
}