This library can be used to interpret a Jayvee model. For example, the interpreter app uses this library after parsing the command line input.
For interpreting a string, you can simply use the method
interpretString(
modelString, // string
options, // RunOptions
)
If you want to interpret anything else, you need to define a function that instantiates the JayveeModel
, e.g., from a file:
const extractAstNodeFn = async (
services: JayveeServices,
loggerFactory: LoggerFactory,
) =>
await extractAstNodeFromFile<JayveeModel>(
fileName,
services,
loggerFactory.createLogger(),
);
const exitCode = await interpretModel(extractAstNodeFn, options);
Run nx build interpreter-lib
to build the library.
Run nx test interpreter-lib
to execute the unit tests via vitest.