plug some memory leaks, adapt to Vala.Block changes replace public fields
authorJürg Billeter <j@bitron.ch>
Mon, 26 Jun 2006 13:54:03 +0000 (13:54 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 26 Jun 2006 13:54:03 +0000 (13:54 +0000)
2006-06-26  Jürg Billeter  <j@bitron.ch>

* vala/parser.y: plug some memory leaks, adapt to Vala.Block changes
* vala/valaattribute.vala, vala/valabinaryexpression.vala,
  vala/valablock.vala, vala/valabooleanexpression.vala,
  vala/valabreakstatement.vala, vala/valaliteral.vala,
  vala/valastatement.vala: replace public fields by properties / private
  fields, don't mark properties as construct-only, use non-null types
* vala/valadatatype.vala: renamed from Vala.Type_ to Vala.DataType
* vala/valasymbolbuilder.vala, vala/valasymbolresolver.vala,
  vala/valasemanticanalyzer.vala, vala/valacodegenerator.vala,
  vala/valasourcefile.vala, vala/valacallback.vala, vala/valaclass.vala,
  vala/valaclassregisterfunction.vala, vala/valaconstant.vala,
  vala/valaenum.vala, vala/valaflags.vala, vala/valainstancecast.vala,
  vala/valainterface.vala, vala/valainterfaceregisterfunction.vala,
  vala/valamethod.vala, vala/valastruct.vala,
  vala/valatypeparameter.vala, vala/valatypereference.vala,
  vala/valatypergisterfunction.vala: adapt to renaming of Vala.Type_ to
  Vala.DataType
* vala/Makefile.am: update

svn path=/trunk/; revision=53

30 files changed:
vala/ChangeLog
vala/vala/Makefile.am
vala/vala/parser.y
vala/vala/valaattribute.vala
vala/vala/valabinaryexpression.vala
vala/vala/valablock.vala
vala/vala/valabooleanliteral.vala
vala/vala/valabreakstatement.vala
vala/vala/valacallback.vala
vala/vala/valaclass.vala
vala/vala/valaclassregisterfunction.vala
vala/vala/valacodegenerator.vala
vala/vala/valaconstant.vala
vala/vala/valadatatype.vala [moved from vala/vala/valatype.vala with 76% similarity]
vala/vala/valaenum.vala
vala/vala/valaflags.vala
vala/vala/valainstancecast.vala
vala/vala/valainterface.vala
vala/vala/valainterfaceregisterfunction.vala
vala/vala/valaliteral.vala
vala/vala/valamethod.vala
vala/vala/valasemanticanalyzer.vala
vala/vala/valasourcefile.vala
vala/vala/valastatement.vala
vala/vala/valastruct.vala
vala/vala/valasymbolbuilder.vala
vala/vala/valasymbolresolver.vala
vala/vala/valatypeparameter.vala
vala/vala/valatypereference.vala
vala/vala/valatyperegisterfunction.vala

index b4d62b4..78caaed 100644 (file)
@@ -1,3 +1,24 @@
+2006-06-26  Jürg Billeter  <j@bitron.ch>
+
+       * vala/parser.y: plug some memory leaks, adapt to Vala.Block changes
+       * vala/valaattribute.vala, vala/valabinaryexpression.vala,
+         vala/valablock.vala, vala/valabooleanexpression.vala,
+         vala/valabreakstatement.vala, vala/valaliteral.vala,
+         vala/valastatement.vala: replace public fields by properties / private
+         fields, don't mark properties as construct-only, use non-null types
+       * vala/valadatatype.vala: renamed from Vala.Type_ to Vala.DataType
+       * vala/valasymbolbuilder.vala, vala/valasymbolresolver.vala,
+         vala/valasemanticanalyzer.vala, vala/valacodegenerator.vala,
+         vala/valasourcefile.vala, vala/valacallback.vala, vala/valaclass.vala,
+         vala/valaclassregisterfunction.vala, vala/valaconstant.vala,
+         vala/valaenum.vala, vala/valaflags.vala, vala/valainstancecast.vala,
+         vala/valainterface.vala, vala/valainterfaceregisterfunction.vala,
+         vala/valamethod.vala, vala/valastruct.vala,
+         vala/valatypeparameter.vala, vala/valatypereference.vala,
+         vala/valatypergisterfunction.vala: adapt to renaming of Vala.Type_ to
+         Vala.DataType
+       * vala/Makefile.am: update
+
 2006-06-22  Jürg Billeter  <j@bitron.ch>
 
        * vala/valaassignment.vala: don't mark properties as construct-only,
index 0f466e8..0b53dff 100644 (file)
@@ -77,6 +77,9 @@ libvala_la_SOURCES = \
        valacontinuestatement.c \
        valacontinuestatement.h \
        valacontinuestatement.vala \
+       valadatatype.c \
+       valadatatype.h \
+       valadatatype.vala \
        valadeclarationstatement.c \
        valadeclarationstatement.h \
        valadeclarationstatement.vala \
@@ -239,9 +242,6 @@ libvala_la_SOURCES = \
        valasymbolresolver.c \
        valasymbolresolver.h \
        valasymbolresolver.vala \
-       valatype.c \
-       valatype.h \
-       valatype.vala \
        valatypecheck.c \
        valatypecheck.h \
        valatypecheck.vala \
index 14bea6e..a4a8c4c 100644 (file)
@@ -393,6 +393,7 @@ type_name
                        vala_type_reference_add_type_argument ($$, l->data);
                        g_object_unref (l->data);
                }
+               g_list_free ($2);
          }
        | IDENTIFIER DOT IDENTIFIER opt_type_argument_list
          {
@@ -406,6 +407,7 @@ type_name
                        vala_type_reference_add_type_argument ($$, l->data);
                        g_object_unref (l->data);
                }
+               g_list_free ($4);
          }
        ;
 
@@ -990,8 +992,13 @@ block
        : OPEN_BRACE opt_statement_list CLOSE_BRACE
          {
                ValaSourceReference *src = src(@1);
-               $$ = VALA_STATEMENT (vala_block_new ($2, src));
+               $$ = VALA_STATEMENT (vala_block_new (src));
                if ($2 != NULL) {
+                       GList *l;
+                       for (l = $2; l != NULL; l = l->next) {
+                               vala_block_add_statement (VALA_BLOCK ($$), l->data);
+                               g_object_unref (l->data);
+                       }
                        g_list_free ($2);
                }
                g_object_unref (src);
@@ -1074,6 +1081,7 @@ local_variable_type
                        vala_type_reference_add_type_argument ($$, l->data);
                        g_object_unref (l->data);
                }
+               g_list_free ($2);
                g_object_unref ($1);
          }
        | REF primary_expression opt_type_argument_list opt_op_neg
@@ -1090,6 +1098,7 @@ local_variable_type
                        vala_type_reference_add_type_argument ($$, l->data);
                        g_object_unref (l->data);
                }
+               g_list_free ($3);
                g_object_unref ($2);
          }
        | local_variable_type array_qualifier
@@ -1399,7 +1408,7 @@ class_declaration
                
                VALA_CODE_NODE(current_class)->attributes = $2;
                if ($3 != 0) {
-                       VALA_TYPE_(current_class)->access = $3;
+                       VALA_DATA_TYPE(current_class)->access = $3;
                }
                for (l = $7; l != NULL; l = l->next) {
                        vala_class_add_type_parameter (current_class, l->data);
@@ -1982,7 +1991,7 @@ struct_header
                }
                VALA_CODE_NODE($$)->attributes = $2;
                if ($3 != 0) {
-                       VALA_TYPE_($$)->access = $3;
+                       VALA_DATA_TYPE($$)->access = $3;
                }
                
                g_free ($5);
