2008-04-13 Jürg Billeter <j@bitron.ch>
+ * vala/valaparser.vala: deprecate construct as parameter modifier,
+ fixes bug 524138
+
+ * */*.vala: port to new syntax
+
+2008-04-13 Jürg Billeter <j@bitron.ch>
+
* vala/valaparser.vala: report warning when using obsolete syntax
for non-null types
private Gee.List<CCodeStatement> statements = new ArrayList<CCodeStatement> ();
- public CCodeCaseStatement (construct CCodeExpression expression) {
+ public CCodeCaseStatement (CCodeExpression expression) {
+ this.expression = expression;
}
/**
private Gee.List<CCodeDeclarator> declarators = new ArrayList<CCodeDeclarator> ();
- public CCodeDeclaration (construct string type_name) {
+ public CCodeDeclaration (string type_name) {
+ this.type_name = type_name;
}
/**
private Gee.List<CCodeEnumValue> values = new ArrayList<CCodeEnumValue> ();
- public CCodeEnum (construct string name = null) {
+ public CCodeEnum (string name = null) {
+ this.name = name;
}
/**
*/
public CCodeExpression value { get; set; }
- public CCodeEnumValue (construct string name, construct CCodeExpression value = null) {
+ public CCodeEnumValue (string name, CCodeExpression value = null) {
+ this.value = value;
+ this.name = name;
}
public override void write (CCodeWriter writer) {
private Gee.List<CCodeExpression> initializer = new ArrayList<CCodeExpression> ();
private Gee.List<CCodeExpression> iterator = new ArrayList<CCodeExpression> ();
- public CCodeForStatement (construct CCodeExpression condition, construct CCodeStatement body = null) {
+ public CCodeForStatement (CCodeExpression condition, CCodeStatement body = null) {
+ this.body = body;
+ this.condition = condition;
}
/**
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
- public CCodeFunction (construct string name, construct string return_type) {
+ public CCodeFunction (string name, string return_type) {
+ this.return_type = return_type;
+ this.name = name;
}
/**
private Gee.List<CCodeExpression> arguments = new ArrayList<CCodeExpression> ();
- public CCodeFunctionCall (construct CCodeExpression call = null) {
+ public CCodeFunctionCall (CCodeExpression call = null) {
+ this.call = call;
}
/**
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
- public CCodeFunctionDeclarator (construct string name) {
+ public CCodeFunctionDeclarator (string name) {
+ this.name = name;
}
/**
*/
public string name { get; set construct; }
- public CCodeGotoStatement (construct string name) {
+ public CCodeGotoStatement (string name) {
+ this.name = name;
}
public override void write (CCodeWriter writer) {
*/
public string name { get; set construct; }
- public CCodeLabel (construct string name) {
+ public CCodeLabel (string name) {
+ this.name = name;
}
public override void write (CCodeWriter writer) {
*/
public CCodeExpression replacement_expression { get; set; }
- public CCodeMacroReplacement (construct string name, construct string replacement) {
+ public CCodeMacroReplacement (string name, string replacement) {
+ this.replacement = replacement;
+ this.name = name;
}
- public CCodeMacroReplacement.with_expression (construct string name, construct CCodeExpression replacement_expression) {
+ public CCodeMacroReplacement.with_expression (string name, CCodeExpression replacement_expression) {
+ this.name = name;
+ this.replacement_expression = replacement_expression;
}
public override void write (CCodeWriter writer) {
private Gee.List<CCodeDeclaration> declarations = new ArrayList<CCodeDeclaration> ();
- public CCodeStruct (construct string name) {
+ public CCodeStruct (string name) {
+ this.name = name;
}
/**
private Gee.List<CCodeCaseStatement> case_statements = new ArrayList<CCodeCaseStatement> ();
private Gee.List<CCodeStatement> default_statements = new ArrayList<CCodeStatement> ();
- public CCodeSwitchStatement (construct CCodeExpression expression) {
+ public CCodeSwitchStatement (CCodeExpression expression) {
+ this.expression = expression;
}
/**
// concurrent modification protection
private int _stamp = 0;
- public ArrayList (construct EqualFunc equal_func = GLib.direct_equal) {
+ public ArrayList (EqualFunc equal_func = GLib.direct_equal) {
+ this.equal_func = equal_func;
}
public Type get_element_type () {
// concurrent modification protection
public int _stamp = 0;
- public Iterator (construct ArrayList list) {
+ public Iterator (ArrayList list) {
+ this.list = list;
}
public bool next () {
private const int MIN_SIZE = 11;
private const int MAX_SIZE = 13845163;
- public HashMap (construct HashFunc key_hash_func = GLib.direct_hash, construct EqualFunc key_equal_func = GLib.direct_equal, construct EqualFunc value_equal_func = GLib.direct_equal) {
+ public HashMap (HashFunc key_hash_func = GLib.direct_hash, EqualFunc key_equal_func = GLib.direct_equal, EqualFunc value_equal_func = GLib.direct_equal) {
+ this.key_hash_func = key_hash_func;
+ this.key_equal_func = key_equal_func;
+ this.value_equal_func = value_equal_func;
}
construct {
private HashMap<K,V> _map;
- public KeySet (construct HashMap map) {
+ public KeySet (HashMap map) {
+ this.map = map;
}
public Type get_element_type () {
// concurrent modification protection
private int _stamp;
- public KeyIterator (construct HashMap map) {
+ public KeyIterator (HashMap map) {
+ this.map = map;
}
public bool next () {
private HashMap<K,V> _map;
- public ValueCollection (construct HashMap map) {
+ public ValueCollection (HashMap map) {
+ this.map = map;
}
public Type get_element_type () {
// concurrent modification protection
private int _stamp;
- public ValueIterator (construct HashMap map) {
+ public ValueIterator (HashMap map) {
+ this.map = map;
}
public bool next () {
private const int MIN_SIZE = 11;
private const int MAX_SIZE = 13845163;
- public HashSet (construct HashFunc hash_func = GLib.direct_hash, construct EqualFunc equal_func = GLib.direct_equal) {
+ public HashSet (HashFunc hash_func = GLib.direct_hash, EqualFunc equal_func = GLib.direct_equal) {
+ this.hash_func = hash_func;
+ this.equal_func = equal_func;
}
construct {
// concurrent modification protection
private int _stamp = 0;
- public Iterator (construct HashSet set) {
+ public Iterator (HashSet set) {
+ this.set = set;
}
public bool next () {
private Collection<G> _collection;
- public ReadOnlyCollection (construct Collection<G> collection = null) {
+ public ReadOnlyCollection (Collection<G> collection = null) {
+ this.collection = collection;
}
public Type get_element_type () {
private List<G> _list;
- public ReadOnlyList (construct List<G> list = null) {
+ public ReadOnlyList (List<G> list = null) {
+ this.list = list;
}
public Type get_element_type () {
private Map<K,V> _map;
- public ReadOnlyMap (construct Map<K,V> map = null) {
+ public ReadOnlyMap (Map<K,V> map = null) {
+ this.map = map;
}
public Set<K> get_keys () {
private Set<G> _set;
- public ReadOnlySet (construct Set<G> set = null) {
+ public ReadOnlySet (Set<G> set = null) {
+ this.set = set;
}
public Type get_element_type () {
public class Vala.CCodeArrayCreationExpressionBinding : CCodeExpressionBinding {
public ArrayCreationExpression array_creation_expression { get; set; }
- public CCodeArrayCreationExpressionBinding (construct CodeGenerator codegen, construct ArrayCreationExpression array_creation_expression) {
+ public CCodeArrayCreationExpressionBinding (CodeGenerator codegen, ArrayCreationExpression array_creation_expression) {
+ this.array_creation_expression = array_creation_expression;
+ this.codegen = codegen;
}
public override void emit () {
public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
public Assignment assignment { get; set; }
- public CCodeAssignmentBinding (construct CodeGenerator codegen, construct Assignment assignment) {
+ public CCodeAssignmentBinding (CodeGenerator codegen, Assignment assignment) {
+ this.assignment = assignment;
+ this.codegen = codegen;
}
private void emit_property_assignment () {
public class Vala.CCodeElementAccessBinding : CCodeExpressionBinding {
public ElementAccess element_access { get; set; }
- public CCodeElementAccessBinding (construct CodeGenerator codegen, construct ElementAccess element_access) {
+ public CCodeElementAccessBinding (CodeGenerator codegen, ElementAccess element_access) {
+ this.element_access = element_access;
+ this.codegen = codegen;
}
public override void emit () {
get { return (method.get_attribute ("NoWrapper") == null); }
}
- public CCodeMethodBinding (construct CodeGenerator codegen, construct Method method) {
+ public CCodeMethodBinding (CodeGenerator codegen, Method method) {
+ this.method = method;
+ this.codegen = codegen;
}
public static CCodeMethodBinding get (Method method) {
* Represents a dynamic bound DBus method.
*/
public class Vala.DBusMethod : Method {
- public DBusMethod (construct string name, construct DataType return_type, construct 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;
}
public override Collection<string> get_cheader_filenames () {
* Represents a dynamic bound DBus signal.
*/
public class Vala.DBusSignal : Signal {
- public DBusSignal (construct string name, construct DataType return_type, construct 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;
}
}
* @param inner variable whose address is to be computed
* @return newly created address-of expression
*/
- public AddressofExpression (construct Expression inner, construct SourceReference source_reference = null) {
+ public AddressofExpression (Expression inner, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.inner = inner;
}
public override void accept (CodeVisitor visitor) {
return new ReadOnlyList<Expression> (sizes);
}
- public ArrayCreationExpression (construct DataType element_type, construct int rank, construct InitializerList initializer_list, construct SourceReference source_reference) {
+ public ArrayCreationExpression (DataType element_type, int rank, InitializerList initializer_list, SourceReference source_reference) {
+ 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) {
*
* @return newly created field
*/
- public ArrayLengthField (construct SourceReference source_reference) {
+ public ArrayLengthField (SourceReference source_reference) {
+ this.source_reference = source_reference;
name = "length";
}
}
*
* @return newly created method
*/
- public ArrayMoveMethod (construct SourceReference source_reference) {
+ public ArrayMoveMethod (SourceReference source_reference) {
+ this.source_reference = source_reference;
name = "move";
}
}
*
* @return newly created method
*/
- public ArrayResizeMethod (construct SourceReference source_reference) {
+ public ArrayResizeMethod (SourceReference source_reference) {
+ this.source_reference = source_reference;
name = "resize";
}
* @param source_reference reference to source code
* @return newly created assignment
*/
- public Assignment (construct Expression left, construct Expression right, construct AssignmentOperator operator = AssignmentOperator.SIMPLE, construct 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;
+ this.left = left;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created attribute
*/
- public Attribute (construct string name, construct SourceReference source_reference) {
+ public Attribute (string name, SourceReference source_reference) {
+ this.source_reference = source_reference;
+ this.name = name;
}
/**
*
* @param source reference to source code
*/
- public Block (construct SourceReference source_reference = null) {
+ public Block (SourceReference source_reference = null) {
+ this.source_reference = source_reference;
}
/**
* @param type target type
* @return newly created cast expression
*/
- public CastExpression (construct Expression inner, construct DataType type_reference, construct SourceReference source_reference, construct bool is_silent_cast) {
+ public CastExpression (Expression inner, DataType type_reference, SourceReference source_reference, bool is_silent_cast) {
+ this.type_reference = type_reference;
+ this.source_reference = source_reference;
+ this.is_silent_cast = is_silent_cast;
+ this.inner = inner;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created catch clause
*/
- public CatchClause (construct DataType? type_reference, construct string variable_name, construct Block body, construct 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;
+ this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
public BasicBlock? last_block { get; set; }
public CatchClause? catch_clause { get; set; }
- public JumpTarget.break_target (construct BasicBlock basic_block) {
+ public JumpTarget.break_target (BasicBlock basic_block) {
+ this.basic_block = basic_block;
break_target = true;
}
- public JumpTarget.continue_target (construct BasicBlock basic_block) {
+ public JumpTarget.continue_target (BasicBlock basic_block) {
+ this.basic_block = basic_block;
continue_target = true;
}
- public JumpTarget.return_target (construct BasicBlock basic_block) {
+ public JumpTarget.return_target (BasicBlock basic_block) {
+ this.basic_block = basic_block;
return_target = true;
}
- public JumpTarget.error_target (construct BasicBlock basic_block, construct CatchClause catch_clause, construct Enum? error_domain, construct EnumValue? error_code) {
+ public JumpTarget.error_target (BasicBlock basic_block, CatchClause catch_clause, Enum? error_domain, EnumValue? error_code) {
+ this.basic_block = basic_block;
+ this.catch_clause = catch_clause;
+ this.error_domain = error_domain;
+ this.error_code = error_code;
error_target = true;
}
- public JumpTarget.finally_clause (construct BasicBlock basic_block, construct BasicBlock last_block) {
+ public JumpTarget.finally_clause (BasicBlock basic_block, BasicBlock last_block) {
+ this.basic_block = basic_block;
+ this.last_block = last_block;
finally_clause = true;
}
}
* @param source reference to source code
* @return newly created class
*/
- public Class (construct string name, construct SourceReference source_reference = null) {
+ public Class (string name, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.name = name;
}
/**
*/
public weak Class class_symbol { get; set; }
- public ClassType (construct Class class_symbol) {
+ public ClassType (Class class_symbol) {
+ this.class_symbol = class_symbol;
data_type = class_symbol;
}
* @param source_reference reference to source code
* @return newly created constant
*/
- public Constant (construct string name, construct DataType type_reference, construct Expression initializer, construct SourceReference source_reference) {
+ public Constant (string name, DataType type_reference, Expression initializer, SourceReference source_reference) {
+ this.type_reference = type_reference;
+ this.initializer = initializer;
+ this.source_reference = source_reference;
+ this.name = name;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created method
*/
- public CreationMethod (construct string type_name, construct string name, construct 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;
return_type = new VoidType ();
}
* @param source reference to source code
* @return newly created delegate
*/
- public Delegate (construct string name, construct DataType return_type, construct SourceReference source_reference = null) {
+ public Delegate (string name, DataType return_type, SourceReference source_reference = null) {
+ this.return_type = return_type;
+ this.source_reference = source_reference;
+ this.name = name;
}
construct {
public class Vala.DelegateType : DataType {
public Delegate delegate_symbol { get; set; }
- public DelegateType (construct Delegate delegate_symbol) {
+ public DelegateType (Delegate delegate_symbol) {
+ this.delegate_symbol = delegate_symbol;
}
public override bool is_invokable () {
* @param source_reference reference to source code
* @return newly created destructor
*/
- public Destructor (construct SourceReference source_reference = null) {
+ public Destructor (SourceReference source_reference = null) {
+ this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
* @param source reference to source code
* @return newly created do statement
*/
- public DoStatement (construct Block body, construct Expression condition, construct 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;
}
public override void accept (CodeVisitor visitor) {
return new ReadOnlyList<Expression> (indices);
}
- public ElementAccess (construct Expression container, construct SourceReference source_reference) {
+ public ElementAccess (Expression container, SourceReference source_reference) {
+ this.source_reference = source_reference;
+ this.container = container;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created enum
*/
- public Enum (construct string name, construct SourceReference source_reference = null) {
+ public Enum (string name, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.name = name;
}
/**
* @param name enum value name
* @return newly created enum value
*/
- public EnumValue (construct string name, SourceReference source_reference = null) {
+ public EnumValue (string name, SourceReference source_reference = null) {
+ this.name = name;
this.source_reference = source_reference;
}
* @param value numerical representation
* @return newly created enum value
*/
- public EnumValue.with_value (construct string name, construct 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;
}
* @param name enum value name
* @return newly created enum value
*/
- public ErrorCode (construct string name) {
+ public ErrorCode (string name) {
+ this.name = name;
}
/**
* @param value numerical representation
* @return newly created enum value
*/
- public ErrorCode.with_value (construct string name, construct Expression value) {
+ public ErrorCode.with_value (string name, Expression value) {
+ this.name = name;
+ this.value = value;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created error domain
*/
- public ErrorDomain (construct string name, construct SourceReference source_reference = null) {
+ public ErrorDomain (string name, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.name = name;
}
/**
* @param source reference to source code
* @return newly created expression statement
*/
- public ExpressionStatement (construct Expression expression, construct SourceReference source_reference = null) {
+ public ExpressionStatement (Expression expression, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.expression = expression;
}
public override void accept (CodeVisitor visitor) {
* @param source reference to source code
* @return newly created field
*/
- public Field (construct string name, construct DataType type_reference, construct Expression initializer, construct 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;
+ this.name = name;
}
public override void accept (CodeVisitor visitor) {
* @param source reference to source code
* @return newly created foreach statement
*/
- public ForeachStatement (construct DataType type_reference, construct string variable_name, construct Expression collection, construct Block body, construct SourceReference source_reference) {
+ public ForeachStatement (DataType type_reference, string variable_name, Expression collection, Block body, SourceReference source_reference) {
+ this.variable_name = variable_name;
+ this.collection = collection;
+ this.body = body;
+ this.source_reference = source_reference;
+ this.type_reference = type_reference;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created for statement
*/
- public ForStatement (construct Expression condition, construct Block body, construct 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;
}
/**
* @param source_reference reference to source code
* @return newly created initializer list
*/
- public InitializerList (construct SourceReference source_reference) {
+ public InitializerList (SourceReference source_reference) {
+ this.source_reference = source_reference;
}
public override void accept_children (CodeVisitor visitor) {
public class Vala.IntegerType : ValueType {
public IntegerLiteral literal { get; set; }
- public IntegerType (construct Typesymbol type_symbol) {
+ public IntegerType (Typesymbol type_symbol) {
+ this.type_symbol = type_symbol;
data_type = type_symbol;
}
* @param source reference to source code
* @return newly created interface
*/
- public Interface (construct string name, construct SourceReference source_reference = null) {
+ public Interface (string name, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.name = name;
}
/**
*/
public weak Interface interface_symbol { get; set; }
- public InterfaceType (construct Interface interface_symbol) {
+ public InterfaceType (Interface interface_symbol) {
+ this.interface_symbol = interface_symbol;
data_type = interface_symbol;
}
* @param source_reference reference to source code
* @return newly created invocation expression
*/
- public InvocationExpression (construct Expression call, construct SourceReference source_reference = null) {
+ public InvocationExpression (Expression call, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.call = call;
}
/**
* @param source_reference reference to source code
* @return newly created lambda expression
*/
- public LambdaExpression (construct Expression expression_body, construct SourceReference source_reference) {
+ public LambdaExpression (Expression expression_body, SourceReference source_reference) {
+ this.source_reference = source_reference;
+ this.expression_body = expression_body;
}
/**
* @param source_reference reference to source code
* @return newly created lambda expression
*/
- public LambdaExpression.with_statement_body (construct Block statement_body, construct SourceReference source_reference) {
+ public LambdaExpression.with_statement_body (Block statement_body, SourceReference source_reference) {
+ this.statement_body = statement_body;
+ this.source_reference = source_reference;
}
/**
* @param source_reference reference to source code
* @return newly created local variable declaration
*/
- public LocalVariableDeclaration (construct DataType type_reference, construct SourceReference source_reference) {
+ public LocalVariableDeclaration (DataType type_reference, SourceReference source_reference) {
+ this.type_reference = type_reference;
+ this.source_reference = source_reference;
}
/**
* @param source_reference reference to source code
* @return newly created local variable declaration
*/
- public LocalVariableDeclaration.var_type (construct SourceReference source_reference) {
+ public LocalVariableDeclaration.var_type (SourceReference source_reference) {
+ this.source_reference = source_reference;
}
/**
*/
public Block body { get; set construct; }
- public LockStatement (construct Expression resource, construct Block body, construct 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;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created member access expression
*/
- public MemberAccess (construct Expression inner, construct string member_name, construct 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 (construct string member_name, construct 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 (construct Expression inner, construct string member_name, construct 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;
pointer_member_access = true;
}
* @param source_reference reference to source code
* @return newly created member initializer
*/
- public MemberInitializer (construct string name, construct Expression initializer, construct 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;
}
public override void accept (CodeVisitor visitor) {
* @param source reference to source code
* @return newly created method
*/
- public Method (construct string name, construct DataType return_type, construct 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;
}
construct {
public class Vala.MethodType : DataType {
public Method method_symbol { get; set; }
- public MethodType (construct Method method_symbol) {
+ public MethodType (Method method_symbol) {
+ this.method_symbol = method_symbol;
}
public override bool is_invokable () {
* @param source_reference reference to source code
* @return newly created namespace
*/
- public Namespace (construct string name, construct SourceReference source_reference = null) {
+ public Namespace (string name, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.name = name;
access = SymbolAccessibility.PUBLIC;
}
* @param source_reference reference to source code
* @return newly created namespace reference
*/
- public NamespaceReference (construct string name, construct SourceReference source_reference) {
+ public NamespaceReference (string name, SourceReference source_reference) {
+ this.source_reference = source_reference;
+ this.name = name;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created object creation expression
*/
- public ObjectCreationExpression (construct MemberAccess member_name, construct SourceReference source_reference) {
+ public ObjectCreationExpression (MemberAccess member_name, SourceReference source_reference) {
+ this.source_reference = source_reference;
+ this.member_name = member_name;
}
/**
// varargs
return context.create_formal_parameter_with_ellipsis (get_src (begin));
}
- bool construct_param = accept (TokenType.CONSTRUCT);
+ bool construct_param = false;
+ if (accept (TokenType.CONSTRUCT)) {
+ Report.warning (get_last_src (), "deprecated syntax, use assignments in the method body");
+ construct_param = true;
+ }
var type = parse_type ();
var ut = type as UnresolvedType;
if (ut != null) {
* @param inner pointer to be dereferenced
* @return newly created pointer indirection
*/
- public PointerIndirection (construct Expression inner, construct SourceReference source_reference = null) {
+ public PointerIndirection (Expression inner, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.inner = inner;
}
public override void accept (CodeVisitor visitor) {
*/
public DataType base_type { get; set; }
- public PointerType (construct DataType base_type) {
+ public PointerType (DataType base_type) {
+ this.base_type = base_type;
}
public override string to_string () {
* @param source reference to source code
* @return newly created property accessor
*/
- public PropertyAccessor (construct bool readable, construct bool writable, construct bool construction, construct Block body, construct SourceReference source_reference) {
+ public PropertyAccessor (bool readable, bool writable, bool construction, Block body, SourceReference source_reference) {
+ this.writable = writable;
+ this.construction = construction;
+ this.body = body;
+ this.source_reference = source_reference;
+ this.readable = readable;
}
public override void accept (CodeVisitor visitor) {
* @param inner variable whose reference is to be transferred
* @return newly created reference transfer expression
*/
- public ReferenceTransferExpression (construct Expression inner, construct SourceReference source_reference = null) {
+ public ReferenceTransferExpression (Expression inner, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.inner = inner;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created return statement
*/
- public ReturnStatement (construct Expression return_expression = null, construct SourceReference source_reference = null) {
+ public ReturnStatement (Expression return_expression = null, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.return_expression = return_expression;
}
public override void accept (CodeVisitor visitor) {
*
* @return newly created scope
*/
- public Scope (construct Symbol owner = null) {
+ public Scope (Symbol owner = null) {
+ this.owner = owner;
}
/**
* @param source reference to source code
* @return newly created signal
*/
- public Signal (construct string name, construct DataType return_type, construct 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;
}
/**
public class Vala.SignalType : DataType {
public Signal signal_symbol { get; set; }
- public SignalType (construct Signal signal_symbol) {
+ public SignalType (Signal signal_symbol) {
+ this.signal_symbol = signal_symbol;
}
public override bool is_invokable () {
* @param pkg true if this is a VAPI package file
* @return newly created source file
*/
- public SourceFile (construct CodeContext context, construct string filename, construct bool pkg = false) {
+ public SourceFile (CodeContext context, string filename, bool pkg = false) {
+ this.filename = filename;
+ this.pkg = pkg;
+ this.context = context;
}
/**
* @param source_reference reference to source code
* @return newly created struct
*/
- public Struct (construct string name, construct SourceReference source_reference = null) {
+ public Struct (string name, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.name = name;
}
/**
* @param source_reference reference to source code
* @return newly created switch section
*/
- public SwitchSection (construct SourceReference source_reference) {
+ public SwitchSection (SourceReference source_reference) {
+ this.source_reference = source_reference;
}
/**
* @param source_reference reference to source code
* @return newly created switch statement
*/
- public SwitchStatement (construct Expression expression, construct SourceReference source_reference) {
+ public SwitchStatement (Expression expression, SourceReference source_reference) {
+ this.source_reference = source_reference;
+ this.expression = expression;
}
/**
* @param source_reference reference to source code
* @return newly created throw statement
*/
- public ThrowStatement (construct Expression error_expression, construct SourceReference source_reference = null) {
+ public ThrowStatement (Expression error_expression, SourceReference source_reference = null) {
+ this.source_reference = source_reference;
+ this.error_expression = error_expression;
}
public override void accept (CodeVisitor visitor) {
* @param source_reference reference to source code
* @return newly created try statement
*/
- public TryStatement (construct Block body, construct Block finally_body, construct SourceReference source_reference = null) {
+ public TryStatement (Block body, Block finally_body, SourceReference source_reference = null) {
+ this.finally_body = finally_body;
+ this.source_reference = source_reference;
+ this.body = body;
}
/**
*/
public weak Typesymbol type_symbol { get; set; }
- public ValueType (construct Typesymbol type_symbol) {
+ public ValueType (Typesymbol type_symbol) {
+ this.type_symbol = type_symbol;
data_type = type_symbol;
}
* @param source reference to source code
* @return newly created variable declarator
*/
- public VariableDeclarator (construct string name, construct Expression initializer = null, construct SourceReference source_reference = null) {
+ public VariableDeclarator (string name, Expression initializer = null, SourceReference source_reference = null) {
+ this.initializer = initializer;
+ this.source_reference = source_reference;
+ this.name = name;
}
public override void accept (CodeVisitor visitor) {
* @param source reference to source code
* @return newly created while statement
*/
- public WhileStatement (construct Expression condition, construct Block body, construct 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;
}
public override void accept (CodeVisitor visitor) {
using GLib;
class Vala.VAPICheck : Object {
- public VAPICheck (string gidlname, construct CodeContext context = new CodeContext ()) {
+ public VAPICheck (string gidlname, CodeContext context = new CodeContext ()) {
gidl = new SourceFile (context, gidlname);
metadata = new SourceFile (context, gidlname.substring (0, gidlname.len () - 5) + ".metadata");
+ this.context = context;
}
public CodeContext context { get; construct; }