Descriptive constructor parameter names

Create issue
Issue #286 new
Jesper Öqvist created an issue

JastAdd 2.3.0 generates nondescriptive parameter names for the default AST class constructors. The parameters are named p0, p1, etc. For example:

  public AddExpr(Expr p0, Expr p1) {
    setChild(p0, 0);
    setChild(p1, 1);
  }

It would be preferable to use the child component names, to remove the need for comparing against the AST declaration when creating an AST node. For example:

  public AddExpr(Expr leftOperand, Expr rightOperand) {
    setChild(leftOperand, 0);
    setChild(rightOperand, 1);
  }

Comments (0)

  1. Log in to comment