Brainrot is a meme-inspired programming language that translates common programming keywords into internet slang and meme references. It's built using Flex (lexical analyzer) and Bison (parser generator), making it a fun way to learn about language processing and compiler design.
Brainrot is a C-like programming language where traditional keywords are replaced with popular internet slang. For example:
void→skibidiint→rizzfor→flexreturn→bussin
To build and run the Brainrot compiler, you'll need:
- GCC (GNU Compiler Collection)
- Flex (Fast Lexical Analyzer)
- Bison (Parser Generator)
sudo apt-get update
sudo apt-get install gcc flex bisonsudo pacman -S gcc flex bisonbrew install gcc flex bison- Clone this repository:
git clone https://github.com/araujo88/brainrot.git
cd brainrot- Generate the parser and lexer:
bison -d -Wcounterexamples lang.y -o lang.tab.c
flex -o lang.lex.c lang.l- Compile the compiler:
make- Create a Brainrot source file (e.g.,
hello.brainrot):
skibidi main {
yapping("Hello, World!");
bussin 0;
}- Run your Brainrot program:
./brainrot < hello.brainrot| Brainrot | C Equivalent |
|---|---|
| skibidi | void |
| rizz | int |
| cap | bool |
| cooked | auto |
| flex | for |
| bussin | return |
| edging | if |
| amogus | else |
| goon | while |
| bruh | break |
| grind | continue |
| chad | float |
| gigachad | double |
| yap | char |
| grimace | const |
| sigma | case |
| based | default |
| mewing | do |
| gyatt | enum |
| whopper | extern |
| cringe | goto |
| giga | long |
| edgy | register |
| soy | short |
| nut | signed |
| maxxing | sizeof |
| salty | static |
| gang | struct |
| ohio | switch |
| chungus | union |
| nonut | unsigned |
| schizo | volatile |
yapping(string): equivalent toprintfbaka(string): equivalent tofprintf(stderr...)
The language supports basic arithmetic operators:
+Addition-Subtraction*Multiplication/Division=Assignment<Less than>Greater than&&Logical AND||Logical OR
Current limitations include:
- No support for increment/decrement operators (++/--)
- Limited support for complex expressions
- No support for functions other than main
- Basic error reporting
Feel free to contribute to this project by:
- Forking the repository
- Creating a new branch for your feature
- Submitting a pull request
This project is licensed under the GPL License - see the LICENSE file for details.
- This project is created for educational purposes
- Inspired by meme culture and internet slang
- Built using Flex and Bison tools
- Error reporting is minimal
- No support for arrays
- Limited string manipulation capabilities
- No support for complex control structures
Please report any additional issues in the GitHub Issues section.