vhdlpp: VTypeRangeExpr::elaborate()

This commit is contained in:
Maciej Suminski 2016-01-28 10:22:43 +01:00
parent 42ead3a482
commit 32f202bddc
2 changed files with 15 additions and 3 deletions

View File

@ -282,7 +282,7 @@ class VTypeRange : public VType {
// Get the type that is limited by the range. // Get the type that is limited by the range.
inline const VType*base_type() const { return base_; } inline const VType*base_type() const { return base_; }
private: protected:
const VType*base_; const VType*base_;
}; };
@ -295,7 +295,6 @@ class VTypeRangeConst : public VTypeRange {
return new VTypeRangeConst(base_type()->clone(), start_, end_); return new VTypeRangeConst(base_type()->clone(), start_, end_);
} }
public: // Virtual methods
void write_to_stream(std::ostream&fd) const; void write_to_stream(std::ostream&fd) const;
private: private:
@ -309,6 +308,7 @@ class VTypeRangeExpr : public VTypeRange {
~VTypeRangeExpr(); ~VTypeRangeExpr();
VType*clone() const; VType*clone() const;
int elaborate(Entity*end, ScopeBase*scope) const;
public: // Virtual methods public: // Virtual methods
void write_to_stream(std::ostream&fd) const; void write_to_stream(std::ostream&fd) const;

View File

@ -29,7 +29,8 @@ int VType::elaborate(Entity*, ScopeBase*) const
int VTypeArray::elaborate(Entity*ent, ScopeBase*scope) const int VTypeArray::elaborate(Entity*ent, ScopeBase*scope) const
{ {
int errors = 0; int errors = 0;
etype_->elaborate(ent, scope);
errors += etype_->elaborate(ent, scope);
for (vector<range_t>::const_iterator cur = ranges_.begin() for (vector<range_t>::const_iterator cur = ranges_.begin()
; cur != ranges_.end() ; ++ cur) { ; cur != ranges_.end() ; ++ cur) {
@ -43,3 +44,14 @@ int VTypeArray::elaborate(Entity*ent, ScopeBase*scope) const
return errors; return errors;
} }
int VTypeRangeExpr::elaborate(Entity*ent, ScopeBase*scope) const
{
int errors = 0;
errors += base_->elaborate(ent, scope);
errors += start_->elaborate_expr(ent, scope, 0);
errors += end_->elaborate_expr(ent, scope, 0);
return errors;
}