protected void recoverStatements() {
	class MethodVisitor extends ASTVisitor {
		public ASTVisitor typeVisitor;

		TypeDeclaration enclosingType; // used only for initializer

		TypeDeclaration[] types = new TypeDeclaration[0];
		int typePtr = -1;
		public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope scope) {
			typePtr = -1;
			return true;
		}
		public boolean visit(Initializer initializer, MethodScope scope) {
			typePtr = -1;
			return true;
		}
		public boolean visit(MethodDeclaration methodDeclaration,Scope scope) {
			typePtr = -1;
			return true;
		}
		public boolean visit(TypeDeclaration typeDeclaration, BlockScope scope) {
			return this.visit(typeDeclaration);
		}
		public boolean visit(TypeDeclaration typeDeclaration, Scope scope) {
			return this.visit(typeDeclaration);
		}
		private boolean visit(TypeDeclaration typeDeclaration) {
			if(this.types.length <= ++this.typePtr) {
				int length = this.typePtr;
				System.arraycopy(this.types, 0, this.types = new TypeDeclaration[length * 2 + 1], 0, length);
			}
			this.types[this.typePtr] = typeDeclaration;
			return false;
		}
		public void endVisit(ConstructorDeclaration constructorDeclaration, ClassScope scope) {
			this.endVisitMethod(constructorDeclaration, scope);
		}
		public void endVisit(MethodDeclaration methodDeclaration, Scope scope) {
			this.endVisitMethod(methodDeclaration, scope);
		}
		private void endVisitMethod(AbstractMethodDeclaration methodDeclaration, Scope scope) {
			TypeDeclaration[] foundTypes = null;
//			int length = 0;
//			if(this.typePtr > -1) {
//				length = this.typePtr + 1;
//				foundTypes = new TypeDeclaration[length];
//				System.arraycopy(this.types, 0, foundTypes, 0, length);
//			}
			ReferenceContext oldContext = Parser.this.referenceContext;
			Parser.this.recoveryScanner.resetTo(methodDeclaration.bodyStart, methodDeclaration.bodyEnd);
			Scanner oldScanner = Parser.this.scanner;
			Parser.this.scanner = Parser.this.recoveryScanner;
			Parser.this.parseStatements(
					methodDeclaration,
					methodDeclaration.bodyStart,
					methodDeclaration.bodyEnd,
					foundTypes,
					compilationUnit);
			Parser.this.scanner = oldScanner;
			Parser.this.referenceContext = oldContext;

//			for (int i = 0; i < length; i++) {
//				foundTypes[i].traverse(typeVisitor, scope);
//			}
		}
		public void endVisit(Initializer initializer, MethodScope scope) {
			TypeDeclaration[] foundTypes = null;
			int length = 0;
			if(this.typePtr > -1) {
				length = this.typePtr + 1;
				foundTypes = new TypeDeclaration[length];
				System.arraycopy(this.types, 0, foundTypes, 0, length);
			}
			ReferenceContext oldContext = Parser.this.referenceContext;
			Parser.this.recoveryScanner.resetTo(initializer.bodyStart, initializer.bodyEnd);
			Scanner oldScanner = Parser.this.scanner;
			Parser.this.scanner = Parser.this.recoveryScanner;
			Parser.this.parseStatements(
					this.enclosingType,
					initializer.bodyStart,
					initializer.bodyEnd,
					foundTypes,
					compilationUnit);
			Parser.this.scanner = oldScanner;
			Parser.this.referenceContext = oldContext;

			for (int i = 0; i < length; i++) {
				foundTypes[i].traverse(typeVisitor, scope);
			}
		}
	}
	class TypeVisitor extends ASTVisitor {
		public MethodVisitor methodVisitor;

		TypeDeclaration[] types = new TypeDeclaration[0];
		int typePtr = -1;

		public void endVisit(TypeDeclaration typeDeclaration, BlockScope scope) {
			endVisitType();
		}
		public void endVisit(TypeDeclaration typeDeclaration, ClassScope scope) {
			endVisitType();
		}
		private void endVisitType() {
			this.typePtr--;
		}
		public boolean visit(TypeDeclaration typeDeclaration, BlockScope scope) {
			return this.visit(typeDeclaration);
		}
		public boolean visit(TypeDeclaration typeDeclaration, ClassScope scope) {
			return this.visit(typeDeclaration);
		}
		private boolean visit(TypeDeclaration typeDeclaration) {
			if(this.types.length <= ++this.typePtr) {
				int length = this.typePtr;
				System.arraycopy(this.types, 0, this.types = new TypeDeclaration[length * 2 + 1], 0, length);
			}
			this.types[this.typePtr] = typeDeclaration;
			return true;
		}
		public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope scope) {
			if(constructorDeclaration.isDefaultConstructor()) return false;

			constructorDeclaration.traverse(methodVisitor, scope);
			return false;
		}
		public boolean visit(Initializer initializer, MethodScope scope) {
			methodVisitor.enclosingType = this.types[typePtr];
			initializer.traverse(methodVisitor, scope);
			return false;
		}
		public boolean visit(MethodDeclaration methodDeclaration, Scope scope) {
			methodDeclaration.traverse(methodVisitor, scope);
			return false;
		}
	}

	if (false)
	{
	MethodVisitor methodVisitor = new MethodVisitor();
	TypeVisitor typeVisitor = new TypeVisitor();
	methodVisitor.typeVisitor = typeVisitor;
	typeVisitor.methodVisitor = methodVisitor;

	if(this.referenceContext instanceof AbstractMethodDeclaration) {
		((AbstractMethodDeclaration)this.referenceContext).traverse(methodVisitor, (Scope)null);
	}else if(this.referenceContext instanceof CompilationUnitDeclaration) {
		CompilationUnitDeclaration compilationUnitDeclaration=(CompilationUnitDeclaration)this.referenceContext;
		if (compilationUnitDeclaration.statements!=null)
			for (int i = 0; i < compilationUnitDeclaration.statements.length; i++) {
				if( compilationUnitDeclaration.statements[i] instanceof AbstractMethodDeclaration)
					((AbstractMethodDeclaration)compilationUnitDeclaration.statements[i] ).traverse(methodVisitor, (Scope)null);
			}
	} else if(this.referenceContext instanceof TypeDeclaration) {
		TypeDeclaration typeContext = (TypeDeclaration)this.referenceContext;

		int length = typeContext.fields.length;
		for (int i = 0; i < length; i++) {
			final FieldDeclaration fieldDeclaration = typeContext.fields[i];
			switch(fieldDeclaration.getKind()) {
				case AbstractVariableDeclaration.INITIALIZER:
					methodVisitor.enclosingType = typeContext;
					((Initializer) fieldDeclaration).traverse(methodVisitor, (MethodScope)null);
					break;
			}
		}
	}
	}
	else
	{
		CompilationUnitDeclaration compilationUnitDeclaration=(CompilationUnitDeclaration)this.referenceContext;

		ReferenceContext oldContext = Parser.this.referenceContext;
		int start = compilationUnitDeclaration.sourceStart;
		int end = compilationUnitDeclaration.sourceEnd;
		Parser.this.recoveryScanner.resetTo(start, end);
		Scanner oldScanner = Parser.this.scanner;
		Parser.this.scanner = Parser.this.recoveryScanner;
		/* unit creation */
		this.referenceContext =
			this.compilationUnit = compilationUnitDeclaration=
				new CompilationUnitDeclaration(
					this.problemReporter,
					compilationUnitDeclaration.compilationResult,
					end);

		Parser.this.parseStatements(
				compilationUnitDeclaration,
				start,
				end,
				null,
				compilationUnit);
		Parser.this.scanner = oldScanner;
		Parser.this.referenceContext = oldContext;
	}


}