How gayathri-samudrala/shellforge90126 works
Shellforge is a Unix-style interactive shell. Its main workflow reads a command line, tokenizes and parses it into a pipeline, expands variables, then executes commands with built-ins, custom commands, or external programs. Execution also supports redirection, pipelines, background jobs, and job tracking; history is a separate shell capability. The graph follows the sampled entry point and executor excerpts plus the source index. Job-control code is included, but its wiring to execution is not established by the available excerpts.
Main entry points: main.c Shell loop · executor.c Pipeline executor · lexer.c Lexer · parser.c Pipeline parser
Components 15
Shell interaction
- Shell loop
src/main.c - History
src/history.c
Command processing
- Lexer
src/lexer.c - Token model
src/token.c - Pipeline parser
src/parser.c - Variable expansion
src/expand.c
Command runtime
- Pipeline executor
src/executor.c - Built-in commands
src/builtin.c - Custom commands
src/custom_commands.c
Shell state
- Job registry
src/jobs.c - Terminal job control
src/job_control.c
Other components
- Shell user
- External programs
- Command files
- OS processes
Connections 16
- Shell user → Shell loop: enters commands
src/main.c - Shell loop → Lexer: tokenizes line
src/main.c - Shell loop → Pipeline parser: parses tokens
src/main.c - Shell loop → Variable expansion: expands variables
src/main.c - Shell loop → Pipeline executor: executes pipeline
src/main.c - Shell loop → History: records and prints
src/main.c - Lexer → Token model: creates tokens
- Pipeline parser → Token model: reads tokens
- Pipeline executor → Built-in commands: dispatches built-ins
src/executor.c - Pipeline executor → Custom commands: dispatches custom
src/executor.c - Pipeline executor → External programs: executes programs
src/executor.c - Pipeline executor → Command files: redirects streams
src/executor.c - Pipeline executor → OS processes: forks and waits
src/executor.c - Pipeline executor → Job registry: registers background jobs
src/executor.c - Shell loop → Job registry: initializes tracking
src/main.c - Shell loop → Terminal job control: job-control wiring unclear