Skip to content
Snippets Groups Projects

Clean-up, document and rename some attributes.

Merged René Schöne requested to merge cleanup into master
4 files
+ 20
14
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -76,26 +76,30 @@ aspect ComponentAnalysis {
return null;
}
/* Should this better return the component, where it is defined previously defined? */
//--- isInvalidRedefinition ---
/**
* Check, if a component with the same name is already declared in some supertype
*/
syn boolean Component.isInvalidRedefinition() = false;
eq TokenComponent.isInvalidRedefinition() = hasInvalidRedefinitionOn(enclosingTypeDecl());
eq RelationComponent.isInvalidRedefinition() = hasInvalidRedefinitionOn(getTypeUse().decl());
syn boolean Component.isInvalidRedefinition() = invalidRedefinition() != null;
syn boolean Component.hasInvalidRedefinitionOn(TypeDecl td) {
if (td == null) return false;
/**
* Check, if a component with the same name is already declared in some supertype, and return it, if any
*/
syn Component Component.invalidRedefinition() = null;
eq TokenComponent.invalidRedefinition() = invalidRedefinitionOn(enclosingTypeDecl());
eq RelationComponent.invalidRedefinition() = invalidRedefinitionOn(getTypeUse().decl());
syn Component Component.invalidRedefinitionOn(TypeDecl td) {
if (td == null) return null;
while (td.hasSuper() && td.getSuper().decl() != null) {
td = td.getSuper().decl();
// find a matching component on the RHS of the (current) super type
Component c = findComponent(td, getID());
if (c != null && !this.isEqual(c)) return true;
if (c != null && !this.isEqual(c)) return c;
}
return false;
return null;
}
//--- isEqual ---
Loading