?? astnode.java
字號:
String s = ste[1].toString(); throw new Error(s+" Cannot create bytecode for:"+getClass().getName()); } // Declared in CreateBCode.jrag at line 191 public void createBCode(CodeGeneration gen) { for (int i=0; i<getNumChild(); i++) getChild(i).createBCode(gen); } // Declared in GenerateClassfile.jrag at line 303 // Remove method bodies and cached attributes after the class file has been generated public boolean clear() { boolean empty = true; for(int i = 0; i < getNumChild(); i++) { ASTNode child = getChild(i); if(!child.clear()) empty = false; else { if(child instanceof List) ((ASTNode)this).setChild(new List(), i); else if(child instanceof Opt) ((ASTNode)this).setChild(new Opt(), i); //setChild(null, i); } } if(empty) { setParent(null); } if(flush()) flushCache(); return empty; } // Declared in InnerClasses.jrag at line 155 public void collectEnclosingVariables(HashSet set, TypeDecl typeDecl) { for(int i = 0; i < getNumChild(); i++) getChild(i).collectEnclosingVariables(set, typeDecl); } // Declared in Java2Rewrites.jrag at line 63 public void flushCaches() { flushCache(); for(int i = 0; i < getNumChild(); i++) getChild(i).flushCaches(); } // Declared in Transformations.jrag at line 12 // generic traversal of the tree public void transformation() { for(int i = 0; i < getNumChild(); i++) { getChild(i).transformation(); } } // Declared in Transformations.jrag at line 208 // imperative transformation of the AST // syntax ASTNode.replace(sourcenode).with(destnode) // this syntax is used to allow for building the destnode using the sourcenode protected static ASTNode replace(ASTNode node) { replacePos = node.getParent().getIndexOfChild(node); node.getParent().in$Circle(true); return node.getParent(); } // Declared in Transformations.jrag at line 213 protected ASTNode with(ASTNode node) { ((ASTNode)this).setChild(node, replacePos); in$Circle(false); return node; } // Declared in Transformations.jrag at line 218 private static int replacePos = 0; // Declared in ASTNode.ast at line 3 // Declared in ASTNode.ast line 0
public ASTNode() { super();
} // Declared in ASTNode.ast at line 9
static public boolean generatedWithCircularEnabled = true; // Declared in ASTNode.ast at line 10
static public boolean generatedWithCacheCycle = false; // Declared in ASTNode.ast at line 11
static public boolean generatedWithComponentCheck = false; // Declared in ASTNode.ast at line 12
static public boolean IN_CIRCLE = false; // Declared in ASTNode.ast at line 13
static public int CIRCLE_INDEX; // Declared in ASTNode.ast at line 14
static public boolean CHANGE = false; // Declared in ASTNode.ast at line 15
static public boolean RESET_CYCLE = false; // Declared in ASTNode.ast at line 16
public static int boundariesCrossed = 0; // Declared in ASTNode.ast at line 43
protected static ASTNode$State state = new ASTNode$State(); // Declared in ASTNode.ast at line 44
public boolean in$Circle = false; // Declared in ASTNode.ast at line 45
public boolean in$Circle() { return in$Circle; } // Declared in ASTNode.ast at line 46
public void in$Circle(boolean b) { in$Circle = b; } // Declared in ASTNode.ast at line 47
public boolean is$Final = false; // Declared in ASTNode.ast at line 48
public boolean is$Final() { return is$Final; } // Declared in ASTNode.ast at line 49
public void is$Final(boolean b) { is$Final = b; } // Declared in ASTNode.ast at line 50
protected static final int REWRITE_CHANGE = 1; // Declared in ASTNode.ast at line 51
protected static final int REWRITE_NOCHANGE = 2; // Declared in ASTNode.ast at line 52
protected static final int REWRITE_INTERRUPT = 3; // Declared in ASTNode.ast at line 53
@SuppressWarnings("cast") public T getChild(int i) {
return (T)ASTNode.getChild(this, i);
} // Declared in ASTNode.ast at line 56
public static ASTNode getChild(ASTNode that, int i) {
ASTNode node = that.getChildNoTransform(i);
if(node.is$Final()) return node;
if(!node.mayHaveRewrite()) {
node.is$Final(that.is$Final());
return node;
}
if(!node.in$Circle()) {
int rewriteState;
int num = ASTNode.boundariesCrossed;
do {
ASTNode.state.push(ASTNode.REWRITE_CHANGE);
ASTNode oldNode = node;
oldNode.in$Circle(true);
node = node.rewriteTo();
if(node != oldNode)
that.setChild(node, i);
oldNode.in$Circle(false);
rewriteState = state.pop();
} while(rewriteState == ASTNode.REWRITE_CHANGE);
if(rewriteState == ASTNode.REWRITE_NOCHANGE && that.is$Final()) {
node.is$Final(true);
ASTNode.boundariesCrossed = num;
}
}
else if(that.is$Final() != node.is$Final()) boundariesCrossed++;
return node;
} // Declared in ASTNode.ast at line 84
private int childIndex; // Declared in ASTNode.ast at line 85
public int getIndexOfChild(ASTNode node) {
if(node != null && node.childIndex < getNumChildNoTransform() && node == getChildNoTransform(node.childIndex))
return node.childIndex;
for(int i = 0; i < getNumChildNoTransform(); i++)
if(getChildNoTransform(i) == node) {
node.childIndex = i;
return i;
}
return -1;
} // Declared in ASTNode.ast at line 96
public void addChild(T node) {
setChild(node, getNumChildNoTransform());
} // Declared in ASTNode.ast at line 99
@SuppressWarnings("cast") public final T getChildNoTransform(int i) {
return (T)children[i];
} // Declared in ASTNode.ast at line 102
protected ASTNode parent; // Declared in ASTNode.ast at line 103
protected ASTNode[] children; // Declared in ASTNode.ast at line 104
protected int numChildren; // Declared in ASTNode.ast at line 105
protected int numChildren() {
return numChildren;
} // Declared in ASTNode.ast at line 108
public int getNumChild() {
return numChildren();
} // Declared in ASTNode.ast at line 111
public final int getNumChildNoTransform() {
return numChildren();
} // Declared in ASTNode.ast at line 114
public void setChild(T node, int i) {
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 126
public void insertChild(T node, int i) {
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 141
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 152
public ASTNode getParent() {
if(parent != null && parent.is$Final() != is$Final()) {
boundariesCrossed++;
}
return parent;
} // Declared in ASTNode.ast at line 158
public void setParent(ASTNode node) {
parent = node;
} // Declared in ASTNode.ast at line 161
protected static int duringDefiniteAssignment = 0; // Declared in ASTNode.ast at line 162 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 172 protected static int duringVariableDeclaration = 0; // Declared in ASTNode.ast at line 173 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 183 protected static int duringLookupConstructor = 0; // Declared in ASTNode.ast at line 184 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 194 protected static int duringConstantExpression = 0; // Declared in ASTNode.ast at line 195 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 205 protected static int duringAnonymousClasses = 0; // Declared in ASTNode.ast at line 206 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 216 protected static int duringSyntacticClassification = 0; // Declared in ASTNode.ast at line 217 protected static boolean duringSyntacticClassification() { if(duringSyntacticClassification == 0) { return false; } else { state.pop(); state.push(ASTNode.REWRITE_INTERRUPT); return true;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -