small C-like programming language targeting the Uxn virtual computer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
486 B

#ifndef UPARSE_H
#define UPARSE_H
#include "ulex.h"
typedef enum {
NODE_ADD,
NODE_SUB
} UASTNodeType;
typedef struct s_UASTNode {
UASTNodeType type;
struct s_UASTNode *left;
struct s_UASTNode *right;
union {
int num;
};
} UASTNode;
typedef struct {
ULexState lstate;
UToken current;
UToken previous;
} UParseState;
/* returns the base AST node, or NULL if a syntax error occurred */
UASTNode *UP_parseSource(const char *src);
#endif