Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Behenlang is a toy programming langauge inspired from Bhailang.

NotificationsYou must be signed in to change notification settings

HonestFreak/Behenlang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

image

Behenlang is a toy programming langauge inspired from Bhailang.

Geting Started

Prerequisites

You need llvmlite and sly modules to run the project.

  • llvmlite

    pip install llvmlite
  • sly

    pip install sly

Usage

Compiling the code

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.

Documentation:

General

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.

Print

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}

Defining Variables

kaam intmain() {    behen x=5    behen y=9.0        behen bhejo 0}

Conditional Statements

kaam intmain() {    behen num1 = 18    behen rem = num1 % 2    behen agar rem == 0{        behen bolo('Even')    }     warna{        behen bolo('Odd')    }    behen bhejo 0}

Iterations

kaam intmain(){    behen i = 0    jabtak i< 10    {        didi bolo('Hello')        didi i = i+1    }   didi bhejo 0    }

Calling Functions

kaam inthello() {    behen bolo("Ye hai hello function\n")    behen bhejo 0}kaam intmain(){hello()    behen bolo("Ye hai main fun")    behen bhejo 0}

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Sources:

  1. https://school.geekwall.in/p/Byz8Rg0GX
  2. https://llvmlite.readthedocs.io/en/latest/
  3. https://sly.readthedocs.io/en/latest/sly.html #documentation enough to make lexer and parser. Can use other libs like rply too
  4. https://groups.seas.harvard.edu/courses/cs153/2019fa/llvmlite.html
  5. https://buildmedia.readthedocs.org/media/pdf/llvmlite/latest/llvmlite.pdf
  6. https://github.com/topics/llvmlite #reference from many projectes which used llvmlite

About

Behenlang is a toy programming langauge inspired from Bhailang.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp