From: kpouer Date: Thu, 27 Feb 2003 22:00:33 +0000 (+0000) Subject: Use the PHPParserManager instead of instantiating the parser X-Git-Url: http://git.phpeclipse.com Use the PHPParserManager instead of instantiating the parser --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java index 37ea7e4..36b568c 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPExternalParserAction.java @@ -13,8 +13,6 @@ package net.sourceforge.phpeclipse.actions; import java.util.Iterator; -import net.sourceforge.phpdt.internal.compiler.parser.Parser; - import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.jface.action.IAction; @@ -23,6 +21,7 @@ import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IObjectActionDelegate; import org.eclipse.ui.IWorkbenchPart; +import test.PHPParserSuperclass; public class PHPExternalParserAction implements IObjectActionDelegate { @@ -74,7 +73,7 @@ public class PHPExternalParserAction implements IObjectActionDelegate { case IResource.FILE : // single file: IFile file = (IFile) resource; - Parser.phpExternalParse(file); + PHPParserSuperclass.phpExternalParse(file); } } } diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java index 2adfda1..5b53646 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java @@ -19,7 +19,6 @@ import java.util.List; import java.util.TreeSet; import net.sourceforge.phpdt.internal.compiler.parser.PHPOutlineInfo; -import net.sourceforge.phpdt.internal.compiler.parser.Parser; import net.sourceforge.phpdt.internal.compiler.parser.PHPSegment; import net.sourceforge.phpdt.internal.compiler.parser.PHPSegmentWithChildren; import net.sourceforge.phpdt.internal.ui.viewsupport.ImageDescriptorRegistry; @@ -43,6 +42,8 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.views.contentoutline.ContentOutlinePage; +import test.PHPParserSuperclass; +import test.PHPParserManager; /** * A content outline page which always represents the functions of the @@ -100,7 +101,7 @@ public class PHPContentOutlinePage extends ContentOutlinePage { String name; int index; String text = document.get(); - Parser parser = new Parser(null); + PHPParserSuperclass parser = PHPParserManager.getParser(null); PHPOutlineInfo outlineInfo = parser.parseInfo(fInput, text); fVariables = outlineInfo.getVariables(); diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java index 610022d..9ba7e1a 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java @@ -17,7 +17,6 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.List; -import net.sourceforge.phpdt.internal.compiler.parser.Parser; import net.sourceforge.phpeclipse.PHPeclipsePlugin; import org.eclipse.core.resources.IFile; @@ -28,6 +27,8 @@ import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.TextEditorAction; +import test.PHPParserSuperclass; +import test.PHPParserManager; /** * Class that defines the action for parsing the current PHP file @@ -86,7 +87,7 @@ public class PHPParserAction extends TextEditorAction { } catch (IOException e) { } } else { - Parser.phpExternalParse(fileToParse); + PHPParserSuperclass.phpExternalParse(fileToParse); } } } catch (CoreException e) { @@ -164,7 +165,7 @@ public class PHPParserAction extends TextEditorAction { } String input = buf.toString(); - Parser parser = new Parser(fileToParse); + PHPParserSuperclass parser = PHPParserManager.getParser(fileToParse); try { parser.parse(input); } catch (CoreException e) {