- Download the latest interpreter from the release page
- Create a text file with the name
test.bejat
- Add the following line to the file
`panggilin bilang pake "Hello, World" ./bejat test.bejat
Bejat is a strongly typed language with no support for type casting because I don't know how to implement type casting.
- String:
tulisan
- Boolean:
bulen
- Number:
nomor
- Null: It doesn't exist, I am too lazy to implement it.
"Hello" ini tulisan nya foo
^ ^ ^
Data Data Type Variable Name
"World" ini gantinya foo
^ ^
Data Variable Name
- Addition:
ditambah
- Subtraction:
dikurang
- Multiplication:
dikali
- Division:
dibagi
- Modulo:
sisa bagi
- Equal:
sama ama
- Not Equal:
ga sama ama
- Greater Than:
lebih dari
- Greater Than or Equal to:
lebih ato sama ama
- Less Than:
kurang dari
- Less Than or Equal to:
kurang ato sama ama
I honestly forgot to implement this so I am not gonna bother.
panggilin bilang pake "Hello, World"
^ ^ ^
Keyword Func Name Data
There is none... sorry, it's just that when I allow you guys to define your own function I have to deal with variable scope and oh my god what a complex problem to solve, or that I am just too dumb. Which is probably the latter but you can technically make your own function. If you scour my badly written code in this repository you can find how I parse my language and write your own standard library function directly.
kalo a sama ama 20 {
panggilin bilang pake "TRUEEEEE"
}
kalo a sama ama 20 {
panggilin bilang pake "TRUEEEEE"
} kalo ga a lebih dari 9999 {
panggilin bilang pake "elif"
}
kalo a sama ama 20 {
panggilin bilang pake "TRUEEEEE"
} kalo ga a lebih dari 9999 {
panggilin bilang pake "elif"
} yaudah {
panggilin bilang pake "ELSE"
}
Really? why would you want to compile this? No. Why would you want to download this in the first place? are you okay? Maybe you need to talk to a helpline? https://www.helpguide.org/find-help.htm
But it's actually quite simple
- Clone this repository
pip install -r requirements.txt
- Make sure you got antlr4 installed on your system if not then
pip install antlr4-tools
- run ./generate_grammar.sh
- python3 ./main.py ./step_test.bejat
Python 3.12+
And also I reccomend doing everything inside a virtual environment.
Thank you for even reading this far into the README.md but honestly I don't think this project is worth contributing. Thank you again..