On this page ...

Typing and Validating

Besides the concrete syntax and scoping, typing and validation are important parts of a language definition. Freon provides default implementations and generation tools for each of them.

Each generator takes as input a separate definition file and can be run independently. For instance, you can use one of the following commands:

npm run freon type-it -d src/defs -o src/
npm run freon validate-it -d src/defs -o src/
Incomplete code

Keep in mind that all commands, except all, when used individually (i.e., without combining them with others), may produce code that does not compile correctly. For example, the scoper and validator may depend on the typer and attempt to reference its class, which might not yet be generated. Similarly, the editor may try to include the scoper.

To avoid such issues, it is recommended to start with the all command. Once it has been run, you can use specific commands for individual aspects of your language as needed. This approach ensures that all dependencies are correctly in place while minimizing regeneration time.

© 2018 - 2025 Freon contributors - Freon is open source under the MIT License.