This repository contains the parsing module for the minishell team project at 42 School.
The parsing part is responsible for interpreting user input, handling tokens, and preparing the data for execution in the shell environment.
- Lexical Analysis: Splits user input into tokens.
- Syntax Analysis: Validates token sequences according to shell grammar rules.
- Environment Variables: Expands environment variables (
$VAR
) correctly. - Quoting Handling: Manages both single (
'
) and double ("
) quotes. - Redirections: Parses input/output redirections (
<
,>
,>>
). - Pipelines: Supports parsing of piped commands (
|
).
-
Tokenization:
- Splits the command into meaningful tokens like commands, options, and arguments.
-
Validation:
- Ensures proper syntax (e.g., no unclosed quotes, invalid pipes, or misused redirections).
-
Expansion:
- Handles shell-specific features like environment variable expansion and tilde (
~
) expansion.
- Handles shell-specific features like environment variable expansion and tilde (
-
Preparation:
- Organizes parsed data into a structured format for the executor module.