How robotii/lito works
Main Components
a. Frontend Components:
• Lexer (/compiler/lexer)
• Parser (/compiler/parser)
• AST (Abstract Syntax Tree) (/compiler/ast)
b. Middle-end Components:
• Bytecode Generator (/compiler/bytecode)
• Compiler Core (/compiler)
c. Backend/Runtime Components:
• Virtual Machine (/vm)
• Standard Library (/lib)
• REPL (Read-Eval-Print Loop) (/repl)
Component Relationships and Data Flow
Source Code → Lexer → Parser → AST → Bytecode Generator → VM → Program Output
Detailed Component Breakdown
For each major component, include these elements:
a. Lexer Section:
• Token definitions (/compiler/token)
• Lexical analysis process
b. Parser Section:
• Expression parsing
• Statement parsing
• Error handling
• Precedence rules
• State management
c. Bytecode Generation:
• Instruction set
• Expression generation
• Statement generation
• Local variable management
d. Virtual Machine:
• Object system (various object types in /vm)
• Class system
• Method dispatch
• Runtime environment
• Built-in types (Array, Hash, String, etc.)
• Concurrency features (Thread, Channel, WaitGroup)
Implementation Details
Technical aspects:
• FSM (Finite State Machine) integration (/fsm)
• Test infrastructure (/tests, /specs)
• Example code processing flow
• Standard library loading mechanism