Check for missing concat subexpressions (PR#11)

This commit is contained in:
steve 2000-10-14 02:23:02 +00:00
parent 06f5482631
commit f526d235d1
3 changed files with 27 additions and 11 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elab_net.cc,v 1.50 2000/10/08 04:59:36 steve Exp $"
#ident "$Id: elab_net.cc,v 1.51 2000/10/14 02:23:02 steve Exp $"
#endif
# include "PExpr.h"
@ -925,6 +925,13 @@ NetNet* PEConcat::elaborate_net(Design*des, const string&path,
/* Elaborate the operands of the concatenation. */
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) {
if (parms_[idx] == 0) {
cerr << get_line() << ": error: Empty expressions "
<< "not allowed in concatenations." << endl;
errors += 1;
continue;
}
/* Look for the special case of an unsized number in a
concatenation expression. Mark this as an error, but
allow elaboration to continue to see if I can find
@ -1745,6 +1752,9 @@ NetNet* PEUnary::elaborate_net(Design*des, const string&path,
/*
* $Log: elab_net.cc,v $
* Revision 1.51 2000/10/14 02:23:02 steve
* Check for missing concat subexpressions (PR#11)
*
* Revision 1.50 2000/10/08 04:59:36 steve
* Fix repeat concatenation with multiple expressions (PR#10)
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: parse.y,v 1.106 2000/09/23 03:04:10 steve Exp $"
#ident "$Id: parse.y,v 1.107 2000/10/14 02:23:02 steve Exp $"
#endif
# include "parse_misc.h"
@ -732,7 +732,7 @@ expression_list
{ svector<PExpr*>*tmp = new svector<PExpr*>(*$1, 0);
delete $1;
$$ = tmp;
}
}
;
@ -803,8 +803,8 @@ expr_primary
{ $$ = $2; }
| '{' expression_list '}'
{ PEConcat*tmp = new PEConcat(*$2);
tmp->set_file(@2.text);
tmp->set_lineno(@2.first_line);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
delete $2;
$$ = tmp;
}

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: pform_dump.cc,v 1.61 2000/07/26 05:08:07 steve Exp $"
#ident "$Id: pform_dump.cc,v 1.62 2000/10/14 02:23:02 steve Exp $"
#endif
/*
@ -83,9 +83,12 @@ void PEConcat::dump(ostream&out) const
return;
}
out << "{" << *parms_[0];
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1)
out << ", " << *parms_[idx];
out << "{";
if (parms_[0]) out << *parms_[0];
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
out << ", ";
if (parms_[idx]) out << *parms_[idx];
}
out << "}";
@ -97,10 +100,10 @@ void PECallFunction::dump(ostream &out) const
out << name_ << "(";
if (parms_.count() > 0) {
parms_[0]->dump(out);
if (parms_[0]) parms_[0]->dump(out);
for (unsigned idx = 1; idx < parms_.count(); ++idx) {
out << ", ";
parms_[idx]->dump(out);
if (parms_[idx]) parms_[idx]->dump(out);
}
}
out << ")";
@ -780,6 +783,9 @@ void PUdp::dump(ostream&out) const
/*
* $Log: pform_dump.cc,v $
* Revision 1.62 2000/10/14 02:23:02 steve
* Check for missing concat subexpressions (PR#11)
*
* Revision 1.61 2000/07/26 05:08:07 steve
* Parse disable statements to pform.
*