Skip to content

C0mRD/brocode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project logo

BroCode

Status GitHub Issues GitHub Pull Requests


A tiny programming language based on inside jokes

📝 Table of Contents

🧐 About

BroCode is a tiny programming language built using Antlr4 Python3 runtime, it includes all the essential features of any modern day programming language. But what sets broCode apart is its use of regional language(bengali) words as tokens. BroCode is available for you to explore and if you want to build your own programming language, brocode is perfect to take the inspiration.

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Brocode also has an online playground to try your code on the go. Check the official website .

Prerequisites

Python3 is need to be pre-installed to run brocode. Also install requirements via pip.

pip install -r requirements.txt

Installing

Install brocode binary release from here.

To get the source code for development purpose clone this repository via git or download as a zip file from github.

git clone https://github.com/C0mRD/broCode

Windows

Download the brocode binary release for windows first. Run brocode.exe file with the input filename as an argument.

brocode code.bro

Linux

Install all the prerequisites first. Download zip file for linux from the release. Give the brocode file permission to execute.

chmod +x brocode

Run brocode file in terminal with the input filename as an argument.

brocode code.bro

To get more brocode example files see the example folder.

🎈 Documentation

General

start bro is the entrypoint for the program and all program must end with stop bro . Anything outside of it will be ignored.

start bro

stop bro

Built-ins

Use bol bro to print anything to console.

start bro
 bol bro 'Hello World';
stop bro

Variables

Variables can be declared or assigned using -> operator.

start bro
 a -> 10;
 b->12;
 a->b;
stop bro

Types

Supports int , float , string types.

start bro
 a->10;
 b->8.5;
 c-> 'hello';
stop bro

Conditionals

BroCode supports if-else-if ladder construct , jodi bro will execute if condition, jodi na bro equivalet to elseif and na hole bro equivalent to else.

start bro
a -> 12;
b -> 10;
jodi bro a<b{
  bol bro 'less';
}
jodi na bro a==b{
  bol bro 'equal';
}
na hole bro{
  bol bro 'greater';
}
stop bro

Loops

Statements inside jotokhon bro blocks are executed as long as a specified condition evaluates to true.

start bro
a -> 12;
b -> 20;
jotokhon bro a<b{
  bol bro a;
  a -> a+1;
}
stop bro

🚀 Todo

  • Variables (int, float, string)

  • Binary operations

  • Conditionals

  • Loops

  • Output to console

  • I/O Operations

  • Functions

  • User-defined data types

  • Import statements

⛏️ Built Using

✍️ Authors

  • @c0mrd - Idea & Initial work