Welcome to the WinZig AST Generator, a tool written in Rust that generates Abstract Syntax Trees (ASTs) for the WinZig programming language. This project provides an easy-to-use interface for analyzing your WinZig code, offering you insights into its structure and aiding in debugging.
This tool leverages Rust's efficient and safe systems programming language capabilities, making the AST generation process reliable and fast.
make
./winzigc --ast winzig_test_programs/winzig_01
- Rust (recommend 1.67.1 or higher)
- Cargo (recommend 1.67.1 or higher)
Make sure you have these installed on your machine before proceeding.
-
Clone this repository to your local machine.
git clone https://github.com/ThilinaTLM/win-zig-parser.git cd win-zig-parser
-
Build the project using Cargo.
cargo build --release
-
Run the executable with sample WinZig source file.
./target/release/win-zig winzig_test_programs/winzig_01
Run the following command to run the test suite.
cargo test
This will test all the source files provided in winzig_test_programs
directory.
It will compare generated AST with expected AST provided as a winzig_xx.tree
file.
-
Generate AST
./target/release/win-zig <path-to-winzig-file>
-
Generate AST with verbose output
./target/release/win-zig <path-to-winzig-file> --verbose
-
Get lexical tokens
./target/release/win-zig <path-to-winzig-file> --tokens