Lines Matching refs:to
40 void WriteModifiers(CodeWriter* to, int mod, int mask) { in WriteModifiers() argument
44 to->Write("@Override "); in WriteModifiers()
48 to->Write("public "); in WriteModifiers()
50 to->Write("private "); in WriteModifiers()
52 to->Write("protected "); in WriteModifiers()
56 to->Write("static "); in WriteModifiers()
60 to->Write("final "); in WriteModifiers()
64 to->Write("abstract "); in WriteModifiers()
68 void WriteArgumentList(CodeWriter* to, const vector<std::shared_ptr<Expression>>& arguments) { in WriteArgumentList() argument
71 arguments[i]->Write(to); in WriteArgumentList()
73 to->Write(", "); in WriteArgumentList()
80 void Field::Write(CodeWriter* to) const { in Write()
82 to->Write("%s\n", this->comment.c_str()); in Write()
85 to->Write("%s\n", a.c_str()); in Write()
87 WriteModifiers(to, this->modifiers, SCOPE_MASK | STATIC | FINAL | OVERRIDE); in Write()
88 this->variable->WriteDeclaration(to); in Write()
91 to->Write(" = %s", this->value.c_str()); in Write()
93 to->Write(";\n"); in Write()
98 void LiteralExpression::Write(CodeWriter* to) const { in Write()
99 to->Write("%s", this->value.c_str()); in Write()
104 void StringLiteralExpression::Write(CodeWriter* to) const { in Write()
105 to->Write("\"%s\"", this->value.c_str()); in Write()
110 void Variable::WriteDeclaration(CodeWriter* to) const { in WriteDeclaration()
112 to->Write("%s ", a.c_str()); in WriteDeclaration()
114 to->Write("%s %s", this->type.c_str(), this->name.c_str()); in WriteDeclaration()
117 void Variable::Write(CodeWriter* to) const { to->Write("%s", name.c_str()); } in Write()
124 void FieldVariable::Write(CodeWriter* to) const { in Write()
126 overloaded{[&](std::shared_ptr<Expression> e) { e->Write(to); }, in Write()
127 [&](const std::string& s) { to->Write("%s", s.c_str()); }, [](std::monostate) {}}, in Write()
129 to->Write(".%s", name.c_str()); in Write()
134 void LiteralStatement::Write(CodeWriter* to) const { in Write()
135 to->Write("%s", value_.c_str()); in Write()
138 void StatementBlock::Write(CodeWriter* to) const { in Write()
139 to->Write("{\n"); in Write()
140 to->Indent(); in Write()
143 this->statements[i]->Write(to); in Write()
145 to->Dedent(); in Write()
146 to->Write("}\n"); in Write()
159 void ExpressionStatement::Write(CodeWriter* to) const { in Write()
160 this->expression->Write(to); in Write()
161 to->Write(";\n"); in Write()
170 void Assignment::Write(CodeWriter* to) const { in Write()
171 this->lvalue->Write(to); in Write()
172 to->Write(" = "); in Write()
174 to->Write("(%s)", this->cast->c_str()); in Write()
176 this->rvalue->Write(to); in Write()
196 void MethodCall::Write(CodeWriter* to) const { in Write()
199 e->Write(to); in Write()
200 to->Write("."); in Write()
202 [&](const std::string& s) { to->Write("%s.", s.c_str()); }, [](std::monostate) {}}, in Write()
204 to->Write("%s(", this->name.c_str()); in Write()
205 WriteArgumentList(to, this->arguments); in Write()
206 to->Write(")"); in Write()
213 void Comparison::Write(CodeWriter* to) const { in Write()
214 to->Write("("); in Write()
215 this->lvalue->Write(to); in Write()
216 to->Write("%s", this->op.c_str()); in Write()
217 this->rvalue->Write(to); in Write()
218 to->Write(")"); in Write()
227 void NewExpression::Write(CodeWriter* to) const { in Write()
228 to->Write("new %s(", this->instantiableName.c_str()); in Write()
229 WriteArgumentList(to, this->arguments); in Write()
230 to->Write(")"); in Write()
236 void NewArrayExpression::Write(CodeWriter* to) const { in Write()
237 to->Write("new %s[", this->type.c_str()); in Write()
238 size->Write(to); in Write()
239 to->Write("]"); in Write()
244 void Cast::Write(CodeWriter* to) const { in Write()
245 to->Write("((%s)", this->type.c_str()); in Write()
246 expression->Write(to); in Write()
247 to->Write(")"); in Write()
255 void VariableDeclaration::Write(CodeWriter* to) const { in Write()
256 this->lvalue->WriteDeclaration(to); in Write()
258 to->Write(" = "); in Write()
259 this->rvalue->Write(to); in Write()
261 to->Write(";\n"); in Write()
264 void IfStatement::Write(CodeWriter* to) const { in Write()
266 to->Write("if ("); in Write()
267 this->expression->Write(to); in Write()
268 to->Write(") "); in Write()
270 this->statements->Write(to); in Write()
272 to->Write("else "); in Write()
273 this->elseif->Write(to); in Write()
279 void ReturnStatement::Write(CodeWriter* to) const { in Write()
280 to->Write("return "); in Write()
281 this->expression->Write(to); in Write()
282 to->Write(";\n"); in Write()
285 void TryStatement::Write(CodeWriter* to) const { in Write()
286 to->Write("try "); in Write()
287 this->statements->Write(to); in Write()
290 void FinallyStatement::Write(CodeWriter* to) const { in Write()
291 to->Write("finally "); in Write()
292 this->statements->Write(to); in Write()
297 void Case::Write(CodeWriter* to) const { in Write()
303 to->Write("case %s:\n", s.c_str()); in Write()
305 to->Write("default:\n"); in Write()
309 to->Write("default:\n"); in Write()
311 statements->Write(to); in Write()
316 void SwitchStatement::Write(CodeWriter* to) const { in Write()
317 to->Write("switch ("); in Write()
318 this->expression->Write(to); in Write()
319 to->Write(")\n{\n"); in Write()
320 to->Indent(); in Write()
323 this->cases[i]->Write(to); in Write()
325 to->Dedent(); in Write()
326 to->Write("}\n"); in Write()
329 void Method::Write(CodeWriter* to) const { in Write()
333 to->Write("%s\n", this->comment.c_str()); in Write()
337 to->Write("%s\n", a.c_str()); in Write()
340 WriteModifiers(to, this->modifiers, in Write()
344 to->Write("%s ", this->returnType->c_str()); in Write()
347 to->Write("%s(", this->name.c_str()); in Write()
351 this->parameters[i]->WriteDeclaration(to); in Write()
353 to->Write(", "); in Write()
357 to->Write(")"); in Write()
362 to->Write(" throws "); in Write()
364 to->Write(", "); in Write()
366 to->Write("%s", this->exceptions[i].c_str()); in Write()
370 to->Write(";\n"); in Write()
372 to->Write("\n"); in Write()
373 this->statements->Write(to); in Write()
377 void LiteralClassElement::Write(CodeWriter* to) const { in Write()
378 to->Write("%s", element.c_str()); in Write()
381 void Class::Write(CodeWriter* to) const { in Write()
385 to->Write("%s\n", this->comment.c_str()); in Write()
388 to->Write("%s\n", a.c_str()); in Write()
391 WriteModifiers(to, this->modifiers, ALL_MODIFIERS); in Write()
394 to->Write("class "); in Write()
396 to->Write("interface "); in Write()
405 to->Write("%s", name.c_str()); in Write()
408 to->Write(" extends %s", this->extends->c_str()); in Write()
414 to->Write(" implements"); in Write()
416 to->Write(" extends"); in Write()
419 to->Write(" %s", this->interfaces[i].c_str()); in Write()
423 to->Write("\n"); in Write()
424 to->Write("{\n"); in Write()
425 to->Indent(); in Write()
429 this->elements[i]->Write(to); in Write()
432 to->Dedent(); in Write()
433 to->Write("}\n"); in Write()
444 void Document::Write(CodeWriter* to) const { in Write()
446 to->Write("%s\n", comment_.c_str()); in Write()
448 to->Write( in Write()
453 to->Write("package %s;\n", package_.c_str()); in Write()
457 clazz_->Write(to); in Write()