vhdlpp: VTypeRange::type_match()

This commit is contained in:
Maciej Suminski 2016-02-17 13:56:25 +01:00
parent 1ed4603a18
commit fca2fff24e
2 changed files with 12 additions and 0 deletions

View File

@ -278,6 +278,7 @@ class VTypeRange : public VType {
bool write_std_types(std::ostream&fd) const;
int emit_def(std::ostream&out, perm_string name) const;
bool type_match(const VType*that) const;
// Get the type that is limited by the range.
inline const VType*base_type() const { return base_; }

View File

@ -85,3 +85,14 @@ bool VTypeArray::type_match(const VType*that) const
return false;
}
bool VTypeRange::type_match(const VType*that) const
{
if(VType::type_match(that))
return true;
if(base_->type_match(that))
return true;
return false;
}