A simple programming language similar to C which is parsed and executed using Java.
This project is for educational purposes. It provides basics of how to write a programming language.
Just run the Main.java file.
- Input is not supported.
- Output is supported using
printffunction.
Assignments are implemented by single =;
+addition-subtraction*multiplication/division%modulus
ifelseif(together)else
!negation.!=not equal.==equal.<less than.>greater than.<=less or equal.>=greater or equal.&&and.||or.
for- supported. For-loops can be stopped bybreak.whileis not supported.do-whileis not supported.
- Boolean
boolean - Integer
int - Double
double - String
string - Void
voidfor functions. - Struct
structfor creating custom structures. A new instance of a struct can be created usingnewkeyword. - Null
null. Any variable can be null.
Arrays are not supported.
- Functions arguments can have default value
void func(int p = 0). - Functions arguments with the same type can be chained
int totalChars(string a, b, c). - Recursion is supported.
❗ There are could be functionalities that are not listed above. For the full list of functionalities have a look at the language's grammar file.
The language is close as much as possible to the C language, so just use your imagination 😉