NameResolution.jrag 396 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.");
  }


}