ApolloVM class
The Apollo VM.
- Implemented types
- Available extensions
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
final
-
loadedCodeLanguages
→ List<
String> -
no setter
- moduleLoader ↔ ModuleLoader?
-
An optional custom ModuleLoader for import resolution. When set (before
the resolutionEngine is first used), it replaces the default web-safe
in-memory VMModuleLoader — e.g. a
DartPackageLoaderthat resolvespackage:imports. Leavenullfor the default in-memory behavior.getter/setter pair - nullSafetyChecks → bool
-
Whether loadCodeUnit rejects a code unit whose AST has null-safety
errors, throwing NullSafetyError before the unit is registered.
final
- resolutionEngine → ModuleResolutionEngine
-
The lazily-created module-resolution engine, backed by moduleLoader when
set, otherwise the web-safe in-memory VMModuleLoader.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
allCodeUnits(
String language) → List< CodeUnit> -
All loaded CodeUnits of
languageacross every namespace. -
allCodeUnitsAllLanguages(
) → List< CodeUnit> - All loaded CodeUnits across every language and namespace.
-
createCodeGenerator(
String language, ApolloSourceCodeStorage codeStorage) → ApolloCodeGenerator? -
Creates an
ApolloCodeGeneratorfor thelanguageand acodeStorage. -
createGenerator<
O extends Object> (String language, ApolloCodeUnitStorage< O> codeStorage) → ApolloGenerator<Object, ApolloCodeUnitStorage< ?Object> , Object> -
Creates an ApolloGenerator for the
languageand acodeStorage. -
createRunner(
String language, {bool importCorePackageMath = false}) → ApolloRunner? -
Creates a runner for the
language. -
generateAll(
ApolloGenerator< Object, ApolloCodeUnitStorage< generator) → voidObject> , Object> -
Generate all the loaded code with
codeGeneratorimplementation. -
generateAllCode(
ApolloCodeGenerator codeGenerator) → void -
Generate all the loaded code with
codeGeneratorimplementation. -
generateAllCodeIn(
String language, {ApolloSourceCodeStorage? codeStorage}) → ApolloSourceCodeStorage -
Generates all the VM loaded code in
language, returning aApolloSourceCodeStorage. -
generateAllIn<
O extends Object> (String language, {ApolloCodeUnitStorage< O> ? codeStorage}) → ApolloCodeUnitStorage<O> -
Generates all the VM loaded code in
language, returning aApolloSourceCodeStorage. -
getLanguageNamespaces(
String language) → LanguageNamespaces -
Returns a LanguageNamespaces for
language. -
getNamespace(
String language, String namespace) → CodeNamespace? -
Returns a CodeNamespace for
languageandnamespace. -
getNamespaceWithClass(
String className, {String? language, bool caseInsensitive = false}) → List< CodeNamespace> -
Returns a CodeNamespace with class
classNameforlanguage(optional). -
getNamespaceWithName(
String namespace) → List< CodeNamespace> -
Returns a List of CodeNamespace with name
namespace. -
getNamespaceWithNameAndClass(
String namespace, String className, {bool caseInsensitive = false}) → List< CodeNamespace> -
Returns a List of CodeNamespace with name
namespaceand with classclassName. -
getParser<
T extends Object> (String language) → ApolloCodeParser< T> ? -
Returns a parser for a
language. -
loadAllAST(
Uint8List archive, {ASTBinaryVerifier? verifier, ASTBinaryVerifier? entryVerifier}) → Future< int> -
Available on ApolloVM, provided by the ApolloVMBinaryAST extension
Loads every code unit in an archive, returning how many were loaded. -
loadCodeUnit<
T extends Object> (CodeUnit< T> codeUnit) → Future<bool> -
Loads
codeUnit, parsing theCodeUnit.sourceto the corresponding AST (Abstract Syntax Tree). -
loadCodeUnitAST(
Uint8List image, {ASTBinaryVerifier? verifier, String? id, String? namespace}) → Future< bool> -
Available on ApolloVM, provided by the ApolloVMBinaryAST extension
Decodes a binary AST image and loads it, skipping the parser entirely. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
{String? language}) → List< ImportDiagnostic> -
Resolves the import graph of all loaded modules (optionally restricted to
language) and returns the aggregated ImportDiagnostics. Idempotent and incremental: already-resolved modules are served from cache, and (re)loading a CodeUnit invalidates the affected subgraph. -
resolveCoreType(
String typeName, {String? namespace, String? language, bool caseInsensitive = false}) → ASTType? -
resolveType(
String typeName, {String? namespace, String? language, bool caseInsensitive = false}) → ASTType? -
Resolves an ASTType with
typeName.override -
saveAllAST(
{String? language, ASTBinarySigner? signer}) → Uint8List -
Available on ApolloVM, provided by the ApolloVMBinaryAST extension
Bundles the AST of every loaded code unit into a single archive. -
saveCodeUnitAST(
CodeUnit codeUnit, {ASTBinarySigner? signer}) → Uint8List -
Available on ApolloVM, provided by the ApolloVMBinaryAST extension
Encodes the AST ofcodeUnit, which must already be loaded. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
parseLanguageFromFilePathExtension(
String fileOrExtension) → String -
Returns the language associated with
fileOrExtension.