Commit 5811e4c2 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

s/Typesymbol/TypeSymbol/

2008-05-26  Juerg Billeter  <j@bitron.ch>

	* vala/valaarraytype.vala:
	* vala/valaclass.vala:
	* vala/valacreationmethod.vala:
	* vala/valadatatype.vala:
	* vala/valadelegate.vala:
	* vala/valaenum.vala:
	* vala/valaerrordomain.vala:
	* vala/valainstancecast.vala:
	* vala/valaintegertype.vala:
	* vala/valainterface.vala:
	* vala/valainterfacewriter.vala:
	* vala/valaobjecttype.vala:
	* vala/valaobjecttypesymbol.vala:
	* vala/valasemanticanalyzer.vala:
	* vala/valasourcefile.vala:
	* vala/valastruct.vala:
	* vala/valasymbolresolver.vala:
	* vala/valatypeparameter.vala:
	* vala/valatypesymbol.vala:
	* vala/valavaluetype.vala:
	* gobject/valaccodeassignmentbinding.vala:
	* gobject/valaccodeclassbinding.vala:
	* gobject/valaccodeelementaccessbinding.vala:
	* gobject/valaccodegenerator.vala:
	* gobject/valaccodegeneratorsignal.vala:
	* gobject/valaccodeinterfacebinding.vala:
	* gobject/valaccodeinvocationexpressionbinding.vala:
	* gobject/valaccodememberaccessbinding.vala:
	* gobject/valaccodemethodbinding.vala:
	* gobject/valaccodeobjecttypesymbolbinding.vala:
	* gobject/valaccodetypesymbolbinding.vala:
	* gobject/valaclassregisterfunction.vala:
	* gobject/valagidlwriter.vala:
	* gobject/valainterfaceregisterfunction.vala:
	* gobject/valatyperegisterfunction.vala:
	* vapigen/valagidlparser.vala:

	s/Typesymbol/TypeSymbol/

svn path=/trunk/; revision=1451
parent e28d0904
2008-05-26 Jürg Billeter <j@bitron.ch>
* vala/valaarraytype.vala:
* vala/valaclass.vala:
* vala/valacreationmethod.vala:
* vala/valadatatype.vala:
* vala/valadelegate.vala:
* vala/valaenum.vala:
* vala/valaerrordomain.vala:
* vala/valainstancecast.vala:
* vala/valaintegertype.vala:
* vala/valainterface.vala:
* vala/valainterfacewriter.vala:
* vala/valaobjecttype.vala:
* vala/valaobjecttypesymbol.vala:
* vala/valasemanticanalyzer.vala:
* vala/valasourcefile.vala:
* vala/valastruct.vala:
* vala/valasymbolresolver.vala:
* vala/valatypeparameter.vala:
* vala/valatypesymbol.vala:
* vala/valavaluetype.vala:
* gobject/valaccodeassignmentbinding.vala:
* gobject/valaccodeclassbinding.vala:
* gobject/valaccodeelementaccessbinding.vala:
* gobject/valaccodegenerator.vala:
* gobject/valaccodegeneratorsignal.vala:
* gobject/valaccodeinterfacebinding.vala:
* gobject/valaccodeinvocationexpressionbinding.vala:
* gobject/valaccodememberaccessbinding.vala:
* gobject/valaccodemethodbinding.vala:
* gobject/valaccodeobjecttypesymbolbinding.vala:
* gobject/valaccodetypesymbolbinding.vala:
* gobject/valaclassregisterfunction.vala:
* gobject/valagidlwriter.vala:
* gobject/valainterfaceregisterfunction.vala:
* gobject/valatyperegisterfunction.vala:
* vapigen/valagidlparser.vala:
s/Typesymbol/TypeSymbol/
2008-05-26 Jürg Billeter <j@bitron.ch>
* vapi/libxml-2.0.vapi: use [Compact] attribute
......
......@@ -158,7 +158,7 @@ public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
codegen.temp_vars.insert (0, temp_decl);
var parse_call = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_parse_name"));
parse_call.add_argument (sig.get_canonical_cconstant ());
var decl_type = (Typesymbol) sig.parent_symbol;
var decl_type = (TypeSymbol) sig.parent_symbol;
parse_call.add_argument (new CCodeIdentifier (decl_type.get_type_id ()));
parse_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (temp_decl.name)));
parse_call.add_argument (new CCodeConstant ("NULL"));
......@@ -244,7 +244,7 @@ public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
cparam_map.set (codegen.get_param_pos (param.cparameter_position), (CCodeFormalParameter) param.ccodenode);
}
} else {
cparam = new CCodeFormalParameter ("sender", ((Typesymbol) sig.parent_symbol).get_cname () + "*");
cparam = new CCodeFormalParameter ("sender", ((TypeSymbol) sig.parent_symbol).get_cname () + "*");
cparam_map.set (codegen.get_param_pos (0), cparam);
foreach (FormalParameter param in sig.get_parameters()) {
// ensure that C code node has been generated
......@@ -353,7 +353,7 @@ public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
if (container_type != null && codegen.list_type != null && codegen.map_type != null &&
(container_type.is_subtype_of (codegen.list_type) || container_type.is_subtype_of (codegen.map_type))) {
// lookup symbol in interface instead of class as implemented interface methods are not in VAPI files
Typesymbol collection_iface = null;
TypeSymbol collection_iface = null;
if (container_type.is_subtype_of (codegen.list_type)) {
collection_iface = codegen.list_type;
} else if (container_type.is_subtype_of (codegen.map_type)) {
......
......@@ -23,7 +23,7 @@
using GLib;
public class Vala.CCodeClassBinding : CCodeObjectTypesymbolBinding {
public class Vala.CCodeClassBinding : CCodeObjectTypeSymbolBinding {
public Class cl { get; set; }
public CCodeClassBinding (CCodeGenerator codegen, Class cl) {
......
......@@ -65,7 +65,7 @@ public class Vala.CCodeElementAccessBinding : CCodeExpressionBinding {
codenode = ccall;
} else if (container_type != null && codegen.list_type != null && codegen.map_type != null &&
(container_type.is_subtype_of (codegen.list_type) || container_type.is_subtype_of (codegen.map_type))) {
Typesymbol collection_iface = null;
TypeSymbol collection_iface = null;
if (container_type.is_subtype_of (codegen.list_type)) {
collection_iface = codegen.list_type;
} else if (container_type.is_subtype_of (codegen.map_type)) {
......
......@@ -32,7 +32,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
public Symbol root_symbol;
public Symbol current_symbol;
public Typesymbol current_type_symbol;
public TypeSymbol current_type_symbol;
public Class current_class;
public Method current_method;
public DataType current_return_type;
......@@ -100,21 +100,21 @@ public class Vala.CCodeGenerator : CodeGenerator {
public DataType string_type;
public DataType float_type;
public DataType double_type;
public Typesymbol gtype_type;
public Typesymbol gobject_type;
public TypeSymbol gtype_type;
public TypeSymbol gobject_type;
public ErrorType gerror_type;
public Class glist_type;
public Class gslist_type;
public Typesymbol gstringbuilder_type;
public Typesymbol garray_type;
public TypeSymbol gstringbuilder_type;
public TypeSymbol garray_type;
public DataType gquark_type;
public Struct mutex_type;
public Typesymbol type_module_type;
public TypeSymbol type_module_type;
public Interface iterable_type;
public Interface iterator_type;
public Interface list_type;
public Interface map_type;
public Typesymbol dbus_object_type;
public TypeSymbol dbus_object_type;
public Method substring_method;
......@@ -206,38 +206,38 @@ public class Vala.CCodeGenerator : CodeGenerator {
root_symbol = context.root;
bool_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("bool"));
char_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("char"));
unichar_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("unichar"));
short_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("short"));
ushort_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("ushort"));
int_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int"));
uint_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("uint"));
long_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("long"));
ulong_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("ulong"));
int8_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int8"));
uint8_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("uint8"));
int64_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int64"));
uint64_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("uint64"));
float_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("float"));
double_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("double"));
bool_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("bool"));
char_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("char"));
unichar_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("unichar"));
short_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("short"));
ushort_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("ushort"));
int_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("int"));
uint_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("uint"));
long_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("long"));
ulong_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("ulong"));
int8_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("int8"));
uint8_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("uint8"));
int64_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("int64"));
uint64_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("uint64"));
float_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("float"));
double_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("double"));
string_type = new ObjectType ((Class) root_symbol.scope.lookup ("string"));
substring_method = (Method) string_type.data_type.scope.lookup ("substring");
var glib_ns = root_symbol.scope.lookup ("GLib");
gtype_type = (Typesymbol) glib_ns.scope.lookup ("Type");
gobject_type = (Typesymbol) glib_ns.scope.lookup ("Object");
gtype_type = (TypeSymbol) glib_ns.scope.lookup ("Type");
gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
gerror_type = new ErrorType (null, null);
glist_type = (Class) glib_ns.scope.lookup ("List");
gslist_type = (Class) glib_ns.scope.lookup ("SList");
gstringbuilder_type = (Typesymbol) glib_ns.scope.lookup ("StringBuilder");
garray_type = (Typesymbol) glib_ns.scope.lookup ("Array");
gstringbuilder_type = (TypeSymbol) glib_ns.scope.lookup ("StringBuilder");
garray_type = (TypeSymbol) glib_ns.scope.lookup ("Array");
gquark_type = new ValueType ((Typesymbol) glib_ns.scope.lookup ("Quark"));
gquark_type = new ValueType ((TypeSymbol) glib_ns.scope.lookup ("Quark"));
mutex_type = (Struct) glib_ns.scope.lookup ("StaticRecMutex");
type_module_type = (Typesymbol) glib_ns.scope.lookup ("TypeModule");
type_module_type = (TypeSymbol) glib_ns.scope.lookup ("TypeModule");
if (context.module_init_method != null) {
module_init_fragment = new CCodeFragment ();
......@@ -260,7 +260,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
var dbus_ns = root_symbol.scope.lookup ("DBus");
if (dbus_ns != null) {
dbus_object_type = (Typesymbol) dbus_ns.scope.lookup ("Object");
dbus_object_type = (TypeSymbol) dbus_ns.scope.lookup ("Object");
}
/* we're only interested in non-pkg source files */
......@@ -767,7 +767,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
current_return_type = null;
var t = (Typesymbol) prop.parent_symbol;
var t = (TypeSymbol) prop.parent_symbol;
ReferenceType this_type;
if (t is Class) {
......@@ -2415,7 +2415,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
if (inner_node == null) {
l = new CCodeIdentifier ("self");
} else if (stmt.resource.symbol_reference.parent_symbol != current_type_symbol) {
l = new InstanceCast ((CCodeExpression) inner_node.ccodenode, (Typesymbol) stmt.resource.symbol_reference.parent_symbol);
l = new InstanceCast ((CCodeExpression) inner_node.ccodenode, (TypeSymbol) stmt.resource.symbol_reference.parent_symbol);
} else {
l = (CCodeExpression) inner_node.ccodenode;
}
......@@ -2579,7 +2579,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
var ma = (MemberAccess) array_expr;
CCodeExpression pub_inst = null;
Typesymbol base_type = null;
TypeSymbol base_type = null;
CCodeExpression length_expr = null;
if (ma.inner == null) {
......@@ -2587,7 +2587,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
if (current_type_symbol != null) {
/* base type is available if this is a type method */
base_type = (Typesymbol) current_type_symbol;
base_type = (TypeSymbol) current_type_symbol;
}
} else {
pub_inst = (CCodeExpression) ma.inner.ccodenode;
......@@ -2600,7 +2600,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
if (field.binding == MemberBinding.INSTANCE) {
var length_cname = get_array_length_cname (field.name, dim);
var instance_expression_type = get_data_type_for_symbol (base_type);
var instance_target_type = get_data_type_for_symbol ((Typesymbol) field.parent_symbol);
var instance_target_type = get_data_type_for_symbol ((TypeSymbol) field.parent_symbol);
CCodeExpression typed_inst = get_implicit_cast_expression (pub_inst, instance_expression_type, instance_target_type);
CCodeExpression inst;
......@@ -2609,7 +2609,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
} else {
inst = typed_inst;
}
if (((Typesymbol) field.parent_symbol).is_reference_type ()) {
if (((TypeSymbol) field.parent_symbol).is_reference_type ()) {
length_expr = new CCodeMemberAccess.pointer (inst, length_cname);
} else {
length_expr = new CCodeMemberAccess (inst, length_cname);
......@@ -2700,7 +2700,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
var ma = (MemberAccess) delegate_expr;
CCodeExpression pub_inst = null;
Typesymbol base_type = null;
TypeSymbol base_type = null;
CCodeExpression target_expr = null;
if (ma.inner == null) {
......@@ -2708,7 +2708,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
if (current_type_symbol != null) {
/* base type is available if this is a type method */
base_type = (Typesymbol) current_type_symbol;
base_type = (TypeSymbol) current_type_symbol;
}
} else {
pub_inst = (CCodeExpression) ma.inner.ccodenode;
......@@ -2720,7 +2720,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
if (field.binding == MemberBinding.INSTANCE) {
var instance_expression_type = get_data_type_for_symbol (base_type);
var instance_target_type = get_data_type_for_symbol ((Typesymbol) field.parent_symbol);
var instance_target_type = get_data_type_for_symbol ((TypeSymbol) field.parent_symbol);
CCodeExpression typed_inst = get_implicit_cast_expression (pub_inst, instance_expression_type, instance_target_type);
CCodeExpression inst;
......@@ -2729,7 +2729,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
} else {
inst = typed_inst;
}
if (((Typesymbol) field.parent_symbol).is_reference_type ()) {
if (((TypeSymbol) field.parent_symbol).is_reference_type ()) {
target_expr = new CCodeMemberAccess.pointer (inst, target_cname);
} else {
target_expr = new CCodeMemberAccess (inst, target_cname);
......@@ -3127,7 +3127,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
foreach (MemberInitializer init in expr.get_object_initializer ()) {
if (init.symbol_reference is Field) {
var f = (Field) init.symbol_reference;
var instance_target_type = get_data_type_for_symbol ((Typesymbol) f.parent_symbol);
var instance_target_type = get_data_type_for_symbol ((TypeSymbol) f.parent_symbol);
var typed_inst = get_implicit_cast_expression (instance, expr.type_reference, instance_target_type);
CCodeExpression lhs;
if (expr.type_reference.data_type is Struct) {
......@@ -3345,7 +3345,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
visit_expression (expr);
}
static CCodeFunctionCall create_type_check (CCodeNode ccodenode, Typesymbol type) {
static CCodeFunctionCall create_type_check (CCodeNode ccodenode, TypeSymbol type) {
var ccheck = new CCodeFunctionCall (new CCodeIdentifier (type.get_upper_case_cname ("IS_")));
ccheck.add_argument ((CCodeExpression) ccodenode);
return ccheck;
......@@ -3626,7 +3626,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
} else if (prop.base_interface_property != null) {
base_property = prop.base_interface_property;
}
var base_property_type = (Typesymbol) base_property.parent_symbol;
var base_property_type = (TypeSymbol) base_property.parent_symbol;
set_func = "%s_set_%s".printf (base_property_type.get_lower_case_cname (null), base_property.name);
if (prop is DynamicProperty) {
set_func = dynamic_property_binding ((DynamicProperty) prop).get_setter_cname ();
......@@ -3647,7 +3647,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
instance_expression_type = ma.inner.value_type;
}
var instance_target_type = get_data_type_for_symbol ((Typesymbol) base_property.parent_symbol);
var instance_target_type = get_data_type_for_symbol ((TypeSymbol) base_property.parent_symbol);
instance = get_implicit_cast_expression (instance, instance_expression_type, instance_target_type);
ccall.add_argument (instance);
......@@ -3711,7 +3711,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
return wrappers.add (wrapper_name);
}
public static DataType get_data_type_for_symbol (Typesymbol sym) {
public static DataType get_data_type_for_symbol (TypeSymbol sym) {
DataType type = null;
if (sym is Class) {
......@@ -3751,7 +3751,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
return null;
}
private CCodeStatement create_property_type_check_statement (Property prop, bool check_return_type, Typesymbol t, bool non_null, string var_name) {
private CCodeStatement create_property_type_check_statement (Property prop, bool check_return_type, TypeSymbol t, bool non_null, string var_name) {
if (check_return_type) {
return create_type_check_statement (prop, prop.property_type, t, non_null, var_name);
} else {
......@@ -3759,7 +3759,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
}
}
public CCodeStatement? create_type_check_statement (CodeNode method_node, DataType ret_type, Typesymbol t, bool non_null, string var_name) {
public CCodeStatement? create_type_check_statement (CodeNode method_node, DataType ret_type, TypeSymbol t, bool non_null, string var_name) {
var ccheck = new CCodeFunctionCall ();
if ((t is Class && ((Class) t).is_subtype_of (gobject_type)) || t is Interface) {
......
......@@ -134,7 +134,7 @@ public class Vala.CCodeGenerator {
public override void visit_signal (Signal sig) {
// parent_symbol may be null for late bound signals
if (sig.parent_symbol != null) {
var dt = sig.parent_symbol as Typesymbol;
var dt = sig.parent_symbol as TypeSymbol;
if (!dt.is_subtype_of (gobject_type)) {
sig.error = true;
Report.error (sig.source_reference, "Only classes and interfaces deriving from GLib.Object support signals. `%s' does not derive from GLib.Object.".printf (dt.get_full_name ()));
......
......@@ -23,7 +23,7 @@
using GLib;
public class Vala.CCodeInterfaceBinding : CCodeObjectTypesymbolBinding {
public class Vala.CCodeInterfaceBinding : CCodeObjectTypeSymbolBinding {
public Interface iface { get; set; }
public CCodeInterfaceBinding (CCodeGenerator codegen, Interface iface) {
......
......@@ -111,7 +111,7 @@ public class Vala.CCodeInvocationExpressionBinding : CCodeExpressionBinding {
// parent_symbol may be null for late bound methods
if (base_method.parent_symbol != null) {
var instance_target_type = codegen.get_data_type_for_symbol ((Typesymbol) base_method.parent_symbol);
var instance_target_type = codegen.get_data_type_for_symbol ((TypeSymbol) base_method.parent_symbol);
instance = codegen.get_implicit_cast_expression (instance, instance_expression_type, instance_target_type);
}
......
......@@ -83,7 +83,7 @@ public class Vala.CCodeMemberAccessBinding : CCodeExpressionBinding {
var f = (Field) expr.symbol_reference;
if (f.binding == MemberBinding.INSTANCE) {
var instance_expression_type = base_type;
var instance_target_type = codegen.get_data_type_for_symbol ((Typesymbol) f.parent_symbol);
var instance_target_type = codegen.get_data_type_for_symbol ((TypeSymbol) f.parent_symbol);
CCodeExpression typed_inst = codegen.get_implicit_cast_expression (pub_inst, instance_expression_type, instance_target_type);
var cl = instance_target_type.data_type as Class;
......@@ -131,7 +131,7 @@ public class Vala.CCodeMemberAccessBinding : CCodeExpressionBinding {
} else if (prop.base_interface_property != null) {
base_property = prop.base_interface_property;
}
var base_property_type = (Typesymbol) base_property.parent_symbol;
var base_property_type = (TypeSymbol) base_property.parent_symbol;
string getter_cname;
if (prop is DynamicProperty) {
getter_cname = codegen.dynamic_property_binding ((DynamicProperty) prop).get_getter_cname ();
......@@ -217,7 +217,7 @@ public class Vala.CCodeMemberAccessBinding : CCodeExpressionBinding {
}
} else if (expr.symbol_reference is Signal) {
var sig = (Signal) expr.symbol_reference;
var cl = (Typesymbol) sig.parent_symbol;
var cl = (TypeSymbol) sig.parent_symbol;
if (sig.has_emitter) {
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_%s".printf (cl.get_lower_case_cname (null), sig.name)));
......
......@@ -139,7 +139,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
CCodeFunctionDeclarator vdeclarator = null;
if (m.binding == MemberBinding.INSTANCE || (m.parent_symbol is Struct && m is CreationMethod)) {
Typesymbol parent_type = find_parent_type (m);
TypeSymbol parent_type = find_parent_type (m);
DataType this_type;
if (parent_type is Class) {
this_type = new ObjectType ((Class) parent_type);
......@@ -172,7 +172,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
codegen.type_struct.add_declaration (vdecl);
}
} else if (m.binding == MemberBinding.CLASS) {
Typesymbol parent_type = find_parent_type (m);
TypeSymbol parent_type = find_parent_type (m);
DataType this_type;
this_type = new ClassType ((Class) parent_type);
var class_param = new CCodeFormalParameter ("klass", this_type.get_cname ());
......@@ -661,7 +661,7 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
}
}
private CCodeStatement create_method_type_check_statement (Method m, DataType return_type, Typesymbol t, bool non_null, string var_name) {
private CCodeStatement create_method_type_check_statement (Method m, DataType return_type, TypeSymbol t, bool non_null, string var_name) {
return codegen.create_type_check_statement (m, return_type, t, non_null, var_name);
}
......@@ -695,10 +695,10 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
return new CCodeExpressionStatement (cassert);
}
private Typesymbol? find_parent_type (Symbol sym) {
private TypeSymbol? find_parent_type (Symbol sym) {
while (sym != null) {
if (sym is Typesymbol) {
return (Typesymbol) sym;
if (sym is TypeSymbol) {
return (TypeSymbol) sym;
}
sym = sym.parent_symbol;
}
......
......@@ -22,7 +22,7 @@
using GLib;
public abstract class Vala.CCodeObjectTypesymbolBinding : Vala.CCodeTypesymbolBinding {
public abstract class Vala.CCodeObjectTypeSymbolBinding : Vala.CCodeTypeSymbolBinding {
bool is_dbus_visible (CodeNode node) {
var dbus_attribute = node.get_attribute ("DBus");
......@@ -35,7 +35,7 @@ public abstract class Vala.CCodeObjectTypesymbolBinding : Vala.CCodeTypesymbolBi
return true;
}
public CCodeFragment register_dbus_info (ObjectTypesymbol bindable) {
public CCodeFragment register_dbus_info (ObjectTypeSymbol bindable) {
CCodeFragment fragment = new CCodeFragment ();
......@@ -207,7 +207,7 @@ public abstract class Vala.CCodeObjectTypesymbolBinding : Vala.CCodeTypesymbolBi
return fragment;
}
string generate_dbus_wrapper (Method m, ObjectTypesymbol bindable) {
string generate_dbus_wrapper (Method m, ObjectTypeSymbol bindable) {
string wrapper_name = "_dbus_%s".printf (m.get_cname ());
// declaration
......
......@@ -23,7 +23,7 @@
using GLib;
public abstract class Vala.CCodeTypesymbolBinding : CCodeBinding {
public abstract class Vala.CCodeTypeSymbolBinding : CCodeBinding {
public CCodeFunctionCall get_param_spec (Property prop) {
var cspec = new CCodeFunctionCall ();
cspec.add_argument (prop.get_canonical_cconstant ());
......@@ -166,7 +166,7 @@ public abstract class Vala.CCodeTypesymbolBinding : CCodeBinding {
return cspec;
}
public CCodeFunctionCall get_signal_creation (Signal sig, Typesymbol type) {
public CCodeFunctionCall get_signal_creation (Signal sig, TypeSymbol type) {
var csignew = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_new"));
csignew.add_argument (new CCodeConstant ("\"%s\"".printf (sig.name)));
csignew.add_argument (new CCodeIdentifier (type.get_upper_case_cname ("TYPE_")));
......
......@@ -41,7 +41,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
class_reference = cl;
}
public override Typesymbol get_type_declaration () {
public override TypeSymbol get_type_declaration () {
return class_reference;
}
......
......@@ -33,7 +33,7 @@ public class Vala.GIdlWriter : CodeVisitor {
int indent;
private Typesymbol gobject_type;
private TypeSymbol gobject_type;
/**
* Writes the public interface of the specified code context into the
......@@ -47,7 +47,7 @@ public class Vala.GIdlWriter : CodeVisitor {
var root_symbol = context.root;
var glib_ns = root_symbol.scope.lookup ("GLib");
gobject_type = (Typesymbol) glib_ns.scope.lookup ("Object");
gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
stream = FileStream.open (filename, "w");
......@@ -385,7 +385,7 @@ public class Vala.GIdlWriter : CodeVisitor {
DataType instance_type = null;
if (m.binding == MemberBinding.INSTANCE) {
instance_type = CCodeGenerator.get_data_type_for_symbol ((Typesymbol) m.parent_symbol);
instance_type = CCodeGenerator.get_data_type_for_symbol ((TypeSymbol) m.parent_symbol);
}
write_params (m.get_parameters (), instance_type);
......@@ -418,7 +418,7 @@ public class Vala.GIdlWriter : CodeVisitor {
write_params (m.get_parameters ());
write_return_type (CCodeGenerator.get_data_type_for_symbol ((Typesymbol) m.parent_symbol));
write_return_type (CCodeGenerator.get_data_type_for_symbol ((TypeSymbol) m.parent_symbol));
indent--;
write_indent ();
......
......@@ -36,7 +36,7 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction {
interface_reference = iface;
}
public override Typesymbol get_type_declaration () {
public override TypeSymbol get_type_declaration () {
return interface_reference;
}
......
......@@ -137,7 +137,7 @@ public abstract class Vala.TypeRegisterFunction : Object {
*
* @return type to be registered
*/
public abstract Typesymbol get_type_declaration ();
public abstract TypeSymbol get_type_declaration ();
/**
* Returns the name of the type struct in C code.
......
......@@ -74,10 +74,10 @@ public class Vala.ArrayType : ReferenceType {
var root_symbol = source_reference.file.context.root;
if (rank > 1) {
// length is an int[] containing the dimensions of the array, starting at 0
ValueType integer = new ValueType((Typesymbol) root_symbol.scope.lookup("int"));
ValueType integer = new ValueType((TypeSymbol) root_symbol.scope.lookup("int"));
length_field.field_type = new ArrayType (integer, 1, source_reference);
} else {
length_field.field_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int"));
length_field.field_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("int"));
}
}
......@@ -94,7 +94,7 @@ public class Vala.ArrayType : ReferenceType {
resize_method.set_cname ("g_renew");
var root_symbol = source_reference.file.context.root;
var int_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int"));
var int_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("int"));
resize_method.add_parameter (new FormalParameter ("length", int_type));
......@@ -113,7 +113,7 @@ public class Vala.ArrayType : ReferenceType {
move_method.set_cname ("_vala_array_move");
var root_symbol = source_reference.file.context.root;
var int_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int"));
var int_type = new ValueType ((TypeSymbol) root_symbol.scope.lookup ("int"));
move_method.add_parameter (new FormalParameter ("src", int_type));
move_method.add_parameter (new FormalParameter ("dest", int_type));
......
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents a class declaration in the source code.
*/
public class Vala.Class : ObjectTypesymbol {
public class Vala.Class : ObjectTypeSymbol {
/**
* Specifies the base class.
*/
......@@ -702,7 +702,7 @@ public class Vala.Class : ObjectTypesymbol {
this.free_function = name;
}
public override bool is_subtype_of (Typesymbol t) {
public override bool is_subtype_of (TypeSymbol t) {
if (this == t) {
return true;
}
......
......@@ -70,7 +70,7 @@ public class Vala.CreationMethod : Method {
}
public override string get_default_cname () {
var parent = parent_symbol as Typesymbol;
var parent = parent_symbol as TypeSymbol;
string infix = "new";
if (parent is Struct) {
......
......@@ -42,7 +42,7 @@ public abstract class Vala.DataType : CodeNode {
/**
* The referred data type.
*/
public weak Typesymbol data_type { get; set; }
public weak TypeSymbol data_type { get; set; }
/**
* The referred generic type parameter.
......@@ -116,7 +116,7 @@ public abstract class Vala.DataType : CodeNode {
*/
public string get_const_cname () {
string ptr;
Typesymbol t;
TypeSymbol t;
// FIXME: workaround to make constant arrays possible
if (this is ArrayType) {
t = ((ArrayType) this).element_type.data_type;
......
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents a function callback type.
*/
public class Vala.Delegate : Typesymbol {
public class Vala.Delegate : TypeSymbol {
/**
* The return type of this callback.
*/
......
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents an enum declaration in the source code.
*/
public class Vala.Enum : Typesymbol {
public class Vala.Enum : TypeSymbol {
/**
* Specifies whether this is a flags enum.
*/
......
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents an error domain declaration in the source code.
*/
public class Vala.ErrorDomain : Typesymbol {
public class Vala.ErrorDomain : TypeSymbol {
private Gee.List<ErrorCode> codes = new ArrayList<ErrorCode> ();
private Gee.List<Method> methods = new ArrayList<Method> ();
private string cname;
......
......@@ -29,7 +29,7 @@ public class Vala.InstanceCast : CCodeFunctionCall {
/**
* The target type.
*/
public weak Typesymbol type_reference { get; set construct; }
public weak TypeSymbol type_reference { get; set construct; }
/**
* The expression to be cast.
......@@ -43,7 +43,7 @@ public class Vala.InstanceCast : CCodeFunctionCall {
* @param type the target type
* @return newly created instance cast expression
*/
public InstanceCast (CCodeExpression expr, Typesymbol type) {
public InstanceCast (CCodeExpression expr, TypeSymbol type) {
inner = expr;
type_reference = type;
}
......
......@@ -28,7 +28,7 @@ using GLib;
public class Vala.IntegerType : ValueType {
public IntegerLiteral literal { get; set; }
public IntegerType (Typesymbol type_symbol) {
public IntegerType (TypeSymbol type_symbol) {
this.type_symbol = type_symbol;
data_type = type_symbol;
}
......
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents a class declaration in the source code.
*/
public class Vala.Interface : ObjectTypesymbol {
public class Vala.Interface : ObjectTypeSymbol {
/**
* Specifies whether this interface is static. Static interfaces are not
* available at run-time. They can be implemented by structs.
......@@ -376,7 +376,7 @@ public class Vala.Interface : ObjectTypesymbol {
return "g_object_unref";
}
public override bool is_subtype_of (Typesymbol t) {
public override bool is_subtype_of (TypeSymbol t) {
if (this == t) {
return true;
}
......