*******************************************************************************/
package net.sourceforge.phpdt.internal.compiler.parser;
-import net.sourceforge.phpdt.internal.compiler.ast.ASTNode;
+//import net.sourceforge.phpdt.internal.compiler.ast.ASTNode;
import net.sourceforge.phpdt.internal.compiler.ast.Block;
import net.sourceforge.phpdt.internal.compiler.ast.Statement;
protected Parser recoveringParser;
- public RecoveredElement(RecoveredElement parent, int bracketBalance) {
- this(parent, bracketBalance, null);
- }
+// public RecoveredElement(RecoveredElement parent, int bracketBalance) {
+// this(parent, bracketBalance, null);
+// }
- public RecoveredElement(RecoveredElement parent, int bracketBalance,
- Parser parser) {
- this.parent = parent;
- this.bracketBalance = bracketBalance;
- this.recoveringParser = parser;
- }
+// public RecoveredElement(RecoveredElement parent, int bracketBalance,
+// Parser parser) {
+// this.parent = parent;
+// this.bracketBalance = bracketBalance;
+// this.recoveringParser = parser;
+// }
/*
* Record a method declaration
/*
* Answer the depth of this element, considering the parent link.
*/
- public int depth() {
- int depth = 0;
- RecoveredElement current = this;
- while ((current = current.parent) != null)
- depth++;
- return depth;
- }
+// public int depth() {
+// int depth = 0;
+// RecoveredElement current = this;
+// while ((current = current.parent) != null)
+// depth++;
+// return depth;
+// }
/*
* Answer the enclosing method node, or null if none
/*
* Answer the associated parsed structure
*/
- public ASTNode parseTree() {
- return null;
- }
+// public ASTNode parseTree() {
+// return null;
+// }
/*
* Iterate the enclosing blocks and tag them so as to preserve their content
/*
* Answer the very source end of the corresponding parse node
*/
- public int sourceEnd() {
- return 0;
- }
-
- protected String tabString(int tab) {
- StringBuffer result = new StringBuffer();
- for (int i = tab; i > 0; i--) {
- result.append(" "); //$NON-NLS-1$
- }
- return result.toString();
- }
+// public int sourceEnd() {
+// return 0;
+// }
+
+// protected String tabString(int tab) {
+// StringBuffer result = new StringBuffer();
+// for (int i = tab; i > 0; i--) {
+// result.append(" "); //$NON-NLS-1$
+// }
+// return result.toString();
+// }
/*
* Answer the top node
* Update the corresponding parse node from parser state which is about to
* disappear because of restarting recovery
*/
- public void updateFromParserState() {
- }
+// public void updateFromParserState() {
+// }
/*
* A closing brace got consumed, might have closed the current element, in
* which case both the currentElement is exited
*/
- public RecoveredElement updateOnClosingBrace(int braceStart, int braceEnd) {
- if ((--bracketBalance <= 0) && (parent != null)) {
- this.updateSourceEndIfNecessary(braceEnd);
- return parent;
- }
- return this;
- }
+// public RecoveredElement updateOnClosingBrace(int braceStart, int braceEnd) {
+// if ((--bracketBalance <= 0) && (parent != null)) {
+// this.updateSourceEndIfNecessary(braceEnd);
+// return parent;
+// }
+// return this;
+// }
/*
* An opening brace got consumed, might be the expected opening one of the
* current element, in which case the bodyStart is updated.
*/
- public RecoveredElement updateOnOpeningBrace(int braceEnd) {
-
- if (bracketBalance++ == 0) {
- this.updateBodyStart(braceEnd + 1);
- return this;
- }
- return null; // no update is necessary
- }
+// public RecoveredElement updateOnOpeningBrace(int braceEnd) {
+//
+// if (bracketBalance++ == 0) {
+// this.updateBodyStart(braceEnd + 1);
+// return this;
+// }
+// return null; // no update is necessary
+// }
/*
* Final update the corresponding parse node
*/
- public void updateParseTree() {
- }
+// public void updateParseTree() {
+// }
/*
* Update the declarationSourceEnd of the corresponding parse node