Welcome to Wolf-C, a lightweight compiler with a syntax inspired by Python and C. Wolf-C is designed to be simple and flexible, currently supporting two data types: int
and bool
.
Comments in Wolf-C use familiar C-style syntax:
// single line comment
/*
multi line comment
*/
- Data types: int, bool
- C-like operations: Arithmetic, assignment, comparison
- Python-like structure: Indentation for block definition
- Generates output: Abstract Syntax Tree (AST), Intermediate Representation (IR), and Assembly
main():
int x = 10
bool is_valid = True
bool has_error = False
main():
int x = 5
int y = x * 2
y += 1
if y > 10:
x = 0
else
x = 1
if x == 0:
y = 42
main():
int a = 3
int b = a + 4
if b > 5:
if a == 3:
b += 10
- Run
make
to create a Docker container. - Use
docker ps
to find the container ID of the running project. - Access the container using the command: bash
docker exec -it <container_id> bash
- modify file.w inside the code directory.
- Run the build command to compile your file:
build
- This will generate and print:
- Abstract Syntax Tree (AST)
- Intermediate Representation (IR)
- Assembly Code