3 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
5 import org.eclipse.core.resources.IFile;
7 public class PHPParserManager {
10 public static PHPParserSuperclass getParser(IFile fileToParse) {
12 PHPParserSuperclass actualParser;
13 if (PHPeclipsePlugin.PHPPARSER == PHPeclipsePlugin.PHPPARSER_ORIGINAL) {
14 actualParser = (PHPParserSuperclass) Class.forName(PHPeclipsePlugin.PHPPARSER).newInstance();
16 actualParser = (PHPParserSuperclass) Class.forName(PHPeclipsePlugin.PHPPARSER).newInstance();
18 actualParser.setFileToParse(fileToParse);
20 } catch (InstantiationException e) {
21 PHPeclipsePlugin.log(e);
22 } catch (IllegalAccessException e) {
23 PHPeclipsePlugin.log(e);
24 } catch (ClassNotFoundException e) {
25 PHPeclipsePlugin.log(e);
30 public static PHPParserSuperclass getParser() {
32 PHPParserSuperclass actualParser;
33 if (PHPeclipsePlugin.PHPPARSER == PHPeclipsePlugin.PHPPARSER_ORIGINAL) {
34 actualParser = (PHPParserSuperclass) Class.forName(PHPeclipsePlugin.PHPPARSER).newInstance();
36 actualParser = (PHPParserSuperclass) Class.forName(PHPeclipsePlugin.PHPPARSER).newInstance();
39 } catch (InstantiationException e) {
40 PHPeclipsePlugin.log(e);
41 } catch (IllegalAccessException e) {
42 PHPeclipsePlugin.log(e);
43 } catch (ClassNotFoundException e) {
44 PHPeclipsePlugin.log(e);
50 * To avoid instantiation.
52 private PHPParserManager() {