Generate DeclaredAt annotations

Issue #240 resolved
Jesper Öqvist created an issue

JastAdd 2.1.13

This is a feature request from MSc students using JastAdd.

The suggestion is to generate AST annotations with the declaration location for attributes, similar to the ones that annotate child getters and attribute methods currently.

For example:

  /**
   * @attribute inh
   * @aspect TypeAnalysis
   * @declaredat /home/jesper/git/simplic/src/jastadd/TypeAnalysis.jrag:32
   */
  @ASTNodeAnnotation.Attribute
  @DeclaredAt("/home/jesper/git/simplic/src/jastadd/TypeAnalysis.jrag:32")
  public Type expectedType() {
    Type expectedType_value = getParent().Define_expectedType(this, null);

    return expectedType_value;
  }

Comments (2)

  1. Jesper Mattsson Account Deactivated

    It would likely be useful to be able to get the paths relative to some specified folder. This would allow the generated Java code to be moved to another location without invalidating the paths.

  2. Log in to comment