vhdlpp: ProcessStatement inherits after ScopeBase.
This commit is contained in:
parent
25cd0827ba
commit
b037d533f9
|
|
@ -260,9 +260,10 @@ StatementList::~StatementList()
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessStatement::ProcessStatement(perm_string iname,
|
ProcessStatement::ProcessStatement(perm_string iname,
|
||||||
|
const ActiveScope&ref,
|
||||||
std::list<Expression*>*sensitivity_list,
|
std::list<Expression*>*sensitivity_list,
|
||||||
std::list<SequentialStmt*>*statements_list)
|
std::list<SequentialStmt*>*statements_list)
|
||||||
: StatementList(statements_list), iname_(iname)
|
: StatementList(statements_list), Scope(ref), iname_(iname)
|
||||||
{
|
{
|
||||||
if (sensitivity_list)
|
if (sensitivity_list)
|
||||||
sensitivity_list_.splice(sensitivity_list_.end(), *sensitivity_list);
|
sensitivity_list_.splice(sensitivity_list_.end(), *sensitivity_list);
|
||||||
|
|
|
||||||
|
|
@ -271,10 +271,11 @@ class FinalStatement : public StatementList {
|
||||||
void dump(ostream&out, int indent =0) const;
|
void dump(ostream&out, int indent =0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProcessStatement : public StatementList {
|
class ProcessStatement : public StatementList, public Scope {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProcessStatement(perm_string iname,
|
ProcessStatement(perm_string iname,
|
||||||
|
const ActiveScope&ref,
|
||||||
std::list<Expression*>*sensitivity_list,
|
std::list<Expression*>*sensitivity_list,
|
||||||
std::list<SequentialStmt*>*statement_list);
|
std::list<SequentialStmt*>*statement_list);
|
||||||
~ProcessStatement();
|
~ProcessStatement();
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,6 @@ int ProcessStatement::elaborate(Entity*ent, Architecture*arc)
|
||||||
{
|
{
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
|
|
||||||
|
|
||||||
StatementList::elaborate(ent, arc);
|
StatementList::elaborate(ent, arc);
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
|
|
|
||||||
|
|
@ -361,6 +361,8 @@ int ProcessStatement::emit(ostream&out, Entity*ent, Architecture*arc)
|
||||||
else
|
else
|
||||||
out << "always begin" << endl;
|
out << "always begin" << endl;
|
||||||
|
|
||||||
|
emit_variables(out, ent, arc);
|
||||||
|
|
||||||
int errors = StatementList::emit(out, ent, arc);
|
int errors = StatementList::emit(out, ent, arc);
|
||||||
|
|
||||||
if (! sensitivity_list_.empty()) {
|
if (! sensitivity_list_.empty()) {
|
||||||
|
|
|
||||||
|
|
@ -778,7 +778,10 @@ concurrent_assertion_statement
|
||||||
std::list<SequentialStmt*> stmts;
|
std::list<SequentialStmt*> stmts;
|
||||||
stmts.push_back($1);
|
stmts.push_back($1);
|
||||||
stmts.push_back(new WaitStmt(WaitStmt::FINAL, NULL));
|
stmts.push_back(new WaitStmt(WaitStmt::FINAL, NULL));
|
||||||
ProcessStatement*tmp = new ProcessStatement(empty_perm_string, NULL, &stmts);
|
push_scope();
|
||||||
|
ProcessStatement*tmp = new ProcessStatement(empty_perm_string, *active_scope,
|
||||||
|
NULL, &stmts);
|
||||||
|
pop_scope();
|
||||||
FILE_NAME(tmp, @1);
|
FILE_NAME(tmp, @1);
|
||||||
$$ = tmp;
|
$$ = tmp;
|
||||||
}
|
}
|
||||||
|
|
@ -2089,26 +2092,30 @@ process_declarative_part_opt
|
||||||
|
|
||||||
process_statement
|
process_statement
|
||||||
: identifier_colon_opt K_postponed_opt K_process
|
: identifier_colon_opt K_postponed_opt K_process
|
||||||
|
{
|
||||||
|
push_scope();
|
||||||
|
}
|
||||||
process_sensitivity_list_opt K_is_opt
|
process_sensitivity_list_opt K_is_opt
|
||||||
process_declarative_part_opt
|
process_declarative_part_opt
|
||||||
K_begin sequence_of_statements
|
K_begin sequence_of_statements
|
||||||
K_end K_postponed_opt K_process identifier_opt ';'
|
K_end K_postponed_opt K_process identifier_opt ';'
|
||||||
{ perm_string iname = $1? lex_strings.make($1) : empty_perm_string;
|
{ perm_string iname = $1? lex_strings.make($1) : empty_perm_string;
|
||||||
if ($1) delete[]$1;
|
if ($1) delete[]$1;
|
||||||
if ($12) {
|
if ($13) {
|
||||||
if (iname.nil()) {
|
if (iname.nil()) {
|
||||||
errormsg(@12, "Process end name %s for un-named processes.\n", $12);
|
errormsg(@13, "Process end name %s for un-named processes.\n", $13);
|
||||||
} else if (iname != $12) {
|
} else if (iname != $13) {
|
||||||
errormsg(@12, "Process name %s does not match opening name %s.\n",
|
errormsg(@13, "Process name %s does not match opening name %s.\n",
|
||||||
$12, $1);
|
$13, $1);
|
||||||
}
|
}
|
||||||
delete[]$12;
|
delete[]$13;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessStatement*tmp = new ProcessStatement(iname, $4, $8);
|
ProcessStatement*tmp = new ProcessStatement(iname, *active_scope, $5, $9);
|
||||||
FILE_NAME(tmp, @3);
|
pop_scope();
|
||||||
delete $4;
|
FILE_NAME(tmp, @4);
|
||||||
delete $8;
|
delete $5;
|
||||||
|
delete $9;
|
||||||
$$ = tmp;
|
$$ = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue