[Jastadd] Questions on the comments in the generated .java files.

From: Na, Hyunik <hina_at_kaist.ac.kr>
Date: Thu, 8 Dec 2011 13:40:16 +0900

Hello JastAddJ developers,

I’m reading JastAddJ source code and trying to understand it to implement a Java language extension for my research.

I have two questions today. ( Certaninly, I’m going to ask many many questions. ☺ )

In the AST directory of every FrontEnd or BackEnd compiler, the .java files generated from .ast, .jrag, and .jadd files are put.
In the .java files, several kinds of comments give information about the generated entities ( nodes, methods, classes and interfaces ).

Q1. What are the meanings of apilevels, internal, low-level and high-level, respectively?
     Some entities have “_at_apilevel” comments and some don’t. When does an entity have a @apilevel comment? When doesn’t one?

Q2. The source location following each _at_declaredat in the comment is valuable information to track an entity’s definition site.
     But, some of the source location information seem to be wrong. For example, the generated AbstractDot.java file
     in the Java1.4FrontEnd/AST directory has

-=-=-=
   ...
   ...

 /**
   * _at_ast method
   * _at_declaredat java.ast:1
   */
  public AbstractDot() {
    super();


  }
  /**
   * _at_ast method
   * _at_declaredat java.ast:7
   */
  public AbstractDot(Expr p0, Access p1) {
    setChild(p0, 0);
    setChild(p1, 1);
  }
  /**
   * _at_apilevel low-level
   * _at_ast method
   * _at_declaredat java.ast:14
   */
  protected int numChildren() {
    return 2;
  }
  /**
   * _at_apilevel internal
   * _at_ast method
   * _at_declaredat java.ast:20
   */
  public boolean mayHaveRewrite() {
    return false;
  }
  /**
   * Setter for Left
   * _at_apilevel high-level
   * _at_ast method
   * _at_declaredat java.ast:5
   */
  public void setLeft(Expr node) {
    setChild(node, 0);
  }
  /**
   * Getter for Left
   * _at_apilevel high-level
   * _at_ast method
   * _at_declaredat java.ast:12
   */
  public Expr getLeft() {
    return (Expr)getChild(0);
  }
  /**
   * _at_apilevel low-level
   * _at_ast method
   * _at_declaredat java.ast:18
   */
  public Expr getLeftNoTransform() {
    return (Expr)getChildNoTransform(0);
  }
  /**
   * Setter for Right
   * _at_apilevel high-level
   * _at_ast method
   * _at_declaredat java.ast:5
   */
  public void setRight(Access node) {
    setChild(node, 1);
  }
  /**
   * Getter for Right
   * _at_apilevel high-level
   * _at_ast method
   * _at_declaredat java.ast:12
   */

   ...
   ...
-=-=-=

       In the above comments, the comments of the form "_at_declaredat java.ast:#" seem incorrect.
       Am I missing something?




Probably, I don't need to understand the generated java files, but only need to understand .ast, .jrag, and .jadd files.
Above questions are just out of my curiosity.


- Hyunik
Received on Thu Dec 08 2011 - 05:40:44 CET

This archive was generated by hypermail 2.3.0 : Wed Apr 16 2014 - 17:19:06 CEST