How bmarques1995/star works
Star is an embeddable C++ scripting language. Its main user workflow accepts source through the REPL or file runner, then the runtime performs lexical analysis, parsing, name resolution, and tree-walk execution; execution evaluates values, environments, functions, and objects, with native functions available for integration. The repository also includes AST printing and a separate register-based VM implementation. Runtime and language components are represented from the source index; some internal call details are not excerpted, so those links are marked unverified.
Main entry points: Interpreter.cc Tree-walk interpreter · Runtime.cc Runtime pipeline · Value.cc Values and operations · Repl.cc REPL and file runner
Components 24
Entry points
- REPL and file runner
src/repl/Repl.cc - CLI entry
src/repl/main.cc - Native print
src/star_cli/source/Print.cc - Console output
src/star_cli/source/Console.cc
Language front end
- Scanner
src/star/source/Scanner.cc - Tokens
src/star/source/Token.cc - Parser and AST
src/star/source/Parser.cc - AST printer
src/star/source/AstPrinter.cc - Resolver
src/star/source/Resolver.cc
Runtime execution
- Runtime pipeline
src/star/source/Runtime.cc - Tree-walk interpreter
src/star/source/Interpreter.cc - Environments
src/star/source/Environment.cc - Values and operations
src/star/source/Value.cc - Value operations
src/star/source/ValueOperations.cc - Functions
src/star/source/Function.cc - Classes and instances
src/star/source/Class.cc - Instance behavior
src/star/source/Instance.cc - Native escape
src/star/source/builtin/Escape.cc - Regex processing
src/star/source/RegexProcessor.cc
Virtual machine
- VM dispatcher
src/star_vm/source/VM.cc - Push instructions
src/star_vm/source/Push.cc - Exit instruction
src/star_vm/source/Exit.cc - Register buffer
src/star_vm/source/RegisterBuffer.cc
Other components
- Script author
Connections 26
- Script author → REPL and file runner: provides source
- CLI entry → REPL and file runner: starts
src/repl/main.cc - REPL and file runner → Runtime pipeline: runs source
src/repl/Repl.cc - Runtime pipeline → Scanner: scans
- Runtime pipeline → Parser and AST: parses
- Runtime pipeline → Resolver: resolves
- Runtime pipeline → Tree-walk interpreter: executes
- Scanner → Tokens: creates tokens
src/star/source/Scanner.cc - Parser and AST → Tokens: consumes tokens
- Parser and AST → AST printer: produces AST
- Resolver → Tree-walk interpreter: resolves names for
- Tree-walk interpreter → Environments: uses scopes
- Tree-walk interpreter → Values and operations: evaluates values
src/star/source/Interpreter.cc - Tree-walk interpreter → Functions: calls
src/star/source/Interpreter.cc - Tree-walk interpreter → Instance behavior: accesses properties
src/star/source/Interpreter.cc - Classes and instances → Instance behavior: constructs instances
src/star/source/Class.cc - Values and operations → Classes and instances: represents classes
src/star/source/Value.cc - Values and operations → Instance behavior: represents instances
src/star/source/Value.cc - Values and operations → Functions: represents callables
src/star/source/Value.cc - Values and operations → Value operations: delegates operations
- Tree-walk interpreter → Native escape: registers escape
src/star/source/Interpreter.cc - REPL and file runner → Native print: registers native
src/repl/Repl.cc - Native print → Console output: writes output
src/star_cli/source/Print.cc - VM dispatcher → Push instructions: dispatches
src/star_vm/source/VM.cc - VM dispatcher → Exit instruction: dispatches
src/star_vm/source/VM.cc - VM dispatcher → Register buffer: uses registers