How lhy-pkueecs/test_repository works
Project type and purpose
• This is a command-line “shell” or small interpreter framework written in Python.
• It parses user input, builds an AST, evaluates it via a core engine and runtime, and dispatches commands to built-in “apps.”
File structure
• Top-level:
• README.md (very brief, just a placeholder)
• src/ – all code lives here
• src/core/:
• api.py – public APIs for external callers
• app.py, app_factory.py – definitions of “apps” (commands) and how to instantiate them
• builtinapp_executor.py – logic to run built-in apps
• engine.py – the evaluator, takes an AST and drives execution
• runtime.py – execution context (variables, I/O state)
• eval_tree.py, eval_node.py – AST representation and node evaluation logic
• error_handling.py – centralized error classes and handlers
• shell_parser/grammar.lark, parser.py – the Lark grammar and parser for user input
• utils.py – shared helper functions
• src/shell.py – the entry-point that ties core pieces together
• src/user/:
• prompt.py – reads user input, handles line editing
• shell.py – a “user-facing” shell wrapper that leverages core
README for additional insights
• Very minimal; it only indicates “this repo is for testing.”
• No architecture notes in README.
Detail level
– Capture every layer and major module.
– Do not over-simplify: show the distinction between AST representation (eval_tree.py) and evaluation logic (engine.py, eval_node.py).
– Show how app modules are discovered and invoked via app_factory/builtinapp_executor.