inner.accept (visitor);
}
+ public override string to_string () {
+ return "&" + inner.to_string ();
+ }
+
public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
return true;
}
+ public override string to_string () {
+ var builder = new StringBuilder ("new ");
+ builder.append_printf ("%s[", element_type.to_string ());
+ bool first = true;
+ foreach (var size in sizes) {
+ if (first) {
+ builder.append (size.to_string ());
+ first = false;
+ } else {
+ builder.append_printf (", %s", size.to_string ());
+ }
+ }
+ if (initializer_list != null) {
+ builder.append (initializer_list.to_string ());
+ }
+ return builder.str;
+ }
+
public override void replace_expression (Expression old_node, Expression new_node) {
for (int i = 0; i < sizes.size; i++) {
if (sizes[i] == old_node) {
right.accept (visitor);
}
+ private unowned string get_operator_string () {
+ switch (_operator) {
+ case AssignmentOperator.SIMPLE: return "=";
+ case AssignmentOperator.BITWISE_OR: return "|=";
+ case AssignmentOperator.BITWISE_AND: return "&=";
+ case AssignmentOperator.BITWISE_XOR: return "^=";
+ case AssignmentOperator.ADD: return "+=";
+ case AssignmentOperator.SUB: return "-=";
+ case AssignmentOperator.MUL: return "*=";
+ case AssignmentOperator.DIV: return "/=";
+ case AssignmentOperator.PERCENT: return "%=";
+ case AssignmentOperator.SHIFT_LEFT: return "<<=";
+ case AssignmentOperator.SHIFT_RIGHT: return ">>=";
+ default: assert_not_reached ();
+ }
+ }
+
+ public override string to_string () {
+ return "(%s %s %s)".printf (_left.to_string (), get_operator_string (), _right.to_string ());
+ }
+
public override void replace_expression (Expression old_node, Expression new_node) {
if (left == old_node) {
left = new_node;
}
public override string to_string () {
- return _left.to_string () + get_operator_string () + _right.to_string ();
+ return "(%s %s %s)".printf (_left.to_string (), get_operator_string (), _right.to_string ());
}
public override bool is_constant () {
}
}
+ public override string to_string () {
+ if (is_non_null_cast) {
+ return "(!) %s".printf (inner.to_string ());
+ } else if (is_silent_cast) {
+ return "%s as %s".printf (inner.to_string (), type_reference.to_string ());
+ } else {
+ return "(%s) %s".printf (type_reference.to_string (), inner.to_string ());
+ }
+ }
+
public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
false_expression.get_error_types (collection, source_reference);
}
+ public override string to_string () {
+ return "(%s ? %s : %s)".printf (condition.to_string (), true_expression.to_string (), false_expression.to_string ());
+ }
+
public override void replace_expression (Expression old_node, Expression new_node) {
if (condition == old_node) {
condition = new_node;
}
}
+ public override string to_string () {
+ var s = "%s[".printf (container.to_string ());
+ bool first = true;
+ foreach (var index in indices) {
+ if (first) {
+ s += index.to_string ();
+ first = false;
+ } else {
+ s += ", %s".printf (index.to_string ());
+ }
+ }
+ return s + "]";
+ }
+
public override void replace_expression (Expression old_node, Expression new_node) {
if (container == old_node) {
container = new_node;
return true;
}
+ public override string to_string () {
+ var builder = new StringBuilder ("{");
+ bool first = true;
+ foreach (var initializer in initializers) {
+ if (first) {
+ builder.append (initializer.to_string ());
+ first = false;
+ } else {
+ builder.append_printf (", %s", initializer.to_string ());
+ }
+ }
+ return builder.str;
+ }
+
public override void replace_expression (Expression old_node, Expression new_node) {
for (int i = 0; i < initializers.size; i++) {
if (initializers[i] == old_node) {
if (inner == null) {
return member_name;
} else {
- return "%s.%s".printf (inner.to_string (), member_name);
+ return "%s%s%s".printf (inner.to_string (), pointer_member_access ? "->" : ".", member_name);
}
} else {
// ensure to always use fully-qualified name
return null;
}
+
+ public override string to_string () {
+ var b = new StringBuilder ();
+ b.append_c ('(');
+ if (is_yield_expression) {
+ b.append ("yield ");
+ }
+ b.append (call.to_string ());
+ b.append_c ('(');
+
+ bool first = true;
+ foreach (var expr in argument_list) {
+ if (!first) {
+ b.append (", ");
+ }
+ b.append (expr.to_string ());
+ first = false;
+ }
+ b.append ("))");
+
+ return b.str;
+ }
}
return !error;
}
+
+ public override string to_string () {
+ if (name == null) {
+ return "(root namespace)";
+ } else {
+ return "namespace %s".printf (name);
+ }
+ }
}
public override void get_used_variables (Collection<Variable> collection) {
inner.get_used_variables (collection);
}
+
+ public override string to_string () {
+ return "(*%s)".printf (inner.to_string ());
+ }
}
codegen.visit_expression (this);
}
+
+ public override string to_string () {
+ return "(%s%s)".printf (inner.to_string (), increment ? "++" : "--");
+ }
}
collection.add (param);
}
}
+
+ public override string to_string () {
+ return "(owned) %s".printf (inner.to_string ());
+ }
}
public virtual void add_destructor (Destructor d) {
Report.error (d.source_reference, "unexpected declaration");
}
+
+ public override string to_string () {
+ return get_full_name ();
+ }
}
public enum Vala.SymbolAccessibility {
codegen.visit_expression (this);
}
+
+ public override string to_string () {
+ return "(%s is %s)".printf (expression.to_string (), type_reference.to_string ());
+ }
}