} constant;
VECTOR_MAKE(constant, compile_constants);
+void compile_constant_debug() {
+ int iter = 0;
+ for(; iter < compile_constants_elements; iter++) {
+ constant *c = &compile_constants_data[iter];
+ switch(c->type) {
+ case TYPE_FLOAT: printf("constant: %s FLOAT %f\n", c->name, c->value[0]); break;
+ case TYPE_VECTOR: printf("constant: %s VECTOR {%f,%f,%f}\n",c->name, c->value[0], c->value[1], c->value[2]); break;
+ case TYPE_STRING: printf("constant: %s STRING %s\n", c->name, c->string); break;
+ case TYPE_VOID: printf("constant: %s VOID %s\n", c->name, c->string); break;
+ }
+ }
+}
+
/*
* Generates a parse tree out of the lexees generated by the lexer. This
* is where the tree is built. This is where valid check is performed.
error(ERROR_INTERNAL, "Include subsystem failure\n");
exit (-1);
}
+ compile_constants_add((constant) {
+ .name = "#include",
+ .type = TYPE_VOID,
+ .value = {0,0,0},
+ .string = copy
+ });
parse_gen(next);
mem_d (copy);
lex_close(next);
break;
}
}
+ compile_constant_debug();
lex_reset(file);
return 1;
}