}
if (next_ != NULL) {
if (!send)
- if (next_->name_ != NULL)
+ if (next_->name_ == NULL)
out << ',';
else
out << ' ';
}
}
+void CYArray::Output(std::ostream &out) const {
+ out << '[';
+ if (elements_ != NULL)
+ elements_->Output(out);
+ out << ']';
+}
+
void CYBoolean::Output(std::ostream &out) const {
out << (Value() ? "true" : "false");
}
out << "while" << *test_ << ';';
}
-void CYElement::Output(std::ostream &out, bool raw) const {
- if (!raw)
- out << '[';
+void CYElement::Output(std::ostream &out) const {
if (value_ != NULL)
value_->Output(out, true);
- if (next_ != NULL) {
+ if (next_ != NULL || value_ == NULL)
out << ',';
- next_->Output(out, true);
- }
- if (!raw)
- out << ']';
-}
-
-void CYElement::Output(std::ostream &out) const {
- Output(out, false);
+ if (next_ != NULL)
+ next_->Output(out);
}
void CYEmpty::Output(std::ostream &out) const {
out << Value();
}
+void CYObject::Output(std::ostream &out) const {
+ out << '{';
+ if (property_ != NULL)
+ property_->Output(out);
+ out << '}';
+}
+
void CYParameter::Output(std::ostream &out) const {
out << *name_;
if (next_ != NULL) {
out << Operator() << *rhs_;
}
-void CYProperty::Output(std::ostream &out, bool raw) const {
- if (!raw)
- out << '{';
+void CYProperty::Output(std::ostream &out) const {
out << *name_ << ':' << *value_;
if (next_ != NULL) {
out << ',';
- next_->Output(out, true);
+ next_->Output(out);
}
- if (!raw)
- out << '}';
-}
-
-void CYProperty::Output(std::ostream &out) const {
- Output(out, false);
}
void CYReturn::Output(std::ostream &out) const {
out << ';';
}
-void CYSource::Part(std::ostream &out) const {
+void CYSelector::Output(std::ostream &out) const {
+ out << '"';
+ if (name_ != NULL)
+ name_->Output(out);
+ out << '"';
+}
+
+void CYSelectorPart::Output(std::ostream &out) const {
+ if (name_ != NULL)
+ out << *name_;
+ if (value_)
+ out << ':';
+ if (next_ != NULL)
+ next_->Output(out);
+}
+
+void CYSource::Show(std::ostream &out) const {
for (const CYSource *next(this); next != NULL; next = next->next_)
- next->Output(out);
+ next->Output(out, false);
}
void CYSource::Output(std::ostream &out, bool block) const {
Output(out);
else {
out << '{';
- Part(out);
+ Show(out);
out << '}';
}
}