summaryrefslogtreecommitdiff
path: root/redes/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'redes/main.c')
-rw-r--r--redes/main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/redes/main.c b/redes/main.c
new file mode 100644
index 0000000..dc451f9
--- /dev/null
+++ b/redes/main.c
@@ -0,0 +1,23 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <readline/readline.h>
+#include <readline/history.h>
+#include <string.h>
+
+#include "syntax.h"
+#include "stages.h"
+
+
+int main() {
+ char* line;
+ while (1) {
+ line = readline("$ ");
+ if (line[0] == '\0') continue;
+ if (strcmp(line, "exit") == 0) exit(0);
+ add_history(line);
+ Ast ast = lex(line);
+ PipelineTree pltree = process_ast(ast);
+ execute_pipeline_tree(pltree);
+ }
+ free(line);
+}