diff options
| author | Christopher Uhlig | 2024-10-17 15:52:19 +0200 |
|---|---|---|
| committer | Christopher Uhlig | 2024-10-17 15:52:19 +0200 |
| commit | f4663487bec69c37ed6a010a342ce2132f400eb5 (patch) | |
| tree | 1307963b9c24364c5e6d76c0d6914adc926ef9d7 /src | |
| parent | 2b6dfc7368384655da2a843896539f443695b972 (diff) | |
| parent | 873c0ddbec693666dda5d92654fcb07d4b41b4dc (diff) | |
| download | minishell-f4663487bec69c37ed6a010a342ce2132f400eb5.tar.gz minishell-f4663487bec69c37ed6a010a342ce2132f400eb5.zip | |
Merge branch 'interpreter' of https://github.com/dpu-kaiser/minishell into echo-builtint
Diffstat (limited to 'src')
| -rw-r--r-- | src/interpreter.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/interpreter.c b/src/interpreter.c new file mode 100644 index 0000000..2a09e6d --- /dev/null +++ b/src/interpreter.c @@ -0,0 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* interpreter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/08/05 13:15:24 by dkaiser #+# #+# */ +/* Updated: 2024/08/05 13:33:16 by dkaiser ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "minishell.h" + +static int eval_pipe(t_pipe *pipe); +static int eval_cmd(t_cmd *cmd); + +int eval(t_node *node) +{ + if (node->type == PIPE_NODE) + return (eval_pipe(&node->content.pipe)); + else if (node->type == CMD_NODE) + return (eval_cmd(&node->content.cmd)); + else + { + panic(UNREACHABLE); + return (-1); + } +} + +static int eval_pipe(t_pipe *pipe) +{ + return (0); +} + +static int eval_cmd(t_cmd *cmd) +{ + return (0); +} |
