I was starting to creating my own programing language and till now i made the compiler that tokenizes the file input and does syntax check to generate the C code on an output.c file.
it can compile variable creation in a new language with diffrent syntax end has a build in printf function called write(). end one called getInput() which is for basic I/O.
let <var_name>: <var_type> = <value>;
let number: integer = 45;
let name: string = "michael";
let isGood: boolean = true;
write("Hello!!\n");
write(number);
write("How are you!\n");
number = getInput("Enter a number: ");
name = getInput("Enter your name: ");
# This is a comment
let newVar1: integer = getInput("Enter a number: ");
let newVar2: string = getInput("Enter your name: ");
# For now loops are only allowing write()
loop i=1 to 3: write("Hello");
loop x=2 to 10: write(x);
...integer
string
float
booleanUSE the compiler:
- compile the compiler:
make- use the compiler:
./compile filenameI will add more in the future.