Declaring an NTA child in the abstract grammar does not cause JastAdd to report an error if a corresponding equation for the NTA child is missing. This can cause problems when the NTA child was a non-NTA in a supertype. The following example from ExtendJ illustrates the problem:
abstract TypeDecl ::= ... BodyDecl*; PrimitiveType : TypeDecl ::= ... /BodyDecl*/;
This compiles fine even if there is no equation
PrimitiveType.getBodyDeclList(). Problems occur during runtime when trying to access the
BodyDecl list in a
PrimitiveType node, because then the
getBodyDeclList() method inherited from
TypeDecl is called and it either accesses the wrong node or returns null.