Skip to content
Snippets Groups Projects
NameResolution.jrag 396 B
aspect NameResolution {

  refine RefResolverStubs eq ASTNode.globallyResolveTypeDeclByToken(String id) = program().resolveTypeDecl(id);

  syn TypeDecl Program.resolveTypeDecl(String name) {
    for (TypeDecl decl : typeDecls()) {
      if (decl.getName().equals(name)) {
        return decl;
      }
    }
    throw new RuntimeException("TypeDecl " + name + " could not be resolved.");
  }


}