vhdlpp: Basic loop support (loop..end loop).
This commit is contained in:
parent
b4d5248c67
commit
79f38b8c56
|
|
@ -1660,7 +1660,6 @@ loop_statement
|
|||
BasicLoopStatement* tmp = new BasicLoopStatement(loop_name, $3);
|
||||
FILE_NAME(tmp, @2);
|
||||
|
||||
sorrymsg(@1, "Loop statements are not supported.\n");
|
||||
$$ = tmp;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -273,6 +273,8 @@ class BasicLoopStatement : public LoopStatement {
|
|||
~BasicLoopStatement();
|
||||
|
||||
int elaborate(Entity*ent, ScopeBase*scope);
|
||||
int emit(ostream&out, Entity*ent, ScopeBase*scope);
|
||||
void write_to_stream(std::ostream&fd);
|
||||
void dump(ostream&out, int indent) const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -212,9 +212,9 @@ int WhileLoopStatement::elaborate(Entity*ent, ScopeBase*scope)
|
|||
return errors;
|
||||
}
|
||||
|
||||
int BasicLoopStatement::elaborate(Entity*, ScopeBase*)
|
||||
int BasicLoopStatement::elaborate(Entity*ent, ScopeBase*scope)
|
||||
{
|
||||
return 0;
|
||||
return elaborate_substatements(ent, scope);
|
||||
}
|
||||
|
||||
int ReportStmt::elaborate(Entity*ent, ScopeBase*scope)
|
||||
|
|
|
|||
|
|
@ -477,6 +477,24 @@ int ForLoopStatement::emit_runtime_(ostream&out, Entity*ent, ScopeBase*scope)
|
|||
return errors;
|
||||
}
|
||||
|
||||
int BasicLoopStatement::emit(ostream&out, Entity*ent, ScopeBase*scope)
|
||||
{
|
||||
int errors = 0;
|
||||
|
||||
out << "forever begin" << endl;
|
||||
errors += emit_substatements(out, ent, scope);
|
||||
out << "end" << endl;
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
void BasicLoopStatement::write_to_stream(std::ostream&fd)
|
||||
{
|
||||
fd << "loop" << endl;
|
||||
write_to_stream_substatements(fd);
|
||||
fd << "end loop;" << endl;
|
||||
}
|
||||
|
||||
int ReportStmt::emit(ostream&out, Entity*ent, ScopeBase*scope)
|
||||
{
|
||||
out << "$display(\"** ";
|
||||
|
|
|
|||
Loading…
Reference in New Issue