34 tokens = tokens->
next;
36 tokens = tokens->
next;
62 word = ft_strdup((*tokens)->value);
65 while ((*tokens)->connected && (*tokens)->next)
67 *tokens = (*tokens)->
next;
68 temp = ft_strjoin(word, (*tokens)->value);
75 *tokens = (*tokens)->
next;
96 args = ft_calloc(count + 1,
sizeof(
char *));
101 ft_free_strarray(args);
122 if (!tokens || !*tokens)
t_ast * create_cmd_node(char **args, int argc)
Create a NODE_COMMAND AST node.
AST node creation and destruction prototypes.
Parser entry point & sub parser prototypes.
int count_word_tokens(t_token *tokens)
Count consecutive word token groups.
t_ast * parse_simple_command(t_token **tokens)
Parse a simple command from consecutive word tokens.
char ** collect_args(t_token **tokens, int *argc)
Collect consecutive word tokens into an arguments array.
static int fill_args_array(char **args, t_token **tokens, int count)
Fill argument array from consecutive word tokens.
Lexer token (singly linked list)
t_token_type type
Token type (word, pipe, redir)
struct s_token * next
Next token.
int connected
1 if connected