Java package reorganization.
Compiler-related support classes moved to package tools, java package structure
reorganized, classes renamed. The goal is to use same INameEnvironment and
ICompulationUnit implementation for both compiling and parsing, highlighting and
resolving.
package stx.libjava.tools.parser;
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
public class Parser extends org.eclipse.jdt.internal.compiler.parser.Parser {
public Parser() {
this(
new ProblemReporter(
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
new CompilerOptions(),
new DefaultProblemFactory()),
true);
}
public Parser(ProblemReporter problemReporter,
boolean optimizeStringLiterals) {
super(problemReporter, optimizeStringLiterals);
options.docCommentSupport = true;
javadocParser.checkDocComment = true;
}
public CompilationUnitDeclaration parse(ICompilationUnit cu, boolean diet) {
if (diet) {
return dietParse(cu, new CompilationResult(cu, 1, 1, 1000));
} else {
return parse(cu, new CompilationResult(cu, 1, 1, 1000 ));
}
}
}