- Linux or WSL environment
- Python 3 installed (
python3 --version) - pip for Python 3 (
pip3 --version) - make, gcc, flex, and bison installed
sudo apt update
sudo apt install python3 python3-pip make gcc flex bisonpip3 install matplotlib numpyIn your project directory, run:
make clean
makeThis will compile the WizuAll compiler executable.
You can import data variables directly from JSON or CSV files using the following syntax at the top of your .wzl file:
import "data.json";
import "data.csv";
- After import, all top-level keys (for JSON) or columns (for CSV) become variables in your WizuAll code.
- Example usage:
import "data.json"; plot(x, y); - Important: Place all data files (e.g.,
data.json,data.csv) in the main project directory (the same directory where you run the compiler and whereoutput.pyis generated).
To compile a WizuAll source file (for example, examples/tc6.wzl):
./wizuall_compiler examples/tc6.wzlThis will generate a Python file named output.py in the main directory.
To run the generated Python code:
python3 output.py- All plot images are now saved in a subfolder called
plots/in the main directory. - The images are named
plot_<runid>_<counter>.pngfor each run, where<runid>is a unique timestamp for that run and<counter>is the plot number (e.g.,plot_1717171717_1.png). - This ensures that plots from different runs will not overwrite each other.
- The
plotsdirectory is created automatically if it does not exist. - Tip: You can easily identify which plots belong to which run by their
<runid>value.
- AST Output: When you run the compiler, the AST for your WizuAll program will be displayed in the terminal before code generation.
- Plots:
All plots are saved as PNG files in the
plots/directory. - Print Statements:
Any
printcommands in your WizuAll script will output results directly to the terminal/command line. - Warnings: Any matplotlib warnings (such as those about non-interactive backends) are automatically suppressed in the generated code.
# 1. Build the compiler
make clean
make
# 2. Compile a WizuAll file (prints AST and generates output.py)
./wizuall_compiler < examples/tc6.wzl
# 3. Run the generated Python code
python3 output.py
# 4. Check the plots/ directory for generated plot images
ls plots/- You can replace
examples/tc6.wzlwith any other.wzlfile you wish to compile. - Ensure all dependencies are installed before running the compiler or generated code.
- No shell scripts are required; all steps are manual and transparent.
Enjoy using WizuAll for your data analysis and visualization needs!