summaryrefslogtreecommitdiff
path: root/syntax.h
diff options
context:
space:
mode:
Diffstat (limited to 'syntax.h')
-rw-r--r--syntax.h69
1 files changed, 32 insertions, 37 deletions
diff --git a/syntax.h b/syntax.h
index 9f2d224..1bdf984 100644
--- a/syntax.h
+++ b/syntax.h
@@ -13,13 +13,6 @@
#define ALLOC_MEMSET(T,VAL) {VAL=malloc(sizeof(T));memset(VAL,0,sizeof(T));}
-typedef struct ast_range ast_range;
-typedef struct ast_if ast_if;
-typedef struct ast_value ast_value;
-typedef struct ast_expr ast_expr;
-typedef struct ast_expr_bit ast_expr_bit;
-typedef struct ast_expr_cmp ast_expr_cmp;
-
//welcome to 90's
//[TYPE]_[SET/GET/ADD/INIT]_[VALUE]
//G -get
@@ -30,33 +23,14 @@ typedef struct ast_expr_cmp ast_expr_cmp;
//S - start
//E - end
-//ATRT
-typedef struct ast_root
-{
- int size;
- int total_tokens;
- ast_range **range;
-} ast_root;
-
-//ATRN
-typedef struct ast_range
-{
- int range_type;
- unsigned long start;
- unsigned long end;
- int next_type;
- int size_iff;
- ast_if **iff;
- ast_value *val;
-} ast_range;
-//ATI
-typedef struct ast_if
+//ATV
+typedef struct ast_value
{
- int eval;
- ast_expr *expr;
- ast_value *val;
-} ast_if;
+ int size;
+ char *note;
+
+} ast_value;
//ATEB
typedef struct ast_expr_bit
@@ -80,13 +54,34 @@ typedef struct ast_expr
ast_expr_bit **bit;
} ast_expr;
-//ATV
-typedef struct ast_value
+//ATI
+typedef struct ast_if
+{
+ int eval;
+ ast_expr *expr;
+ ast_value *val;
+} ast_if;
+
+//ATRN
+typedef struct ast_range
+{
+ int range_type;
+ unsigned long start;
+ unsigned long end;
+ int next_type;
+ int size_iff;
+ ast_if **iff;
+ ast_value *val;
+} ast_range;
+
+//ATRT
+typedef struct ast_root
{
int size;
- char *note;
-
-} ast_value;
+ int total_tokens;
+ ast_range **range;
+} ast_root;
+
static int tk_pos = 0;