Hetu constructor
Hetu({
- HetuConfig? config,
- HTResourceContext<
HTSource> ? sourceContext, - HTLexicon? lexicon,
- String parserName = 'default',
- HTParser? parser,
Create a Hetu environment.
Implementation
Hetu(
{HetuConfig? config,
HTResourceContext<HTSource>? sourceContext,
HTLexicon? lexicon,
String parserName = 'default',
HTParser? parser})
: config = config ?? HetuConfig(),
lexicon = lexicon ?? HTDefaultLexicon(),
sourceContext = sourceContext ?? HTOverlayContext() {
_currentParser = parser ??
HTDefaultParser(
config: this.config,
);
bundler = HTBundler(
sourceContext: this.sourceContext,
);
_parsers[parserName] = _currentParser;
analyzer = HTAnalyzer(
config: this.config,
sourceContext: this.sourceContext,
);
compiler = HTCompiler(
config: this.config,
lexicon: this.lexicon,
);
interpreter = HTInterpreter(
config: this.config,
sourceContext: this.sourceContext,
lexicon: this.lexicon,
);
}