A tiny programming language based on inside jokes
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.
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 .
Python3 is need to be pre-installed to run brocode. Also install requirements via pip.
pip install -r requirements.txt
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.
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
Use bol bro
to print anything to console.
start bro
bol bro 'Hello World';
stop bro
Variables can be declared or assigned using ->
operator.
start bro
a -> 10;
b->12;
a->b;
stop bro
Supports int
, float
, string
types.
start bro
a->10;
b->8.5;
c-> 'hello';
stop bro
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
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
-
Variables (int, float, string)
-
Binary operations
-
Conditionals
-
Loops
-
Output to console
-
I/O Operations
-
Functions
-
User-defined data types
-
Import statements
- @c0mrd - Idea & Initial work