diff --git a/src/Node.c b/src/Node.c new file mode 100644 index 0000000..82b1acb --- /dev/null +++ b/src/Node.c @@ -0,0 +1,9 @@ +#include "Node.h" +#include + +Node * Node_new(int type) +{ + Node * node = (Node *)malloc(sizeof(Node)); + node->type = type; + return node; +} diff --git a/src/Node.h b/src/Node.h new file mode 100644 index 0000000..788800e --- /dev/null +++ b/src/Node.h @@ -0,0 +1,27 @@ +#ifndef NODE_H +#define NODE_H + +#include "String.h" + +typedef struct +{ + int type; + union + { + struct + { + String * fname; + size_t line; + String * text; + } token; + }; +} Node; + +enum +{ + NODE_TYPE_TOKEN, +}; + +Node * Node_new(int type); + +#endif