Named after my favorite football skill move, Rabona is a football-themed interpreted programming language that uses the .rbn file extension. Built using Flex, Bison, and C, it parses source code into an Abstract Syntax Tree (AST) before evaluating it through a custom runtime.
- Why Rabona?
- Technologies Used
- Repository Structure
- Installation & Build
- Architecture Overview
- Challenges & Solutions
- Future Roadmap
Rabona is inspired by football tactics. Every programming construct is expressed using football terminology, making programs read like match instructions rather than traditional code. That makes the project memorable.
- C
- Flex
- GNU Bison
- GCC
- Make
rabona-lang/
├── src/
│ ├── rabona.l
│ ├── rabona.y
│ ├── ast.c
│ └── ast.h
├── examples/
│ ├── 01_match_day.rbn
│ ├── 02_stamina_loop.rbn
│ ├── 03_dugout_arrays.rbn
│ └── ultimate_match.rbn
├── README.md
├── Language_Manual.txt
└── Makefile
Clone the repository and compile the source code using make:
git clone [https://github.com/shuyeb00/rabona-lang.git](https://github.com/shuyeb00/rabona-lang.git)
cd rabona-lang
make clean
make
./rabona examples/ultimate_match.rbn
echo "10" | ./rabona examples/interactive.rbn
+------------------+ Tokens +-----------------+ AST Nodes +--------------------+
| Source (.rbn) | -------------> | Flex (Lexer) | -------------> | Bison (Parser) |
+------------------+ +-----------------+ +--------------------+
|
v
+------------------+ Result +-----------------+ +--------------------+
| Terminal Output | <------------- | C Backend (AST) | <------------------ | Memory / Eval Tree |
+------------------+ +-----------------+ +--------------------+
-
Bison Sequential Token Limitation: Standard Bison evaluation executes line-by-line during parsing, which breaks looping structures.
Solution: Constructed a dynamic Abstract Syntax Tree (AST) in memory via ast.c and ast.h, allowing loops like keep_possession to repeatedly re-evaluate nodes without re-parsing source text. -
Symbol Table Immutability: Enforcing global read-only rules for constants (legend).
Solution: Implemented strict flag validations in the symbol table lookup and assignment stages to throw errors upon modification attempts.
-
Local function scopes
-
Multiple parameters for tactic functions
-
Floating-point number support
-
Strings as first-class data types (beyond direct chant usage)
-
for loop syntax equivalent
-
Modules and file inclusion
-
Native File I/O support