|
@@ -100,6 +100,19 @@ String Pointer::to_string() const
|
|
return builder.to_string();
|
|
return builder.to_string();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+String Reference::to_string() const
|
|
|
|
+{
|
|
|
|
+ if (!m_referenced_type)
|
|
|
|
+ return {};
|
|
|
|
+ StringBuilder builder;
|
|
|
|
+ builder.append(m_referenced_type->to_string());
|
|
|
|
+ if (m_kind == Kind::Lvalue)
|
|
|
|
+ builder.append("&");
|
|
|
|
+ else
|
|
|
|
+ builder.append("&&");
|
|
|
|
+ return builder.to_string();
|
|
|
|
+}
|
|
|
|
+
|
|
void Parameter::dump(FILE* output, size_t indent) const
|
|
void Parameter::dump(FILE* output, size_t indent) const
|
|
{
|
|
{
|
|
ASTNode::dump(output, indent);
|
|
ASTNode::dump(output, indent);
|
|
@@ -359,6 +372,16 @@ void Pointer::dump(FILE* output, size_t indent) const
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void Reference::dump(FILE* output, size_t indent) const
|
|
|
|
+{
|
|
|
|
+ ASTNode::dump(output, indent);
|
|
|
|
+ print_indent(output, indent + 1);
|
|
|
|
+ outln(output, "{}", m_kind == Kind::Lvalue ? "&" : "&&");
|
|
|
|
+ if (!m_referenced_type.is_null()) {
|
|
|
|
+ m_referenced_type->dump(output, indent + 1);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
void MemberExpression::dump(FILE* output, size_t indent) const
|
|
void MemberExpression::dump(FILE* output, size_t indent) const
|
|
{
|
|
{
|
|
ASTNode::dump(output, indent);
|
|
ASTNode::dump(output, indent);
|