| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.sdk; | 8 library engine.sdk; |
| 9 | 9 |
| 10 import 'source.dart' show ContentCache, Source, UriKind; | 10 import 'source.dart' show ContentCache, Source, UriKind; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool get isShared; | 73 bool get isShared; |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * Return `true` if this library can be run on the VM. | 76 * Return `true` if this library can be run on the VM. |
| 77 * | 77 * |
| 78 * @return `true` if this library can be run on the VM | 78 * @return `true` if this library can be run on the VM |
| 79 */ | 79 */ |
| 80 bool get isVmLibrary; | 80 bool get isVmLibrary; |
| 81 } | 81 } |
| 82 | 82 |
| 83 /** | |
| 84 * Instances of the class `SdkLibrary` represent the information known about a s
ingle library | |
| 85 * within the SDK. | |
| 86 */ | |
| 87 class SdkLibraryImpl implements SdkLibrary { | |
| 88 /** | |
| 89 * The short name of the library. This is the name used after `dart:` in a URI
. | |
| 90 */ | |
| 91 String _shortName = null; | |
| 92 | |
| 93 /** | |
| 94 * The path to the file defining the library. The path is relative to the `lib
` directory | |
| 95 * within the SDK. | |
| 96 */ | |
| 97 String path = null; | |
| 98 | |
| 99 /** | |
| 100 * The name of the category containing the library. Unless otherwise specified
in the libraries | |
| 101 * file all libraries are assumed to be shared between server and client. | |
| 102 */ | |
| 103 String category = "Shared"; | |
| 104 | |
| 105 /** | |
| 106 * A flag indicating whether the library is documented. | |
| 107 */ | |
| 108 bool _documented = true; | |
| 109 | |
| 110 /** | |
| 111 * A flag indicating whether the library is an implementation library. | |
| 112 */ | |
| 113 bool _implementation = false; | |
| 114 | |
| 115 /** | |
| 116 * An encoding of which platforms this library is intended to work on. | |
| 117 */ | |
| 118 int _platforms = 0; | |
| 119 | |
| 120 /** | |
| 121 * The bit mask used to access the bit representing the flag indicating whethe
r a library is | |
| 122 * intended to work on the dart2js platform. | |
| 123 */ | |
| 124 static int DART2JS_PLATFORM = 1; | |
| 125 | |
| 126 /** | |
| 127 * The bit mask used to access the bit representing the flag indicating whethe
r a library is | |
| 128 * intended to work on the VM platform. | |
| 129 */ | |
| 130 static int VM_PLATFORM = 2; | |
| 131 | |
| 132 /** | |
| 133 * Initialize a newly created library to represent the library with the given
name. | |
| 134 * | |
| 135 * @param name the short name of the library | |
| 136 */ | |
| 137 SdkLibraryImpl(String name) { | |
| 138 this._shortName = name; | |
| 139 } | |
| 140 | |
| 141 @override | |
| 142 String get shortName => _shortName; | |
| 143 | |
| 144 @override | |
| 145 bool get isDart2JsLibrary => (_platforms & DART2JS_PLATFORM) != 0; | |
| 146 | |
| 147 @override | |
| 148 bool get isDocumented => _documented; | |
| 149 | |
| 150 @override | |
| 151 bool get isImplementation => _implementation; | |
| 152 | |
| 153 @override | |
| 154 bool get isInternal => "Internal" == category; | |
| 155 | |
| 156 /** | |
| 157 * Return `true` if library can be used for both client and server | |
| 158 */ | |
| 159 @override | |
| 160 bool get isShared => category == "Shared"; | |
| 161 | |
| 162 /** | |
| 163 * Return `true` if this library can be run on the VM. | |
| 164 * | |
| 165 * @return `true` if this library can be run on the VM | |
| 166 */ | |
| 167 @override | |
| 168 bool get isVmLibrary => (_platforms & VM_PLATFORM) != 0; | |
| 169 | |
| 170 /** | |
| 171 * Record that this library can be compiled to JavaScript by dart2js. | |
| 172 */ | |
| 173 void setDart2JsLibrary() { | |
| 174 _platforms |= DART2JS_PLATFORM; | |
| 175 } | |
| 176 | |
| 177 /** | |
| 178 * Set whether the library is documented to match the given value. | |
| 179 * | |
| 180 * @param documented `true` if the library is documented | |
| 181 */ | |
| 182 void set documented(bool documented) { | |
| 183 this._documented = documented; | |
| 184 } | |
| 185 | |
| 186 /** | |
| 187 * Set whether the library is an implementation library to match the given val
ue. | |
| 188 * | |
| 189 * @param implementation `true` if the library is an implementation library | |
| 190 */ | |
| 191 void set implementation(bool implementation) { | |
| 192 this._implementation = implementation; | |
| 193 } | |
| 194 | |
| 195 /** | |
| 196 * Record that this library can be run on the VM. | |
| 197 */ | |
| 198 void setVmLibrary() { | |
| 199 _platforms |= VM_PLATFORM; | |
| 200 } | |
| 201 } | |
| 202 | |
| 203 class SdkLibrariesReader_LibraryBuilder extends RecursiveAstVisitor<Object> { | 83 class SdkLibrariesReader_LibraryBuilder extends RecursiveAstVisitor<Object> { |
| 204 /** | 84 /** |
| 205 * The prefix added to the name of a library to form the URI used in code to r
eference the | 85 * The prefix added to the name of a library to form the URI used in code to r
eference the |
| 206 * library. | 86 * library. |
| 207 */ | 87 */ |
| 208 static String _LIBRARY_PREFIX = "dart:"; | 88 static String _LIBRARY_PREFIX = "dart:"; |
| 209 | 89 |
| 210 /** | 90 /** |
| 211 * The name of the optional parameter used to indicate whether the library is
an implementation | 91 * The name of the optional parameter used to indicate whether the library is
an implementation |
| 212 * library. | 92 * library. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 236 |
| 357 /** | 237 /** |
| 358 * Return the number of library URI's for which a mapping is available. | 238 * Return the number of library URI's for which a mapping is available. |
| 359 * | 239 * |
| 360 * @return the number of library URI's for which a mapping is available | 240 * @return the number of library URI's for which a mapping is available |
| 361 */ | 241 */ |
| 362 int size() => _libraryMap.length; | 242 int size() => _libraryMap.length; |
| 363 } | 243 } |
| 364 | 244 |
| 365 /** | 245 /** |
| 246 * Instances of the class `SdkLibrary` represent the information known about a s
ingle library |
| 247 * within the SDK. |
| 248 */ |
| 249 class SdkLibraryImpl implements SdkLibrary { |
| 250 /** |
| 251 * The short name of the library. This is the name used after `dart:` in a URI
. |
| 252 */ |
| 253 String _shortName = null; |
| 254 |
| 255 /** |
| 256 * The path to the file defining the library. The path is relative to the `lib
` directory |
| 257 * within the SDK. |
| 258 */ |
| 259 String path = null; |
| 260 |
| 261 /** |
| 262 * The name of the category containing the library. Unless otherwise specified
in the libraries |
| 263 * file all libraries are assumed to be shared between server and client. |
| 264 */ |
| 265 String category = "Shared"; |
| 266 |
| 267 /** |
| 268 * A flag indicating whether the library is documented. |
| 269 */ |
| 270 bool _documented = true; |
| 271 |
| 272 /** |
| 273 * A flag indicating whether the library is an implementation library. |
| 274 */ |
| 275 bool _implementation = false; |
| 276 |
| 277 /** |
| 278 * An encoding of which platforms this library is intended to work on. |
| 279 */ |
| 280 int _platforms = 0; |
| 281 |
| 282 /** |
| 283 * The bit mask used to access the bit representing the flag indicating whethe
r a library is |
| 284 * intended to work on the dart2js platform. |
| 285 */ |
| 286 static int DART2JS_PLATFORM = 1; |
| 287 |
| 288 /** |
| 289 * The bit mask used to access the bit representing the flag indicating whethe
r a library is |
| 290 * intended to work on the VM platform. |
| 291 */ |
| 292 static int VM_PLATFORM = 2; |
| 293 |
| 294 /** |
| 295 * Initialize a newly created library to represent the library with the given
name. |
| 296 * |
| 297 * @param name the short name of the library |
| 298 */ |
| 299 SdkLibraryImpl(String name) { |
| 300 this._shortName = name; |
| 301 } |
| 302 |
| 303 @override |
| 304 String get shortName => _shortName; |
| 305 |
| 306 @override |
| 307 bool get isDart2JsLibrary => (_platforms & DART2JS_PLATFORM) != 0; |
| 308 |
| 309 @override |
| 310 bool get isDocumented => _documented; |
| 311 |
| 312 @override |
| 313 bool get isImplementation => _implementation; |
| 314 |
| 315 @override |
| 316 bool get isInternal => "Internal" == category; |
| 317 |
| 318 /** |
| 319 * Return `true` if library can be used for both client and server |
| 320 */ |
| 321 @override |
| 322 bool get isShared => category == "Shared"; |
| 323 |
| 324 /** |
| 325 * Return `true` if this library can be run on the VM. |
| 326 * |
| 327 * @return `true` if this library can be run on the VM |
| 328 */ |
| 329 @override |
| 330 bool get isVmLibrary => (_platforms & VM_PLATFORM) != 0; |
| 331 |
| 332 /** |
| 333 * Record that this library can be compiled to JavaScript by dart2js. |
| 334 */ |
| 335 void setDart2JsLibrary() { |
| 336 _platforms |= DART2JS_PLATFORM; |
| 337 } |
| 338 |
| 339 /** |
| 340 * Set whether the library is documented to match the given value. |
| 341 * |
| 342 * @param documented `true` if the library is documented |
| 343 */ |
| 344 void set documented(bool documented) { |
| 345 this._documented = documented; |
| 346 } |
| 347 |
| 348 /** |
| 349 * Set whether the library is an implementation library to match the given val
ue. |
| 350 * |
| 351 * @param implementation `true` if the library is an implementation library |
| 352 */ |
| 353 void set implementation(bool implementation) { |
| 354 this._implementation = implementation; |
| 355 } |
| 356 |
| 357 /** |
| 358 * Record that this library can be run on the VM. |
| 359 */ |
| 360 void setVmLibrary() { |
| 361 _platforms |= VM_PLATFORM; |
| 362 } |
| 363 } |
| 364 |
| 365 /** |
| 366 * Instances of the class `DartSdk` represent a Dart SDK installed in a specifie
d location. | 366 * Instances of the class `DartSdk` represent a Dart SDK installed in a specifie
d location. |
| 367 */ | 367 */ |
| 368 abstract class DartSdk { | 368 abstract class DartSdk { |
| 369 /** | 369 /** |
| 370 * The short name of the dart SDK async library. | 370 * The short name of the dart SDK async library. |
| 371 */ | 371 */ |
| 372 static final String DART_ASYNC = "dart:async"; | 372 static final String DART_ASYNC = "dart:async"; |
| 373 | 373 |
| 374 /** | 374 /** |
| 375 * The short name of the dart SDK core library. | 375 * The short name of the dart SDK core library. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 436 |
| 437 /** | 437 /** |
| 438 * Return the source representing the library with the given `dart:` URI, or `
null` if | 438 * Return the source representing the library with the given `dart:` URI, or `
null` if |
| 439 * the given URI does not denote a library in this SDK. | 439 * the given URI does not denote a library in this SDK. |
| 440 * | 440 * |
| 441 * @param dartUri the URI of the library to be returned | 441 * @param dartUri the URI of the library to be returned |
| 442 * @return the source representing the specified library | 442 * @return the source representing the specified library |
| 443 */ | 443 */ |
| 444 Source mapDartUri(String dartUri); | 444 Source mapDartUri(String dartUri); |
| 445 } | 445 } |
| OLD | NEW |