diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /myfind/ast_evaluation/expression.h | |
Diffstat (limited to 'myfind/ast_evaluation/expression.h')
| -rw-r--r-- | myfind/ast_evaluation/expression.h | 28 |
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 */
|
