diff options
author | FreeArtMan <dos21h@gmail.com> | 2015-12-17 21:38:37 +0000 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2015-12-17 21:38:37 +0000 |
commit | 02496faab558fa758adf3a24006201cf5ab557fb (patch) | |
tree | b6249838b3a9d5044bedcb8f1978a55d0ed4181c | |
parent | a61ad1cef9ef77f9afd67230df5470b6b55525be (diff) | |
download | dm-02496faab558fa758adf3a24006201cf5ab557fb.tar.gz dm-02496faab558fa758adf3a24006201cf5ab557fb.zip |
Fixed structure order in syntax.h to compile on NetBSD
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | darray.c | 4 | ||||
-rw-r--r-- | darray.h | 14 | ||||
-rw-r--r-- | syntax.h | 69 |
4 files changed, 43 insertions, 46 deletions
@@ -1,6 +1,6 @@ PROJECT=dm CC=gcc -CFLAGS=-std=c1x +CFLAGS=-std=c99 SOURCES=$(PROJECT)_parser.c darray.c tokenizer.c syntax.c mtable.c OBJECTS=$(SOURCES:.c=.o) @@ -3,7 +3,7 @@ /*****************************************************************************/ darray* darr_create(ssize_t data_size, ssize_t init_size) { - //PRINT("\n"); + /* PRINT("\n"); */ int i = 0; darray *arr = NULL; @@ -45,7 +45,7 @@ error: free( arr ); arr = NULL; } - //ERROR("\n"); + /* ERROR("\n"); */ return NULL; } @@ -8,16 +8,18 @@ #include <string.h> #include <sys/types.h> -//#include "debug.h" -//#include "mmm.h" +/* +#include "debug.h" +#include "mmm.h" +*/ #define DEFAULT_EXPAND_RATE 10 typedef struct darray { - int end; //element amount. end <= max - int max; //maximal element number - size_t size; //single element size - size_t expand; //expand size + int end; /*element amount. end <= max */ + int max; /*maximal element number */ + size_t size; /*single element size */ + size_t expand; /*expand size */ void **data; } darray; @@ -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; |