/* This is the shared header for the lex and yacc files. It's everything they need put into one header so I don't have weird errors*/ #ifndef SHARED_H_ #define SHARED_H_ #include "list.h" #include #include #include "env.h" #ifndef DEBUG #define DEBUG 3 #endif char *yytext; int yylineno; void *last_id; typedef struct id_type id_type_t; struct id_type { void *type; /* The type of this variable, as per Hw2 */ unsigned int dimension; /* Vector dimension */ unsigned int size; /* Size along the last dimension */ id_type_t *subtype; /* Type of the previous dimensions */ id_type_t *supertype; /*type of the parent dimension*/ int loc; int temp; }; void *makeType(void*); void *makeArray(void*, void*); void printValue(id_type_t*); int *int_var; int *float_var; int *true_var; int *false_var; int *bool_var; int *char_var; unsigned int loc_of_array(id_type_t*, int); int int_val; double float_val; //array stuff unsigned int sizeoftype(id_type_t *); unsigned int sizeofidtype(id_type_t *); unsigned int loc_of_array(id_type_t *t, int size); void run_tests(); #endif