+2008-10-27 Jürg Billeter <j@bitron.ch>
+
+ * vala/valaarraylengthfield.vala:
+ * vala/valaarraymovemethod.vala:
+ * vala/valaarrayresizemethod.vala:
+ * vala/valablock.vala:
+ * vala/valaclass.vala:
+ * vala/valaconstant.vala:
+ * vala/valaconstructor.vala:
+ * vala/valacreationmethod.vala:
+ * vala/valadelegate.vala:
+ * vala/valadestructor.vala:
+ * vala/valadynamicmethod.vala:
+ * vala/valadynamicproperty.vala:
+ * vala/valadynamicsignal.vala:
+ * vala/valaenum.vala:
+ * vala/valaenumvalue.vala:
+ * vala/valaerrorcode.vala:
+ * vala/valaerrordomain.vala:
+ * vala/valafield.vala:
+ * vala/valaforeachstatement.vala:
+ * vala/valaformalparameter.vala:
+ * vala/valainterface.vala:
+ * vala/valalocalvariable.vala:
+ * vala/valamember.vala:
+ * vala/valamethod.vala:
+ * vala/valanamespace.vala:
+ * vala/valaobjecttypesymbol.vala:
+ * vala/valaproperty.vala:
+ * vala/valasignal.vala:
+ * vala/valastruct.vala:
+ * vala/valaswitchsection.vala:
+ * vala/valasymbol.vala:
+ * vala/valatypeparameter.vala:
+ * vala/valatypesymbol.vala:
+
+ Use constructor chaining instead of helper method
+
2008-10-26 Jürg Billeter <j@bitron.ch>
* vala/Makefile.am:
* @return newly created field
*/
public ArrayLengthField (SourceReference source_reference) {
- base.init ();
- name = "length";
+ base ("length", new InvalidType (), null, source_reference);
external = true;
- this.source_reference = source_reference;
}
}
* @return newly created method
*/
public ArrayMoveMethod (SourceReference source_reference) {
- base.init ();
- name = "move";
+ base ("move", new VoidType (), source_reference);
external = true;
- this.source_reference = source_reference;
}
}
* @return newly created method
*/
public ArrayResizeMethod (SourceReference source_reference) {
- base.init ();
- name = "resize";
+ base ("resize", new VoidType (), source_reference);
external = true;
- this.source_reference = source_reference;
cinstance_parameter_position = 0.1;
}
}
* @param source reference to source code
*/
public Block (SourceReference source_reference) {
- base.init ();
- this.source_reference = source_reference;
+ base (null, source_reference);
}
/**
* @return newly created class
*/
public Class (string name, SourceReference? source_reference = null) {
- base.init ();
- this.source_reference = source_reference;
- this.name = name;
+ base (name, source_reference);
}
/**
* @return newly created constant
*/
public Constant (string name, DataType type_reference, Expression? initializer, SourceReference? source_reference) {
- base.init ();
- this.name = name;
+ base (name, source_reference);
this.type_reference = type_reference;
this.initializer = initializer;
- this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
* @return newly created constructor
*/
public Constructor (SourceReference source) {
- base.init ();
- source_reference = source;
+ base (null, source);
}
public override void accept (CodeVisitor visitor) {
* @return newly created method
*/
public CreationMethod (string? type_name, string? name, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
- this.source_reference = source_reference;
+ base (name, new VoidType (), source_reference);
this.type_name = type_name;
- return_type = new VoidType ();
carray_length_parameter_position = -3;
cdelegate_target_parameter_position = -3;
* @return newly created delegate
*/
public Delegate (string? name, DataType return_type, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
+ base (name, source_reference);
this.return_type = return_type;
- this.source_reference = source_reference;
// error is -1 (right of user_data)
cinstance_parameter_position = -2;
* @return newly created destructor
*/
public Destructor (SourceReference? source_reference = null) {
- base.init ();
- this.source_reference = source_reference;
+ base (null, source_reference);
}
public override void accept (CodeVisitor visitor) {
static int dynamic_method_id;
public DynamicMethod (DataType dynamic_type, string name, DataType return_type, SourceReference? source_reference = null) {
- base.init ();
+ base (name, return_type, source_reference);
this.dynamic_type = dynamic_type;
- this.name = name;
- this.return_type = return_type;
- this.source_reference = source_reference;
}
public override Gee.List<string> get_cheader_filenames () {
private string cname;
public DynamicProperty (DataType dynamic_type, string name, SourceReference? source_reference = null) {
- base.init ();
+ base (name, null, null, null, source_reference);
this.dynamic_type = dynamic_type;
- this.name = name;
- this.source_reference = source_reference;
}
public override Gee.List<string> get_cheader_filenames () {
public Expression handler { get; set; }
public DynamicSignal (DataType dynamic_type, string name, DataType return_type, SourceReference? source_reference = null) {
- base.init ();
+ base (name, return_type, source_reference);
this.dynamic_type = dynamic_type;
- this.name = name;
- this.return_type = return_type;
- this.source_reference = source_reference;
}
}
* @return newly created enum
*/
public Enum (string name, SourceReference? source_reference = null) {
- base.init ();
- this.source_reference = source_reference;
- this.name = name;
+ base (name, source_reference);
}
/**
* @return newly created enum value
*/
public EnumValue (string name, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
- this.source_reference = source_reference;
+ base (name, source_reference);
}
/**
* @return newly created enum value
*/
public EnumValue.with_value (string name, Expression value, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
+ this (name, source_reference);
this.value = value;
- this.source_reference = source_reference;
}
/**
* @return newly created enum value
*/
public ErrorCode (string name, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
- this.source_reference = source_reference;
+ base (name, source_reference);
}
/**
* @return newly created enum value
*/
public ErrorCode.with_value (string name, Expression value, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
+ this (name, source_reference);
this.value = value;
- this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
* @return newly created error domain
*/
public ErrorDomain (string name, SourceReference? source_reference = null) {
- base.init ();
- this.source_reference = source_reference;
- this.name = name;
+ base (name, source_reference);
}
/**
* @return newly created field
*/
public Field (string name, DataType field_type, Expression? initializer, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
+ base (name, source_reference);
this.field_type = field_type;
this.initializer = initializer;
- this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
* @return newly created foreach statement
*/
public ForeachStatement (DataType? type_reference, string variable_name, Expression collection, Block body, SourceReference source_reference) {
- base.init ();
+ base (source_reference);
this.variable_name = variable_name;
this.collection = collection;
this.body = body;
- this.source_reference = source_reference;
this.type_reference = type_reference;
}
* @return newly created formal parameter
*/
public FormalParameter (string name, DataType parameter_type, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
+ base (name, source_reference);
this.parameter_type = parameter_type;
- this.source_reference = source_reference;
access = SymbolAccessibility.PUBLIC;
}
* Creates a new ellipsis parameter representing an indefinite number of
* parameters.
*/
- public FormalParameter.with_ellipsis (SourceReference? source = null) {
- base.init ();
+ public FormalParameter.with_ellipsis (SourceReference? source_reference = null) {
+ base (null, source_reference);
ellipsis = true;
- source_reference = source;
access = SymbolAccessibility.PUBLIC;
}
* @return newly created interface
*/
public Interface (string name, SourceReference? source_reference = null) {
- base.init ();
- this.source_reference = source_reference;
- this.name = name;
+ base (name, source_reference);
}
/**
* @return newly created variable declarator
*/
public LocalVariable (DataType? variable_type, string name, Expression? initializer = null, SourceReference? source_reference = null) {
- base.init ();
+ base (name, source_reference);
this.variable_type = variable_type;
- this.name = name;
this.initializer = initializer;
- this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
*/
public abstract class Vala.Member : Symbol {
private Gee.List<string> cheader_filenames = new ArrayList<string> ();
-
+
+ public Member (string? name, SourceReference? source_reference) {
+ base (name, source_reference);
+ }
+
public override void accept (CodeVisitor visitor) {
visitor.visit_member (this);
}
* @param source reference to source code
* @return newly created method
*/
- public Method (string name, DataType return_type, SourceReference? source_reference = null) {
- base.init ();
+ public Method (string? name, DataType return_type, SourceReference? source_reference = null) {
+ base (name, source_reference);
this.return_type = return_type;
- this.source_reference = source_reference;
- this.name = name;
carray_length_parameter_position = -3;
cdelegate_target_parameter_position = -3;
* @return newly created namespace
*/
public Namespace (string? name, SourceReference? source_reference = null) {
- base.init ();
- this.source_reference = source_reference;
- this.name = name;
+ base (name, source_reference);
access = SymbolAccessibility.PUBLIC;
}
public abstract Gee.List<Method> get_methods ();
public abstract Gee.List<Signal> get_signals ();
public abstract Gee.List<Property> get_properties ();
+
+ public ObjectTypeSymbol (string name, SourceReference? source_reference = null) {
+ base (name, source_reference);
+ }
}
/**
* The property type.
*/
- public DataType property_type {
+ public DataType? property_type {
get { return _data_type; }
set {
_data_type = value;
* @param source reference to source code
* @return newly created property
*/
- public Property (string name, DataType property_type, PropertyAccessor? get_accessor, PropertyAccessor? set_accessor, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
+ public Property (string name, DataType? property_type, PropertyAccessor? get_accessor, PropertyAccessor? set_accessor, SourceReference? source_reference = null) {
+ base (name, source_reference);
this.property_type = property_type;
this.get_accessor = get_accessor;
this.set_accessor = set_accessor;
- this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
* @return newly created signal
*/
public Signal (string name, DataType return_type, SourceReference? source_reference = null) {
- base.init ();
- this.name = name;
+ base (name, source_reference);
this.return_type = return_type;
- this.source_reference = source_reference;
}
/**
* @return newly created struct
*/
public Struct (string name, SourceReference? source_reference = null) {
- base.init ();
- this.source_reference = source_reference;
- this.name = name;
+ base (name, source_reference);
}
/**
* @return newly created switch section
*/
public SwitchSection (SourceReference source_reference) {
- base.init ();
- this.source_reference = source_reference;
+ base (source_reference);
}
/**
/**
* The symbol name.
*/
- public string name { get; set; }
+ public string? name { get; set; }
/**
* Specifies whether this symbol is active.
private weak Scope _owner;
private Scope _scope;
- public void init () {
+ public Symbol (string? name, SourceReference? source_reference) {
+ this.name = name;
+ this.source_reference = source_reference;
_scope = new Scope (this);
}
* @param source reference to source code
* @return newly created generic type parameter
*/
- public TypeParameter (string _name, SourceReference source) {
- base.init ();
- name = _name;
- source_reference = source;
+ public TypeParameter (string name, SourceReference source_reference) {
+ base (name, source_reference);
}
public override void accept (CodeVisitor visitor) {
public abstract class Vala.TypeSymbol : Symbol {
private Gee.List<string> cheader_filenames = new ArrayList<string> ();
+ public TypeSymbol (string? name, SourceReference? source_reference = null) {
+ base (name, source_reference);
+ }
+
/**
* Returns the name of this data type as it is used in C code.
*