Add Node module
This commit is contained in:
1 parent
866dd42196
commit
89889b778f
2 files changed
+36
No files matched your search
@@ -0,0 +1,9 @@
|
||||
#include "Node.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
Node * Node_new(int type)
|
||||
{
|
||||
Node * node = (Node *)malloc(sizeof(Node));
|
||||
node->type = type;
|
||||
return node;
|
||||
}
|
||||
+27
@@ -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
|
||||
Reference in new issue
Block a user