Translate if statements

This commit is contained in:
Nick Gasson 2008-06-11 14:20:05 +01:00
parent a7cfdc3a87
commit 19e60b698f
1 changed files with 13 additions and 0 deletions

View File

@ -287,6 +287,19 @@ static int draw_wait(vhdl_process *proc, stmt_container *container,
static int draw_if(vhdl_process *proc, stmt_container *container,
ivl_statement_t stmt)
{
vhdl_expr *test = translate_expr(ivl_stmt_cond_expr(stmt));
if (NULL == test)
return 1;
vhdl_if_stmt *vhdif = new vhdl_if_stmt(test);
draw_stmt(proc, vhdif->get_then_container(),
ivl_stmt_cond_true(stmt));
draw_stmt(proc, vhdif->get_else_container(),
ivl_stmt_cond_false(stmt));
container->add_stmt(vhdif);
return 0;
}