X-Git-Url: http://secure.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 774fbf1..7eef9ca 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java @@ -12,31 +12,33 @@ Contributors: Klaus Hartlage - www.eclipseproject.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