* IBM Corporation - added #createScanner allowing to make comment check stricter
******************************************************************************/
package net.sourceforge.phpdt.core;
-
+
import java.util.Map;
import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
import net.sourceforge.phpdt.internal.formatter.CodeFormatter;
-import net.sourceforge.phpeclipse.PHPCore;
import org.eclipse.core.runtime.Plugin;
*/
public static ICodeFormatter createCodeFormatter(){
- Plugin jdtCorePlugin = PHPCore.getPlugin();
+ Plugin jdtCorePlugin = JavaCore.getPlugin();
if (jdtCorePlugin == null) return null;
// IExtensionPoint extension = jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.FORMATTER_EXTPOINT_ID);
*/
public static ICodeFormatter createDefaultCodeFormatter(Map options){
- if (options == null) options = PHPCore.getOptions();
+ if (options == null) options = JavaCore.getOptions();
return new CodeFormatter(options);
}
scanner.recordLineSeparator = recordLineSeparator;
return scanner;
}
+
+ public static Scanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator, boolean phpMode){
+
+ Scanner scanner = new Scanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/);
+ scanner.recordLineSeparator = recordLineSeparator;
+ scanner.setPHPMode(phpMode);
+ return scanner;
+ }
}