Genrate warning when NTA not subclass of ASTNode

Issue #280 resolved
Alfred Åkesson
created an issue

Example following code will generate NullPointerException.

Ast:

A;

Jrag:

aspect Test {
    syn nta interfaceB A.getA();
    interface interfaceB {}
}

Generate a error insted.

Comments (2)

  1. Jesper Öqvist

    An error message for this error is already implemented in JastAdd, however it is never shown because JastAdd crashes while building the parent map:

    java.lang.NullPointerException
        at org.jastadd.ast.AST.Grammar.parentMap_compute(Grammar.java:2171)
        at org.jastadd.ast.AST.Grammar.parentMap(Grammar.java:2139)
        at org.jastadd.ast.AST.ASTDecl.parents_compute(ASTDecl.java:4574)
        at org.jastadd.ast.AST.ASTDecl.parents(ASTDecl.java:4562)
        at org.jastadd.ast.AST.ASTDecl.isRootNode(ASTDecl.java:4964)
        at org.jastadd.ast.AST.Grammar.roots_compute(Grammar.java:1986)
        at org.jastadd.ast.AST.Grammar.roots(Grammar.java:1972)
        at org.jastadd.ast.AST.Grammar.collect_contributors_Grammar_problems(Grammar.java:2479)
        at org.jastadd.ast.AST.Grammar.survey_Grammar_problems(Grammar.java:1575)
        at org.jastadd.ast.AST.Grammar.problems_compute(Grammar.java:2462)
        at org.jastadd.ast.AST.Grammar.problems(Grammar.java:2445)
        at org.jastadd.JastAdd.compile(JastAdd.java:210)
        at org.jastadd.JastAdd.compile(JastAdd.java:129)
        at org.jastadd.JastAdd.main(JastAdd.java:114)
    
  2. Log in to comment