aspect NameCheck{ public void ExhibitBodyDecl.nameCheck() { JPITypeAccess jpiAccess = (JPITypeAccess) getJPIName(); if(jpiAccess.decls(getParameterTypeList()).isEmpty()){ StringBuffer parameters = new StringBuffer(); for(TypeDecl pd : getParameterTypeList()){ parameters.append(pd.name()+","); } if (parameters.length() != 0) parameters.deleteCharAt(parameters.length()-1); error("NameCheck: There is not a JPI declaration with the signature "+jpiAccess.typeName()+"("+parameters+")"); } } public void JPITypeDecl.nameCheck(){ JPITypeAccess dummyAccess = new JPITypeAccess("", this.getID()); dummyAccess.setParent(this); SimpleSet set = dummyAccess.decls(this.getParameterTypeList()); if (set.size() > 1) error("NameCheck: There is other JPI with the same signature"); TypeAccess jpiSuperAccess = (TypeAccess) getSuperTypeName(); if (jpiSuperAccess.getID().equals("$RootJPI$")){ return; } if(((JPITypeAccess)jpiSuperAccess).decls(getParentParameterTypeList()).isEmpty()){ error("NameCheck: There is not a JPI declaration with the same signature."); } } public void JPISuperArgAccess.nameCheck(){ if(decls().isEmpty()) error("NameCheck: There is no argument named " + name()); } //inh SimpleSet JPISuperArgAccess.lookupVariable(String name); syn lazy SimpleSet JPITypeDecl.lookupVariable(String name){ for(int i = 0; i < getNumParameter(); i++) if(getParameter(i).name().equals(name)) return (ParameterDeclaration)getParameter(i); return SimpleSet.emptySet; } eq JPITypeDecl.getSuperArgumentName().lookupVariable(String name) = lookupVariable(name); syn lazy SimpleSet JPISuperArgAccess.decls() { SimpleSet set = lookupVariable(name()); return set; } public void DummyAccess.nameCheck(){ //FIXME: probably there is a better way to solve the $RootJPI$ access. } }