How mliligenes/42-minishell works
This repository implements minishell: an interactive command-line shell that parses a command, prepares and executes its command tree, and maintains shell state. The main workflow is visible in the shell loop and parser excerpts; filenames and declarations indicate additional runtime capabilities including builtins, pipes, redirections, heredocs, and wildcard/variable expansion. The mandatory and bonus trees are parallel implementations, so the graph uses mandatory paths. Execution internals were not sampled; links to them reflect only the dispatches visible in the sampled entry points.
Main entry points: shell_loop.c Interactive loop · parser.c Input parser · execute_cmd_handle.c Command execution · main.c AST dispatch
Components 19
Shell interface
- Program entry
mandatory/main.c - Interactive loop
mandatory/shell_loop.c
Command parsing
- Input parser
mandatory/parsing/parser.c - Lexer and tokenizer
mandatory/tokenizer/tokenizer.c - Token validation
mandatory/tokenizer/token_validation.c - Token processing
mandatory/processing/processing.c - AST construction
mandatory/parsing/ast_construction.c
Expansion and preparation
- Expansion and wildcards
mandatory/post_processing/expension.c - Wildcard matching
mandatory/post_processing/wildcard.c
Command execution
- AST dispatch
mandatory/main.c - Command execution
mandatory/execution/execute_cmd_handle.c - Pipes and logic
mandatory/execution/pipe.c - Redirections
mandatory/execution/redirections.c - Here-documents
mandatory/heredoc/open_here_docs.c - Shell builtins
mandatory/builtins/ft_export.c
Shell state and I/O
- Environment
mandatory/builtins/env_utils.c - Signal handling
mandatory/signals.c
Other components
- Shell user
- Process and filesystem
Connections 18
- Shell user → Interactive loop: enters commands
- Program entry → Interactive loop: starts loop
- Interactive loop → Input parser: parses input
- Input parser → Lexer and tokenizer: creates tokens
- Input parser → Token validation: validates tokens
- Input parser → Token processing: extracts tokens
- Input parser → AST construction: builds tree
- Interactive loop → Here-documents: opens documents
- Interactive loop → AST dispatch: executes tree
- AST dispatch → Command execution: executes command
- AST dispatch → Pipes and logic: handles operators
- Command execution → Shell builtins: runs builtins
- Command execution → Redirections: applies redirects
- Command execution → Process and filesystem: runs processes
- Command execution → Environment: reads environment
- Shell builtins → Environment: updates environment
- Interactive loop → Signal handling: sets handlers
- Pipes and logic → Process and filesystem: connects processes