feat: redirection rules
This commit is contained in:
parent
18c1da6bdf
commit
32f56beb6b
8 changed files with 218 additions and 25 deletions
35
src/utils/ast/ast_word.h
Normal file
35
src/utils/ast/ast_word.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef AST_WORD_H
|
||||
#define AST_WORD_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "ast_base.h"
|
||||
|
||||
struct ast_word
|
||||
{
|
||||
enum ast_type type;
|
||||
char *word;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if the given AST node is a command.
|
||||
*/
|
||||
bool ast_is_word(struct ast *node);
|
||||
|
||||
/**
|
||||
* Retrieves the command data from the given AST node.
|
||||
* Assumes that the node is of type AST_CMD.
|
||||
*/
|
||||
struct ast_word *ast_get_word(struct ast *node);
|
||||
|
||||
/**
|
||||
* Creates a new AST node representing a command.
|
||||
*/
|
||||
struct ast *ast_create_word(char* word);
|
||||
|
||||
/*
|
||||
* @brief: frees the given ast_command and sets the pointer to NULL.
|
||||
*/
|
||||
void ast_free_word(struct ast_word *ast_node);
|
||||
|
||||
#endif /* ! AST_WORD_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue