Commit 160d75b8 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

rename DataType to Typesymbol

2007-12-02  Juerg Billeter  <j@bitron.ch>

	* vala/valatypesymbol.vala, vala/Makefile.am: rename DataType to
	  Typesymbol

	* vala/*.vala, gobject/*.vala, vapigen/*.vala: adapt after renaming

svn path=/trunk/; revision=745
parent 064eb741
2007-12-02 Jürg Billeter <j@bitron.ch>
* vala/valatypesymbol.vala, vala/Makefile.am: rename DataType to
Typesymbol
* vala/*.vala, gobject/*.vala, vapigen/*.vala: adapt after renaming
2007-12-01 Jürg Billeter <j@bitron.ch>
* ccode/valaccodeblock.vala: don't emit unreachable code,
......
......@@ -173,7 +173,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 = (DataType) 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"));
......
......@@ -97,21 +97,21 @@ public class Vala.CCodeGenerator : CodeGenerator {
public TypeReference string_type;
public TypeReference float_type;
public TypeReference double_type;
public DataType gtypeinstance_type;
public DataType gobject_type;
public DataType gerror_type;
public DataType glist_type;
public DataType gslist_type;
public DataType gstring_type;
public DataType garray_type;
public Typesymbol gtypeinstance_type;
public Typesymbol gobject_type;
public Typesymbol gerror_type;
public Typesymbol glist_type;
public Typesymbol gslist_type;
public Typesymbol gstring_type;
public Typesymbol garray_type;
public TypeReference gquark_type;
public TypeReference mutex_type;
public DataType type_module_type;
public DataType iterable_type;
public DataType iterator_type;
public DataType list_type;
public DataType map_type;
public DataType connection_type;
public Typesymbol type_module_type;
public Typesymbol iterable_type;
public Typesymbol iterator_type;
public Typesymbol list_type;
public Typesymbol map_type;
public Typesymbol connection_type;
Method substring_method;
......@@ -201,65 +201,65 @@ public class Vala.CCodeGenerator : CodeGenerator {
root_symbol = context.root;
bool_type = new TypeReference ();
bool_type.data_type = (DataType) root_symbol.scope.lookup ("bool");
bool_type.data_type = (Typesymbol) root_symbol.scope.lookup ("bool");
char_type = new TypeReference ();
char_type.data_type = (DataType) root_symbol.scope.lookup ("char");
char_type.data_type = (Typesymbol) root_symbol.scope.lookup ("char");
unichar_type = new TypeReference ();
unichar_type.data_type = (DataType) root_symbol.scope.lookup ("unichar");
unichar_type.data_type = (Typesymbol) root_symbol.scope.lookup ("unichar");
short_type = new TypeReference ();
short_type.data_type = (DataType) root_symbol.scope.lookup ("short");
short_type.data_type = (Typesymbol) root_symbol.scope.lookup ("short");
ushort_type = new TypeReference ();
ushort_type.data_type = (DataType) root_symbol.scope.lookup ("ushort");
ushort_type.data_type = (Typesymbol) root_symbol.scope.lookup ("ushort");
int_type = new TypeReference ();
int_type.data_type = (DataType) root_symbol.scope.lookup ("int");
int_type.data_type = (Typesymbol) root_symbol.scope.lookup ("int");
uint_type = new TypeReference ();
uint_type.data_type = (DataType) root_symbol.scope.lookup ("uint");
uint_type.data_type = (Typesymbol) root_symbol.scope.lookup ("uint");
long_type = new TypeReference ();
long_type.data_type = (DataType) root_symbol.scope.lookup ("long");
long_type.data_type = (Typesymbol) root_symbol.scope.lookup ("long");
ulong_type = new TypeReference ();
ulong_type.data_type = (DataType) root_symbol.scope.lookup ("ulong");
ulong_type.data_type = (Typesymbol) root_symbol.scope.lookup ("ulong");
int64_type = new TypeReference ();
int64_type.data_type = (DataType) root_symbol.scope.lookup ("int64");
int64_type.data_type = (Typesymbol) root_symbol.scope.lookup ("int64");
uint64_type = new TypeReference ();
uint64_type.data_type = (DataType) root_symbol.scope.lookup ("uint64");
uint64_type.data_type = (Typesymbol) root_symbol.scope.lookup ("uint64");
float_type = new TypeReference ();
float_type.data_type = (DataType) root_symbol.scope.lookup ("float");
float_type.data_type = (Typesymbol) root_symbol.scope.lookup ("float");
double_type = new TypeReference ();
double_type.data_type = (DataType) root_symbol.scope.lookup ("double");
double_type.data_type = (Typesymbol) root_symbol.scope.lookup ("double");
string_type = new TypeReference ();
string_type.data_type = (DataType) root_symbol.scope.lookup ("string");
string_type.data_type = (Typesymbol) root_symbol.scope.lookup ("string");
substring_method = (Method) string_type.data_type.scope.lookup ("substring");
var glib_ns = root_symbol.scope.lookup ("GLib");
gtypeinstance_type = (DataType) glib_ns.scope.lookup ("TypeInstance");
gobject_type = (DataType) glib_ns.scope.lookup ("Object");
gerror_type = (DataType) glib_ns.scope.lookup ("Error");
glist_type = (DataType) glib_ns.scope.lookup ("List");
gslist_type = (DataType) glib_ns.scope.lookup ("SList");
gstring_type = (DataType) glib_ns.scope.lookup ("String");
garray_type = (DataType) glib_ns.scope.lookup ("Array");
gtypeinstance_type = (Typesymbol) glib_ns.scope.lookup ("TypeInstance");
gobject_type = (Typesymbol) glib_ns.scope.lookup ("Object");
gerror_type = (Typesymbol) glib_ns.scope.lookup ("Error");
glist_type = (Typesymbol) glib_ns.scope.lookup ("List");
gslist_type = (Typesymbol) glib_ns.scope.lookup ("SList");
gstring_type = (Typesymbol) glib_ns.scope.lookup ("String");
garray_type = (Typesymbol) glib_ns.scope.lookup ("Array");
gquark_type = new TypeReference ();
gquark_type.data_type = (DataType) glib_ns.scope.lookup ("Quark");
gquark_type.data_type = (Typesymbol) glib_ns.scope.lookup ("Quark");
mutex_type = new TypeReference ();
mutex_type.data_type = (DataType) glib_ns.scope.lookup ("Mutex");
mutex_type.data_type = (Typesymbol) glib_ns.scope.lookup ("Mutex");
type_module_type = (DataType) 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 ();
......@@ -274,15 +274,15 @@ public class Vala.CCodeGenerator : CodeGenerator {
var gee_ns = root_symbol.scope.lookup ("Gee");
if (gee_ns != null) {
iterable_type = (DataType) gee_ns.scope.lookup ("Iterable");
iterator_type = (DataType) gee_ns.scope.lookup ("Iterator");
list_type = (DataType) gee_ns.scope.lookup ("List");
map_type = (DataType) gee_ns.scope.lookup ("Map");
iterable_type = (Typesymbol) gee_ns.scope.lookup ("Iterable");
iterator_type = (Typesymbol) gee_ns.scope.lookup ("Iterator");
list_type = (Typesymbol) gee_ns.scope.lookup ("List");
map_type = (Typesymbol) gee_ns.scope.lookup ("Map");
}
var dbus_ns = root_symbol.scope.lookup ("DBus");
if (dbus_ns != null) {
connection_type = (DataType) dbus_ns.scope.lookup ("Connection");
connection_type = (Typesymbol) dbus_ns.scope.lookup ("Connection");
}
/* we're only interested in non-pkg source files */
......@@ -384,8 +384,8 @@ public class Vala.CCodeGenerator : CodeGenerator {
public override void visit_constant (Constant! c) {
c.accept_children (this);
if (c.parent_symbol is DataType) {
var t = (DataType) c.parent_symbol;
if (c.parent_symbol is Typesymbol) {
var t = (Typesymbol) c.parent_symbol;
if (!c.is_internal_symbol () && !(c.type_reference.data_type is Array)) {
var cdefine = new CCodeMacroReplacement.with_expression (c.get_cname (), (CCodeExpression) c.initializer.ccodenode);
......@@ -570,7 +570,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
current_return_type = null;
var t = (DataType) prop.parent_symbol;
var t = (Typesymbol) prop.parent_symbol;
var this_type = new TypeReference ();
this_type.data_type = t;
......@@ -2019,7 +2019,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, (DataType) 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;
}
......@@ -2136,7 +2136,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
var ma = (MemberAccess) array_expr;
CCodeExpression pub_inst = null;
DataType base_type = null;
Typesymbol base_type = null;
CCodeExpression length_expr = null;
if (ma.inner == null) {
......@@ -2144,7 +2144,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
if (current_type_symbol != null) {
/* base type is available if this is a type method */
base_type = (DataType) current_type_symbol;
base_type = (Typesymbol) current_type_symbol;
}
} else {
pub_inst = (CCodeExpression) ma.inner.ccodenode;
......@@ -2158,7 +2158,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
var instance_expression_type = new TypeReference ();
instance_expression_type.data_type = base_type;
var instance_target_type = new TypeReference ();
instance_target_type.data_type = (DataType) field.parent_symbol;
instance_target_type.data_type = (Typesymbol) field.parent_symbol;
CCodeExpression typed_inst = get_implicit_cast_expression (pub_inst, instance_expression_type, instance_target_type);
CCodeExpression inst;
......@@ -2167,7 +2167,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
} else {
inst = typed_inst;
}
if (((DataType) 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);
......@@ -2510,7 +2510,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
if (init.symbol_reference is Field) {
var f = (Field) init.symbol_reference;
var instance_target_type = new TypeReference ();
instance_target_type.data_type = (DataType) f.parent_symbol;
instance_target_type.data_type = (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) {
......@@ -2700,7 +2700,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
visit_expression (expr);
}
static CCodeFunctionCall create_type_check (CCodeNode! ccodenode, DataType! 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;
......@@ -2799,7 +2799,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
} else if (prop.base_interface_property != null) {
base_property = prop.base_interface_property;
}
var base_property_type = (DataType) 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);
}
......@@ -2819,7 +2819,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
}
var instance_target_type = new TypeReference ();
instance_target_type.data_type = (DataType) base_property.parent_symbol;
instance_target_type.data_type = (Typesymbol) base_property.parent_symbol;
instance = get_implicit_cast_expression (instance, instance_expression_type, instance_target_type);
ccall.add_argument (instance);
......
......@@ -161,7 +161,7 @@ public class Vala.CCodeGenerator {
return cspec;
}
private CCodeFunctionCall! get_signal_creation (Signal! sig, DataType! type) {
private 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_")));
......
......@@ -85,7 +85,7 @@ public class Vala.CCodeGenerator {
// parent_symbol may be null for late bound methods
if (base_method.parent_symbol != null) {
var instance_target_type = new TypeReference ();
instance_target_type.data_type = (DataType) base_method.parent_symbol;
instance_target_type.data_type = (Typesymbol) base_method.parent_symbol;
instance = get_implicit_cast_expression (instance, instance_expression_type, instance_target_type);
}
......
......@@ -24,7 +24,7 @@
using GLib;
public class Vala.CCodeGenerator {
private void process_cmember (MemberAccess! expr, CCodeExpression pub_inst, DataType base_type) {
private void process_cmember (MemberAccess! expr, CCodeExpression pub_inst, Typesymbol base_type) {
if (expr.symbol_reference is Method) {
var m = (Method) expr.symbol_reference;
......@@ -78,7 +78,7 @@ public class Vala.CCodeGenerator {
var instance_expression_type = new TypeReference ();
instance_expression_type.data_type = base_type;
var instance_target_type = new TypeReference ();
instance_target_type.data_type = (DataType) f.parent_symbol;
instance_target_type.data_type = (Typesymbol) f.parent_symbol;
CCodeExpression typed_inst = get_implicit_cast_expression (pub_inst, instance_expression_type, instance_target_type);
bool is_gtypeinstance = (instance_target_type.data_type.is_subtype_of (gtypeinstance_type));
......@@ -110,7 +110,7 @@ public class Vala.CCodeGenerator {
} else if (prop.base_interface_property != null) {
base_property = prop.base_interface_property;
}
var base_property_type = (DataType) base_property.parent_symbol;
var base_property_type = (Typesymbol) base_property.parent_symbol;
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_get_%s".printf (base_property_type.get_lower_case_cname (null), base_property.name)));
var instance_expression_type = new TypeReference ();
......@@ -166,7 +166,7 @@ public class Vala.CCodeGenerator {
}
} else if (expr.symbol_reference is Signal) {
var sig = (Signal) expr.symbol_reference;
var cl = (DataType) 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)));
......@@ -195,14 +195,14 @@ public class Vala.CCodeGenerator {
public override void visit_member_access (MemberAccess! expr) {
CCodeExpression pub_inst = null;
DataType base_type = null;
Typesymbol base_type = null;
if (expr.inner == null) {
pub_inst = new CCodeIdentifier ("self");
if (current_type_symbol != null) {
/* base type is available if this is a type method */
base_type = (DataType) current_type_symbol;
base_type = (Typesymbol) current_type_symbol;
if (!base_type.is_reference_type ()) {
pub_inst = new CCodeIdentifier ("(*self)");
......
......@@ -122,11 +122,11 @@ public class Vala.CCodeGenerator {
this_type.data_type = find_parent_type (m);
if (m.base_interface_method != null && !m.is_abstract && !m.is_virtual) {
var base_type = new TypeReference ();
base_type.data_type = (DataType) m.base_interface_method.parent_symbol;
base_type.data_type = (Typesymbol) m.base_interface_method.parent_symbol;
instance_param = new CCodeFormalParameter ("base", base_type.get_cname ());
} else if (m.overrides) {
var base_type = new TypeReference ();
base_type.data_type = (DataType) m.base_method.parent_symbol;
base_type.data_type = (Typesymbol) m.base_method.parent_symbol;
instance_param = new CCodeFormalParameter ("base", base_type.get_cname ());
} else {
if (m.parent_symbol is Struct && !((Struct) m.parent_symbol).is_simple_type ()) {
......@@ -381,7 +381,7 @@ public class Vala.CCodeGenerator {
vfunc.line = function.line;
var this_type = new TypeReference ();
this_type.data_type = (DataType) m.parent_symbol;
this_type.data_type = (Typesymbol) m.parent_symbol;
var cparam = new CCodeFormalParameter ("self", this_type.get_cname ());
vfunc.add_parameter (cparam);
......@@ -532,11 +532,11 @@ public class Vala.CCodeGenerator {
}
}
private CCodeStatement create_method_type_check_statement (Method! m, DataType! t, bool non_null, string! var_name) {
private CCodeStatement create_method_type_check_statement (Method! m, Typesymbol! t, bool non_null, string! var_name) {
return create_type_check_statement (m, m.return_type.data_type, t, non_null, var_name);
}
private CCodeStatement create_property_type_check_statement (Property! prop, bool getter, DataType! t, bool non_null, string! var_name) {
private CCodeStatement create_property_type_check_statement (Property! prop, bool getter, Typesymbol! t, bool non_null, string! var_name) {
if (getter) {
return create_type_check_statement (prop, prop.type_reference.data_type, t, non_null, var_name);
} else {
......@@ -544,7 +544,7 @@ public class Vala.CCodeGenerator {
}
}
private CCodeStatement create_type_check_statement (CodeNode! method_node, DataType ret_type, DataType! t, bool non_null, string! var_name) {
private CCodeStatement create_type_check_statement (CodeNode! method_node, Typesymbol 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 && !((Interface) t).declaration_only)) {
......@@ -583,7 +583,7 @@ public class Vala.CCodeGenerator {
return new CCodeExpressionStatement (ccheck);
}
private CCodeExpression default_value_for_type (DataType! type) {
private CCodeExpression default_value_for_type (Typesymbol! type) {
if (type.is_reference_type () || type is Pointer) {
return new CCodeConstant ("NULL");
} else if (type.get_default_value () != null) {
......@@ -592,10 +592,10 @@ public class Vala.CCodeGenerator {
return null;
}
private DataType find_parent_type (Symbol sym) {
private Typesymbol find_parent_type (Symbol sym) {
while (sym != null) {
if (sym is DataType) {
return (DataType) sym;
if (sym is Typesymbol) {
return (Typesymbol) sym;
}
sym = sym.parent_symbol;
}
......
......@@ -107,7 +107,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 DataType;
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 ()));
......
......@@ -41,7 +41,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
class_reference = cl;
}
public override DataType! get_type_declaration () {
public override Typesymbol! get_type_declaration () {
return class_reference;
}
......
......@@ -31,20 +31,20 @@ public class Vala.DBusBindingProvider : Object, BindingProvider {
set {
_context = value;
string_type = (DataType) _context.root.scope.lookup ("string");
string_type = (Typesymbol) _context.root.scope.lookup ("string");
var dbus_ns = _context.root.scope.lookup ("DBus");
if (dbus_ns != null) {
connection_type = (DataType) dbus_ns.scope.lookup ("Connection");
dbus_error_type = (DataType) dbus_ns.scope.lookup ("Error");
connection_type = (Typesymbol) dbus_ns.scope.lookup ("Connection");
dbus_error_type = (Typesymbol) dbus_ns.scope.lookup ("Error");
}
}
}
private CodeContext _context;
private DataType string_type;
private DataType connection_type;
private DataType dbus_error_type;
private Typesymbol string_type;
private Typesymbol connection_type;
private Typesymbol dbus_error_type;
private Collection<Symbol> symbols = new ArrayList<Symbol> ();
......@@ -106,7 +106,7 @@ public class Vala.DBusBindingProvider : Object, BindingProvider {
return null;
}
private bool is_dbus_interface (DataType! t) {
private bool is_dbus_interface (Typesymbol! t) {
if (!(t is Interface)) {
return false;
}
......
......@@ -36,7 +36,7 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction {
interface_reference = iface;
}
public override DataType! 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 DataType! get_type_declaration ();
public abstract Typesymbol! get_type_declaration ();
/**
* Returns the name of the type struct in C code.
......
......@@ -43,7 +43,6 @@ libvalacore_la_VALASOURCES = \
valaconstructor.vala \
valacontinuestatement.vala \
valacreationmethod.vala \
valadatatype.vala \
valadeclarationstatement.vala \
valadestructor.vala \
valadostatement.vala \
......@@ -113,6 +112,7 @@ libvalacore_la_VALASOURCES = \
valatypeofexpression.vala \
valatypeparameter.vala \
valatypereference.vala \
valatypesymbol.vala \
valaunaryexpression.vala \
valavariabledeclarator.vala \
valawhilestatement.vala \
......
......@@ -27,12 +27,12 @@ using Gee;
/**
* Represents an array type i.e. everything with direct accessable elements.
*/
public class Vala.Array : DataType {
public class Vala.Array : Typesymbol {
/**
* DataType of which this is an array of.
* Typesymbol of which this is an array of.
*/
public weak DataType element_type { get; set construct; }
public weak Typesymbol element_type { get; set construct; }
/**
* TypeParameter of which this is an array of.
......@@ -50,7 +50,7 @@ public class Vala.Array : DataType {
private ArrayResizeMethod resize_method;
private ArrayMoveMethod move_method;
public Array (DataType! _element_type, int _rank, SourceReference _source_reference) {
public Array (Typesymbol! _element_type, int _rank, SourceReference _source_reference) {
rank = _rank;
element_type = _element_type;
source_reference = _source_reference;
......@@ -159,7 +159,7 @@ public class Vala.Array : DataType {
var root_symbol = source_reference.file.context.root;
length_field.type_reference = new TypeReference ();
length_field.type_reference.data_type = (DataType) root_symbol.scope.lookup ("int");
length_field.type_reference.data_type = (Typesymbol) root_symbol.scope.lookup ("int");
}
return length_field;
......@@ -176,7 +176,7 @@ public class Vala.Array : DataType {
var root_symbol = source_reference.file.context.root;
var int_type = new TypeReference ();
int_type.data_type = (DataType) root_symbol.scope.lookup ("int");
int_type.data_type = (Typesymbol) root_symbol.scope.lookup ("int");
resize_method.add_parameter (new FormalParameter ("length", int_type));
......@@ -196,7 +196,7 @@ public class Vala.Array : DataType {
var root_symbol = source_reference.file.context.root;
var int_type = new TypeReference ();
int_type.data_type = (DataType) root_symbol.scope.lookup ("int");
int_type.data_type = (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 function callback type.
*/
public class Vala.Callback : DataType {
public class Vala.Callback : Typesymbol {
/**
* The return type of this callback.
*/
......
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents a class declaration in the source code.
*/
public class Vala.Class : DataType {
public class Vala.Class : Typesymbol {
/**
* Specifies the base class.
*/
......@@ -566,7 +566,7 @@ public class Vala.Class : DataType {
this.free_function = name;
}
public override bool is_subtype_of (DataType! t) {
public override bool is_subtype_of (Typesymbol! t) {
if (this == t) {
return true;
}
......
......@@ -67,11 +67,11 @@ public class Vala.CreationMethod : Method {
public override string! get_default_cname () {
var parent = parent_symbol;
assert (parent is DataType);
assert (parent is Typesymbol);
if (name.len () == ".new".len ()) {
return "%snew".printf (((DataType) parent).get_lower_case_cprefix ());
return "%snew".printf (((Typesymbol) parent).get_lower_case_cprefix ());
} else {
return "%snew_%s".printf (((DataType) parent).get_lower_case_cprefix (), name.offset (".new.".len ()));
return "%snew_%s".printf (((Typesymbol) parent).get_lower_case_cprefix (), name.offset (".new.".len ()));
}
}
}
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents an enum declaration in the source code.
*/
public class Vala.Enum : DataType {
public class Vala.Enum : Typesymbol {
/**
* Specifies whether this is a flags enum.
*/
......
/* valainstancecast.vala
*
* Copyright (C) 2006 Jürg Billeter
* Copyright (C) 2006-2007 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -29,7 +29,7 @@ public class Vala.InstanceCast : CCodeFunctionCall {
/**
* The target type.
*/
public weak DataType! 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, DataType! type) {
public InstanceCast (CCodeExpression! expr, Typesymbol! type) {
inner = expr;
type_reference = type;
}
......
......@@ -26,7 +26,7 @@ using Gee;
/**
* Represents a class declaration in the source code.
*/
public class Vala.Interface : DataType {
public class Vala.Interface : Typesymbol {
/**
* Specifies whether this interface is static. Static interfaces are not
* available at run-time. They can be implemented by structs.
......@@ -290,7 +290,7 @@ public class Vala.Interface : DataType {
return "g_object_unref";
}
public override bool is_subtype_of (DataType! t) {
public override bool is_subtype_of (Typesymbol! t) {
if (this == t) {
return true;
}
......
......@@ -516,7 +516,7 @@ public class Vala.InterfaceWriter : CodeVisitor {
if (m is CreationMethod) {
write_string (" ");
var datatype = (DataType) m.parent_symbol;
var datatype = (Typesymbol) m.parent_symbol;
write_identifier (datatype.name);
write_identifier (m.name.offset (".new".len ()));
} else if (!m.instance) {
......
......@@ -26,15 +26,15 @@ using Gee;
/**
* Represents a pointer-type.
*/
public class Vala.Pointer : DataType {
public class Vala.Pointer : Typesymbol {
/**
* The type to which this pointer type points.
*/
public weak DataType! referent_type { get; set construct; }
public weak Typesymbol! referent_type { get; set construct; }
private string cname;
public Pointer (construct DataType! referent_type, construct SourceReference source_reference = null) {
public Pointer (construct Typesymbol! referent_type, construct SourceReference source_reference = null) {
}
construct {
......
......@@ -51,16 +51,16 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
TypeReference ulong_type;
TypeReference unichar_type;
TypeReference type_type;
DataType pointer_type;
DataType object_type;
DataType initially_unowned_type;
DataType glist_type;
DataType gslist_type;
DataType gerror_type;
DataType iterable_type;
DataType iterator_type;
DataType list_type;
DataType map_type;
Typesymbol pointer_type;
Typesymbol object_type;
Typesymbol initially_unowned_type;
Typesymbol glist_type;
Typesymbol gslist_type;
Typesymbol gerror_type;
Typesymbol iterable_type;
Typesymbol iterator_type;
Typesymbol list_type;
Typesymbol map_type;
private int next_lambda_id = 0;
......@@ -85,46 +85,46 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
root_symbol = context.root;
bool_type = new TypeReference ();