summaryrefslogtreecommitdiff
path: root/myfind/ast_evaluation/expression.h
diff options
context:
space:
mode:
Diffstat (limited to 'myfind/ast_evaluation/expression.h')
-rw-r--r--myfind/ast_evaluation/expression.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/myfind/ast_evaluation/expression.h b/myfind/ast_evaluation/expression.h
new file mode 100644
index 0000000..d81718d
--- /dev/null
+++ b/myfind/ast_evaluation/expression.h
@@ -0,0 +1,28 @@
+#ifndef EXPRESSION_H
+#define EXPRESSION_H
+
+enum my_expr_type
+{
+ EXPR_ADDITION = 0,
+ EXPR_SUBTRACTION,
+ EXPR_MULTIPLICATION,
+ EXPR_DIVISION,
+ EXPR_NEGATION,
+ EXPR_NUMBER
+};
+
+struct my_expr
+{
+ enum my_expr_type type;
+ union
+ {
+ struct
+ {
+ struct my_expr *left;
+ struct my_expr *right;
+ } children;
+ int value;
+ } data;
+};
+
+#endif /* ! EXPRESSION_H */