How samhithpola2025/ivoryscript-v2 works
IvoryScript is a C++ language front end that currently generates and prints an AST; despite the bytecodevm directory name, the README says it does not execute programs. Users either provide an .ivc file or enter REPL mode. Both paths tokenize source, parse it into a Program AST, and print that AST; the parser also uses scoped symbol tables and shared type helpers. The README documents language syntax and sample programs, but unsampled implementation details are not inferred here.
Main entry points: main.cpp CLI Entry · repl.cpp REPL Loop · parser.cpp Parser and AST · traverser.cpp AST Printer
Components 10
Language Front End
- Tokenizer
ivoryscript/modules/tokenizer/tokenizer.cpp - Parser and AST
ivoryscript/modules/parser/parser.cpp
Parser Support
- Scoped Symbols
ivoryscript/modules/parser/symtab.cpp - Language Helpers
ivoryscript/modules/helpers/helpers.cpp
AST Output
- AST Printer
ivoryscript/modules/bytecodevm/traverser.cpp
Other components
- File User
- REPL User
- Terminal Output
Connections 14
- File User → CLI Entry: provides file
- REPL User → REPL Loop: enters source
- CLI Entry → REPL Loop: starts when no file
- CLI Entry → Tokenizer: tokenizes file
- Tokenizer → Parser and AST: supplies tokens
- CLI Entry → Parser and AST: parses tokens
- CLI Entry → AST Printer: prints AST
- REPL Loop → Tokenizer: tokenizes input
- REPL Loop → Parser and AST: parses tokens
- REPL Loop → AST Printer: prints AST
- Parser and AST → Scoped Symbols: resolves symbols
- Parser and AST → Language Helpers: maps types
- AST Printer → Language Helpers: formats operators
- AST Printer → Terminal Output: writes AST