public RecoveredElement add(FieldDeclaration fieldDeclaration, int bracketBalanceValue) { /* attach it to last type - if any */ if (this.typeCount > 0){ RecoveredType type = this.types[this.typeCount -1]; type.bodyEnd = 0; // reset position type.typeDeclaration.declarationSourceEnd = 0; // reset position type.typeDeclaration.bodyEnd = 0; resetPendingModifiers(); return type.add(fieldDeclaration, bracketBalanceValue); } return this; // ignore } public RecoveredElement add(ImportReference importReference, int bracketBalanceValue) {
public String toString(int tab) { StringBuffer result = new StringBuffer(tabString(tab)); result.append("Recovered unit: [\n"); //$NON-NLS-1$ this.unitDeclaration.print(tab + 1, result); result.append(tabString(tab + 1)); result.append("]"); //$NON-NLS-1$ if (this.imports != null) { for (int i = 0; i < this.importCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.imports[i].toString(tab + 1)); } } if (this.types != null) { for (int i = 0; i < this.typeCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.types[i].toString(tab + 1)); } } return result.toString(); } public CompilationUnitDeclaration updatedCompilationUnitDeclaration(){
public void updateParseTree(){ updatedCompilationUnitDeclaration(); } /*
element = new RecoveredUnit(this.compilationUnit, 0, this);
private void initModuleInfo(RecoveredElement element) { if (element instanceof RecoveredUnit) { RecoveredUnit unit = (RecoveredUnit) element; if (unit.unitDeclaration.isModuleInfo()) { ASTNode node = null; int i = 0; for (; i <= this.astPtr; i++) { if ((node = this.astStack[i]) instanceof ModuleDeclaration) { unit.add((ModuleDeclaration) node, this.bracketDepth); break; } } } } } protected void consumeAnnotationTypeDeclarationHeader() {
element = new RecoveredUnit(this.compilationUnit, 0, this);
private void initModuleInfo(RecoveredElement element) { if (element instanceof RecoveredUnit) { RecoveredUnit unit = (RecoveredUnit) element; if (unit.unitDeclaration.isModuleInfo()) { ASTNode node = null; int i = 0; for (; i <= this.astPtr; i++) { if ((node = this.astStack[i]) instanceof ModuleDeclaration) { unit.add((ModuleDeclaration) node, this.bracketDepth); break; } } } } } @Override
public RecoveredElement add(FieldDeclaration fieldDeclaration, int bracketBalanceValue) { /* attach it to last type - if any */ if (this.typeCount > 0){ RecoveredType type = this.types[this.typeCount -1]; type.bodyEnd = 0; // reset position type.typeDeclaration.declarationSourceEnd = 0; // reset position type.typeDeclaration.bodyEnd = 0; resetPendingModifiers(); return type.add(fieldDeclaration, bracketBalanceValue); } return this; // ignore } public RecoveredElement add(ExportsStatement exportReference, int bracketBalanceValue) {
public void updateParseTree(){ updatedCompilationUnitDeclaration(); } /*
public String toString(int tab) { StringBuffer result = new StringBuffer(tabString(tab)); result.append("Recovered unit: [\n"); //$NON-NLS-1$ this.unitDeclaration.print(tab + 1, result); result.append(tabString(tab + 1)); result.append("]"); //$NON-NLS-1$ if (this.imports != null) { for (int i = 0; i < this.importCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.imports[i].toString(tab + 1)); } } if (this.types != null) { for (int i = 0; i < this.typeCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.types[i].toString(tab + 1)); } } return result.toString(); } public CompilationUnitDeclaration updatedCompilationUnitDeclaration(){
element = new RecoveredUnit(this.compilationUnit, 0, this);
public RecoveredElement add(FieldDeclaration fieldDeclaration, int bracketBalanceValue) { /* attach it to last type - if any */ if (this.typeCount > 0){ RecoveredType type = this.types[this.typeCount -1]; type.bodyEnd = 0; // reset position type.typeDeclaration.declarationSourceEnd = 0; // reset position type.typeDeclaration.bodyEnd = 0; resetPendingModifiers(); return type.add(fieldDeclaration, bracketBalanceValue); } return this; // ignore } public RecoveredElement add(ImportReference importReference, int bracketBalanceValue) {
@Override public void updateParseTree(){ updatedCompilationUnitDeclaration(); } /*
public String toString(int tab) { StringBuffer result = new StringBuffer(tabString(tab)); result.append("Recovered unit: [\n"); //$NON-NLS-1$ this.unitDeclaration.print(tab + 1, result); result.append(tabString(tab + 1)); result.append("]"); //$NON-NLS-1$ if (this.imports != null) { for (int i = 0; i < this.importCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.imports[i].toString(tab + 1)); } } if (this.types != null) { for (int i = 0; i < this.typeCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.types[i].toString(tab + 1)); } } return result.toString(); } public CompilationUnitDeclaration updatedCompilationUnitDeclaration(){
element = new RecoveredUnit(this.compilationUnit, 0, this);
public RecoveredElement add(FieldDeclaration fieldDeclaration, int bracketBalanceValue) { /* attach it to last type - if any */ if (this.typeCount > 0){ RecoveredType type = this.types[this.typeCount -1]; type.bodyEnd = 0; // reset position type.typeDeclaration.declarationSourceEnd = 0; // reset position type.typeDeclaration.bodyEnd = 0; resetPendingModifiers(); return type.add(fieldDeclaration, bracketBalanceValue); } return this; // ignore } public RecoveredElement add(ImportReference importReference, int bracketBalanceValue) {
public void updateParseTree(){ updatedCompilationUnitDeclaration(); } /*
@Override public String toString(int tab) { StringBuffer result = new StringBuffer(tabString(tab)); result.append("Recovered unit: [\n"); //$NON-NLS-1$ this.unitDeclaration.print(tab + 1, result); result.append(tabString(tab + 1)); result.append("]"); //$NON-NLS-1$ if (this.imports != null) { for (int i = 0; i < this.importCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.imports[i].toString(tab + 1)); } } if (this.types != null) { for (int i = 0; i < this.typeCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.types[i].toString(tab + 1)); } } return result.toString(); } public CompilationUnitDeclaration updatedCompilationUnitDeclaration(){
element = new RecoveredUnit(this.compilationUnit, 0, this);
public RecoveredElement add(FieldDeclaration fieldDeclaration, int bracketBalanceValue) { /* attach it to last type - if any */ if (this.typeCount > 0){ RecoveredType type = this.types[this.typeCount -1]; type.bodyEnd = 0; // reset position type.typeDeclaration.declarationSourceEnd = 0; // reset position type.typeDeclaration.bodyEnd = 0; resetPendingModifiers(); return type.add(fieldDeclaration, bracketBalanceValue); } return this; // ignore } public RecoveredElement add(ImportReference importReference, int bracketBalanceValue) {