UNPKG

tyson

Version:

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.

45 lines (44 loc) 1.61 kB
export interface TysonConfig { /** * A path to the .jison file you want Tyson to use. */ pathToBnfGrammarFile: string; /** * A path to a TypeScript file exporting the type dictionary interface you want Tyson to use. */ pathToTypeDictFile: string; /** * A path pointing to where you want Tyson to emit the generated TypeScript file. * * The file does not need to already exist, but the containing directory does * (e.g., if you want to pass ./src/generated/semanticActions.generated.ts, * then the directory ./src/generated/ must exist prior to running tyson). */ pathToOutputFile: string; /** * The name of the type dictionary interface the generated file * should import from your type dictionary file. * * If this field is omitted, it will default to `"TysonTypeDictionary"`. * * @default "TysonTypeDictionary" */ typeDictInterfaceName?: string; /** * If this is set to `true`, `yylstack` will have a location field for * each symbol in the production RHS, regardless of whether that symbol's * location is used by the semantic action or not. * * @default false */ emitUnusedLocations?: boolean; /** * If this is set to `true`, a semantic value parameter will be emitted * for each symbol in a production's RHS, regardless of whether the * semantic action uses it or not. * * @default false */ emitUnusedSemanticValueParams?: boolean; } export declare function generateTypeScriptFile(config: TysonConfig): void;