MiniDevil
As beautiful as a shell
Redirection utilities. More...
Include dependency graph for parser_redir_utils.c:Redirection utilities.
Definition in file parser_redir_utils.c.
Functions | |
| static int | is_redir (t_ast *node) |
| Check if an AST node is of redirection type. More... | |
| t_ast * | reverse_redir_chain (t_ast *node) |
| Reverse a redirection chain for left to right execution order. More... | |
| char * | join_connected_delim (t_token **tokens, int *quoted) |
| Join connected tokens in a single string. More... | |
|
static |
Check if an AST node is of redirection type.
| node | Node to check |
Definition at line 22 of file parser_redir_utils.c.
References NODE_REDIR_HEREDOC, NODE_REDIR_IN, and t_ast::type.
Referenced by reverse_redir_chain().
Here is the caller graph for this function:Reverse a redirection chain for left to right execution order.
The parser builds redirections with the outermost being last, so this reverses the chain so that the first parsed redirection is outermost, matching BASH's left to right behavior
| node | Outermost redirection |
Definition at line 39 of file parser_redir_utils.c.
References t_redir_node::cmd, t_ast::data, is_redir(), and t_ast_data::redir.
Referenced by parse_command().
Here is the call graph for this function:
Here is the caller graph for this function:| char* join_connected_delim | ( | t_token ** | tokens, |
| int * | quoted | ||
| ) |
Join connected tokens in a single string.
| tokens | Pointer to current token pointer |
| quoted | Set to 1 if any was quoted |
Definition at line 69 of file parser_redir_utils.c.
References t_token::next, and QUOTE_NONE.
Referenced by parse_one_redirection().
Here is the caller graph for this function: