fix build when using non-null types
authorJuerg Billeter <j@bitron.ch>
Sun, 13 Apr 2008 19:01:07 +0000 (19:01 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 13 Apr 2008 19:01:07 +0000 (19:01 +0000)
2008-04-13  Juerg Billeter  <j@bitron.ch>

* */*.vala: fix build when using non-null types

svn path=/trunk/; revision=1212

73 files changed:
ChangeLog
ccode/valaccodeenum.vala
ccode/valaccodeenumvalue.vala
ccode/valaccodefunctioncall.vala
ccode/valaccodeifstatement.vala
ccode/valaccodereturnstatement.vala
ccode/valaccodevariabledeclarator.vala
ccode/valaccodewriter.vala
compiler/valacompiler.vala
gobject/valaccodecompiler.vala
gobject/valaccodegenerator.vala
gobject/valaccodegeneratormemberaccess.vala
gobject/valaccodegeneratorsignal.vala
gobject/valadbusmethod.vala
gobject/valadbussignal.vala
tests/classes-properties.vala
vala/valaaddressofexpression.vala
vala/valaarraycreationexpression.vala
vala/valaarraytype.vala
vala/valaassignment.vala
vala/valaattribute.vala
vala/valabaseaccess.vala
vala/valabinaryexpression.vala
vala/valablock.vala
vala/valacatchclause.vala
vala/valaclass.vala
vala/valacodecontext.vala
vala/valaconstant.vala
vala/valacreationmethod.vala
vala/valadatatype.vala
vala/valadelegate.vala
vala/valadeletestatement.vala
vala/valadestructor.vala
vala/valadostatement.vala
vala/valaenum.vala
vala/valaenumvalue.vala
vala/valaerrordomain.vala
vala/valaerrortype.vala
vala/valaexpressionstatement.vala
vala/valafield.vala
vala/valaformalparameter.vala
vala/valaforstatement.vala
vala/valaifstatement.vala
vala/valaintegerliteral.vala
vala/valainterface.vala
vala/valainvocationexpression.vala
vala/valalockstatement.vala
vala/valamemberaccess.vala
vala/valamemberinitializer.vala
vala/valamethod.vala
vala/valanamespace.vala
vala/valanullliteral.vala
vala/valaparenthesizedexpression.vala
vala/valaparser.vala
vala/valapointerindirection.vala
vala/valaproperty.vala
vala/valapropertyaccessor.vala
vala/valareferencetransferexpression.vala
vala/valareport.vala
vala/valareturnstatement.vala
vala/valasignal.vala
vala/valasourcefile.vala
vala/valasourcereference.vala
vala/valastruct.vala
vala/valaswitchlabel.vala
vala/valasymbol.vala
vala/valathrowstatement.vala
vala/valatrystatement.vala
vala/valatypesymbol.vala
vala/valaunresolvedtype.vala
vala/valavariabledeclarator.vala
vala/valawhilestatement.vala
vapigen/valagidlparser.vala

index ebef724..1146d62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-04-13  Jürg Billeter  <j@bitron.ch>
 
+       * */*.vala: fix build when using non-null types
+
+2008-04-13  Jürg Billeter  <j@bitron.ch>
+
        * vala/valacodecontext.vala, vala/valasemanticanalyzer.vala,
          gobject/valaccodegenerator.vala, compiler/valacompiler.vala:
          Add --enable-non-null-experimental commandline option
index ffe6dc3..6701d7e 100644 (file)
@@ -1,6 +1,6 @@
 /* valaccodeenum.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -34,7 +34,7 @@ public class Vala.CCodeEnum : CCodeNode {
        
        private Gee.List<CCodeEnumValue> values = new ArrayList<CCodeEnumValue> ();
        
-       public CCodeEnum (string name = null) {
+       public CCodeEnum (string? name = null) {
                this.name = name;
        }
        
index f802b5f..c1d5aed 100644 (file)
@@ -1,6 +1,6 @@
 /* valaccodeenumvalue.vala
  *
- * Copyright (C) 2007  Jürg Billeter
+ * Copyright (C) 2007-2008  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
@@ -35,11 +35,11 @@ public class Vala.CCodeEnumValue : CCodeNode {
        /**
         * The numerical representation of this enum value.
         */
-       public CCodeExpression value { get; set; }
+       public CCodeExpression? value { get; set; }
        
-       public CCodeEnumValue (string name, CCodeExpression value = null) {
-               this.value = value;
+       public CCodeEnumValue (string name, CCodeExpression? value = null) {
                this.name = name;
+               this.value = value;
        }
 
        public override void write (CCodeWriter writer) {
index bedd2d9..e5141f0 100644 (file)
@@ -30,11 +30,11 @@ public class Vala.CCodeFunctionCall : CCodeExpression {
        /**
         * The function to be called.
         */
-       public CCodeExpression call { get; set; }
+       public CCodeExpression? call { get; set; }
        
        private Gee.List<CCodeExpression> arguments = new ArrayList<CCodeExpression> ();
        
-       public CCodeFunctionCall (CCodeExpression call = null) {
+       public CCodeFunctionCall (CCodeExpression? call = null) {
                this.call = call;
        }
        
index effeb62..544db3b 100644 (file)
@@ -1,6 +1,6 @@
 /* valaccodeifstatement.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -39,9 +39,9 @@ public class Vala.CCodeIfStatement : CCodeStatement {
        /**
         * The optional statement to be evaluated if the condition doesn't hold.
         */
-       public CCodeStatement false_statement { get; set construct; }
+       public CCodeStatement? false_statement { get; set construct; }
        
-       public CCodeIfStatement (CCodeExpression cond, CCodeStatement true_stmt, CCodeStatement false_stmt = null) {
+       public CCodeIfStatement (CCodeExpression cond, CCodeStatement true_stmt, CCodeStatement? false_stmt = null) {
                condition = cond;
                true_statement = true_stmt;
                false_statement = false_stmt;
index 94fa198..15d91b6 100644 (file)
@@ -1,6 +1,6 @@
 /* valaccodereturnstatement.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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,9 +29,9 @@ public class Vala.CCodeReturnStatement : CCodeStatement {
        /**
         * The optional expression to return.
         */
-       public CCodeExpression return_expression { get; set; }
+       public CCodeExpression? return_expression { get; set; }
        
-       public CCodeReturnStatement (CCodeExpression expr = null) {
+       public CCodeReturnStatement (CCodeExpression? expr = null) {
                return_expression = expr;
        }
        
index 0443a81..fe32fbe 100644 (file)
@@ -34,15 +34,15 @@ public class Vala.CCodeVariableDeclarator : CCodeDeclarator {
        /**
         * The optional initializer expression.
         */
-       public CCodeExpression initializer { get; set; }
-       
-       public CCodeVariableDeclarator (string _name) {
-               name = _name;
+       public CCodeExpression? initializer { get; set; }
+
+       public CCodeVariableDeclarator (string name) {
+               this.name = name;
        }
-       
-       public CCodeVariableDeclarator.with_initializer (string _name, CCodeExpression init) {
-               name = _name;
-               initializer = init;
+
+       public CCodeVariableDeclarator.with_initializer (string name, CCodeExpression? initializer) {
+               this.name = name;
+               this.initializer = initializer;
        }
 
        public override void write (CCodeWriter writer) {
index 66b33ac..c011c81 100644 (file)
@@ -1,6 +1,6 @@
 /* valaccodewriter.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -107,7 +107,7 @@ public class Vala.CCodeWriter : Object {
        /**
         * Writes tabs according to the current indent level.
         */
-       public void write_indent (CCodeLineDirective line = null) {
+       public void write_indent (CCodeLineDirective? line = null) {
                if (line_directives && line != null) {
                        line.write (this);
                }
index 3252a7f..9767f24 100644 (file)
@@ -146,7 +146,7 @@ class Vala.Compiler : Object {
                context.library = library;
                context.assert = !disable_assert;
                context.checking = !disable_checking;
-               context.non_null = non_null || non_null_experimental;
+               context.non_null = non_null || non_null_experimental || true;
                context.non_null_experimental = non_null_experimental;
                Report.set_verbose_errors (verbose);
 
@@ -293,7 +293,11 @@ class Vala.Compiler : Object {
 
                if (!ccode_only) {
                        var ccompiler = new CCodeCompiler ();
-                       ccompiler.compile (context, cc_command, cc_options);
+                       if (cc_options == null) {
+                               ccompiler.compile (context, cc_command, cc_options);
+                       } else {
+                               ccompiler.compile (context, cc_command, new string[] { null });
+                       }
                }
 
                return quit ();
index b4f8a37..a604c07 100644 (file)
@@ -49,7 +49,7 @@ public class Vala.CCodeCompiler : Object {
         * @param context a code context
         */
        [NoArrayLength]
-       public void compile (CodeContext context, string cc_command, string[] cc_options) {
+       public void compile (CodeContext context, string? cc_command, string[] cc_options) {
                string pc = "pkg-config --cflags";
                if (!context.compile_only) {
                        pc += " --libs";
@@ -94,10 +94,8 @@ public class Vala.CCodeCompiler : Object {
                        cmdline += " -o " + Shell.quote (output);
                }
                cmdline += " " + pkgflags;
-               if (cc_options != null) {
-                       foreach (string cc_option in cc_options) {
-                               cmdline += " " + cc_option;
-                       }
+               foreach (string cc_option in cc_options) {
+                       cmdline += " " + cc_option;
                }
 
                /* make sure include files can be found if -d is used */
index a0d6556..081eafe 100644 (file)
@@ -1171,7 +1171,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
                list.ccodenode = clist;
        }
 
-       public VariableDeclarator get_temp_variable_declarator (DataType type, bool takes_ownership = true, CodeNode node_reference = null) {
+       public VariableDeclarator get_temp_variable_declarator (DataType type, bool takes_ownership = true, CodeNode? node_reference = null) {
                var decl = new VariableDeclarator ("_tmp%d".printf (next_temp_var_id));
                decl.type_reference = type.copy ();
                decl.type_reference.is_ref = false;
@@ -1198,7 +1198,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
                }
        }
 
-       private CCodeExpression get_dup_func_expression (DataType type, SourceReference source_reference) {
+       private CCodeExpression get_dup_func_expression (DataType type, SourceReference? source_reference) {
                if (type.data_type != null) {
                        string dup_function;
                        if (type.data_type.is_reference_counting ()) {
@@ -3239,7 +3239,7 @@ public class Vala.CCodeGenerator : CodeGenerator {
                return result;
        }
 
-       public CCodeExpression get_implicit_cast_expression (CCodeExpression cexpr, DataType expression_type, DataType target_type) {
+       public CCodeExpression get_implicit_cast_expression (CCodeExpression cexpr, DataType? expression_type, DataType target_type) {
                if (null == expression_type) {
                        return cexpr;
                }
index f5918b4..c74c3f9 100644 (file)
@@ -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, DataType? base_type) {
                if (expr.symbol_reference is Method) {
                        var m = (Method) expr.symbol_reference;
                        
index 806b8c2..e674400 100644 (file)
@@ -36,7 +36,7 @@ public class Vala.CCodeGenerator {
                }
        }
        
-       public string get_signal_marshaller_function (Signal sig, string prefix = null) {
+       public string get_signal_marshaller_function (Signal sig, string? prefix = null) {
                var signature = get_signal_signature (sig);
                string ret;
                var params = sig.get_parameters ();
index 4aaa596..57a3305 100644 (file)
@@ -27,7 +27,7 @@ using Gee;
  * Represents a dynamic bound DBus method.
  */
 public class Vala.DBusMethod : Method {
-       public DBusMethod (string name, DataType return_type, SourceReference source_reference = null) {
+       public DBusMethod (string name, DataType return_type, SourceReference? source_reference = null) {
                this.return_type = return_type;
                this.source_reference = source_reference;
                this.name = name;
index f736575..7fdb546 100644 (file)
@@ -26,7 +26,7 @@ using GLib;
  * Represents a dynamic bound DBus signal.
  */
 public class Vala.DBusSignal : Signal {
-       public DBusSignal (string name, DataType return_type, SourceReference source_reference = null) {
+       public DBusSignal (string name, DataType return_type, SourceReference? source_reference = null) {
                this.return_type = return_type;
                this.source_reference = source_reference;
                this.name = name;
index edbbadc..94d6216 100644 (file)
@@ -15,7 +15,8 @@ public class Sample : Object {
                get { return _read_only; }
        }
 
-       public Sample(construct string! name) {
+       public Sample (string name) {
+               this.name = name;
        }
 
        construct {
index f556445..a71a1e1 100644 (file)
@@ -47,7 +47,7 @@ public class Vala.AddressofExpression : Expression {
         * @param inner variable whose address is to be computed
         * @return      newly created address-of expression
         */
-       public AddressofExpression (Expression inner, SourceReference source_reference = null) {
+       public AddressofExpression (Expression inner, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.inner = inner;
        }
index ec8dc95..1dd8b5a 100644 (file)
@@ -1,6 +1,6 @@
 /* valaarraycreationexpression.vala
  *
- * Copyright (C) 2006-2007  Raffaele Sandrini, Jürg Billeter
+ * Copyright (C) 2006-2008  Raffaele Sandrini, 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
@@ -52,7 +52,7 @@ public class Vala.ArrayCreationExpression : Expression {
        /**
         * The root array initializer list.
         */
-       public InitializerList initializer_list { get; set construct; }
+       public InitializerList? initializer_list { get; set construct; }
 
        private DataType _element_type;
 
@@ -70,11 +70,11 @@ public class Vala.ArrayCreationExpression : Expression {
                return new ReadOnlyList<Expression> (sizes);
        }
        
-       public ArrayCreationExpression (DataType element_type, int rank, InitializerList initializer_list, SourceReference source_reference) {
+       public ArrayCreationExpression (DataType element_type, int rank, InitializerList? initializer_list, SourceReference source_reference) {
+               this.element_type = element_type;
                this.rank = rank;
                this.initializer_list = initializer_list;
                this.source_reference = source_reference;
-               this.element_type = element_type;
        }
 
        public override void accept_children (CodeVisitor visitor) {
index dbe07d5..b8e745f 100644 (file)
@@ -40,7 +40,7 @@ public class Vala.ArrayType : ReferenceType {
        private ArrayResizeMethod resize_method;
        private ArrayMoveMethod move_method;
 
-       public ArrayType (DataType element_type, int rank, SourceReference source_reference) {
+       public ArrayType (DataType element_type, int rank, SourceReference? source_reference) {
                this.element_type = element_type;
                this.rank = rank;
                this.source_reference = source_reference;
index 426ebea..a20bca9 100644 (file)
@@ -67,7 +67,7 @@ public class Vala.Assignment : Expression {
         * @param source_reference reference to source code
         * @return                 newly created assignment
         */
-       public Assignment (Expression left, Expression right, AssignmentOperator operator = AssignmentOperator.SIMPLE, SourceReference source_reference = null) {
+       public Assignment (Expression left, Expression right, AssignmentOperator operator = AssignmentOperator.SIMPLE, SourceReference? source_reference = null) {
                this.right = right;
                this.operator = operator;
                this.source_reference = source_reference;
index 7c01c28..993bcec 100644 (file)
@@ -44,9 +44,9 @@ public class Vala.Attribute : CodeNode {
         * @param source_reference reference to source code
         * @return                 newly created attribute
         */
-       public Attribute (string name, SourceReference source_reference) {
-               this.source_reference = source_reference;
+       public Attribute (string name, SourceReference? source_reference) {
                this.name = name;
+               this.source_reference = source_reference;
        }
 
        /**
index b65d928..62bbbc4 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.BaseAccess : Expression {
         * @param source reference to source code
         * @return       newly created base access expression
         */
-       public BaseAccess (SourceReference source = null) {
+       public BaseAccess (SourceReference? source = null) {
                source_reference = source;
        }
        
index 53422c1..7f43d21 100644 (file)
@@ -71,7 +71,7 @@ public class Vala.BinaryExpression : Expression {
         * @param source reference to source code
         * @return       newly created binary expression
         */
-       public BinaryExpression (BinaryOperator op, Expression _left, Expression _right, SourceReference source = null) {
+       public BinaryExpression (BinaryOperator op, Expression _left, Expression _right, SourceReference? source = null) {
                operator = op;
                left = _left;
                right = _right;
index 9208ff7..20807f7 100644 (file)
@@ -41,7 +41,7 @@ public class Vala.Block : Symbol, Statement {
         *
         * @param source reference to source code
         */
-       public Block (SourceReference source_reference = null) {
+       public Block (SourceReference? source_reference = null) {
                this.source_reference = source_reference;
        }
        
index 269ba88..fbaf646 100644 (file)
@@ -65,7 +65,7 @@ public class Vala.CatchClause : CodeNode {
         * @param source_reference reference to source code
         * @return                 newly created catch clause
         */
-       public CatchClause (DataType? type_reference, string variable_name, Block body, SourceReference source_reference = null) {
+       public CatchClause (DataType? type_reference, string variable_name, Block body, SourceReference? source_reference = null) {
                this.type_reference = type_reference;
                this.variable_name = variable_name;
                this.body = body;
index d7ab5a3..5b39843 100644 (file)
@@ -111,7 +111,7 @@ public class Vala.Class : Typesymbol {
         * @param source reference to source code
         * @return       newly created class
         */
-       public Class (string name, SourceReference source_reference = null) {
+       public Class (string name, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.name = name;
        }
@@ -456,7 +456,7 @@ public class Vala.Class : Typesymbol {
                return lower_case_csuffix;
        }
 
-       public override string get_lower_case_cname (string infix) {
+       public override string? get_lower_case_cname (string? infix) {
                if (infix == null) {
                        infix = "";
                }
@@ -470,7 +470,7 @@ public class Vala.Class : Typesymbol {
                return lower_case_cprefix;
        }
        
-       public override string get_upper_case_cname (string infix) {
+       public override string get_upper_case_cname (string? infix) {
                return get_lower_case_cname (infix).up ();
        }
 
index 0bb8f2a..f554638 100644 (file)
@@ -409,49 +409,49 @@ public class Vala.CodeContext : Object {
                return null;
        }
 
-       public Namespace create_namespace (string name, SourceReference source_reference = null) {
+       public Namespace create_namespace (string name, SourceReference? source_reference = null) {
                var node = new Namespace (name, source_reference);
                node.code_binding = codegen.create_namespace_binding (node);
                return node;
        }
 
-       public Class create_class (string name, SourceReference source_reference = null) {
+       public Class create_class (string name, SourceReference? source_reference = null) {
                var node = new Class (name, source_reference);
                node.code_binding = codegen.create_class_binding (node);
                return node;
        }
 
-       public Struct create_struct (string name, SourceReference source_reference = null) {
+       public Struct create_struct (string name, SourceReference? source_reference = null) {
                var node = new Struct (name, source_reference);
                node.code_binding = codegen.create_struct_binding (node);
                return node;
        }
 
-       public Interface create_interface (string name, SourceReference source_reference = null) {
+       public Interface create_interface (string name, SourceReference? source_reference = null) {
                var node = new Interface (name, source_reference);
                node.code_binding = codegen.create_interface_binding (node);
                return node;
        }
 
-       public Enum create_enum (string name, SourceReference source_reference = null) {
+       public Enum create_enum (string name, SourceReference? source_reference = null) {
                var node = new Enum (name, source_reference);
                node.code_binding = codegen.create_enum_binding (node);
                return node;
        }
 
-       public EnumValue create_enum_value (string name, SourceReference source_reference = null) {
+       public EnumValue create_enum_value (string name, SourceReference? source_reference = null) {
                var node = new EnumValue (name, source_reference);
                node.code_binding = codegen.create_enum_value_binding (node);
                return node;
        }
 
-       public EnumValue create_enum_value_with_value (string name, Expression value, SourceReference source_reference = null) {
+       public EnumValue create_enum_value_with_value (string name, Expression? value, SourceReference? source_reference = null) {
                var node = new EnumValue.with_value (name, value, source_reference);
                node.code_binding = codegen.create_enum_value_binding (node);
                return node;
        }
 
-       public ErrorDomain create_error_domain (string name, SourceReference source_reference = null) {
+       public ErrorDomain create_error_domain (string name, SourceReference? source_reference = null) {
                var node = new ErrorDomain (name, source_reference);
                node.code_binding = codegen.create_error_domain_binding (node);
                return node;
@@ -463,409 +463,409 @@ public class Vala.CodeContext : Object {
                return node;
        }
 
-       public ErrorCode create_error_code_with_value (string name, Expression value) {
+       public ErrorCode create_error_code_with_value (string name, Expression? value) {
                var node = new ErrorCode.with_value (name, value);
                node.code_binding = codegen.create_error_code_binding (node);
                return node;
        }
 
-       public Delegate create_delegate (string name, DataType return_type, SourceReference source_reference = null) {
+       public Delegate create_delegate (string? name, DataType return_type, SourceReference? source_reference = null) {
                var node = new Delegate (name, return_type, source_reference);
                node.code_binding = codegen.create_delegate_binding (node);
                return node;
        }
 
-       public Constant create_constant (string name, DataType type_reference, Expression initializer, SourceReference source_reference) {
+       public Constant create_constant (string name, DataType type_reference, Expression? initializer, SourceReference? source_reference) {
                var node = new Constant (name, type_reference, initializer, source_reference);
                node.code_binding = codegen.create_constant_binding (node);
                return node;
        }
 
-       public Field create_field (string name, DataType type_reference, Expression initializer, SourceReference source_reference = null) {
+       public Field create_field (string name, DataType type_reference, Expression? initializer, SourceReference? source_reference = null) {
                var node = new Field (name, type_reference, initializer, source_reference);
                node.code_binding = codegen.create_field_binding (node);
                return node;
        }
 
-       public Method create_method (string name, DataType return_type, SourceReference source_reference = null) {
+       public Method create_method (string name, DataType return_type, SourceReference? source_reference = null) {
                var node = new Method (name, return_type, source_reference);
                node.code_binding = codegen.create_method_binding (node);
                return node;
        }
 
-       public CreationMethod create_creation_method (string type_name, string name, SourceReference source_reference = null) {
+       public CreationMethod create_creation_method (string type_name, string? name, SourceReference? source_reference = null) {
                var node = new CreationMethod (type_name, name, source_reference);
                node.code_binding = codegen.create_creation_method_binding (node);
                return node;
        }
 
-       public FormalParameter create_formal_parameter (string name, DataType type_reference, SourceReference source_reference = null) {
+       public FormalParameter create_formal_parameter (string name, DataType type_reference, SourceReference? source_reference = null) {
                var node = new FormalParameter (name, type_reference, source_reference);
                node.code_binding = codegen.create_formal_parameter_binding (node);
                return node;
        }
 
-       public FormalParameter create_formal_parameter_with_ellipsis (SourceReference source_reference = null) {
+       public FormalParameter create_formal_parameter_with_ellipsis (SourceReference? source_reference = null) {
                var node = new FormalParameter.with_ellipsis (source_reference);
                node.code_binding = codegen.create_formal_parameter_binding (node);
                return node;
        }
 
-       public Property create_property (string name, DataType type_reference, PropertyAccessor get_accessor, PropertyAccessor set_accessor, SourceReference source_reference) {
+       public Property create_property (string name, DataType type_reference, PropertyAccessor? get_accessor, PropertyAccessor? set_accessor, SourceReference? source_reference) {
                var node = new Property (name, type_reference, get_accessor, set_accessor, source_reference);
                node.code_binding = codegen.create_property_binding (node);
                return node;
        }
 
-       public PropertyAccessor create_property_accessor (bool readable, bool writable, bool construction, Block body, SourceReference source_reference) {
+       public PropertyAccessor create_property_accessor (bool readable, bool writable, bool construction, Block? body, SourceReference? source_reference) {
                var node = new PropertyAccessor (readable, writable, construction, body, source_reference);
                node.code_binding = codegen.create_property_accessor_binding (node);
                return node;
        }
 
-       public Signal create_signal (string name, DataType return_type, SourceReference source_reference = null) {
+       public Signal create_signal (string name, DataType return_type, SourceReference? source_reference = null) {
                var node = new Signal (name, return_type, source_reference);
                node.code_binding = codegen.create_signal_binding (node);
                return node;
        }
 
-       public Constructor create_constructor (SourceReference source_reference) {
+       public Constructor create_constructor (SourceReference? source_reference) {
                var node = new Constructor (source_reference);
                node.code_binding = codegen.create_constructor_binding (node);
                return node;
        }
 
-       public Destructor create_destructor (SourceReference source_reference = null) {
+       public Destructor create_destructor (SourceReference? source_reference = null) {
                var node = new Destructor (source_reference);
                node.code_binding = codegen.create_destructor_binding (node);
                return node;
        }
 
-       public TypeParameter create_type_parameter (string name, SourceReference source_reference) {
+       public TypeParameter create_type_parameter (string name, SourceReference? source_reference) {
                var node = new TypeParameter (name, source_reference);
                node.code_binding = codegen.create_type_parameter_binding (node);
                return node;
        }
 
-       public Block create_block (SourceReference source_reference = null) {
+       public Block create_block (SourceReference? source_reference = null) {
                var node = new Block (source_reference);
                node.code_binding = codegen.create_block_binding (node);
                return node;
        }
 
-       public EmptyStatement create_empty_statement (SourceReference source_reference = null) {
+       public EmptyStatement create_empty_statement (SourceReference? source_reference = null) {
                var node = new EmptyStatement (source_reference);
                node.code_binding = codegen.create_empty_statement_binding (node);
                return node;
        }
 
-       public DeclarationStatement create_declaration_statement (LocalVariableDeclaration declaration, SourceReference source_reference) {
+       public DeclarationStatement create_declaration_statement (LocalVariableDeclaration declaration, SourceReference? source_reference) {
                var node = new DeclarationStatement (declaration, source_reference);
                node.code_binding = codegen.create_declaration_statement_binding (node);
                return node;
        }
 
-       public LocalVariableDeclaration create_local_variable_declaration (DataType type_reference, SourceReference source_reference) {
+       public LocalVariableDeclaration create_local_variable_declaration (DataType type_reference, SourceReference? source_reference) {
                var node = new LocalVariableDeclaration (type_reference, source_reference);
                node.code_binding = codegen.create_local_variable_declaration_binding (node);
                return node;
        }
 
-       public LocalVariableDeclaration create_local_variable_declaration_var_type (SourceReference source_reference) {
+       public LocalVariableDeclaration create_local_variable_declaration_var_type (SourceReference? source_reference) {
                var node = new LocalVariableDeclaration.var_type (source_reference);
                node.code_binding = codegen.create_local_variable_declaration_binding (node);
                return node;
        }
 
-       public VariableDeclarator create_variable_declarator (string name, Expression initializer = null, SourceReference source_reference = null) {
+       public VariableDeclarator create_variable_declarator (string name, Expression? initializer = null, SourceReference? source_reference = null) {
                var node = new VariableDeclarator (name, initializer, source_reference);
                node.code_binding = codegen.create_variable_declarator_binding (node);
                return node;
        }
 
-       public InitializerList create_initializer_list (SourceReference source_reference) {
+       public InitializerList create_initializer_list (SourceReference? source_reference) {
                var node = new InitializerList (source_reference);
                node.code_binding = codegen.create_initializer_list_binding (node);
                return node;
        }
 
-       public ExpressionStatement create_expression_statement (Expression expression, SourceReference source_reference = null) {
+       public ExpressionStatement create_expression_statement (Expression expression, SourceReference? source_reference = null) {
                var node = new ExpressionStatement (expression, source_reference);
                node.code_binding = codegen.create_expression_statement_binding (node);
                return node;
        }
 
-       public IfStatement create_if_statement (Expression condition, Block true_statement, Block false_statement, SourceReference source_reference) {
+       public IfStatement create_if_statement (Expression condition, Block true_statement, Block? false_statement, SourceReference? source_reference) {
                var node = new IfStatement (condition, true_statement, false_statement, source_reference);
                node.code_binding = codegen.create_if_statement_binding (node);
                return node;
        }
 
-       public SwitchStatement create_switch_statement (Expression expression, SourceReference source_reference) {
+       public SwitchStatement create_switch_statement (Expression expression, SourceReference? source_reference) {
                var node = new SwitchStatement (expression, source_reference);
                node.code_binding = codegen.create_switch_statement_binding (node);
                return node;
        }
 
-       public SwitchSection create_switch_section (SourceReference source_reference) {
+       public SwitchSection create_switch_section (SourceReference? source_reference) {
                var node = new SwitchSection (source_reference);
                node.code_binding = codegen.create_switch_section_binding (node);
                return node;
        }
 
-       public SwitchLabel create_switch_label (Expression expression, SourceReference source_reference = null) {
+       public SwitchLabel create_switch_label (Expression expression, SourceReference? source_reference = null) {
                var node = new SwitchLabel (expression, source_reference);
                node.code_binding = codegen.create_switch_label_binding (node);
                return node;
        }
 
-       public SwitchLabel create_switch_label_with_default (SourceReference source_reference = null) {
+       public SwitchLabel create_switch_label_with_default (SourceReference? source_reference = null) {
                var node = new SwitchLabel.with_default (source_reference);
                node.code_binding = codegen.create_switch_label_binding (node);
                return node;
        }
 
-       public WhileStatement create_while_statement (Expression condition, Block body, SourceReference source_reference = null) {
+       public WhileStatement create_while_statement (Expression condition, Block body, SourceReference? source_reference = null) {
                var node = new WhileStatement (condition, body, source_reference);
                node.code_binding = codegen.create_while_statement_binding (node);
                return node;
        }
 
-       public DoStatement create_do_statement (Block body, Expression condition, SourceReference source_reference = null) {
+       public DoStatement create_do_statement (Block body, Expression condition, SourceReference? source_reference = null) {
                var node = new DoStatement (body, condition, source_reference);
                node.code_binding = codegen.create_do_statement_binding (node);
                return node;
        }
 
-       public ForStatement create_for_statement (Expression condition, Block body, SourceReference source_reference = null) {
+       public ForStatement create_for_statement (Expression condition, Block body, SourceReference? source_reference = null) {
                var node = new ForStatement (condition, body, source_reference);
                node.code_binding = codegen.create_for_statement_binding (node);
                return node;
        }
 
-       public ForeachStatement create_foreach_statement (DataType type_reference, string variable_name, Expression collection, Block body, SourceReference source_reference) {
+       public ForeachStatement create_foreach_statement (DataType type_reference, string variable_name, Expression collection, Block body, SourceReference? source_reference) {
                var node = new ForeachStatement (type_reference, variable_name, collection, body, source_reference);
                node.code_binding = codegen.create_foreach_statement_binding (node);
                return node;
        }
 
-       public BreakStatement create_break_statement (SourceReference source_reference) {
+       public BreakStatement create_break_statement (SourceReference? source_reference) {
                var node = new BreakStatement (source_reference);
                node.code_binding = codegen.create_break_statement_binding (node);
                return node;
        }
 
-       public ContinueStatement create_continue_statement (SourceReference source_reference) {
+       public ContinueStatement create_continue_statement (SourceReference? source_reference) {
                var node = new ContinueStatement (source_reference);
                node.code_binding = codegen.create_continue_statement_binding (node);
                return node;
        }
 
-       public ReturnStatement create_return_statement (Expression return_expression = null, SourceReference source_reference = null) {
+       public ReturnStatement create_return_statement (Expression? return_expression = null, SourceReference? source_reference = null) {
                var node = new ReturnStatement (return_expression, source_reference);
                node.code_binding = codegen.create_return_statement_binding (node);
                return node;
        }
 
-       public ThrowStatement create_throw_statement (Expression error_expression, SourceReference source_reference = null) {
+       public ThrowStatement create_throw_statement (Expression error_expression, SourceReference? source_reference = null) {
                var node = new ThrowStatement (error_expression, source_reference);
                node.code_binding = codegen.create_throw_statement_binding (node);
                return node;
        }
 
-       public TryStatement create_try_statement (Block body, Block finally_body, SourceReference source_reference = null) {
+       public TryStatement create_try_statement (Block body, Block? finally_body, SourceReference? source_reference = null) {
                var node = new TryStatement (body, finally_body, source_reference);
                node.code_binding = codegen.create_try_statement_binding (node);
                return node;
        }
 
-       public CatchClause create_catch_clause (DataType type_reference, string variable_name, Block body, SourceReference source_reference = null) {
+       public CatchClause create_catch_clause (DataType type_reference, string variable_name, Block body, SourceReference? source_reference = null) {
                var node = new CatchClause (type_reference, variable_name, body, source_reference);
                node.code_binding = codegen.create_catch_clause_binding (node);
                return node;
        }
 
-       public LockStatement create_lock_statement (Expression resource, Block body, SourceReference source_reference = null) {
+       public LockStatement create_lock_statement (Expression resource, Block body, SourceReference? source_reference = null) {
                var node = new LockStatement (resource, body, source_reference);
                node.code_binding = codegen.create_lock_statement_binding (node);
                return node;
        }
 
-       public DeleteStatement create_delete_statement (Expression expression, SourceReference source_reference = null) {
+       public DeleteStatement create_delete_statement (Expression expression, SourceReference? source_reference = null) {
                var node = new DeleteStatement (expression, source_reference);
                node.code_binding = codegen.create_delete_statement_binding (node);
                return node;
        }
 
-       public ArrayCreationExpression create_array_creation_expression (DataType element_type, int rank, InitializerList initializer_list, SourceReference source_reference) {
+       public ArrayCreationExpression create_array_creation_expression (DataType element_type, int rank, InitializerList? initializer_list, SourceReference? source_reference) {
                var node = new ArrayCreationExpression (element_type, rank, initializer_list, source_reference);
                node.code_binding = codegen.create_array_creation_expression_binding (node);
                return node;
        }
 
-       public BooleanLiteral create_boolean_literal (bool value, SourceReference source_reference) {
+       public BooleanLiteral create_boolean_literal (bool value, SourceReference? source_reference) {
                var node = new BooleanLiteral (value, source_reference);
                node.code_binding = codegen.create_boolean_literal_binding (node);
                return node;
        }
 
-       public CharacterLiteral create_character_literal (string value, SourceReference source_reference) {
+       public CharacterLiteral create_character_literal (string value, SourceReference? source_reference) {
                var node = new CharacterLiteral (value, source_reference);
                node.code_binding = codegen.create_character_literal_binding (node);
                return node;
        }
 
-       public IntegerLiteral create_integer_literal (string value, SourceReference source_reference = null) {
+       public IntegerLiteral create_integer_literal (string value, SourceReference? source_reference = null) {
                var node = new IntegerLiteral (value, source_reference);
                node.code_binding = codegen.create_integer_literal_binding (node);
                return node;
        }
 
-       public RealLiteral create_real_literal (string value, SourceReference source_reference) {
+       public RealLiteral create_real_literal (string value, SourceReference? source_reference) {
                var node = new RealLiteral (value, source_reference);
                node.code_binding = codegen.create_real_literal_binding (node);
                return node;
        }
 
-       public StringLiteral create_string_literal (string value, SourceReference source_reference) {
+       public StringLiteral create_string_literal (string value, SourceReference? source_reference) {
                var node = new StringLiteral (value, source_reference);
                node.code_binding = codegen.create_string_literal_binding (node);
                return node;
        }
 
-       public NullLiteral create_null_literal (SourceReference source_reference = null) {
+       public NullLiteral create_null_literal (SourceReference? source_reference = null) {
                var node = new NullLiteral (source_reference);
                node.code_binding = codegen.create_null_literal_binding (node);
                return node;
        }
 
-       public ParenthesizedExpression create_parenthesized_expression (Expression inner, SourceReference source_reference) {
+       public ParenthesizedExpression create_parenthesized_expression (Expression inner, SourceReference? source_reference) {
                var node = new ParenthesizedExpression (inner, source_reference);
                node.code_binding = codegen.create_parenthesized_expression_binding (node);
                return node;
        }
 
-       public MemberAccess create_member_access (Expression inner, string member_name, SourceReference source_reference = null) {
+       public MemberAccess create_member_access (Expression? inner, string member_name, SourceReference? source_reference = null) {
                var node = new MemberAccess (inner, member_name, source_reference);
                node.code_binding = codegen.create_member_access_binding (node);
                return node;
        }
 
-       public MemberAccess create_member_access_simple (string member_name, SourceReference source_reference = null) {
+       public MemberAccess create_member_access_simple (string member_name, SourceReference? source_reference = null) {
                var node = new MemberAccess.simple (member_name, source_reference);
                node.code_binding = codegen.create_member_access_binding (node);
                return node;
        }
 
-       public MemberAccess create_member_access_pointer (Expression inner, string member_name, SourceReference source_reference = null) {
+       public MemberAccess create_member_access_pointer (Expression inner, string member_name, SourceReference? source_reference = null) {
                var node = new MemberAccess.pointer (inner, member_name, source_reference);
                node.code_binding = codegen.create_member_access_binding (node);
                return node;
        }
 
-       public InvocationExpression create_invocation_expression (Expression call, SourceReference source_reference = null) {
+       public InvocationExpression create_invocation_expression (Expression call, SourceReference? source_reference = null) {
                var node = new InvocationExpression (call, source_reference);
                node.code_binding = codegen.create_invocation_expression_binding (node);
                return node;
        }
        
-       public ElementAccess create_element_access (Expression container, SourceReference source_reference) {
+       public ElementAccess create_element_access (Expression container, SourceReference? source_reference) {
                var node = new ElementAccess (container, source_reference);
                node.code_binding = codegen.create_element_access_binding (node);
                return node;
        }
 
-       public BaseAccess create_base_access (SourceReference source_reference = null) {
+       public BaseAccess create_base_access (SourceReference? source_reference = null) {
                var node = new BaseAccess (source_reference);
                node.code_binding = codegen.create_base_access_binding (node);
                return node;
        }
 
-       public PostfixExpression create_postfix_expression (Expression inner, bool increment, SourceReference source_reference) {
+       public PostfixExpression create_postfix_expression (Expression inner, bool increment, SourceReference? source_reference) {
                var node = new PostfixExpression (inner, increment, source_reference);
                node.code_binding = codegen.create_postfix_expression_binding (node);
                return node;
        }
 
-       public ObjectCreationExpression create_object_creation_expression (MemberAccess member_name, SourceReference source_reference) {
+       public ObjectCreationExpression create_object_creation_expression (MemberAccess member_name, SourceReference? source_reference) {
                var node = new ObjectCreationExpression (member_name, source_reference);
                node.code_binding = codegen.create_object_creation_expression_binding (node);
                return node;
        }
 
-       public SizeofExpression create_sizeof_expression (DataType type_reference, SourceReference source_reference) {
+       public SizeofExpression create_sizeof_expression (DataType type_reference, SourceReference? source_reference) {
                var node = new SizeofExpression (type_reference, source_reference);
                node.code_binding = codegen.create_sizeof_expression_binding (node);
                return node;
        }
 
-       public TypeofExpression create_typeof_expression (DataType type_reference, SourceReference source_reference) {
+       public TypeofExpression create_typeof_expression (DataType type_reference, SourceReference? source_reference) {
                var node = new TypeofExpression (type_reference, source_reference);
                node.code_binding = codegen.create_typeof_expression_binding (node);
                return node;
        }
 
-       public UnaryExpression create_unary_expression (UnaryOperator operator, Expression inner, SourceReference source_reference) {
+       public UnaryExpression create_unary_expression (UnaryOperator operator, Expression inner, SourceReference? source_reference) {
                var node = new UnaryExpression (operator, inner, source_reference);
                node.code_binding = codegen.create_unary_expression_binding (node);
                return node;
        }
 
-       public CastExpression create_cast_expression (Expression inner, DataType type_reference, SourceReference source_reference, bool is_silent_cast) {
+       public CastExpression create_cast_expression (Expression inner, DataType type_reference, SourceReference? source_reference, bool is_silent_cast) {
                var node = new CastExpression (inner, type_reference, source_reference, is_silent_cast);
                node.code_binding = codegen.create_cast_expression_binding (node);
                return node;
        }
 
-       public PointerIndirection create_pointer_indirection (Expression inner, SourceReference source_reference = null) {
+       public PointerIndirection create_pointer_indirection (Expression inner, SourceReference? source_reference = null) {
                var node = new PointerIndirection (inner, source_reference);
                node.code_binding = codegen.create_pointer_indirection_binding (node);
                return node;
        }
 
-       public AddressofExpression create_addressof_expression (Expression inner, SourceReference source_reference = null) {
+       public AddressofExpression create_addressof_expression (Expression inner, SourceReference? source_reference = null) {
                var node = new AddressofExpression (inner, source_reference);
                node.code_binding = codegen.create_addressof_expression_binding (node);
                return node;
        }
 
-       public ReferenceTransferExpression create_reference_transfer_expression (Expression inner, SourceReference source_reference = null) {
+       public ReferenceTransferExpression create_reference_transfer_expression (Expression inner, SourceReference? source_reference = null) {
                var node = new ReferenceTransferExpression (inner, source_reference);
                node.code_binding = codegen.create_reference_transfer_expression_binding (node);
                return node;
        }
 
-       public BinaryExpression create_binary_expression (BinaryOperator operator, Expression left, Expression right, SourceReference source_reference = null) {
+       public BinaryExpression create_binary_expression (BinaryOperator operator, Expression left, Expression right, SourceReference? source_reference = null) {
                var node = new BinaryExpression (operator, left, right, source_reference);
                node.code_binding = codegen.create_binary_expression_binding (node);
                return node;
        }
 
-       public TypeCheck create_type_check (Expression expression, DataType type_reference, SourceReference source_reference) {
+       public TypeCheck create_type_check (Expression expression, DataType type_reference, SourceReference? source_reference) {
                var node = new TypeCheck (expression, type_reference, source_reference);
                node.code_binding = codegen.create_type_check_binding (node);
                return node;
        }
 
-       public ConditionalExpression create_conditional_expression (Expression condition, Expression true_expression, Expression false_expression, SourceReference source_reference) {
+       public ConditionalExpression create_conditional_expression (Expression condition, Expression true_expression, Expression false_expression, SourceReference? source_reference) {
                var node = new ConditionalExpression (condition, true_expression, false_expression, source_reference);
                node.code_binding = codegen.create_conditional_expression_binding (node);
                return node;
        }
 
-       public LambdaExpression create_lambda_expression (Expression expression_body, SourceReference source_reference) {
+       public LambdaExpression create_lambda_expression (Expression expression_body, SourceReference? source_reference) {
                var node = new LambdaExpression (expression_body, source_reference);
                node.code_binding = codegen.create_lambda_expression_binding (node);
                return node;
        }
 
-       public LambdaExpression create_lambda_expression_with_statement_body (Block statement_body, SourceReference source_reference) {
+       public LambdaExpression create_lambda_expression_with_statement_body (Block statement_body, SourceReference? source_reference) {
                var node = new LambdaExpression.with_statement_body (statement_body, source_reference);
                node.code_binding = codegen.create_lambda_expression_binding (node);
                return node;
        }
 
-       public Assignment create_assignment (Expression left, Expression right, AssignmentOperator operator = AssignmentOperator.SIMPLE, SourceReference source_reference = null) {
+       public Assignment create_assignment (Expression left, Expression right, AssignmentOperator operator = AssignmentOperator.SIMPLE, SourceReference? source_reference = null) {
                var node = new Assignment (left, right, operator, source_reference);
                node.code_binding = codegen.create_assignment_binding (node);
                return node;
index 3888ddf..f4fceb3 100644 (file)
@@ -1,6 +1,6 @@
 /* valaconstant.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -57,11 +57,11 @@ public class Vala.Constant : Member, Lockable {
         * @param source_reference reference to source code
         * @return                 newly created constant
         */
-       public Constant (string name, DataType type_reference, Expression initializer, SourceReference source_reference) {
+       public Constant (string name, DataType type_reference, Expression? initializer, SourceReference? source_reference) {
+               this.name = name;
                this.type_reference = type_reference;
                this.initializer = initializer;
                this.source_reference = source_reference;
-               this.name = name;
        }
 
        public override void accept (CodeVisitor visitor) {
index cf020c6..0afd4a4 100644 (file)
@@ -44,7 +44,7 @@ public class Vala.CreationMethod : Method {
         * @param source_reference reference to source code
         * @return                 newly created method
         */
-       public CreationMethod (string type_name, string name, SourceReference source_reference = null) {
+       public CreationMethod (string? type_name, string? name, SourceReference? source_reference = null) {
                this.name = name;
                this.source_reference = source_reference;
                this.type_name = type_name;
index 7e301eb..4b4ddec 100644 (file)
@@ -183,7 +183,7 @@ public abstract class Vala.DataType : CodeNode {
         *              name or null
         * @return      the lower case name to be used in C code
         */
-       public virtual string get_lower_case_cname (string infix = null) {
+       public virtual string? get_lower_case_cname (string? infix = null) {
                return data_type.get_lower_case_cname (infix);
        }
 
index 4cee764..5316fad 100644 (file)
@@ -94,10 +94,10 @@ public class Vala.Delegate : Typesymbol {
         * @param source      reference to source code
         * @return            newly created delegate
         */
-       public Delegate (string name, DataType return_type, SourceReference source_reference = null) {
+       public Delegate (string? name, DataType return_type, SourceReference? source_reference = null) {
+               this.name = name;
                this.return_type = return_type;
                this.source_reference = source_reference;
-               this.name = name;
        }
 
        construct {
index 40b21e3..84097de 100644 (file)
@@ -31,7 +31,7 @@ public class Vala.DeleteStatement : CodeNode, Statement {
         */
        public Expression expression { get; set; }
 
-       public DeleteStatement (Expression expression, SourceReference source_reference = null) {
+       public DeleteStatement (Expression expression, SourceReference? source_reference = null) {
                this.expression = expression;
                this.source_reference = source_reference;
        }
index 13dc25c..9074215 100644 (file)
@@ -47,7 +47,7 @@ public class Vala.Destructor : Symbol {
         * @param source_reference reference to source code
         * @return                 newly created destructor
         */
-       public Destructor (SourceReference source_reference = null) {
+       public Destructor (SourceReference? source_reference = null) {
                this.source_reference = source_reference;
        }
 
index b4ea716..94b9326 100644 (file)
@@ -63,7 +63,7 @@ public class Vala.DoStatement : CodeNode, Statement {
         * @param source reference to source code
         * @return       newly created do statement
         */
-       public DoStatement (Block body, Expression condition, SourceReference source_reference = null) {
+       public DoStatement (Block body, Expression condition, SourceReference? source_reference = null) {
                this.condition = condition;
                this.source_reference = source_reference;
                this.body = body;
index 3993721..9230477 100644 (file)
@@ -52,7 +52,7 @@ public class Vala.Enum : Typesymbol {
         * @param source_reference reference to source code
         * @return                 newly created enum
         */
-       public Enum (string name, SourceReference source_reference = null) {
+       public Enum (string name, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.name = name;
        }
@@ -141,14 +141,14 @@ public class Vala.Enum : Typesymbol {
                return lower_case_csuffix;
        }
 
-       public override string get_lower_case_cname (string infix) {
+       public override string? get_lower_case_cname (string? infix) {
                if (infix == null) {
                        infix = "";
                }
                return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
        }
 
-       public override string get_upper_case_cname (string infix = null) {
+       public override string get_upper_case_cname (string? infix = null) {
                return get_lower_case_cname (infix).up ();
        }
 
index a985f91..9bfd3f6 100644 (file)
@@ -39,7 +39,7 @@ public class Vala.EnumValue : Symbol {
         * @param name enum value name
         * @return     newly created enum value
         */
-       public EnumValue (string name, SourceReference source_reference = null) {
+       public EnumValue (string name, SourceReference? source_reference = null) {
                this.name = name;
                this.source_reference = source_reference;
        }
@@ -51,7 +51,7 @@ public class Vala.EnumValue : Symbol {
         * @param value numerical representation
         * @return      newly created enum value
         */
-       public EnumValue.with_value (string name, Expression value, SourceReference source_reference = null) {
+       public EnumValue.with_value (string name, Expression value, SourceReference? source_reference = null) {
                this.name = name;
                this.value = value;
                this.source_reference = source_reference;
index c15879a..63fa957 100644 (file)
@@ -41,7 +41,7 @@ public class Vala.ErrorDomain : Typesymbol {
         * @param source_reference reference to source code
         * @return                 newly created error domain
         */
-       public ErrorDomain (string name, SourceReference source_reference = null) {
+       public ErrorDomain (string name, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.name = name;
        }
@@ -130,14 +130,14 @@ public class Vala.ErrorDomain : Typesymbol {
                return lower_case_csuffix;
        }
 
-       public override string get_lower_case_cname (string infix) {
+       public override string? get_lower_case_cname (string? infix) {
                if (infix == null) {
                        infix = "";
                }
                return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
        }
 
-       public override string get_upper_case_cname (string infix) {
+       public override string get_upper_case_cname (string? infix) {
                return get_lower_case_cname (null).up ();
        }
 
index 7e730ef..29651d7 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.ErrorType : ReferenceType {
         */
        public weak ErrorDomain? error_domain { get; set; }
 
-       public ErrorType (ErrorDomain? error_domain, SourceReference source_reference) {
+       public ErrorType (ErrorDomain? error_domain, SourceReference? source_reference) {
                this.error_domain = error_domain;
                this.data_type = error_domain;
                this.source_reference = source_reference;
@@ -76,7 +76,7 @@ public class Vala.ErrorType : ReferenceType {
                return "GError*";
        }
 
-       public override string get_lower_case_cname (string infix = null) {
+       public override string? get_lower_case_cname (string? infix = null) {
                if (error_domain == null) {
                        if (infix == null) {
                                return "g_error";
index c1a0eab..4422e78 100644 (file)
@@ -49,7 +49,7 @@ public class Vala.ExpressionStatement : CodeNode, Statement {
         * @param source reference to source code
         * @return       newly created expression statement
         */
-       public ExpressionStatement (Expression expression, SourceReference source_reference = null) {
+       public ExpressionStatement (Expression expression, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.expression = expression;
        }
index 77dd412..fb0daef 100644 (file)
@@ -1,6 +1,6 @@
 /* valafield.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -80,7 +80,7 @@ public class Vala.Field : Member, Lockable {
         * @param source reference to source code
         * @return       newly created field
         */
-       public Field (string name, DataType type_reference, Expression initializer, SourceReference source_reference = null) {
+       public Field (string name, DataType type_reference, Expression? initializer, SourceReference? source_reference = null) {
                this.type_reference = type_reference;
                this.initializer = initializer;
                this.source_reference = source_reference;
index b6b6cc3..4dfc01b 100644 (file)
@@ -90,7 +90,7 @@ public class Vala.FormalParameter : Symbol {
         * @param source reference to source code
         * @return       newly created formal parameter
         */
-       public FormalParameter (string _name, DataType type, SourceReference source = null) {
+       public FormalParameter (string _name, DataType type, SourceReference? source = null) {
                name = _name;
                type_reference = type;
                source_reference = source;
@@ -100,7 +100,7 @@ public class Vala.FormalParameter : Symbol {
         * Creates a new ellipsis parameter representing an indefinite number of
         * parameters.
         */
-       public FormalParameter.with_ellipsis (SourceReference source = null) {
+       public FormalParameter.with_ellipsis (SourceReference? source = null) {
                ellipsis = true;
                source_reference = source;
        }
index cfc7496..ba035d8 100644 (file)
@@ -69,7 +69,7 @@ public class Vala.ForStatement : CodeNode, Statement {
         * @param source_reference reference to source code
         * @return                 newly created for statement
         */
-       public ForStatement (Expression condition, Block body, SourceReference source_reference = null) {
+       public ForStatement (Expression condition, Block body, SourceReference? source_reference = null) {
                this.body = body;
                this.source_reference = source_reference;
                this.condition = condition;
index 16bc57d..b4f4b93 100644 (file)
@@ -47,7 +47,7 @@ public class Vala.IfStatement : CodeNode, Statement {
        /**
         * The optional statement to be evaluated if the condition doesn't hold.
         */
-       public Block false_statement { get; set construct; }
+       public Block? false_statement { get; set construct; }
 
        private Expression _condition;
 
@@ -59,7 +59,7 @@ public class Vala.IfStatement : CodeNode, Statement {
         * @param false_stmt statement to be evaluated if condition is false
         * @return           newly created if statement
         */
-       public IfStatement (Expression cond, Block true_stmt, Block false_stmt, SourceReference source) {
+       public IfStatement (Expression cond, Block true_stmt, Block? false_stmt, SourceReference? source) {
                condition = cond;
                true_statement = true_stmt;
                false_statement = false_stmt;
index e7dea54..dc5a7e0 100644 (file)
@@ -38,7 +38,7 @@ public class Vala.IntegerLiteral : Literal {
         * @param source reference to source code
         * @return       newly created integer literal
         */
-       public IntegerLiteral (string i, SourceReference source = null) {
+       public IntegerLiteral (string i, SourceReference? source = null) {
                value = i;
                source_reference = source;
        }
index 4f24d66..068c6d3 100644 (file)
@@ -62,7 +62,7 @@ public class Vala.Interface : Typesymbol {
         * @param source reference to source code
         * @return       newly created interface
         */
-       public Interface (string name, SourceReference source_reference = null) {
+       public Interface (string name, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.name = name;
        }
@@ -302,7 +302,7 @@ public class Vala.Interface : Typesymbol {
                this.lower_case_csuffix = csuffix;
        }
        
-       public override string get_lower_case_cname (string infix) {
+       public override string? get_lower_case_cname (string? infix) {
                if (infix == null) {
                        infix = "";
                }
@@ -313,7 +313,7 @@ public class Vala.Interface : Typesymbol {
                return "%s_".printf (get_lower_case_cname (null));
        }
        
-       public override string get_upper_case_cname (string infix) {
+       public override string get_upper_case_cname (string? infix) {
                return get_lower_case_cname (infix).up ();
        }
 
index 7409370..09cc168 100644 (file)
@@ -52,7 +52,7 @@ public class Vala.InvocationExpression : Expression {
         * @param source_reference reference to source code
         * @return                 newly created invocation expression
         */
-       public InvocationExpression (Expression call, SourceReference source_reference = null) {
+       public InvocationExpression (Expression call, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.call = call;
        }
index ab57045..9ab2cfc 100644 (file)
@@ -36,7 +36,7 @@ public class Vala.LockStatement : CodeNode, Statement {
         */
        public Block body { get; set construct; }
        
-       public LockStatement (Expression resource, Block body, SourceReference source_reference = null) {
+       public LockStatement (Expression resource, Block body, SourceReference? source_reference = null) {
                this.body = body;
                this.source_reference = source_reference;
                this.resource = resource;
index 1f0373c..722ee8a 100644 (file)
@@ -30,7 +30,7 @@ public class Vala.MemberAccess : Expression {
        /**
         * The parent of the member.
         */
-       public Expression inner {
+       public Expression? inner {
                get {
                        return _inner;
                }
@@ -63,7 +63,7 @@ public class Vala.MemberAccess : Expression {
         */
        public bool creation_member { get; set; }
 
-       private Expression _inner;
+       private Expression? _inner;
        private Gee.List<DataType> type_argument_list = new ArrayList<DataType> ();
        
        /**
@@ -74,18 +74,18 @@ public class Vala.MemberAccess : Expression {
         * @param source_reference reference to source code
         * @return                 newly created member access expression
         */
-       public MemberAccess (Expression inner, string member_name, SourceReference source_reference = null) {
+       public MemberAccess (Expression? inner, string member_name, SourceReference? source_reference = null) {
                this.inner = inner;
                this.member_name = member_name;
                this.source_reference = source_reference;
        }
 
-       public MemberAccess.simple (string member_name, SourceReference source_reference = null) {
+       public MemberAccess.simple (string member_name, SourceReference? source_reference = null) {
                this.member_name = member_name;
                this.source_reference = source_reference;
        }
 
-       public MemberAccess.pointer (Expression inner, string member_name, SourceReference source_reference = null) {
+       public MemberAccess.pointer (Expression inner, string member_name, SourceReference? source_reference = null) {
                this.inner = inner;
                this.member_name = member_name;
                this.source_reference = source_reference;
index 364813e..55ab7b5 100644 (file)
@@ -50,7 +50,7 @@ public class Vala.MemberInitializer : CodeNode {
         * @param source_reference reference to source code
         * @return                 newly created member initializer
         */
-       public MemberInitializer (string name, Expression initializer, SourceReference source_reference = null) {
+       public MemberInitializer (string name, Expression initializer, SourceReference? source_reference = null) {
                this.initializer = initializer;
                this.source_reference = source_reference;
                this.name = name;
index e3718db..a108aa0 100644 (file)
@@ -211,7 +211,7 @@ public class Vala.Method : Member {
         * @param source      reference to source code
         * @return            newly created method
         */
-       public Method (string name, DataType return_type, SourceReference source_reference = null) {
+       public Method (string name, DataType return_type, SourceReference? source_reference = null) {
                this.return_type = return_type;
                this.source_reference = source_reference;
                this.name = name;
index 8939943..8483fbe 100644 (file)
@@ -56,7 +56,7 @@ public class Vala.Namespace : Symbol {
         * @param source_reference reference to source code
         * @return                 newly created namespace
         */
-       public Namespace (string name, SourceReference source_reference = null) {
+       public Namespace (string? name, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.name = name;
                access = SymbolAccessibility.PUBLIC;
index f19b528..a623770 100644 (file)
@@ -32,7 +32,7 @@ public class Vala.NullLiteral : Literal {
         * @param source reference to source code
         * @return       newly created null literal
         */
-       public NullLiteral (SourceReference source = null) {
+       public NullLiteral (SourceReference? source = null) {
                source_reference = source;
        }
        
index 8e334bb..543cc9c 100644 (file)
@@ -48,7 +48,7 @@ public class Vala.ParenthesizedExpression : Expression {
         * @param source reference to source code
         * @return       newly created parenthesized expression
         */
-       public ParenthesizedExpression (Expression _inner, SourceReference source) {
+       public ParenthesizedExpression (Expression _inner, SourceReference? source) {
                inner = _inner;
                source_reference = source;
        }
index 99cd130..4f688e8 100644 (file)
@@ -354,6 +354,8 @@ public class Vala.Parser : CodeVisitor {
                        stars++;
                }
 
+               bool nullable = accept (TokenType.INTERR);
+
                int array_rank = 0;
                if (accept (TokenType.OPEN_BRACKET)) {
                        do {
@@ -366,14 +368,14 @@ public class Vala.Parser : CodeVisitor {
                        }
                        while (accept (TokenType.COMMA));
                        expect (TokenType.CLOSE_BRACKET);
+
+                       nullable = accept (TokenType.INTERR);
                }
 
                if (accept (TokenType.OP_NEG)) {
                        Report.warning (get_last_src (), "obsolete syntax, types are non-null by default");
                }
 
-               bool nullable = accept (TokenType.INTERR);
-
                bool transfers_ownership = accept (TokenType.HASH);
 
                var type = new UnresolvedType.from_symbol (sym, get_src (begin));
@@ -1534,9 +1536,9 @@ public class Vala.Parser : CodeVisitor {
                return attrs;
        }
 
-       void set_attributes (CodeNode node, Gee.List<Attribute> attributes) {
+       void set_attributes (CodeNode node, Gee.List<Attribute>? attributes) {
                if (attributes != null) {
-                       foreach (Attribute attr in attributes) {
+                       foreach (Attribute attr in (Gee.List<Attribute>) attributes) {
                                node.attributes.append (attr);
                        }
                }
@@ -1694,7 +1696,7 @@ public class Vala.Parser : CodeVisitor {
                return RecoveryState.EOF;
        }
 
-       Namespace parse_namespace_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Namespace parse_namespace_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                expect (TokenType.NAMESPACE);
                var sym = parse_symbol_name ();
@@ -1812,7 +1814,7 @@ public class Vala.Parser : CodeVisitor {
                }
        }
 
-       Symbol parse_class_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Symbol parse_class_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                var flags = parse_type_declaration_modifiers ();
@@ -1909,7 +1911,7 @@ public class Vala.Parser : CodeVisitor {
                }
        }
 
-       Constant parse_constant_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Constant parse_constant_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                parse_member_declaration_modifiers ();
@@ -1927,7 +1929,7 @@ public class Vala.Parser : CodeVisitor {
                return c;
        }
 
-       Field parse_field_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Field parse_field_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                var flags = parse_member_declaration_modifiers ();
@@ -1990,7 +1992,7 @@ public class Vala.Parser : CodeVisitor {
                }
        }
 
-       Method parse_method_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Method parse_method_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                var flags = parse_member_declaration_modifiers ();
@@ -2037,7 +2039,7 @@ public class Vala.Parser : CodeVisitor {
                return method;
        }
 
-       Property parse_property_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Property parse_property_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                var flags = parse_member_declaration_modifiers ();
@@ -2114,7 +2116,7 @@ public class Vala.Parser : CodeVisitor {
                return prop;
        }
 
-       Signal parse_signal_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Signal parse_signal_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                parse_member_declaration_modifiers ();
@@ -2136,7 +2138,7 @@ public class Vala.Parser : CodeVisitor {
                return sig;
        }
 
-       Constructor parse_constructor_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Constructor parse_constructor_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var flags = parse_member_declaration_modifiers ();
                expect (TokenType.CONSTRUCT);
@@ -2148,7 +2150,7 @@ public class Vala.Parser : CodeVisitor {
                return c;
        }
 
-       Destructor parse_destructor_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Destructor parse_destructor_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                expect (TokenType.TILDE);
                parse_identifier ();
@@ -2159,7 +2161,7 @@ public class Vala.Parser : CodeVisitor {
                return d;
        }
 
-       Symbol parse_struct_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Symbol parse_struct_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                parse_type_declaration_modifiers ();
@@ -2212,7 +2214,7 @@ public class Vala.Parser : CodeVisitor {
                }
        }
 
-       Symbol parse_interface_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Symbol parse_interface_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                parse_type_declaration_modifiers ();
@@ -2284,7 +2286,7 @@ public class Vala.Parser : CodeVisitor {
                }
        }
 
-       Symbol parse_enum_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Symbol parse_enum_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                parse_type_declaration_modifiers ();
@@ -2339,7 +2341,7 @@ public class Vala.Parser : CodeVisitor {
                return result;
        }
 
-       Symbol parse_errordomain_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Symbol parse_errordomain_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                parse_type_declaration_modifiers ();
@@ -2497,7 +2499,7 @@ public class Vala.Parser : CodeVisitor {
                return param;
        }
 
-       CreationMethod parse_creation_method_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       CreationMethod parse_creation_method_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                parse_member_declaration_modifiers ();
@@ -2529,7 +2531,7 @@ public class Vala.Parser : CodeVisitor {
                return method;
        }
 
-       Symbol parse_delegate_declaration (Gee.List<Attribute> attrs) throws ParseError {
+       Symbol parse_delegate_declaration (Gee.List<Attribute>? attrs) throws ParseError {
                var begin = get_location ();
                var access = parse_access_modifier ();
                var flags = parse_member_declaration_modifiers ();
index 9d95c9a..91438ca 100644 (file)
@@ -47,7 +47,7 @@ public class Vala.PointerIndirection : Expression {
         * @param inner pointer to be dereferenced
         * @return      newly created pointer indirection
         */
-       public PointerIndirection (Expression inner, SourceReference source_reference = null) {
+       public PointerIndirection (Expression inner, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.inner = inner;
        }
index afac99d..c0b5b33 100644 (file)
@@ -40,12 +40,12 @@ public class Vala.Property : Member, Lockable {
        /**
         * The get accessor of this property if available.
         */
-       public PropertyAccessor get_accessor { get; set; }
+       public PropertyAccessor? get_accessor { get; set; }
        
        /**
         * The set/construct accessor of this property if available.
         */
-       public PropertyAccessor set_accessor { get; set; }
+       public PropertyAccessor? set_accessor { get; set; }
        
        /**
         * Represents the generated ´this' parameter in this property.
@@ -164,7 +164,7 @@ public class Vala.Property : Member, Lockable {
         * @param source       reference to source code
         * @return             newly created property
         */
-       public Property (string _name, DataType type, PropertyAccessor _get_accessor, PropertyAccessor _set_accessor, SourceReference source) {
+       public Property (string _name, DataType type, PropertyAccessor? _get_accessor, PropertyAccessor? _set_accessor, SourceReference source) {
                name = _name;
                type_reference = type;
                get_accessor = _get_accessor;
index a9e8855..664c718 100644 (file)
@@ -55,7 +55,7 @@ public class Vala.PropertyAccessor : CodeNode {
        /**
         * The accessor body.
         */
-       public Block body { get; set; }
+       public Block? body { get; set; }
 
        public BasicBlock entry_block { get; set; }
 
@@ -81,12 +81,12 @@ public class Vala.PropertyAccessor : CodeNode {
         * @param source       reference to source code
         * @return             newly created property accessor
         */
-       public PropertyAccessor (bool readable, bool writable, bool construction, Block body, SourceReference source_reference) {
+       public PropertyAccessor (bool readable, bool writable, bool construction, Block? body, SourceReference? source_reference) {
+               this.readable = readable;
                this.writable = writable;
                this.construction = construction;
                this.body = body;
                this.source_reference = source_reference;
-               this.readable = readable;
        }
 
        public override void accept (CodeVisitor visitor) {
index a761f04..dfa2a9d 100644 (file)
@@ -47,7 +47,7 @@ public class Vala.ReferenceTransferExpression : Expression {
         * @param inner variable whose reference is to be transferred
         * @return      newly created reference transfer expression
         */
-       public ReferenceTransferExpression (Expression inner, SourceReference source_reference = null) {
+       public ReferenceTransferExpression (Expression inner, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.inner = inner;
        }
index 5b21c9a..c61416b 100644 (file)
@@ -1,6 +1,6 @@
 /* valareport.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -96,7 +96,7 @@ public static class Vala.Report {
         * @param source  reference to source code
         * @param message warning message
         */
-       public static void warning (SourceReference source, string message) {
+       public static void warning (SourceReference? source, string message) {
                warnings++;
                if (source == null) {
                        stderr.printf ("warning: %s\n", message);
@@ -114,7 +114,7 @@ public static class Vala.Report {
         * @param source  reference to source code
         * @param message error message
         */
-       public static void error (SourceReference source, string message) {
+       public static void error (SourceReference? source, string message) {
                errors++;
                if (source == null) {
                        stderr.printf ("error: %s\n", message);
index 5ecd4e5..fe96144 100644 (file)
@@ -1,6 +1,6 @@
 /* valareturnstatement.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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.ReturnStatement : CodeNode, Statement {
        /**
         * The optional expression to return.
         */
-       public Expression return_expression {
+       public Expression? return_expression {
                get { return _return_expression; }
                set {
                        _return_expression = value;
@@ -48,7 +48,7 @@ public class Vala.ReturnStatement : CodeNode, Statement {
         * @param source_reference  reference to source code
         * @return                  newly created return statement
         */
-       public ReturnStatement (Expression return_expression = null, SourceReference source_reference = null) {
+       public ReturnStatement (Expression? return_expression = null, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.return_expression = return_expression;
        }
index ef4e658..de8d8f7 100644 (file)
@@ -60,7 +60,7 @@ public class Vala.Signal : Member, Lockable {
         * @param source      reference to source code
         * @return            newly created signal
         */
-       public Signal (string name, DataType return_type, SourceReference source_reference = null) {
+       public Signal (string name, DataType return_type, SourceReference? source_reference = null) {
                this.return_type = return_type;
                this.source_reference = source_reference;
                this.name = name;
index 3ea5339..cc0e5ec 100644 (file)
@@ -230,7 +230,7 @@ public class Vala.SourceFile : Object {
         * @param sym      a symbol
         * @param dep_type type of dependency
         */
-       public void add_symbol_dependency (Symbol sym, SourceFileDependencyType dep_type) {
+       public void add_symbol_dependency (Symbol? sym, SourceFileDependencyType dep_type) {
                if (pkg) {
                        return;
                }
index 17d5a8e..e57e544 100644 (file)
@@ -1,6 +1,6 @@
 /* valasourcereference.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -85,7 +85,7 @@ public class Vala.SourceReference : Object {
         * @param comment      code comment
         * @return             newly created source reference
         */
-       public SourceReference.with_comment (SourceFile _file, int _first_line, int _first_column, int _last_line, int _last_column, string _comment) {
+       public SourceReference.with_comment (SourceFile _file, int _first_line, int _first_column, int _last_line, int _last_column, string? _comment) {
                file = _file;
                first_line = _first_line;
                first_column = _first_column;
index b31eef0..0830bee 100644 (file)
@@ -62,7 +62,7 @@ public class Vala.Struct : Typesymbol {
         * @param source_reference reference to source code
         * @return                 newly created struct
         */
-       public Struct (string name, SourceReference source_reference = null) {
+       public Struct (string name, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.name = name;
        }
@@ -213,14 +213,14 @@ public class Vala.Struct : Typesymbol {
                return lower_case_csuffix;
        }
 
-       public override string get_lower_case_cname (string infix) {
+       public override string? get_lower_case_cname (string? infix) {
                if (infix == null) {
                        infix = "";
                }
                return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
        }
        
-       public override string get_upper_case_cname (string infix) {
+       public override string get_upper_case_cname (string? infix) {
                return get_lower_case_cname (infix).up ();
        }
 
index e8fc654..a8ef910 100644 (file)
@@ -38,7 +38,7 @@ public class Vala.SwitchLabel : CodeNode {
         * @param source reference to source code
         * @return       newly created switch case label
         */
-       public SwitchLabel (Expression expr, SourceReference source = null) {
+       public SwitchLabel (Expression expr, SourceReference? source = null) {
                expression = expr;
                source_reference = source;
        }
@@ -49,7 +49,7 @@ public class Vala.SwitchLabel : CodeNode {
         * @param source reference to source code
         * @return       newly created switch default label
         */
-       public SwitchLabel.with_default (SourceReference source = null) {
+       public SwitchLabel.with_default (SourceReference? source = null) {
                source_reference = source;
        }
        
index 743b373..2c2863e 100644 (file)
@@ -154,7 +154,7 @@ public abstract class Vala.Symbol : CodeNode {
         *              name or null
         * @return      the lower case name to be used in C code
         */
-       public virtual string get_lower_case_cname (string infix = null) {
+       public virtual string? get_lower_case_cname (string? infix = null) {
                return null;
        }
 
index fd6a5af..90acb9f 100644 (file)
@@ -50,7 +50,7 @@ public class Vala.ThrowStatement : CodeNode, Statement {
         * @param source_reference reference to source code
         * @return                 newly created throw statement
         */
-       public ThrowStatement (Expression error_expression, SourceReference source_reference = null) {
+       public ThrowStatement (Expression error_expression, SourceReference? source_reference = null) {
                this.source_reference = source_reference;
                this.error_expression = error_expression;
        }
index 1fbc2d4..d4eec46 100644 (file)
@@ -35,7 +35,7 @@ public class Vala.TryStatement : CodeNode, Statement {
        /**
         * Specifies the body of the optional finally clause.
         */
-       public Block finally_body { get; set; }
+       public Block? finally_body { get; set; }
 
        private Gee.List<CatchClause> catch_clauses = new ArrayList<CatchClause> ();
 
@@ -47,10 +47,10 @@ public class Vala.TryStatement : CodeNode, Statement {
         * @param source_reference reference to source code
         * @return                 newly created try statement
         */
-       public TryStatement (Block body, Block finally_body, SourceReference source_reference = null) {
+       public TryStatement (Block body, Block? finally_body, SourceReference? source_reference = null) {
+               this.body = body;
                this.finally_body = finally_body;
                this.source_reference = source_reference;
-               this.body = body;
        }
 
        /**
index 71d3019..01bef96 100644 (file)
@@ -155,7 +155,7 @@ public abstract class Vala.Typesymbol : Symbol {
         *              name or null
         * @return      the upper case name to be used in C code
         */
-       public virtual string get_upper_case_cname (string infix = null) {
+       public virtual string get_upper_case_cname (string? infix = null) {
                return null;
        }
 
index ba97907..97de2ea 100644 (file)
@@ -60,7 +60,7 @@ public class Vala.UnresolvedType : DataType {
         * @param source    reference to source code
         * @return          newly created type reference
         */
-       public UnresolvedType.from_symbol (UnresolvedSymbol symbol, SourceReference source = null) {
+       public UnresolvedType.from_symbol (UnresolvedSymbol symbol, SourceReference? source = null) {
                this.unresolved_symbol = symbol;
                source_reference = source;
        }
index 5aadf97..a7e989d 100644 (file)
@@ -1,6 +1,6 @@
 /* valavariabledeclarator.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter
+ * Copyright (C) 2006-2008  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
@@ -64,10 +64,10 @@ public class Vala.VariableDeclarator : Symbol {
         * @param source reference to source code
         * @return       newly created variable declarator
         */
-       public VariableDeclarator (string name, Expression initializer = null, SourceReference source_reference = null) {
+       public VariableDeclarator (string name, Expression? initializer = null, SourceReference? source_reference = null) {
+               this.name = name;
                this.initializer = initializer;
                this.source_reference = source_reference;
-               this.name = name;
        }
        
        public override void accept (CodeVisitor visitor) {
index 6f58bcd..e496ba0 100644 (file)
@@ -63,7 +63,7 @@ public class Vala.WhileStatement : CodeNode, Statement {
         * @param source reference to source code
         * @return       newly created while statement
         */
-       public WhileStatement (Expression condition, Block body, SourceReference source_reference = null) {
+       public WhileStatement (Expression condition, Block body, SourceReference? source_reference = null) {
                this.body = body;
                this.source_reference = source_reference;
                this.condition = condition;
index 5fa4aeb..8d2c565 100644 (file)
@@ -1184,7 +1184,7 @@ public class Vala.GIdlParser : CodeVisitor {
                return type;
        }
        
-       private Method create_method (string name, string symbol, IdlNodeParam res, GLib.List<IdlNodeParam> parameters, bool is_constructor, bool is_interface) {
+       private Method create_method (string name, string symbol, IdlNodeParam? res, GLib.List<IdlNodeParam>? parameters, bool is_constructor, bool is_interface) {
                UnresolvedType return_type = null;
                if (res != null) {
                        return_type = parse_param (res);