HTInterpreter constructor

HTInterpreter({
  1. InterpreterConfig? config,
  2. required HTResourceContext<HTSource> sourceContext,
  3. HTLexicon? lexicon,
})

A bytecode interpreter.

Implementation

HTInterpreter(
    {InterpreterConfig? config,
    required this.sourceContext,
    HTLexicon? lexicon})
    : config = config ?? InterpreterConfig(),
      _lexicon = lexicon ?? HTLexiconHetu() {
  globalNamespace =
      HTNamespace(lexicon: _lexicon, id: InternalIdentifier.global);
  currentNamespace = globalNamespace;

  _currentBytecodeModule =
      HTBytecodeModule(id: 'uninitialized', bytes: Uint8List.fromList([]));
  cachedModules[_currentBytecodeModule.id] = _currentBytecodeModule;
}