+void CYCategory::Output(std::ostream &out) const {
+ out << "(function($cys,$cyp,$cyc,$cyn,$cyt){";
+ out << "$cyp=object_getClass($cys);";
+ out << "$cyc=$cys;";
+ if (messages_ != NULL)
+ messages_->Output(out, true);
+ out << "})(";
+ name_->ClassName(out);
+ out << ");";
+}
+
+void CYClass::Output(std::ostream &out) const {
+ out << "(function($cys,$cyp,$cyc,$cyn,$cyt,$cym){";
+ out << "$cyp=object_getClass($cys);";
+ out << "$cyc=objc_allocateClassPair($cys,\"" << *name_ << "\",0);";
+ out << "$cym=object_getClass($cyc);";
+ if (fields_ != NULL)
+ fields_->Output(out);
+ if (messages_ != NULL)
+ messages_->Output(out, false);
+ out << "objc_registerClassPair($cyc);";
+ out << "})(";
+ if (super_ != NULL)
+ super_->Output(out, CYPA, CYNoFlags);
+ else
+ out << "null";
+ out << ");";
+}
+
+void CYCompound::Output(std::ostream &out, CYFlags flags) const {
+ if (CYExpression *expression = expressions_)
+ if (CYExpression *next = expression->next_) {
+ expression->Output(out, CYLeft(flags));
+ CYFlags center(CYCenter(flags));
+ while (next != NULL) {
+ expression = next;
+ out << ',';
+ next = expression->next_;
+ CYFlags right(next != NULL ? center : CYRight(flags));
+ expression->Output(out, right);
+ }
+ } else
+ expression->Output(out, flags);
+}
+
+void CYCondition::Output(std::ostream &out, CYFlags flags) const {
+ test_->Output(out, Precedence() - 1, CYLeft(flags));
+ out << '?';