Skip to content

About

A football themed programming language

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rabona ⚽

C Flex Bison License

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.


📋 Table of Contents

  1. Why Rabona?
  2. Technologies Used
  3. Repository Structure
  4. Installation & Build
  5. Architecture Overview
  6. Challenges & Solutions
  7. Future Roadmap

⚽ Why Rabona?

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.


🛠️ Technologies Used

  • C
  • Flex
  • GNU Bison
  • GCC
  • Make

📂 Repository Structure

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


📥 Installation & Build

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

Running a Script

./rabona examples/ultimate_match.rbn

Running with Inline Input (for scripts using scout)

echo "10" | ./rabona examples/interactive.rbn

🏗️ Architecture Overview

+------------------+     Tokens     +-----------------+     AST Nodes     +--------------------+
|  Source (.rbn)   | -------------> |  Flex (Lexer)   | -------------> |   Bison (Parser)   |
+------------------+                +-----------------+               +--------------------+
                                                                                 |
                                                                                 v
+------------------+     Result     +-----------------+                     +--------------------+
| Terminal Output  | <------------- | C Backend (AST) | <------------------ | Memory / Eval Tree |
+------------------+                +-----------------+                     +--------------------+

⚙️ Challenges & Solutions

  • 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.
    

🔮 Future Roadmap

  • 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

About

A football themed programming language

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages