Skip to content

Artifacts

After using the CLI to build your artifacts you will see for every bnf file in that folder two files will be generated. {name}.js which includes all of the runtime required code specific to this parser, and a {name}.d.ts. If you include the .js file, typescript will automatically read from the d.ts for you to find out the type structure of your syntax tree.

You will also notice a shared.d.ts and a shared.js, this is a small artifact which is shared between all bnf parsers generated to help unify certain types such as ParseError. All of the generated .d.ts and .js must remain in the same folder as each-other, however you can now move them as a group anywhere.

Anything generated by the cli will be referred to as an artifact to differentiate them from any component of the bnf-parser library itself.