X-Git-Url: http://git.phpeclipse.com 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 9ba7e1a..02ca163 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java @@ -9,34 +9,36 @@ http://www.eclipse.org/legal/cpl-v10.html Contributors: IBM Corporation - Initial implementation - Klaus Hartlage - www.eclipseproject.de + www.phpeclipse.de **********************************************************************/ +import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; +import net.sourceforge.phpdt.internal.compiler.util.Util; +import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.actions.ExternalPHPParser; import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.preference.IPreferenceStore; 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; + +//import test.PHPParserManager; /** - * Class that defines the action for parsing the current PHP file + * ClassDeclaration that defines the action for parsing the current PHP file */ public class PHPParserAction extends TextEditorAction { private static PHPParserAction instance = new PHPParserAction(); - private static String[] EXTENSIONS = { ".php", ".php3", ".php4", ".inc", ".phtml" }; protected IFile fileToParse; protected List fVariables = new ArrayList(100); @@ -58,43 +60,43 @@ public class PHPParserAction extends TextEditorAction { */ public void run() { boolean phpFlag = false; - try { - fileToParse = getPHPFile(); + + // try { + fileToParse = getPHPFile(); + parseFile(fileToParse); + } + + public static void parseFile(IFile fileToParse) { + boolean phpFlag = false; +// try { + if (fileToParse == null) { - // should never happen + // TODO should never happen => should throw an exception System.err.println("Error : no file in the editor"); - // should throw an exception + return; } - String name = fileToParse.getName(); - for (int i = 0; i