1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.parser;
14 * Internal statement structure for parsing recovery
16 import net.sourceforge.phpdt.internal.compiler.ast.AstNode;
17 import net.sourceforge.phpdt.internal.compiler.ast.Statement;
19 public class RecoveredStatement extends RecoveredElement {
21 public Statement statement;
22 boolean alreadyCompletedLocalInitialization;
23 public RecoveredStatement(Statement statement, RecoveredElement parent, int bracketBalance){
24 super(parent, bracketBalance);
25 this.statement = statement;
28 * Answer the associated parsed structure
30 public AstNode parseTree(){
34 * Answer the very source end of the corresponding parse node
36 public int sourceEnd(){
37 return this.statement.sourceEnd;
39 public String toString(int tab){
40 return tabString(tab) + "Recovered statement:\n" + statement.toString(tab + 1); //$NON-NLS-1$
42 public Statement updatedStatement(){
45 public void updateParseTree(){
46 this.updatedStatement();
49 * Update the declarationSourceEnd of the corresponding parse node
51 public void updateSourceEndIfNecessary(int sourceEnd){
52 if (this.statement.sourceEnd == 0)
53 this.statement.sourceEnd = sourceEnd;