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 610022d..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,12 +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.parser.Parser; +import net.sourceforge.phpdt.internal.compiler.util.Util; import net.sourceforge.phpeclipse.PHPeclipsePlugin; import org.eclipse.core.resources.IFile; @@ -29,8 +30,11 @@ import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.TextEditorAction; +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 { @@ -57,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