Пример #1
0
void dump_expr_addr(const expr *e, dump *ctx)
{
	if(e->bits.lbl.spel){
		dump_desc_expr(ctx, "label address", e);
		dump_inc(ctx);
		dump_strliteral(ctx, e->bits.lbl.spel, strlen(e->bits.lbl.spel));
		dump_dec(ctx);
	}else{
		dump_desc_expr(ctx, "address-of", e);
		dump_inc(ctx);
		dump_expr(e->lhs, ctx);
		dump_dec(ctx);
	}
}
Пример #2
0
void dump_expr_stmt(const expr *e, dump *ctx)
{
	dump_desc_expr(ctx, "statement expression", e);
	dump_inc(ctx);
	dump_stmt(e->code, ctx);
	dump_dec(ctx);
}
Пример #3
0
void dump_expr_assign(const expr *e, dump *ctx)
{
	dump_desc_expr(ctx, "assignment", e);
	dump_inc(ctx);
	dump_expr(e->lhs, ctx);
	dump_dec(ctx);
	dump_inc(ctx);
	dump_expr(e->rhs, ctx);
	dump_dec(ctx);
}
Пример #4
0
void dump_expr_compound_lit(const expr *e, dump *ctx)
{
	decl *const d = e->bits.complit.decl;

	dump_desc_expr(ctx, "compound literal", e);

	dump_inc(ctx);
	dump_init(ctx, d->bits.var.init.dinit);
	dump_dec(ctx);
}
Пример #5
0
void dump_expr_funcall(const expr *e, dump *ctx)
{
	expr **iter;

	dump_desc_expr(ctx, "call", e);

	dump_inc(ctx);
	dump_expr(e->expr, ctx);
	dump_dec(ctx);

	dump_inc(ctx);
	for(iter = e->funcargs; iter && *iter; iter++)
		dump_expr(*iter, ctx);

	dump_dec(ctx);
}
Пример #6
0
void dump_expr_if(const expr *e, dump *ctx)
{
	dump_desc_expr(ctx, "conditional", e);

	dump_inc(ctx);

	dump_expr(e->expr, ctx);

	if(e->lhs)
		dump_expr(e->lhs, ctx);
	else
		dump_printf(ctx, "?: lhs\n");

	dump_expr(e->rhs, ctx);

	dump_dec(ctx);
}