@@ -2088,7 +2097,7 @@ enum_declaration
                VALA_CODE_NODE($$)->attributes = $2;
 
                if ($3 != 0) {
-                       VALA_TYPE_($$)->access = $3;
+                       VALA_DATA_TYPE($$)->access = $3;
                }
                for (l = $6; l != NULL; l = l->next) {
                        vala_enum_add_value ($$, l->data);
@@ -2169,7 +2178,7 @@ callback_declaration
                $$ = vala_callback_new ($6, $5, src);
                g_object_unref (src);
                if ($3 != 0) {
-                       VALA_TYPE_($$)->access = $3;
+                       VALA_DATA_TYPE($$)->access = $3;
                }
                VALA_CODE_NODE($$)->attributes = $2;
                
index af6b6b2..fae496a 100644 (file)
@@ -24,16 +24,16 @@ using GLib;
 
 namespace Vala {
        public class Attribute : CodeNode {
-               public string name { get; construct; }
-               public SourceReference source_reference { get; construct; }
+               public string! name { get; set construct; }
+               public SourceReference source_reference { get; set; }
 
                public List<NamedArgument> args;
                
-               public static ref Attribute new (string name, SourceReference source) {
+               public static ref Attribute! new (string! name, SourceReference source) {
                        return (new Attribute (name = name, source_reference = source));
                }
 
-               public void add_argument (NamedArgument arg) {
+               public void add_argument (NamedArgument! arg) {
                        args.append (arg);
                }
        }
index 6f8f18e..a3e5617 100644 (file)
@@ -24,15 +24,15 @@ using GLib;
 
 namespace Vala {
        public class BinaryExpression : Expression {
-               public BinaryOperator operator { get; construct; }
-               public Expression left { get; construct; }
-               public Expression right { get; construct; }
+               public BinaryOperator operator { get; set construct; }
+               public Expression! left { get; set construct; }
+               public Expression! right { get; set construct; }
                
-               public static ref BinaryExpression new (BinaryOperator op, Expression left, Expression right, SourceReference source) {
+               public static ref BinaryExpression! new (BinaryOperator op, Expression! left, Expression! right, SourceReference source) {
                        return (new BinaryExpression (operator = op, left = left, right = right, source_reference = source));
                }
                
-               public override void accept (CodeVisitor visitor) {
+               public override void accept (CodeVisitor! visitor) {
                        left.accept (visitor);
                        right.accept (visitor);                 
 
index e609a57..f670975 100644 (file)
@@ -24,16 +24,20 @@ using GLib;
 
 namespace Vala {
        public class Block : Statement {
-               public List<Statement> statement_list { get; construct; }
-               public bool contains_jump_statement;
+               private List<Statement> statement_list;
+               public bool contains_jump_statement { get; set; }
                private List<VariableDeclarator> local_variables;
                
-               public static ref Block new (List<Statement> statement_list, SourceReference source) {
-                       return (new Block (statement_list = statement_list, source_reference = source));
+               public static ref Block! new (SourceReference source) {
+                       return (new Block (source_reference = source));
                }
                
                public void add_statement (Statement! stmt) {
-                       _statement_list.append (stmt);
+                       statement_list.append (stmt);
+               }
+               
+               public ref List<Statement> get_statements () {
+                       return statement_list;
                }
                
                public void add_local_variable (VariableDeclarator! decl) {
@@ -47,7 +51,7 @@ namespace Vala {
                public override void accept (CodeVisitor! visitor) {
                        visitor.visit_begin_block (this);
 
-                       foreach (Statement stmt in statement_list) {
+                       foreach (Statement! stmt in statement_list) {
                                stmt.accept (visitor);
                        }
 
index 09a988c..7ad98fb 100644 (file)
@@ -24,14 +24,14 @@ using GLib;
 
 namespace Vala {
        public class BooleanLiteral : Literal {
-               public bool value { get; construct; }
-               public SourceReference source_reference { get; construct; }
+               public bool value { get; set; }
+               public SourceReference source_reference { get; set; }
 
-               public static ref BooleanLiteral new (bool b, SourceReference source) {
+               public static ref BooleanLiteral! new (bool b, SourceReference source) {
                        return (new BooleanLiteral (value = b, source_reference = source));
                }
                
-               public override void accept (CodeVisitor visitor) {
+               public override void accept (CodeVisitor! visitor) {
                        visitor.visit_boolean_literal (this);
                }
        }
index 6aff3be..4df127b 100644 (file)
@@ -24,11 +24,11 @@ using GLib;
 
 namespace Vala {
        public class BreakStatement : Statement {
-               public static ref BreakStatement new (SourceReference source) {
+               public static ref BreakStatement! new (SourceReference source) {
                        return (new BreakStatement (source_reference = source));
                }
                
-               public override void accept (CodeVisitor visitor) {
+               public override void accept (CodeVisitor! visitor) {
                        visitor.visit_break_statement (this);
                }
        }
index 0185c05..3dc5bc3 100644 (file)
@@ -23,7 +23,7 @@
 using GLib;
 
 namespace Vala {
-       public class Callback : Type_ {
+       public class Callback : DataType {
                public TypeReference return_type { get; construct; }
                public List<FormalParameter> parameters;
                
index 18486cf..e9267d9 100644 (file)
@@ -23,7 +23,7 @@
 using GLib;
 
 namespace Vala {
-       public class Class : Type_ {
+       public class Class : DataType {
                List<string> type_parameters;
                public List<TypeReference> base_types;
                public Class base_class;
@@ -197,7 +197,7 @@ namespace Vala {
                                                if (lit is StringLiteral) {
                                                        var val = ((StringLiteral) lit).eval ();
                                                        foreach (string filename in val.split (",")) {
-                                                               cheader_filenames.append (filename);
+                                                               add_cheader_filename (filename);
                                                        }
                                                }
                                        }
index f80acf0..cc88c3c 100644 (file)
@@ -26,7 +26,7 @@ namespace Vala {
        public class ClassRegisterFunction : TypeRegisterFunction {
                public Class class_reference { get; construct; }
                
-               public override Type_ get_type_declaration () {
+               public override DataType get_type_declaration () {
                        return class_reference;
                }
                
index d698723..bd3eb34 100644 (file)
@@ -613,8 +613,8 @@ namespace Vala {
                }
 
                public override void visit_constant (Constant! c) {
-                       if (c.symbol.parent_symbol.node is Type_) {
-                               var t = (Type_) c.symbol.parent_symbol.node;
+                       if (c.symbol.parent_symbol.node is DataType) {
+                               var t = (DataType) c.symbol.parent_symbol.node;
                                var cdecl = new CCodeDeclaration (type_name = c.type_reference.get_const_cname ());
                                var arr = "";
                                if (c.type_reference.array) {
@@ -633,8 +633,8 @@ namespace Vala {
                                if (f.instance) {
                                        instance_priv_struct.add_field (f.type_reference.get_cname (), f.get_cname ());
                                } else {
-                                       if (f.symbol.parent_symbol.node is Type_) {
-                                               var t = (Type_) f.symbol.parent_symbol.node;
+                                       if (f.symbol.parent_symbol.node is DataType) {
+                                               var t = (DataType) f.symbol.parent_symbol.node;
                                                var cdecl = new CCodeDeclaration (type_name = f.type_reference.get_cname ());
                                                cdecl.add_declarator (new CCodeVariableDeclarator (name = "%s_%s".printf (t.get_lower_case_cname (null), f.get_cname ())));
                                                cdecl.modifiers = CCodeModifiers.STATIC;
@@ -644,7 +644,7 @@ namespace Vala {
                        }
                }
                
-               private ref CCodeStatement create_type_check_statement (Method! m, Type_! t, bool non_null, string! var_name) {
+               private ref CCodeStatement create_type_check_statement (Method! m, DataType! t, bool non_null, string! var_name) {
                        var ccheck = new CCodeFunctionCall ();
                        
                        var ctype_check = new CCodeFunctionCall (call = new CCodeIdentifier (name = t.get_upper_case_cname ("IS_")));
@@ -691,13 +691,13 @@ namespace Vala {
                        
                        if (m.instance) {
                                var this_type = new TypeReference ();
-                               this_type.type = (Type_) m.symbol.parent_symbol.node;
+                               this_type.type = (DataType) m.symbol.parent_symbol.node;
                                if (!m.is_override) {
                                        var cparam = new CCodeFormalParameter (type_name = this_type.get_cname (), name = "self");
                                        function.add_parameter (cparam);
                                } else {
                                        var base_type = new TypeReference ();
-                                       base_type.type = (Type_) m.base_method.symbol.parent_symbol.node;
+                                       base_type.type = (DataType) m.base_method.symbol.parent_symbol.node;
                                        var cparam = new CCodeFormalParameter (type_name = base_type.get_cname (), name = "base");
                                        function.add_parameter (cparam);
                                }
@@ -776,7 +776,7 @@ namespace Vala {
                                var vfunc = new CCodeFunction (name = m.get_cname (), return_type = m.return_type.get_cname ());
 
                                var this_type = new TypeReference ();
-                               this_type.type = (Type_) m.symbol.parent_symbol.node;
+                               this_type.type = (DataType) m.symbol.parent_symbol.node;
 
                                var cparam = new CCodeFormalParameter (type_name = this_type.get_cname (), name = "self");
                                vfunc.add_parameter (cparam);
@@ -935,7 +935,7 @@ namespace Vala {
                
                        var cblock = new CCodeBlock ();
                        
-                       foreach (Statement stmt in b.statement_list) {
+                       foreach (Statement stmt in b.get_statements ()) {
                                var src = stmt.source_reference;
                                if (src != null && src.comment != null) {
                                        cblock.add_statement (new CCodeComment (text = src.comment));
@@ -1393,7 +1393,7 @@ namespace Vala {
                        visit_expression (expr);
                }
                
-               private void process_cmember (Expression! expr, CCodeExpression pub_inst, Type_ base_type) {
+               private void process_cmember (Expression! expr, CCodeExpression pub_inst, DataType base_type) {
                        if (expr.symbol_reference.node is Method) {
                                var m = (Method) expr.symbol_reference.node;
                                if (!m.is_override) {
@@ -1406,7 +1406,7 @@ namespace Vala {
                                if (f.instance) {
                                        ref CCodeExpression typed_inst;
                                        if (f.symbol.parent_symbol.node != base_type) {
-                                               typed_inst = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((Type_) f.symbol.parent_symbol.node).get_upper_case_cname (null)));
+                                               typed_inst = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((DataType) f.symbol.parent_symbol.node).get_upper_case_cname (null)));
                                                ((CCodeFunctionCall) typed_inst).add_argument (pub_inst);
                                        } else {
                                                typed_inst = pub_inst;
@@ -1419,8 +1419,8 @@ namespace Vala {
                                        }
                                        expr.ccodenode = new CCodeMemberAccess (inner = inst, member_name = f.get_cname (), is_pointer = true);
                                } else {
-                                       if (f.symbol.parent_symbol.node is Type_) {
-                                               var t = (Type_) f.symbol.parent_symbol.node;
+                                       if (f.symbol.parent_symbol.node is DataType) {
+                                               var t = (DataType) f.symbol.parent_symbol.node;
                                                expr.ccodenode = new CCodeIdentifier (name = "%s_%s".printf (t.get_lower_case_cname (null), f.get_cname ()));
                                        } else {
                                                expr.ccodenode = new CCodeIdentifier (name = f.get_cname ());
@@ -1445,7 +1445,7 @@ namespace Vala {
                                        ccast.add_argument (pub_inst);
                                        typed_pub_inst = ccast;
                                } else if (prop.symbol.parent_symbol.node != base_type) {
-                                       var ccast = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((Type_) prop.symbol.parent_symbol.node).get_upper_case_cname (null)));
+                                       var ccast = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((DataType) prop.symbol.parent_symbol.node).get_upper_case_cname (null)));
                                        ccast.add_argument (pub_inst);
                                        typed_pub_inst = ccast;
                                }
@@ -1474,7 +1474,7 @@ namespace Vala {
                
                public override void visit_simple_name (SimpleName! expr) {
                        var pub_inst = new CCodeIdentifier (name = "self");
-                       var base_type = (Type_) current_type_symbol.node;
+                       var base_type = (DataType) current_type_symbol.node;
                        
                        process_cmember (expr, pub_inst, base_type);
 
@@ -1489,7 +1489,7 @@ namespace Vala {
 
                public override void visit_member_access (MemberAccess! expr) {
                        var pub_inst = (CCodeExpression) expr.inner.ccodenode;
-                       Type_ base_type = null;
+                       DataType base_type = null;
                        if (expr.inner.static_type != null) {
                                base_type = expr.inner.static_type.type;
                        }
@@ -1528,8 +1528,8 @@ namespace Vala {
                                        Report.error (expr.source_reference, "unsupported method invocation");
                                }
                                
-                               if (req_cast && ((Type_) m.symbol.parent_symbol.node).is_reference_type ()) {
-                                       var ccall = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((Type_) base_method.symbol.parent_symbol.node).get_upper_case_cname (null)));
+                               if (req_cast && ((DataType) m.symbol.parent_symbol.node).is_reference_type ()) {
+                                       var ccall = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((DataType) base_method.symbol.parent_symbol.node).get_upper_case_cname (null)));
                                        ccall.add_argument (instance);
                                        instance = ccall;
                                }
@@ -1757,8 +1757,8 @@ namespace Vala {
                                        return;
                                }
                                
-                               if (req_cast && ((Type_) prop.symbol.parent_symbol.node).is_reference_type ()) {
-                                       var ccast = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((Type_) prop.symbol.parent_symbol.node).get_upper_case_cname (null)));
+                               if (req_cast && ((DataType) prop.symbol.parent_symbol.node).is_reference_type ()) {
+                                       var ccast = new CCodeFunctionCall (call = new CCodeIdentifier (name = ((DataType) prop.symbol.parent_symbol.node).get_upper_case_cname (null)));
                                        ccast.add_argument (instance);
                                        instance = ccast;
                                }
index e84d7f2..c4dc7d6 100644 (file)
@@ -44,8 +44,8 @@ namespace Vala {
                string cname;
                public string get_cname () {
                        if (cname == null) {
-                               if (symbol.parent_symbol.node is Type_) {
-                                       var t = (Type_) symbol.parent_symbol.node;
+                               if (symbol.parent_symbol.node is DataType) {
+                                       var t = (DataType) symbol.parent_symbol.node;
                                        cname = "%s_%s".printf (t.get_upper_case_cname (null), name);
                                } else {
                                        var ns = (Namespace) symbol.parent_symbol.node;
similarity index 76%
rename from vala/vala/valatype.vala
rename to vala/vala/valadatatype.vala
index 19271c3..cbd37a8 100644 (file)
@@ -23,9 +23,9 @@
 using GLib;
 
 namespace Vala {
-       public abstract class Type_ : CodeNode {
-               public string name { get; construct; }
-               public SourceReference source_reference { get; construct; }
+       public abstract class DataType : CodeNode {
+               public string! name { get; set construct; }
+               public SourceReference source_reference { get; set; }
                public weak Namespace @namespace;
                public MemberAccessibility access;
 
@@ -39,12 +39,19 @@ namespace Vala {
                public abstract ref string get_upper_case_cname (string infix);
                public abstract ref string get_lower_case_cname (string infix);
                
-               public List<weak string> cheader_filenames;
+               private List<string> cheader_filenames;
                public ref List<string> get_cheader_filenames () {
                        if (cheader_filenames == null) {
-                               cheader_filenames = @namespace.get_cheader_filenames ();
+                               /* default to header filenames of the namespace */
+                               foreach (string filename in @namespace.get_cheader_filenames ()) {
+                                       add_cheader_filename (filename);
+                               }
                        }
                        return cheader_filenames.copy ();
                }
+               
+               public void add_cheader_filename (string! filename) {
+                       cheader_filenames.append (filename);
+               }
        }
 }
index 1b58c49..9331d32 100644 (file)
@@ -23,7 +23,7 @@
 using GLib;
 
 namespace Vala {
-       public class Enum : Type_ {
+       public class Enum : DataType {
                List<EnumValue> values;
 
                public static ref Enum new (string name, SourceReference source) {
@@ -101,7 +101,7 @@ namespace Vala {
                                                if (lit is StringLiteral) {
                                                        var val = ((StringLiteral) lit).eval ();
                                                        foreach (string filename in val.split (",", 0)) {
-                                                               cheader_filenames.append (filename);
+                                                               add_cheader_filename (filename);
                                                        }
                                                }
                                        }
index 06801d6..e01b0b9 100644 (file)
@@ -23,7 +23,7 @@
 using GLib;
 
 namespace Vala {
-       public class Flags : Type_ {
+       public class Flags : DataType {
                List<FlagsValue> values;
 
                public static ref Flags new (string name, SourceReference source) {
index acd3bc7..0ce980f 100644 (file)
@@ -24,7 +24,7 @@ using GLib;
 
 namespace Vala {
        public class InstanceCast : CCodeFunctionCall {
-               public Type_ type_reference { get; construct; }
+               public DataType type_reference { get; construct; }
                public CCodeExpression inner { get; construct; }
                
                InstanceCast () {
index 27e8f8a..6218618 100644 (file)
@@ -23,7 +23,7 @@
 using GLib;
 
 namespace Vala {
-       public class Interface : Type_ {
+       public class Interface : DataType {
                List<string> type_parameters;
                public List<TypeReference> base_types;
 
index 66ad166..644b5c6 100644 (file)
@@ -26,7 +26,7 @@ namespace Vala {
        public class InterfaceRegisterFunction : TypeRegisterFunction {
                public Interface interface_reference { get; construct; }
                
-               public override Type_ get_type_declaration () {
+               public override DataType get_type_declaration () {
                        return interface_reference;
                }
                
index 0694aaa..b820dda 100644 (file)
@@ -24,6 +24,6 @@ using GLib;
 
 namespace Vala {
        public abstract class Literal : CodeNode {
-               public TypeReference static_type;
+               public TypeReference static_type { get; set; }
        }
 }
index f8a7a14..9d0029f 100644 (file)
@@ -82,8 +82,8 @@ namespace Vala {
                public string get_cname () {
                        if (cname == null) {
                                var parent = symbol.parent_symbol.node;
-                               if (parent is Type_) {
-                                       cname = "%s_%s".printf (((Type_) parent).get_lower_case_cname (null), name);
+                               if (parent is DataType) {
+                                       cname = "%s_%s".printf (((DataType) parent).get_lower_case_cname (null), name);
                                } else if (parent is Namespace) {
                                        cname = "%s%s".printf (((Namespace) parent).get_lower_case_cprefix (), name);
                                } else {
index 4a49214..1398470 100644 (file)
@@ -34,20 +34,20 @@ namespace Vala {
                
                TypeReference bool_type;
                TypeReference string_type;
-               Type_ initially_unowned_type;
+               DataType initially_unowned_type;
                
                public void analyze (CodeContext context) {
                        root_symbol = context.root;
 
                        bool_type = new TypeReference ();
-                       bool_type.type = (Type_) root_symbol.lookup ("bool").node;
+                       bool_type.type = (DataType) root_symbol.lookup ("bool").node;
 
                        string_type = new TypeReference ();
-                       string_type.type = (Type_) root_symbol.lookup ("string").node;
+                       string_type.type = (DataType) root_symbol.lookup ("string").node;
                        
                        var glib_ns = root_symbol.lookup ("GLib");
                        
-                       initially_unowned_type = (Type_) glib_ns.lookup ("InitiallyUnowned").node;
+                       initially_unowned_type = (DataType) glib_ns.lookup ("InitiallyUnowned").node;
 
                        current_symbol = root_symbol;
                        context.accept (this);
@@ -266,17 +266,17 @@ namespace Vala {
 
                public override void visit_character_literal (CharacterLiteral! expr) {
                        expr.static_type = new TypeReference ();
-                       expr.static_type.type = (Type_) root_symbol.lookup ("char").node;
+                       expr.static_type.type = (DataType) root_symbol.lookup ("char").node;
                }
 
                public override void visit_integer_literal (IntegerLiteral! expr) {
                        expr.static_type = new TypeReference ();
-                       expr.static_type.type = (Type_) root_symbol.lookup ("int").node;
+                       expr.static_type.type = (DataType) root_symbol.lookup ("int").node;
                }
 
                public override void visit_real_literal (IntegerLiteral! expr) {
                        expr.static_type = new TypeReference ();
-                       expr.static_type.type = (Type_) root_symbol.lookup ("double").node;
+                       expr.static_type.type = (DataType) root_symbol.lookup ("double").node;
                }
 
                public override void visit_string_literal (StringLiteral! expr) {
@@ -315,7 +315,7 @@ namespace Vala {
                                return decl.type_reference;
                        } else if (node is EnumValue) {
                                var type = new TypeReference ();
-                               type.type = (Type_) node.symbol.parent_symbol.node;
+                               type.type = (DataType) node.symbol.parent_symbol.node;
                                return type;
                        }
                        return null;
@@ -374,7 +374,7 @@ namespace Vala {
                        }
                
                        if (expr.inner.static_type == null) {
-                               if (expr.inner.symbol_reference.node is Namespace || expr.inner.symbol_reference.node is Type_) {
+                               if (expr.inner.symbol_reference.node is Namespace || expr.inner.symbol_reference.node is DataType) {
                                        expr.symbol_reference = expr.inner.symbol_reference.lookup (expr.member_name);
                                }
                        }
index aaf02c8..510c168 100644 (file)
@@ -104,18 +104,18 @@ namespace Vala {
                public int mark; // used for cycle detection, 0 = white (not yet visited), 1 = gray (currently visiting), 2 = black (already visited)
 
                public void add_symbol_dependency (Symbol sym, SourceFileDependencyType dep_type) {
-                       Type_ t;
+                       DataType t;
                        
-                       if (sym.node is Type_) {
-                               t = (Type_) sym.node;
+                       if (sym.node is DataType) {
+                               t = (DataType) sym.node;
                        } else if (sym.node is Method || sym.node is Field) {
-                               if (sym.parent_symbol.node is Type_) {
-                                       t = (Type_) sym.parent_symbol.node;
+                               if (sym.parent_symbol.node is DataType) {
+                                       t = (DataType) sym.parent_symbol.node;
                                } else {
                                        return;
                                }
                        } else if (sym.node is Property) {
-                               t = (Type_) sym.parent_symbol.node;
+                               t = (DataType) sym.parent_symbol.node;
                        } else if (sym.node is FormalParameter) {
                                var fp = (FormalParameter) sym.node;
                                t = fp.type_reference.type;
index 0a6cc2e..4db130f 100644 (file)
@@ -24,6 +24,6 @@ using GLib;
 
 namespace Vala {
        public abstract class Statement : CodeNode {
-               public SourceReference source_reference { get; construct; }
+               public SourceReference source_reference { get; set; }
        }
 }
index fb79558..4d21ba0 100644 (file)
@@ -23,7 +23,7 @@
 using GLib;
 
 namespace Vala {
-       public class Struct : Type_ {
+       public class Struct : DataType {
                List<TypeParameter> type_parameters;
                List<Constant> constants;
                List<Field> fields;
@@ -143,7 +143,7 @@ namespace Vala {
                                                if (lit is StringLiteral) {
                                                        var val = ((StringLiteral) lit).eval ();
                                                        foreach (string filename in val.split (",", 0)) {
-                                                               cheader_filenames.append (filename);
+                                                               add_cheader_filename (filename);
                                                        }
                                                }
                                        }
index 752b48c..3835bad 100644 (file)
@@ -192,7 +192,7 @@ namespace Vala {
                        
                        if (m.instance) {
                                m.this_parameter = new FormalParameter (name = "this", type_reference = new TypeReference ());
-                               m.this_parameter.type_reference.type = (Type_) m.symbol.parent_symbol.node;
+                               m.this_parameter.type_reference.type = (DataType) m.symbol.parent_symbol.node;
                                m.this_parameter.symbol = new Symbol (node = m.this_parameter);
                                current_symbol.add (m.this_parameter.name, m.this_parameter.symbol);
                        }
@@ -225,7 +225,7 @@ namespace Vala {
                        current_symbol = prop.symbol;
                        
                        prop.this_parameter = new FormalParameter (name = "this", type_reference = new TypeReference ());
-                       prop.this_parameter.type_reference.type = (Type_) prop.symbol.parent_symbol.node;
+                       prop.this_parameter.type_reference.type = (DataType) prop.symbol.parent_symbol.node;
                        prop.this_parameter.symbol = new Symbol (node = prop.this_parameter);
                        current_symbol.add (prop.this_parameter.name, prop.this_parameter.symbol);
                }
index 953ab92..3000140 100644 (file)
@@ -118,7 +118,7 @@ namespace Vala {
                                if (sym.node is TypeParameter) {
                                        type.type_parameter = (TypeParameter) sym.node;
                                } else {
-                                       type.type = (Type_) sym.node;
+                                       type.type = (DataType) sym.node;
                                }
                        } else {
                                var ns_symbol = root_symbol.lookup (type.namespace_name);
@@ -132,7 +132,7 @@ namespace Vala {
                                        Report.error (type.source_reference, "The type name `%s' does not exist in the namespace `%s'".printf (type.type_name, type.namespace_name));
                                        return;
                                }
-                               type.type = (Type_) sym.node;
+                               type.type = (DataType) sym.node;
                        }
                        
                        if (type.type != null && !type.type.is_reference_type ()) {
index fbeb8ce..8069577 100644 (file)
@@ -26,7 +26,7 @@ namespace Vala {
        public class TypeParameter : CodeNode {
                public string name { get; construct; }
                public SourceReference source_reference { get; construct; }
-               public weak Type_ type;
+               public weak DataType type;
                
                public static ref TypeParameter new (string name, SourceReference source) {
                        return (new TypeParameter (name = name, source_reference = source));
index 65ff408..eed8ec6 100644 (file)
@@ -34,7 +34,7 @@ namespace Vala {
                public bool array { get; set; }
                public bool array_own { get; set; }
                public bool non_null { get; set; }
-               public weak Type_ type;
+               public weak DataType type;
                public TypeParameter type_parameter;
                public bool floating_reference { get; set; }
 
index 63bc274..5ecfd09 100644 (file)
@@ -54,7 +54,7 @@ namespace Vala {
                        block = type_block;
                }
                
-               public abstract Type_ get_type_declaration ();
+               public abstract DataType get_type_declaration ();
                public abstract ref string get_type_struct_name ();
                public abstract ref string get_class_init_func_name ();
                public abstract ref string get_instance_struct_size ();