Lines Matching refs:to
40 void LiteralDecl::Write(CodeWriter* to) const { in Write()
41 to->Write("%s", expression_.c_str()); in Write()
56 void ClassDecl::Write(CodeWriter* to) const { in Write()
57 to->Write("class %s ", name_.c_str()); in Write()
60 to->Write(": public %s ", parent_.c_str()); in Write()
62 to->Write("{\n"); in Write()
65 to->Write("public:\n"); in Write()
67 to->Indent(); in Write()
69 dec->Write(to); in Write()
70 to->Dedent(); in Write()
73 to->Write("private:\n"); in Write()
75 to->Indent(); in Write()
77 dec->Write(to); in Write()
78 to->Dedent(); in Write()
80 to->Write("}; // class %s\n", name_.c_str()); in Write()
98 void Enum::Write(CodeWriter* to) const { in Write()
99 to->Write("enum "); in Write()
101 to->Write("class "); in Write()
104 to->Write("%s {\n", enum_name_.c_str()); in Write()
106 to->Write("%s : %s {\n", enum_name_.c_str(), underlying_type_.c_str()); in Write()
108 to->Indent(); in Write()
111 to->Write("%s,\n", field.key.c_str()); in Write()
113 to->Write("%s = %s,\n", field.key.c_str(), field.value.c_str()); in Write()
116 to->Dedent(); in Write()
117 to->Write("};\n"); in Write()
138 void ArgList::Write(CodeWriter* to) const { in Write()
139 to->Write("("); in Write()
142 if (!is_first) { to->Write(", "); } in Write()
144 s->Write(to); in Write()
146 to->Write(")"); in Write()
162 void ConstructorDecl::Write(CodeWriter* to) const { in Write()
164 to->Write("virtual "); in Write()
167 to->Write("explicit "); in Write()
169 to->Write("%s", name_.c_str()); in Write()
171 arguments_.Write(to); in Write()
174 to->Write(" = default"); in Write()
176 to->Write(";\n"); in Write()
183 void MacroDecl::Write(CodeWriter* to) const { in Write()
184 to->Write("%s", name_.c_str()); in Write()
185 arguments_.Write(to); in Write()
186 to->Write("\n"); in Write()
206 void MethodDecl::Write(CodeWriter* to) const { in Write()
208 to->Write("virtual "); in Write()
211 to->Write("static "); in Write()
213 to->Write("%s %s", return_type_.c_str(), name_.c_str()); in Write()
215 arguments_.Write(to); in Write()
218 to->Write(" const"); in Write()
221 to->Write(" override"); in Write()
223 if (is_final_) to->Write(" final"); in Write()
226 to->Write(" = 0"); in Write()
228 to->Write(";\n"); in Write()
249 void StatementBlock::Write(CodeWriter* to) const { in Write()
250 to->Write("{\n"); in Write()
251 to->Indent(); in Write()
253 statement->Write(to); in Write()
255 to->Dedent(); in Write()
256 to->Write("}\n"); in Write()
270 void ConstructorImpl::Write(CodeWriter* to) const { in Write()
271 to->Write("%s::%s", class_name_.c_str(), class_name_.c_str()); in Write()
272 arguments_.Write(to); in Write()
273 to->Write("\n"); in Write()
278 to->Write(" : %s", i.c_str()); in Write()
280 to->Write(",\n %s", i.c_str()); in Write()
285 body_.Write(to); in Write()
306 void MethodImpl::Write(CodeWriter* to) const { in Write()
307 to->Write("%s %s", return_type_.c_str(), method_name_.c_str()); in Write()
308 arguments_.Write(to); in Write()
309 to->Write("%s ", (is_const_method_) ? " const" : ""); in Write()
310 statements_.Write(to); in Write()
328 void SwitchStatement::Write(CodeWriter* to) const { in Write()
329 to->Write("switch (%s) {\n", switch_expression_.c_str()); in Write()
334 to->Write("default:\n"); in Write()
336 to->Write("case %s:\n", case_value.c_str()); in Write()
338 statements->Write(to); in Write()
339 to->Write("break;\n"); in Write()
341 to->Write("}\n"); in Write()
352 void Assignment::Write(CodeWriter* to) const { in Write()
353 to->Write("%s = ", lhs_.c_str()); in Write()
354 rhs_->Write(to); in Write()
355 to->Write(";\n"); in Write()
367 void MethodCall::Write(CodeWriter* to) const { in Write()
368 to->Write("%s", method_name_.c_str()); in Write()
369 arguments_.Write(to); in Write()
376 void IfStatement::Write(CodeWriter* to) const { in Write()
377 to->Write("if (%s", (invert_expression_) ? "!(" : ""); in Write()
378 expression_->Write(to); in Write()
379 to->Write(")%s ", (invert_expression_) ? ")" : ""); in Write()
380 on_true_.Write(to); in Write()
383 to->Write("else "); in Write()
384 on_false_.Write(to); in Write()
396 void Statement::Write(CodeWriter* to) const { in Write()
397 expression_->Write(to); in Write()
398 to->Write(";\n"); in Write()
406 void Comparison::Write(CodeWriter* to) const { in Write()
407 to->Write("(("); in Write()
408 left_->Write(to); in Write()
409 to->Write(") %s (", operator_.c_str()); in Write()
410 right_->Write(to); in Write()
411 to->Write("))"); in Write()
417 void LiteralExpression::Write(CodeWriter* to) const { in Write()
418 to->Write("%s", expression_.c_str()); in Write()
434 void CppNamespace::Write(CodeWriter* to) const { in Write()
435 to->Write("namespace %s {\n\n", name_.c_str()); in Write()
438 dec->Write(to); in Write()
439 to->Write("\n"); in Write()
442 to->Write("} // namespace %s\n", name_.c_str()); in Write()
449 void Document::Write(CodeWriter* to) const { in Write()
451 to->Write("#include <%s>\n", include.c_str()); in Write()
453 to->Write("\n"); in Write()
456 declaration->Write(to); in Write()
464 void CppHeader::Write(CodeWriter* to) const { in Write()
465 to->Write("#ifndef %s\n", include_guard_.c_str()); in Write()
466 to->Write("#define %s\n\n", include_guard_.c_str()); in Write()
468 Document::Write(to); in Write()
469 to->Write("\n"); in Write()
471 to->Write("#endif // %s\n", include_guard_.c_str()); in Write()