+void CYTypedParameter::Output(CYOutput &out) const {
+ out << typed_;
+ if (next_ != NULL)
+ out << ',' << ' ' << next_;
+}
+
+void CYLambda::Output(CYOutput &out, CYFlags flags) const {
+ // XXX: this is seriously wrong
+ out << "[](";
+ out << ")->";
+ out << "{";
+ out << "}";
+}
+
+void CYTypeDefinition::Output(CYOutput &out, CYFlags flags) const {
+ out << "typedef" << ' ' << *typed_;
+}
+
+void CYLetStatement::Output(CYOutput &out, CYFlags flags) const {
+ out << "let" << ' ' << '(' << *declarations_ << ')';
+ code_->Single(out, CYRight(flags), CYCompactShort);
+}
+
+void CYModule::Output(CYOutput &out) const {
+ out << part_;
+ if (next_ != NULL)
+ out << '.' << next_;
+}
+
+namespace cy {
+namespace Syntax {
+
+void New::Output(CYOutput &out, CYFlags flags) const {
+ out << "new" << ' ';
+ CYFlags jacks(CYNoCall | CYCenter(flags));
+ constructor_->Output(out, Precedence(), jacks);
+ if (arguments_ != NULL)
+ out << '(' << *arguments_ << ')';
+}
+
+} }
+
+void CYNull::Output(CYOutput &out, CYFlags flags) const {
+ out << "null";
+}
+
+void CYNumber::Output(CYOutput &out, CYFlags flags) const {
+ std::ostringstream str;
+ CYNumerify(str, Value());
+ std::string value(str.str());
+ out << value.c_str();
+ // XXX: this should probably also handle hex conversions and exponents
+ if ((flags & CYNoInteger) != 0 && value.find('.') == std::string::npos)
+ out << '.';
+}
+
+void CYNumber::PropertyName(CYOutput &out) const {
+ Output(out, CYNoFlags);
+}
+
+void CYObject::Output(CYOutput &out, CYFlags flags) const {
+ bool protect((flags & CYNoBrace) != 0);
+ if (protect)
+ out << '(';
+ out << '{' << '\n';
+ ++out.indent_;
+ out << properties_;
+ --out.indent_;
+ out << '\t' << '}';
+ if (protect)
+ out << ')';
+}
+
+void CYPostfix::Output(CYOutput &out, CYFlags flags) const {
+ lhs_->Output(out, Precedence(), CYLeft(flags));
+ out << Operator();
+}
+
+void CYPrefix::Output(CYOutput &out, CYFlags flags) const {
+ const char *name(Operator());
+ out << name;
+ if (Alphabetic())
+ out << ' ';
+ rhs_->Output(out, Precedence(), CYRight(flags));
+}
+
+void CYProgram::Output(CYOutput &out) const {
+ out << code_;
+}
+
+void CYProperty::Output(CYOutput &out) const {
+ out << '\t';
+ name_->PropertyName(out);
+ out << ':' << ' ';
+ value_->Output(out, CYAssign::Precedence_, CYNoFlags);
+ if (next_ != NULL)
+ out << ',' << '\n' << *next_;
+ else
+ out << '\n';
+}
+
+void CYRegEx::Output(CYOutput &out, CYFlags flags) const {
+ out << Value();