Generate declared-at comments in inherited attribute code

Issue #211 resolved
Jesper Öqvist created an issue

JastAdd2 2.1.11-15-gf392f0b

The documentation comments generated for inherited attribute Define_ methods includes the @declaredat tag pointing to the declaration of the attribute, however there is no simple way right now to find the declaration location of the actual equations.

To solve this JastAdd should generate comments with declared-at info in the generated inherited attribute code. For example:

  /**
   * @declaredat /home/jesper/git/jjtmp/java4/frontend/DefiniteAssignment.jrag:25
   * @apilevel internal
   */
  public boolean Define_isSource(ASTNode caller, ASTNode child) {
    if (caller == getLeftNoTransform()) {
      // @declaredat /home/jesper/git/jjtmp/java4/frontend/DefiniteAssignment.jrag:31
      return true;
    }
    else {
      return getParent().Define_isSource(this, caller);
    }
  }

Comments (1)

  1. Log in to comment