}
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 << ';';
}
+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 {