MiniDevil
As beautiful as a shell
Syntax validation: validates pipe / redirection positions. More...
#include "parser.h"
Include dependency graph for parser_grammar.c:Syntax validation: validates pipe / redirection positions.
Definition in file parser_grammar.c.
Functions | |
| static int | validate_empty (t_token *tokens) |
| Validate that the token list isn't empty. More... | |
| static int | validate_pipe_position (t_token *tokens) |
| Validate pipe positions (not at start nor end and no consecutive pipe) More... | |
| static int | validate_redir_syntax (t_token *tokens) |
| Validate that every redirection is followed by a word token. More... | |
| int | validate_syntax (t_token *tokens) |
| Run all validation checks on a token list. More... | |
|
static |
Validate that the token list isn't empty.
| tokens | Token list |
Definition at line 21 of file parser_grammar.c.
References ERR_EMPTY_INPUT, and print_syntax_error().
Referenced by validate_syntax().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Validate pipe positions (not at start nor end and no consecutive pipe)
| tokens | Token list |
Definition at line 34 of file parser_grammar.c.
References ERR_PIPE_DOUBLE, ERR_PIPE_END, ERR_PIPE_START, t_token::next, print_syntax_error(), TOKEN_PIPE, and t_token::type.
Referenced by validate_syntax().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Validate that every redirection is followed by a word token.
| tokens | Token list |
Definition at line 63 of file parser_grammar.c.
References ERR_REDIR_NO_FILE, is_redirection(), t_token::next, print_syntax_error(), TOKEN_WORD, and t_token::type.
Referenced by validate_syntax().
Here is the call graph for this function:
Here is the caller graph for this function:| int validate_syntax | ( | t_token * | tokens | ) |
Run all validation checks on a token list.
| tokens | Token list to validate |
Definition at line 88 of file parser_grammar.c.
References validate_empty(), validate_pipe_position(), and validate_redir_syntax().
Referenced by parse().
Here is the call graph for this function:
Here is the caller graph for this function: