apply the "global" options from options
or default values to the entries
from grammarList
if its corresponding options-field is not explicitly specified.
parse directories for JSON grammars and create/return GrammarEntry list
add grammars from options.grammar map {[grammarID: string]: GrammarOption}, if the GrammarOption has a file
field set.
parse RuntimeConfiguration for grammar-related settings and "convert" them to the corresponding GrammarOptions
compile a JSON grammar into an executable JS grammar
the JSON grammar as string
the path of the JSON grammar (for debugging/error information)
the GrammarLoadOptions with property mapping (list of GrammarOptions)
the callback when grammar compilation has been completed: callback(error | null, compiledGrammar, map, meta)
HELPER create info-object that helps deciding when to shut-down an async grammar compiler (i.e. stop its thread)
the grammar options with property mapping (list of GrammarOptions)
Generated using TypeDoc
add grammars to (webpack) app build configuration
list of GrammarEntry objects: grammar.id {String}: the grammar id (usually the language code, e.g. "en" or "de") grammar.file {String}: the path to the JSON grammar (from which the executable grammar will be created) grammar.ignore {Boolean}: OPTIONAL if
true
, the grammar will not be loaded (and registered) when the the app is initialized, i.e. needs to be "manually" loaded/initialized by app implementation and/or other mechanisms. If omitted orfalse
, the grammar will be loaded on start-up of the app, and then will be available e.g. viammir.semantic.interpret(,)
.the app configuration to which the grammars will be added
the directories.json representation
the resources configuration
the configuration.json representation