@Override
protected void internalPerform() throws AnalysisException {
TypeProvider typeProvider = ((InternalAnalysisContext) libraryElement.getContext()).getTypeProvider();
ResolvableCompilationUnit resolvableUnit = getContext().computeResolvableCompilationUnit(source);
modificationTime = resolvableUnit.getModificationTime();
CompilationUnit unit = resolvableUnit.getCompilationUnit();
if (unit == null) {
throw new AnalysisException(
"Internal error: computeResolvableCompilationUnit returned a value without a parsed Dart unit");
}
//
// Resolve names in declarations.
//
new DeclarationResolver().resolve(unit, find(libraryElement, source));
//
// Resolve the type names.
//
RecordingErrorListener errorListener = new RecordingErrorListener();
TypeResolverVisitor typeResolverVisitor = new TypeResolverVisitor(
libraryElement,
source,
typeProvider,
errorListener);
unit.accept(typeResolverVisitor);
//
// Resolve the rest of the structure
//
InheritanceManager inheritanceManager = new InheritanceManager(libraryElement);
ResolverVisitor resolverVisitor = new ResolverVisitor(
libraryElement,
source,
typeProvider,
inheritanceManager,
errorListener);
unit.accept(resolverVisitor);
//
// Perform additional error checking.
//
TimeCounterHandle counterHandleErrors = PerformanceStatistics.errors.start();
try {
ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
ErrorVerifier errorVerifier = new ErrorVerifier(
errorReporter,
libraryElement,
typeProvider,
inheritanceManager);
unit.accept(errorVerifier);
ConstantVerifier constantVerifier = new ConstantVerifier(
errorReporter,
libraryElement,
typeProvider);
unit.accept(constantVerifier);
} finally {
counterHandleErrors.stop();
}
//
// Capture the results.