Important
Before starting, make sure to have the following tools installed in your computer:
- GCC (GNU Compiler Collection)
You can run the following command to check if gcc is already installed:
gcc --version
To start, run the following command:
In Windows:
./run [cz-file] [output-txt-file]
In Linux:
./run.sh [cz-file] [output-txt-file]
Write a czar code in a .cz
file, for example:
fixed name: str
name = "Czar"
Run the program:
./run test.cz output.txt
The output file for the symbol table should look like this:
T_FIXED fixed
T_IDENT name
T_COLON :
T_DT_STR str
T_IDENT name
T_EQL =
T_STR "Czar"
T_EOF EOF
The Abstract Syntax Tree should look like this:
P_program:
P_assign_stmt:
Identifier Name: name
Value:
P_decl_stmt:
Mutability Type: fixed
Identifier Name: name
Data type: str