* 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.
*/
-int parse_gen(struct lex_file *file) {
+int parse_gen(lex_file *file) {
int token = 0;
while ((token = lex_token(file)) != ERROR_LEX && file->length >= 0) {
switch (token) {
if (token == '\n')
return error(file, ERROR_PARSE, "Invalid use of include preprocessor directive: wanted #include \"file.h\"\n");
- char *copy = util_strdup(file->lastok);
- struct lex_file *next = lex_include(file, copy);
+ char *copy = util_strdup(file->lastok);
+ lex_file *next = lex_include(file, copy);
if (!next) {
error(file, ERROR_INTERNAL, "Include subsystem failure\n");
}
compile_constant_debug();
lex_reset(file);
+ /* free constants */
+ {
+ size_t i = 0;
+ for (; i < compile_constants_elements; i++) {
+ mem_d(compile_constants_data[i].name);
+ mem_d(compile_constants_data[i].string);
+ }
+ mem_d(compile_constants_data);
+ }
return 1;
}