How adrianmoser1/cmsc124-cardist works
Cardist is currently a small Go expression-language interpreter, not yet a card-game runtime: the README describes its intended game-rule domain, but the implemented workflow is scanning, parsing, and evaluating expressions. The CLI supports token and AST inspection, file evaluation, and a line-oriented REPL; a plain file argument still echoes the file. The graph shows the implemented runtime stages and output layers. Card-game keywords are recognized lexically, but sampled code does not establish game-specific execution. Edges reflect shown calls; the README also notes that plain execution is a placeholder.
Main entry points: main.go CLI and orchestration · parser.go Expression parser · ast_printer.go AST printer · evaluator.go Expression evaluator
Components 10
CLI entry
- CLI and orchestration
main.go - Printed output
Language pipeline
- Scanner
scanner/scanner.go - Expression parser
parser/parser.go - Expression AST
parser/expr.go - AST printer
parser/ast_printer.go
Evaluation and output
- Expression evaluator
evaluator/evaluator.go - Value formatter
evaluator/printer.go
Other components
- CLI user
- REPL input
Connections 11
- CLI user → CLI and orchestration: selects mode
main.go - REPL input → CLI and orchestration: enters prompt
main.go - CLI and orchestration → Scanner: scans source
main.go - CLI and orchestration → Expression parser: parses tokens
main.go - Expression parser → Expression AST: builds expressions
parser/parser.go - CLI and orchestration → AST printer: prints AST
main.go - CLI and orchestration → Expression evaluator: evaluates expressions
main.go - Expression evaluator → Expression AST: visits expressions
evaluator/evaluator.go - CLI and orchestration → Value formatter: formats values
main.go - AST printer → Printed output: writes AST
- Value formatter → Printed output: writes values