📄 program.java
字号:
for(Iterator iter = compilationUnitIterator(); iter.hasNext(); ) { CompilationUnit cu = (CompilationUnit)iter.next(); if(cu.fromSource()) { cu.toString(s); } } } // Declared in PrettyPrint.jadd at line 799 public String dumpTree() { StringBuffer s = new StringBuffer(); for(Iterator iter = compilationUnitIterator(); iter.hasNext(); ) { CompilationUnit cu = (CompilationUnit)iter.next(); if(cu.fromSource()) { s.append(cu.dumpTree()); } } return s.toString(); } // Declared in PrimitiveTypes.jrag at line 13 private boolean initPrimTypes = false; // Declared in PrimitiveTypes.jrag at line 15 public void addPrimitiveTypes() { if(!initPrimTypes) { initPrimTypes = true; CompilationUnit u = new CompilationUnit(); u.setPackageDecl(PRIMITIVE_PACKAGE_NAME); addCompilationUnit(u); TypeDecl classDecl = generateUnknownType(); u.addTypeDecl(classDecl); TypeDecl unknown = classDecl; classDecl = generatePrimitiveType(new BooleanType(), "boolean", unknown); u.addTypeDecl(classDecl); classDecl = generatePrimitiveType(new DoubleType(), "double", unknown); u.addTypeDecl(classDecl); classDecl = generatePrimitiveType(new FloatType(), "float", classDecl); u.addTypeDecl(classDecl); classDecl = generatePrimitiveType(new LongType(), "long", classDecl); u.addTypeDecl(classDecl); classDecl = generatePrimitiveType(new IntType(), "int", classDecl); u.addTypeDecl(classDecl); TypeDecl intDecl = classDecl; classDecl = generatePrimitiveType(new ShortType(), "short", classDecl); u.addTypeDecl(classDecl); classDecl = generatePrimitiveType(new ByteType(), "byte", classDecl); u.addTypeDecl(classDecl); classDecl = generatePrimitiveType(new CharType(), "char", intDecl); u.addTypeDecl(classDecl); classDecl = new NullType(); classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public")))); classDecl.setID("null"); u.addTypeDecl(classDecl); classDecl = new VoidType(); classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public")))); classDecl.setID("void"); u.addTypeDecl(classDecl); } } // Declared in PrimitiveTypes.jrag at line 65 public TypeDecl generatePrimitiveType(PrimitiveType type, String name, TypeDecl superType) { type.setModifiers(new Modifiers(new List().add(new Modifier("public")))); type.setID(name); if(superType != null) type.setSuperClassAccess(superType.createQualifiedAccess()); return type; } // Declared in PrimitiveTypes.jrag at line 73 private TypeDecl generateUnknownType() { ClassDecl classDecl = new UnknownType(); classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public")))); classDecl.setID("Unknown"); MethodDecl methodDecl = new MethodDecl( new Modifiers(new List().add( new Modifier("public") )), new PrimitiveTypeAccess("Unknown"), "unknown", new List(), new List(), new Opt() ); classDecl.addBodyDecl(methodDecl); FieldDeclaration fieldDecl = new FieldDeclaration( new Modifiers(new List().add( new Modifier("public") )), new PrimitiveTypeAccess("Unknown"), "unknown", new Opt() ); classDecl.addBodyDecl(fieldDecl); ConstructorDecl constrDecl = new ConstructorDecl( new Modifiers(new List().add(new Modifier("public"))), "Unknown", new List(), new List(), new Opt(), new Block() ); classDecl.addBodyDecl(constrDecl); return classDecl; } // Declared in java.ast at line 3 // Declared in java.ast line 1
public Program() { super();
setChild(new List(), 0);
is$Final(true);
} // Declared in java.ast at line 12
// Declared in java.ast line 1 public Program(List<CompilationUnit> p0) { setChild(p0, 0); is$Final(true); } // Declared in java.ast at line 17 protected int numChildren() {
return 1;
} // Declared in java.ast at line 20
protected boolean debugNodeAttachmentIsRoot() { return true; } // Declared in java.ast at line 21
public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 1 public void setCompilationUnitList(List<CompilationUnit> list) { setChild(list, 0); } // Declared in java.ast at line 6 private int getNumCompilationUnit = 0; // Declared in java.ast at line 7 public int getNumCompilationUnit() { return getCompilationUnitList().getNumChild(); } // Declared in java.ast at line 11 @SuppressWarnings({"unchecked", "cast"}) public CompilationUnit getCompilationUnit(int i) { return (CompilationUnit)getCompilationUnitList().getChild(i); } // Declared in java.ast at line 15 public void addCompilationUnit(CompilationUnit node) { List<CompilationUnit> list = getCompilationUnitList(); list.addChild(node); } // Declared in java.ast at line 20 public void setCompilationUnit(CompilationUnit node, int i) { List<CompilationUnit> list = getCompilationUnitList(); list.setChild(node, i); } // Declared in java.ast at line 24 public List<CompilationUnit> getCompilationUnits() { return getCompilationUnitList(); } // Declared in java.ast at line 27 public List<CompilationUnit> getCompilationUnitsNoTransform() { return getCompilationUnitListNoTransform(); } // Declared in java.ast at line 31 @SuppressWarnings({"unchecked", "cast"}) public List<CompilationUnit> getCompilationUnitList() { return (List<CompilationUnit>)getChild(0); } // Declared in java.ast at line 35 @SuppressWarnings({"unchecked", "cast"}) public List<CompilationUnit> getCompilationUnitListNoTransform() { return (List<CompilationUnit>)getChildNoTransform(0); } protected int typeObject_visited = -1; protected boolean typeObject_computed = false; protected TypeDecl typeObject_value; // Declared in LookupType.jrag at line 15 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeObject() { if(typeObject_computed) return typeObject_value; if(typeObject_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: typeObject in class: "); typeObject_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); typeObject_value = typeObject_compute(); if(isFinal && num == boundariesCrossed) typeObject_computed = true; typeObject_visited = -1; return typeObject_value; } private TypeDecl typeObject_compute() { return lookupType("java.lang", "Object"); } protected int typeCloneable_visited = -1; protected boolean typeCloneable_computed = false; protected TypeDecl typeCloneable_value; // Declared in LookupType.jrag at line 16 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeCloneable() { if(typeCloneable_computed) return typeCloneable_value; if(typeCloneable_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: typeCloneable in class: "); typeCloneable_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); typeCloneable_value = typeCloneable_compute(); if(isFinal && num == boundariesCrossed) typeCloneable_computed = true; typeCloneable_visited = -1; return typeCloneable_value; } private TypeDecl typeCloneable_compute() { return lookupType("java.lang", "Cloneable"); } protected int typeSerializable_visited = -1; protected boolean typeSerializable_computed = false; protected TypeDecl typeSerializable_value; // Declared in LookupType.jrag at line 17 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeSerializable() { if(typeSerializable_computed) return typeSerializable_value; if(typeSerializable_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: typeSerializable in class: "); typeSerializable_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); typeSerializable_value = typeSerializable_compute(); if(isFinal && num == boundariesCrossed) typeSerializable_computed = true; typeSerializable_visited = -1; return typeSerializable_value; } private TypeDecl typeSerializable_compute() { return lookupType("java.io", "Serializable"); } protected int typeBoolean_visited = -1; protected boolean typeBoolean_computed = false; protected TypeDecl typeBoolean_value; // Declared in LookupType.jrag at line 22 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeBoolean() { if(typeBoolean_computed) return typeBoolean_value; if(typeBoolean_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: typeBoolean in class: "); typeBoolean_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); typeBoolean_value = typeBoolean_compute(); if(isFinal && num == boundariesCrossed) typeBoolean_computed = true; typeBoolean_visited = -1; return typeBoolean_value; } private TypeDecl typeBoolean_compute() { return lookupType(PRIMITIVE_PACKAGE_NAME, "boolean"); } protected int typeByte_visited = -1; protected boolean typeByte_computed = false; protected TypeDecl typeByte_value; // Declared in LookupType.jrag at line 23 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeByte() { if(typeByte_computed) return typeByte_value; if(typeByte_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: typeByte in class: "); typeByte_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); typeByte_value = typeByte_compute(); if(isFinal && num == boundariesCrossed) typeByte_computed = true; typeByte_visited = -1; return typeByte_value; } private TypeDecl typeByte_compute() { return lookupType(PRIMITIVE_PACKAGE_NAME , "byte"); } protected int typeShort_visited = -1; protected boolean typeShort_computed = false;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -