Lines Matching defs:expr
113 print(Excc_t* cc, Exnode_t* expr)
118 if (x = expr->data.print.args)
120 sfprintf(cc->ccdisc->text, "sfprintf(%s, \"%s", expr->data.print.descriptor->op == CONSTANT && expr->data.print.descriptor->data.constant.value.integer == 2 ? "sfstderr" : "sfstdout", fmtesq(x->format, quote));
124 for (x = expr->data.print.args; x; x = x->next)
148 scan(Excc_t* cc, Exnode_t* expr)
153 if (x = expr->data.print.args)
159 for (x = expr->data.print.args; x; x = x->next)
183 gen(Excc_t* cc, register Exnode_t* expr)
194 if (!expr)
196 x = expr->data.operand.left;
197 switch (expr->op)
206 switch (expr->type)
209 sfprintf(cc->ccdisc->text, "%g", expr->data.constant.value.floating);
212 sfprintf(cc->ccdisc->text, "\"%s\"", fmtesq(expr->data.constant.value.string, quote));
215 sfprintf(cc->ccdisc->text, "%I*u", sizeof(expr->data.constant.value.integer), expr->data.constant.value.integer);
218 sfprintf(cc->ccdisc->text, "%I*d", sizeof(expr->data.constant.value.integer), expr->data.constant.value.integer);
226 sfprintf(cc->ccdisc->text, "%s", expr->data.variable.symbol->name);
237 gen(cc, expr->data.operand.right->data.operand.left);
238 if (expr->data.operand.right->data.operand.right)
241 gen(cc, expr->data.operand.right->data.operand.right);
249 if (expr->data.operand.left)
252 gen(cc, expr->data.operand.left);
256 if (expr->data.operand.right)
257 gen(cc, expr->data.operand.right);
262 (*cc->ccdisc->ccf)(cc, expr, expr->data.variable.symbol, expr->data.variable.reference, expr->data.variable.index, cc->ccdisc);
264 sfprintf(cc->ccdisc->text, "%s", expr->data.variable.symbol->name);
270 if (expr->op == DYNAMIC)
273 sfprintf(cc->ccdisc->text, "for (%stmp_%d = (Exassoc_t*)dtfirst(%s); %stmp_%d && (%s = %stmp_%d->name); %stmp_%d = (Exassoc_t*)dtnext(%s, %stmp_%d)) {", cc->id, cc->tmp, expr->data.generate.array->data.variable.symbol->name, cc->id, cc->tmp, expr->data.generate.index->name, cc->id, cc->tmp, cc->id, cc->tmp, expr->data.generate.array->data.variable.symbol->name, cc->id, cc->tmp);
274 gen(cc, expr->data.generate.statement);
279 print(cc, expr);
287 scan(cc, expr);
294 x = expr->data.operand.right;
351 if (expr->data.operand.right)
352 gen(cc, expr->data.operand.right);
356 sfprintf(cc->ccdisc->text, "(%s%s=", x->data.variable.symbol->name, expr->subop == '=' ? "" : opname(expr->subop));
357 gen(cc, expr->data.operand.right);
363 if (!(x = expr->data.operand.right))
364 switch (cc->lastop = expr->data.operand.left->op)
376 gen(cc, expr->data.operand.left);
378 if (!(expr = x))
380 switch (cc->lastop = expr->op)
394 gen(cc, expr);
402 while ((expr = expr->data.operand.right) && expr->op == ',')
405 gen(cc, expr->data.operand.left);
407 if (expr)
410 gen(cc, expr);
418 gen(cc, expr->data.operand.right->data.operand.left);
420 gen(cc, expr->data.operand.right->data.operand.right);
427 gen(cc, expr->data.operand.right);
434 gen(cc, expr->data.operand.right);
453 y = expr->data.operand.right;
456 switch (expr->op)
495 switch (expr->op)
523 sfprintf(cc->ccdisc->text, "%s", opname(expr->op));
528 sfprintf(cc->ccdisc->text, ")%s(", opname(expr->op));
556 exccopen(Expr_t* expr, Exccdisc_t* disc)
565 cc->expr = expr;
566 cc->disc = expr->disc;
576 dtwalk(expr->symbols, global, cc);
618 sym = name ? (Exid_t*)dtmatch(cc->expr->symbols, name) : &cc->expr->main;
638 exdump(Expr_t* expr, Exnode_t* node, Sfio_t* sp)
647 if (!(cc = exccopen(expr, &ccdisc)))
652 for (sym = (Exid_t*)dtfirst(expr->symbols); sym; sym = (Exid_t*)dtnext(expr->symbols, sym))