A tool that generates a TypeScript file from your Jison grammar's semantic actions so the TypeScript compiler will check those semantic actions for errors.
TypeScript does not examine .jison
files, so any errors in your semantic action code will not be caught by the compiler.
Tyson generates a TypeScript file containing your semantic action code, so TypeScript can check your semantic actions for errors.
Tyson provides both a CLI and a Node API.
npx tyson -- ./grammar.jison ./src/typedict.ts --out ./src/generated/semanticActions.generated.ts
For more information, please refer to the CLI docs.
npm install --save tyson
import { generateTypeScriptFile } from "tyson";
generateTypeScriptFile({
pathToBnfGrammarFile: /* ... */,
pathToTypeDictFile: /* ... */,
pathToOutputFile: /* ... */,
});
For more information, please refer to the Node API docs.
All documentation is located in the docs directory.
We recommend that you start by reading the General docs. After that, if you want additional information about the CLI or Node API, you can refer to the CLI docs or Node API docs, respectively.
MIT
Copyright (c) 2020 Kyle Lin
Please refer to docs/CONTRIBUTING.md.