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 9ba7e1a..3d78be7 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPParserAction.java @@ -12,11 +12,13 @@ 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.phpeclipse.PHPeclipsePlugin; import org.eclipse.core.resources.IFile; @@ -27,11 +29,12 @@ 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.PHPParserSuperclass; /** - * 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 { @@ -58,18 +61,27 @@ public class PHPParserAction extends TextEditorAction { */ public void run() { boolean phpFlag = false; + + // try { + fileToParse = getPHPFile(); + parseFile(fileToParse); + } + + public static void parseFile(IFile fileToParse) { + boolean phpFlag = false; try { - fileToParse = getPHPFile(); + 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