for (int i = 0; i < sizes.size; i++) {
if (sizes[i] == old_node) {
sizes[i] = new_node;
+ new_node.parent_node = this;
return;
}
}
/**
* Specifies the instance constructor.
*/
- public Constructor constructor { get; set; }
+ public Constructor constructor {
+ get { return _constructor; }
+ set {
+ _constructor = value;
+ if (_constructor != null) {
+ _constructor.owner = scope;
+ }
+ }
+ }
/**
* Specifies the class constructor.
*/
- public Constructor class_constructor { get; set; }
+ public Constructor class_constructor {
+ get { return _class_constructor; }
+ set {
+ _class_constructor = value;
+ if (_class_constructor != null) {
+ _class_constructor.owner = scope;
+ }
+ }
+ }
/**
* Specifies the static class constructor.
*/
- public Constructor static_constructor { get; set; }
+ public Constructor static_constructor {
+ get { return _static_constructor; }
+ set {
+ _static_constructor = value;
+ if (_static_constructor != null) {
+ _static_constructor.owner = scope;
+ }
+ }
+ }
/**
* Specifies the instance destructor.
set {
_destructor = value;
if (_destructor != null) {
+ _destructor.owner = scope;
if (_destructor.this_parameter != null) {
_destructor.scope.remove (_destructor.this_parameter.name);
}
/**
* Specifies the class destructor.
*/
- public Destructor? static_destructor { get; set; }
+ public Destructor? static_destructor {
+ get { return _static_destructor; }
+ set {
+ _static_destructor = value;
+ if (_static_destructor != null) {
+ _static_destructor.owner = scope;
+ }
+ }
+ }
/**
* Specifies the class destructor.
*/
- public Destructor? class_destructor { get; set; }
+ public Destructor? class_destructor {
+ get { return _class_destructor; }
+ set {
+ _class_destructor = value;
+ if (_class_destructor != null) {
+ _class_destructor.owner = scope;
+ }
+ }
+ }
/**
* Specifies whether this class denotes an error base.
}
}
+ Constructor _constructor;
+ Constructor _class_constructor;
+ Constructor _static_constructor;
Destructor? _destructor;
+ Destructor? _class_destructor;
+ Destructor? _static_destructor;
/**
* Creates a new class.
}
int index = indices.index_of (old_node);
- if (index >= 0 && new_node.parent_node == null) {
+ if (index >= 0) {
indices[index] = new_node;
new_node.parent_node = this;
}
/**
* Specifies the numerical representation of this enum value.
*/
- public Expression value { get; set; }
+ public Expression? value {
+ get { return _value; }
+ set {
+ _value = value;
+ if (_value != null) {
+ _value.parent_node = this;
+ }
+ }
+ }
+
+ private Expression _value;
/**
* Creates a new enum value.
for (int i=0; i < initializer.size; i++) {
if (initializer[i] == old_node) {
initializer[i] = new_node;
+ new_node.parent_node = this;
}
}
for (int i=0; i < iterator.size; i++) {
if (iterator[i] == old_node) {
iterator[i] = new_node;
+ new_node.parent_node = this;
}
}
}
for (int i = 0; i < initializers.size; i++) {
if (initializers[i] == old_node) {
initializers[i] = new_node;
+ new_node.parent_node = this;
}
}
}
/**
* Expression representing the resource to be locked.
*/
- public Expression resource { get; set; }
+ public Expression resource {
+ get { return _resource; }
+ set {
+ _resource = value;
+ _resource.parent_node = this;
+ }
+ }
/**
* The statement during its execution the resource is locked.
*/
- public Block? body { get; set; }
+ public Block? body {
+ get { return _body; }
+ set {
+ _body = value;
+ if (_body != null) {
+ _body.parent_node = this;
+ }
+ }
+ }
+
+ private Expression _resource;
+ private Block _body;
public LockStatement (Expression resource, Block? body, SourceReference? source_reference = null) {
this.body = body;
}
int index = argument_list.index_of (old_node);
- if (index >= 0 && new_node.parent_node == null) {
+ if (index >= 0) {
argument_list[index] = new_node;
new_node.parent_node = this;
}
* The construction method to use or the data type to be created
* with the default construction method.
*/
- public MemberAccess member_name { get; set; }
+ public MemberAccess? member_name {
+ get { return _member_name; }
+ set {
+ _member_name = value;
+ if (_member_name != null) {
+ _member_name.parent_node = this;
+ }
+ }
+ }
public bool is_yield_expression { get; set; }
private List<MemberInitializer> object_initializer = new ArrayList<MemberInitializer> ();
private DataType _data_type;
+ private MemberAccess? _member_name;
/**
* Creates a new object creation expression.
* @param source_reference reference to source code
* @return newly created object creation expression
*/
- public ObjectCreationExpression (MemberAccess member_name, SourceReference source_reference) {
+ public ObjectCreationExpression (MemberAccess? member_name, SourceReference source_reference) {
this.source_reference = source_reference;
this.member_name = member_name;
}
public override void replace_expression (Expression old_node, Expression new_node) {
int index = argument_list.index_of (old_node);
- if (index >= 0 && new_node.parent_node == null) {
+ if (index >= 0) {
argument_list[index] = new_node;
new_node.parent_node = this;
}
/**
* Specifies the label expression.
*/
- public Expression expression { get; set; }
+ public Expression expression {
+ get { return _expression; }
+ set {
+ _expression = value;
+ _expression.parent_node = this;
+ }
+ }
+
+ public weak SwitchSection section {
+ get { return (SwitchSection) parent_node; }
+ }
- public weak SwitchSection section { get; set; }
+ private Expression _expression;
/**
* Creates a new switch case label.
}
labels.add (label);
- label.section = this;
+ label.parent_node = this;
}
/**
public void add_expression (Expression expr) {
expression_list.add (expr);
+ expr.parent_node = this;
}
public List<Expression> get_expressions () {
public void add_expression (Expression expr) {
expression_list.add (expr);
+ expr.parent_node = this;
}
public List<Expression> get_expressions () {
for (int i = 0; i < expression_list.size; i++) {
if (expression_list[i] == old_node) {
expression_list[i] = new_node;
+ new_node.parent_node = this;
}
}
}
/**
* Expression representing the resource to be unlocked.
*/
- public Expression resource { get; set; }
+ public Expression resource {
+ get { return _resource; }
+ set {
+ _resource = value;
+ _resource.parent_node = this;
+ }
+ }
+
+ private Expression _resource;
public UnlockStatement (Expression resource, SourceReference? source_reference = null) {
this.source_reference = source_reference;