[vala/wip/transform: 65/107] Access SemanticAnalyzer.get_data_type_for_symbol in a static way



commit 6c73768ef240ff11ed485d2150115a8e04b62da2
Author: Rico Tzschichholz <ricotz t-online de>
Date:   Mon Oct 1 17:23:02 2012 +0200

    Access SemanticAnalyzer.get_data_type_for_symbol in a static way

 codegen/valagdbusclienttransformer.vala | 2 +-
 codegen/valagdbusservertransformer.vala | 8 ++++----
 codegen/valagvarianttransformer.vala    | 6 +++---
 vala/valacodetransformer.vala           | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valagdbusclienttransformer.vala b/codegen/valagdbusclienttransformer.vala
index 513fbb8b4..539b252ed 100644
--- a/codegen/valagdbusclienttransformer.vala
+++ b/codegen/valagdbusclienttransformer.vala
@@ -328,7 +328,7 @@ public class Vala.GDBusClientTransformer : GVariantTransformer {
                // create proxy class
                var proxy = new Class (iface.name+"Proxy", iface.source_reference, null);
                proxy.add_base_type (data_type ("GLib.DBusProxy"));
-               proxy.add_base_type (context.analyzer.get_data_type_for_symbol (iface));
+               proxy.add_base_type (SemanticAnalyzer.get_data_type_for_symbol (iface));
                proxy.access = iface.access;
                iface.parent_symbol.add_class (proxy);
 
diff --git a/codegen/valagdbusservertransformer.vala b/codegen/valagdbusservertransformer.vala
index e693bb1e3..723ca3980 100644
--- a/codegen/valagdbusservertransformer.vala
+++ b/codegen/valagdbusservertransformer.vala
@@ -39,7 +39,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
        string generate_dbus_method_wrapper (Method m, ObjectTypeSymbol sym) {
                Method wrapper;
                wrapper_method (new VoidType (), "gdbus_server "+m.get_full_name (), out wrapper);
-               var object_type = context.analyzer.get_data_type_for_symbol (sym);
+               var object_type = SemanticAnalyzer.get_data_type_for_symbol (sym);
                wrapper.add_parameter (new Parameter ("object", object_type));
                wrapper.add_parameter (new Parameter ("arguments", data_type ("GLib.Variant", false)));
                wrapper.add_parameter (new Parameter ("invocation", data_type ("GLib.DBusMethodInvocation", 
false)));
@@ -171,7 +171,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
                sym.add_method (im);
 
                push_builder (new CodeBuilder.for_subroutine (im));
-               var object_type = context.analyzer.get_data_type_for_symbol (sym);
+               var object_type = SemanticAnalyzer.get_data_type_for_symbol (sym);
                var object = b.add_temp_declaration (null, expression (@"($object_type) 
(((Object[])user_data)[0])"));
                b.open_switch (expression ("method_name"), null);
                b.add_return ();
@@ -209,7 +209,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
                sym.add_method (m);
 
                push_builder (new CodeBuilder.for_subroutine (m));
-               var object_type = context.analyzer.get_data_type_for_symbol (sym);
+               var object_type = SemanticAnalyzer.get_data_type_for_symbol (sym);
                var object = b.add_temp_declaration (null, expression (@"($object_type) 
(((Object[])user_data)[0])"));
                b.open_switch (expression ("property_name"), null);
                b.add_return (expression ("null"));
@@ -246,7 +246,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
                sym.add_method (m);
 
                push_builder (new CodeBuilder.for_subroutine (m));
-               var object_type = context.analyzer.get_data_type_for_symbol (sym);
+               var object_type = SemanticAnalyzer.get_data_type_for_symbol (sym);
                var object = b.add_temp_declaration (null, expression (@"($object_type) 
(((Object[])user_data)[0])"));
                b.open_switch (expression ("property_name"), null);
                b.add_return (expression ("false"));
diff --git a/codegen/valagvarianttransformer.vala b/codegen/valagvarianttransformer.vala
index e8eef326b..cbce4584b 100644
--- a/codegen/valagvarianttransformer.vala
+++ b/codegen/valagvarianttransformer.vala
@@ -224,7 +224,7 @@ public class Vala.GVariantTransformer : CCodeTransformer {
                }
 
                Method m;
-               var type = context.analyzer.get_data_type_for_symbol (st);
+               var type = SemanticAnalyzer.get_data_type_for_symbol (st);
                if (!wrapper_method (data_type ("GLib.Variant"), "gvariant_serialize_struct 
"+type.to_string(), out m)) {
                        m.add_parameter (new Parameter ("st", type, b.source_reference));
                        push_builder (new CodeBuilder.for_subroutine (m));
@@ -361,7 +361,7 @@ public class Vala.GVariantTransformer : CCodeTransformer {
                }
 
                Method m;
-               var type = context.analyzer.get_data_type_for_symbol (st);
+               var type = SemanticAnalyzer.get_data_type_for_symbol (st);
                type.value_owned = true;
                if (!wrapper_method (type, "gvariant_deserialize_struct "+type.to_string(), out m)) {
                        m.add_parameter (new Parameter ("variant", data_type ("GLib.Variant", false), 
b.source_reference));
@@ -443,7 +443,7 @@ public class Vala.GVariantTransformer : CCodeTransformer {
                if (en.scope.lookup ("from_string") != null) {
                        return;
                }
-               var m = new Method ("from_string", context.analyzer.get_data_type_for_symbol (en), 
en.source_reference);
+               var m = new Method ("from_string", SemanticAnalyzer.get_data_type_for_symbol (en), 
en.source_reference);
                m.add_error_type (data_type ("GLib.DBusError.INVALID_ARGS"));
                m.add_parameter (new Parameter ("str", data_type ("string", false), en.source_reference));
                en.add_method (m);
diff --git a/vala/valacodetransformer.vala b/vala/valacodetransformer.vala
index 02728faec..6d1b01a9f 100644
--- a/vala/valacodetransformer.vala
+++ b/vala/valacodetransformer.vala
@@ -100,7 +100,7 @@ public class Vala.CodeTransformer : CodeVisitor {
 
        // only qualified types, will slightly simplify the work of SymbolResolver
        public DataType data_type (string s, bool value_owned = true, bool nullable = false) {
-               DataType type = context.analyzer.get_data_type_for_symbol ((TypeSymbol) symbol_from_string 
(s));
+               DataType type = SemanticAnalyzer.get_data_type_for_symbol ((TypeSymbol) symbol_from_string 
(s));
                type.value_owned = value_owned;
                type.nullable = nullable;
                return type;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]