| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.sdk; | 4 library engine.sdk; |
| 5 | 5 |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 import 'dart:uri'; | 7 import 'dart:uri'; |
| 8 import 'java_core.dart'; | 8 import 'java_core.dart'; |
| 9 import 'java_io.dart'; | 9 import 'java_io.dart'; |
| 10 import 'java_engine.dart'; | 10 import 'java_engine.dart'; |
| 11 import 'java_engine_io.dart'; | 11 import 'java_engine_io.dart'; |
| 12 import 'package:analyzer_experimental/src/generated/source_io.dart'; | 12 import 'source_io.dart'; |
| 13 import 'package:analyzer_experimental/src/generated/error.dart'; | 13 import 'error.dart'; |
| 14 import 'package:analyzer_experimental/src/generated/scanner.dart'; | 14 import 'scanner.dart'; |
| 15 import 'package:analyzer_experimental/src/generated/parser.dart'; | 15 import 'parser.dart'; |
| 16 import 'package:analyzer_experimental/src/generated/ast.dart'; | 16 import 'ast.dart'; |
| 17 import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisEn
gine; | 17 import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisEn
gine; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Represents a single library in the SDK | 20 * Represents a single library in the SDK |
| 21 */ | 21 */ |
| 22 abstract class SdkLibrary { | 22 abstract class SdkLibrary { |
| 23 /** | 23 /** |
| 24 * Return the name of the category containing the library. | 24 * Return the name of the category containing the library. |
| 25 * @return the name of the category containing the library | 25 * @return the name of the category containing the library |
| 26 */ | 26 */ |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 * </pre> | 188 * </pre> |
| 189 * @coverage dart.engine.sdk | 189 * @coverage dart.engine.sdk |
| 190 */ | 190 */ |
| 191 class SdkLibrariesReader { | 191 class SdkLibrariesReader { |
| 192 /** | 192 /** |
| 193 * Return the library map read from the given source. | 193 * Return the library map read from the given source. |
| 194 * @return the library map read from the given source | 194 * @return the library map read from the given source |
| 195 */ | 195 */ |
| 196 LibraryMap readFrom(JavaFile librariesFile, String libraryFileContents) { | 196 LibraryMap readFrom(JavaFile librariesFile, String libraryFileContents) { |
| 197 List<bool> foundError = [false]; | 197 List<bool> foundError = [false]; |
| 198 AnalysisErrorListener errorListener = new AnalysisErrorListener_6(foundError
); | 198 AnalysisErrorListener errorListener = new AnalysisErrorListener_7(foundError
); |
| 199 Source source = new FileBasedSource.con2(null, librariesFile, false); | 199 Source source = new FileBasedSource.con2(null, librariesFile, false); |
| 200 StringScanner scanner = new StringScanner(source, libraryFileContents, error
Listener); | 200 StringScanner scanner = new StringScanner(source, libraryFileContents, error
Listener); |
| 201 Parser parser = new Parser(source, errorListener); | 201 Parser parser = new Parser(source, errorListener); |
| 202 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); | 202 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); |
| 203 SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_Li
braryBuilder(); | 203 SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_Li
braryBuilder(); |
| 204 if (!foundError[0]) { | 204 if (!foundError[0]) { |
| 205 unit.accept(libraryBuilder); | 205 unit.accept(libraryBuilder); |
| 206 } | 206 } |
| 207 return libraryBuilder.librariesMap; | 207 return libraryBuilder.librariesMap; |
| 208 } | 208 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 _librariesMap.setLibrary(libraryName, library); | 284 _librariesMap.setLibrary(libraryName, library); |
| 285 } | 285 } |
| 286 return null; | 286 return null; |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 class AnalysisErrorListener_6 implements AnalysisErrorListener { | 289 class AnalysisErrorListener_7 implements AnalysisErrorListener { |
| 290 List<bool> foundError; | 290 List<bool> foundError; |
| 291 AnalysisErrorListener_6(this.foundError); | 291 AnalysisErrorListener_7(this.foundError); |
| 292 void onError(AnalysisError error) { | 292 void onError(AnalysisError error) { |
| 293 foundError[0] = true; | 293 foundError[0] = true; |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 /** | 296 /** |
| 297 * Instances of the class {@code LibraryMap} map Dart library URI's to the {@lin
k SdkLibraryImpllibrary}. | 297 * Instances of the class {@code LibraryMap} map Dart library URI's to the {@lin
k SdkLibraryImpllibrary}. |
| 298 * @coverage dart.engine.sdk | 298 * @coverage dart.engine.sdk |
| 299 */ | 299 */ |
| 300 class LibraryMap { | 300 class LibraryMap { |
| 301 /** | 301 /** |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 /** | 651 /** |
| 652 * Read all of the configuration files to initialize the library maps. | 652 * Read all of the configuration files to initialize the library maps. |
| 653 */ | 653 */ |
| 654 void initializeLibraryMap() { | 654 void initializeLibraryMap() { |
| 655 try { | 655 try { |
| 656 JavaFile librariesFile = new JavaFile.relative(new JavaFile.relative(libra
ryDirectory, _INTERNAL_DIR), _LIBRARIES_FILE); | 656 JavaFile librariesFile = new JavaFile.relative(new JavaFile.relative(libra
ryDirectory, _INTERNAL_DIR), _LIBRARIES_FILE); |
| 657 String contents = librariesFile.readAsStringSync(); | 657 String contents = librariesFile.readAsStringSync(); |
| 658 _libraryMap = new SdkLibrariesReader().readFrom(librariesFile, contents); | 658 _libraryMap = new SdkLibrariesReader().readFrom(librariesFile, contents); |
| 659 } on JavaException catch (exception) { | 659 } catch (exception) { |
| 660 AnalysisEngine.instance.logger.logError3(exception); | 660 AnalysisEngine.instance.logger.logError3(exception); |
| 661 _libraryMap = new LibraryMap(); | 661 _libraryMap = new LibraryMap(); |
| 662 } | 662 } |
| 663 } | 663 } |
| 664 /** | 664 /** |
| 665 * Initialize the state of the SDK. | 665 * Initialize the state of the SDK. |
| 666 */ | 666 */ |
| 667 void initializeSdk() { | 667 void initializeSdk() { |
| 668 if (!OSUtilities.isWindows()) { | 668 if (!OSUtilities.isWindows()) { |
| 669 ensureVmIsExecutable(); | 669 ensureVmIsExecutable(); |
| 670 } | 670 } |
| 671 } | 671 } |
| 672 } | 672 } |
| OLD | NEW |