⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 astnode.java

📁 JDK1.4编译器前端
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    return numChildren;
  }    // Declared in ASTNode.ast at line 138
  public int getNumChild() {
    return numChildren();
  }    // Declared in ASTNode.ast at line 141
  public final int getNumChildNoTransform() {
    return numChildren();
  }    // Declared in ASTNode.ast at line 144
  public void setChild(T node, int i) {
        debugNodeAttachment(node);
    if(children == null) {
      children = new ASTNode[i + 1];
    } else if (i >= children.length) {
      ASTNode c[] = new ASTNode[i << 1];
      System.arraycopy(children, 0, c, 0, children.length);
      children = c;
    }
    children[i] = node;
    if(i >= numChildren) numChildren = i+1;
    if(node != null) { node.setParent(this); node.childIndex = i; }
  }    // Declared in ASTNode.ast at line 157
  public void insertChild(T node, int i) {
        debugNodeAttachment(node);
    if(children == null) {
      children = new ASTNode[i + 1];
      children[i] = node;
    } else {
      ASTNode c[] = new ASTNode[children.length + 1];
      System.arraycopy(children, 0, c, 0, i);
      c[i] = node;
      if(i < children.length)
        System.arraycopy(children, i, c, i+1, children.length-i);
      children = c;
    }
    numChildren++;
    if(node != null) { node.setParent(this); node.childIndex = i; }
  }    // Declared in ASTNode.ast at line 173
  public void removeChild(int i) {
    if(children != null) {
      ASTNode child = children[i];
      if(child != null) {
        child.setParent(null);
        child.childIndex = -1;
      }
      System.arraycopy(children, i+1, children, i, children.length-i-1);
      numChildren--;
    }
  }    // Declared in ASTNode.ast at line 184
  public ASTNode getParent() {
    if(parent != null && parent.is$Final() != is$Final()) {
      boundariesCrossed++;
    }
    return parent;
  }    // Declared in ASTNode.ast at line 190
  public void setParent(ASTNode node) {
    parent = node;
  }    // Declared in ASTNode.ast at line 193
    protected boolean debugNodeAttachmentIsRoot() { return false; }    // Declared in ASTNode.ast at line 194
    private static void debugNodeAttachment(ASTNode node) {
        if(node == null) throw new RuntimeException("Trying to assign null to a tree child node");
        while(node != null && !node.debugNodeAttachmentIsRoot()) {
            if(node.in$Circle()) return;
            ASTNode parent = node.parent;
            if(parent != null && parent.getIndexOfChild(node) == -1) return;
            node = parent;
        }
        if(node == null) return;
        throw new RuntimeException("Trying to insert the same tree at multiple tree locations");
    }    // Declared in ASTNode.ast at line 205
    protected static int duringDefiniteAssignment = 0;    // Declared in ASTNode.ast at line 206    protected static boolean duringDefiniteAssignment() {        if(duringDefiniteAssignment == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 216    protected static int duringVariableDeclaration = 0;    // Declared in ASTNode.ast at line 217    protected static boolean duringVariableDeclaration() {        if(duringVariableDeclaration == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 227    protected static int duringLookupConstructor = 0;    // Declared in ASTNode.ast at line 228    protected static boolean duringLookupConstructor() {        if(duringLookupConstructor == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 238    protected static int duringGOP = 0;    // Declared in ASTNode.ast at line 239    protected static boolean duringGOP() {        if(duringGOP == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 249    protected static int duringConstantExpression = 0;    // Declared in ASTNode.ast at line 250    protected static boolean duringConstantExpression() {        if(duringConstantExpression == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 260    protected static int duringAnonymousClasses = 0;    // Declared in ASTNode.ast at line 261    protected static boolean duringAnonymousClasses() {        if(duringAnonymousClasses == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 271    protected static int duringSyntacticClassification = 0;    // Declared in ASTNode.ast at line 272    protected static boolean duringSyntacticClassification() {        if(duringSyntacticClassification == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 282    protected static int duringResolveAmbiguousNames = 0;    // Declared in ASTNode.ast at line 283    protected static boolean duringResolveAmbiguousNames() {        if(duringResolveAmbiguousNames == 0) {            return false;        }        else {            state.pop();            state.push(ASTNode.REWRITE_INTERRUPT);            return true;        }    }    // Declared in ASTNode.ast at line 293    public static void reset() {
        IN_CIRCLE = false;
        CIRCLE_INDEX = 0;
        CHANGE = false;
        LAST_CYCLE = false;
        boundariesCrossed = 0;
        state = new ASTNode$State();
        if(duringDefiniteAssignment != 0) {            System.out.println("Warning: resetting duringDefiniteAssignment");            duringDefiniteAssignment = 0;        }        if(duringVariableDeclaration != 0) {            System.out.println("Warning: resetting duringVariableDeclaration");            duringVariableDeclaration = 0;        }        if(duringLookupConstructor != 0) {            System.out.println("Warning: resetting duringLookupConstructor");            duringLookupConstructor = 0;        }        if(duringGOP != 0) {            System.out.println("Warning: resetting duringGOP");            duringGOP = 0;        }        if(duringConstantExpression != 0) {            System.out.println("Warning: resetting duringConstantExpression");            duringConstantExpression = 0;        }        if(duringAnonymousClasses != 0) {            System.out.println("Warning: resetting duringAnonymousClasses");            duringAnonymousClasses = 0;        }        if(duringSyntacticClassification != 0) {            System.out.println("Warning: resetting duringSyntacticClassification");            duringSyntacticClassification = 0;        }        if(duringResolveAmbiguousNames != 0) {            System.out.println("Warning: resetting duringResolveAmbiguousNames");            duringResolveAmbiguousNames = 0;        }        debugRewrite = new java.util.HashMap();
    }    // Declared in ASTNode.ast at line 335
    public java.util.Iterator<T> iterator() {
        return new java.util.Iterator<T>() {
            private int counter = 0;
            public boolean hasNext() {
                return counter < getNumChild();
            }
            @SuppressWarnings("unchecked") public T next() {
                if(hasNext())
                    return (T)getChild(counter++);
                else
                    return null;
            }
            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }    // Declared in ASTNode.ast at line 352
  public boolean mayHaveRewrite() { return false; }    protected java.util.Map unassignedEverywhere_Variable_TryStmt_visited;    // Declared in DefiniteAssignment.jrag at line 1200 @SuppressWarnings({"unchecked", "cast"})     public boolean unassignedEverywhere(Variable v, TryStmt stmt) {        java.util.List _parameters = new java.util.ArrayList(2);        _parameters.add(v);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -