- Notifications
You must be signed in to change notification settings - Fork1
HonestFreak/Behenlang
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Behenlang is a toy programming langauge inspired from Bhailang.
You need llvmlite and sly modules to run the project.
llvmlite
pip install llvmlite
sly
pip install sly
Extention for behenlang is .behen , to compile .behen files use
python run.py<filename.behen>
This will generate a .ll intermediate code file in the same folder where code is present and output the result too.
kaam
is used to define a function. One must definemain
function in the project. Example :
kaam intmain() {# code goes here behen bhejo 0#similar to return}
behen
ordidi
is used to initialize any statement.
behen bolo()
ordidi bolo()
is used to print the strings :
kaam intmain() { didi bolo("Namste Duniya \n") behen bolo("Hello World")#this is comment behen bhejo 0}
kaam intmain() { behen x=5 behen y=9.0 behen bhejo 0}
kaam intmain() { behen num1 = 18 behen rem = num1 % 2 behen agar rem == 0{ behen bolo('Even') } warna{ behen bolo('Odd') } behen bhejo 0}
kaam intmain(){ behen i = 0 jabtak i< 10 { didi bolo('Hello') didi i = i+1 } didi bhejo 0 }
kaam inthello() { behen bolo("Ye hai hello function\n") behen bhejo 0}kaam intmain(){hello() behen bolo("Ye hai main fun") behen bhejo 0}
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".Dont forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- https://school.geekwall.in/p/Byz8Rg0GX
- https://llvmlite.readthedocs.io/en/latest/
- https://sly.readthedocs.io/en/latest/sly.html #documentation enough to make lexer and parser. Can use other libs like rply too
- https://groups.seas.harvard.edu/courses/cs153/2019fa/llvmlite.html
- https://buildmedia.readthedocs.org/media/pdf/llvmlite/latest/llvmlite.pdf
- https://github.com/topics/llvmlite #reference from many projectes which used llvmlite