Lines Matching refs:to
44 void ClassDecl::Write(CodeWriter* to) const { in Write()
45 to->Write("class %s ", name_.c_str()); in Write()
48 to->Write(": public %s ", parent_.c_str()); in Write()
50 to->Write("{\n"); in Write()
53 to->Write("public:\n"); in Write()
56 dec->Write(to); in Write()
59 to->Write("private:\n"); in Write()
62 dec->Write(to); in Write()
64 to->Write("}; // class %s\n", name_.c_str()); in Write()
84 void Enum::Write(CodeWriter* to) const { in Write()
86 to->Write("enum %s {\n", enum_name_.c_str()); in Write()
88 to->Write("enum %s : %s {\n", enum_name_.c_str(), underlying_type_.c_str()); in Write()
92 to->Write(" %s,\n", field.key.c_str()); in Write()
94 to->Write(" %s = %s,\n", field.key.c_str(), field.value.c_str()); in Write()
97 to->Write("};\n"); in Write()
119 void ArgList::Write(CodeWriter* to) const { in Write()
120 to->Write("("); in Write()
123 if (!is_first) { to->Write(", "); } in Write()
125 s->Write(to); in Write()
127 to->Write(")"); in Write()
143 void ConstructorDecl::Write(CodeWriter* to) const { in Write()
145 to->Write("virtual "); in Write()
148 to->Write("explicit "); in Write()
150 to->Write("%s", name_.c_str()); in Write()
152 arguments_.Write(to); in Write()
155 to->Write(" = default"); in Write()
157 to->Write(";\n"); in Write()
177 void MethodDecl::Write(CodeWriter* to) const { in Write()
179 to->Write("virtual "); in Write()
181 to->Write("%s %s", return_type_.c_str(), name_.c_str()); in Write()
183 arguments_.Write(to); in Write()
186 to->Write(" const"); in Write()
189 to->Write(" override"); in Write()
192 to->Write(" = 0"); in Write()
194 to->Write(";\n"); in Write()
215 void StatementBlock::Write(CodeWriter* to) const { in Write()
216 to->Write("{\n"); in Write()
218 statement->Write(to); in Write()
220 to->Write("}\n"); in Write()
230 void ConstructorImpl::Write(CodeWriter* to) const { in Write()
231 to->Write("%s::%s", class_name_.c_str(), class_name_.c_str()); in Write()
232 arguments_.Write(to); in Write()
233 to->Write("\n"); in Write()
238 to->Write(" : %s", i.c_str()); in Write()
240 to->Write(",\n %s", i.c_str()); in Write()
245 body_.Write(to); in Write()
266 void MethodImpl::Write(CodeWriter* to) const { in Write()
267 to->Write("%s %s", return_type_.c_str(), method_name_.c_str()); in Write()
268 arguments_.Write(to); in Write()
269 to->Write("%s ", (is_const_method_) ? " const" : ""); in Write()
270 statements_.Write(to); in Write()
288 void SwitchStatement::Write(CodeWriter* to) const { in Write()
289 to->Write("switch (%s) {\n", switch_expression_.c_str()); in Write()
294 to->Write("default:\n"); in Write()
296 to->Write("case %s:\n", case_value.c_str()); in Write()
298 statements->Write(to); in Write()
299 to->Write("break;\n"); in Write()
301 to->Write("}\n"); in Write()
312 void Assignment::Write(CodeWriter* to) const { in Write()
313 to->Write("%s = ", lhs_.c_str()); in Write()
314 rhs_->Write(to); in Write()
315 to->Write(";\n"); in Write()
327 void MethodCall::Write(CodeWriter* to) const { in Write()
328 to->Write("%s", method_name_.c_str()); in Write()
329 arguments_.Write(to); in Write()
336 void IfStatement::Write(CodeWriter* to) const { in Write()
337 to->Write("if (%s", (invert_expression_) ? "!(" : ""); in Write()
338 expression_->Write(to); in Write()
339 to->Write(")%s ", (invert_expression_) ? ")" : ""); in Write()
340 on_true_.Write(to); in Write()
343 to->Write("else "); in Write()
344 on_false_.Write(to); in Write()
356 void Statement::Write(CodeWriter* to) const { in Write()
357 expression_->Write(to); in Write()
358 to->Write(";\n"); in Write()
366 void Comparison::Write(CodeWriter* to) const { in Write()
367 to->Write("(("); in Write()
368 left_->Write(to); in Write()
369 to->Write(") %s (", operator_.c_str()); in Write()
370 right_->Write(to); in Write()
371 to->Write("))"); in Write()
377 void LiteralExpression::Write(CodeWriter* to) const { in Write()
378 to->Write("%s", expression_.c_str()); in Write()
394 void CppNamespace::Write(CodeWriter* to) const { in Write()
395 to->Write("namespace %s {\n\n", name_.c_str()); in Write()
398 dec->Write(to); in Write()
399 to->Write("\n"); in Write()
402 to->Write("} // namespace %s\n", name_.c_str()); in Write()
410 void Document::Write(CodeWriter* to) const { in Write()
412 to->Write("#include <%s>\n", include.c_str()); in Write()
414 to->Write("\n"); in Write()
416 namespace_->Write(to); in Write()
425 void CppHeader::Write(CodeWriter* to) const { in Write()
426 to->Write("#ifndef %s\n", include_guard_.c_str()); in Write()
427 to->Write("#define %s\n\n", include_guard_.c_str()); in Write()
429 Document::Write(to); in Write()
430 to->Write("\n"); in Write()
432 to->Write("#endif // %s", include_guard_.c_str()); in Write()