How coderz90/biharlang works
BiharLang is a Bhojpuri-keyword, dynamically typed interpreter. Users run a .bh file through the CLI or enter code in the REPL; both paths tokenize source, parse it into an AST, and evaluate it into runtime values. The evaluator also uses scoped environments for variables and closures, while the lexer and parser provide tokenization and Pratt parsing. The README documents these capabilities; the graph’s runtime connections are limited to relationships shown in the excerpts or README.
Main entry points: main.go CLI runner · repl.go Interactive REPL · evaluator.go Tree evaluator · parser.go Pratt parser
Components 12
User entry
- CLI runner
cmd/bihari/main.go - Interactive REPL
repl/repl.go - Script source
Language front end
- Lexer
lexer/lexer.go - Tokens and keywords
token/token.go - Pratt parser
parser/parser.go - Syntax tree
ast/ast.go
Interpreter runtime
- Tree evaluator
evaluator/evaluator.go - Scoped environment
evaluator/environment.go
Runtime values
- Runtime objects
object/object.go
Other components
- User
- Console output
Connections 21
- User → CLI runner: runs scripts
README.md - User → Interactive REPL: enters code
README.md - CLI runner → Script source: reads file
cmd/bihari/main.go - CLI runner → Lexer: creates lexer
cmd/bihari/main.go - CLI runner → Pratt parser: creates parser
cmd/bihari/main.go - CLI runner → Scoped environment: creates scope
cmd/bihari/main.go - CLI runner → Tree evaluator: evaluates program
cmd/bihari/main.go - Interactive REPL → Lexer: tokenizes line
repl/repl.go - Interactive REPL → Pratt parser: parses line
repl/repl.go - Interactive REPL → Scoped environment: retains scope
repl/repl.go - Interactive REPL → Tree evaluator: evaluates program
repl/repl.go - Lexer → Tokens and keywords: emits tokens
lexer/lexer.go - Pratt parser → Lexer: consumes tokens
parser/parser.go - Pratt parser → Tokens and keywords: checks token types
parser/parser.go - Pratt parser → Syntax tree: builds AST
README.md - Tree evaluator → Syntax tree: walks AST
evaluator/evaluator.go - Tree evaluator → Scoped environment: reads and writes
evaluator/evaluator.go - Tree evaluator → Runtime objects: creates values
evaluator/evaluator.go - Tree evaluator → Console output: prints values
evaluator/evaluator.go - CLI runner → Console output: reports errors
cmd/bihari/main.go - Interactive REPL → Console output: displays results
repl/repl.go