A Rust project for the CL0 Engine.
This repository is structured as a Cargo workspace and is designed for extensibility. It currently contains:
- cl0_parser: The core parsing library for the CL0 Engine.
- cl0_node: The core engine and evaluator of CL0. (More to be added in the future.)
- Location:
crates/cl0_parser - Description:
- Provides tokenization, parsing, and AST generation for the CL0 language.
- Exposes a flexible API for embedding the parser in other Rust projects.
- Can be used as a standalone binary for parsing CL0 source code and printing the resulting AST.
- API: See the Rust docs and the
src/directory for details.
- Location:
crates/cl0_node - Description:
- The evaluator of the CL0 Engine.
- Exposes a flexible API for embedding the engine in other Rust projects.
- Can be used as a standalone binary for a REPL that will parse and execute the input.
- API: See the Rust docs and the
src/directory for details.
-
Clone the repository:
git clone <repo-url> cd CL0
-
Build the workspace:
cargo build [ --release ] (If a release build is required)
After building, you can run the parser binary directly or via the symlink:
./cl0_parser "<input>"- Replace
<input>with your CL0 source code (quotes required if it contains spaces). - The program will print the parsed AST to stdout.
Example:
./cl0_parser "#event : condition => #action."To run all the unit tests of the parser, run the following commands from the project root:
cd crates/cl0_parser
cargo testYou should then see the status of every unit test that was created.
None currently. Please open an issue if you think otherwise!
After building, you can run the REPL binary directly or via the symlink:
./cl0_repl- This should run an executable of the REPL that allows the user to input an initial policy and interact with the node system.
To run all the unit tests of the node engine, run the following commands from the project root:
cd crates/cl0_node
cargo testYou should then see the status of every unit test that was created.
- Need more unit testing especially for more complex operations and parallel actions.
- Need to clean up the api and REPL code.
Please open an issue if you have more!