summaryrefslogtreecommitdiff
path: root/BCT/BytecodeTranslator/TranslationPlugins/Translators/PhoneInitializationTranslator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'BCT/BytecodeTranslator/TranslationPlugins/Translators/PhoneInitializationTranslator.cs')
-rw-r--r--BCT/BytecodeTranslator/TranslationPlugins/Translators/PhoneInitializationTranslator.cs61
1 files changed, 61 insertions, 0 deletions
diff --git a/BCT/BytecodeTranslator/TranslationPlugins/Translators/PhoneInitializationTranslator.cs b/BCT/BytecodeTranslator/TranslationPlugins/Translators/PhoneInitializationTranslator.cs
new file mode 100644
index 00000000..7cd35b44
--- /dev/null
+++ b/BCT/BytecodeTranslator/TranslationPlugins/Translators/PhoneInitializationTranslator.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using BytecodeTranslator.Phone;
+using Microsoft.Cci;
+
+namespace BytecodeTranslator.TranslationPlugins.Translators {
+ class PhoneInitializationTranslator : Translator {
+ private Sink sink;
+ PhoneInitializationMetadataTraverser traverser;
+
+ public PhoneInitializationTranslator(Sink sink) {
+ this.sink = sink;
+ }
+
+ public override void initialize() {
+ traverser = new PhoneInitializationMetadataTraverser(sink.host as MetadataReaderHost);
+ }
+
+ public override bool isOneShot() {
+ return true;
+ }
+
+ public override int getPriority() {
+ // TODO make configurable from outside
+ return 1;
+ }
+
+ public override void TranslateAssemblies(IEnumerable<Microsoft.Cci.IUnit> assemblies) {
+ traverser.InjectPhoneCodeAssemblies(assemblies);
+ }
+ }
+
+ class PhoneNavigationTranslator : Translator {
+ private Sink sink;
+ PhoneNavigationMetadataTraverser traverser;
+
+ public PhoneNavigationTranslator(Sink sink) {
+ this.sink = sink;
+ }
+
+ public override void initialize() {
+ traverser = new PhoneNavigationMetadataTraverser(sink.host as MetadataReaderHost);
+ }
+
+ public override bool isOneShot() {
+ return true;
+ }
+
+ public override int getPriority() {
+ // TODO make configurable from outside
+ return 2;
+ }
+
+ public override void TranslateAssemblies(IEnumerable<Microsoft.Cci.IUnit> assemblies) {
+ traverser.InjectPhoneCodeAssemblies(assemblies);
+ }
+ }
+}