/* * clean-up and exit the software */ int java2cpp_exit( void) { #ifdef YYDEBUG if( IS_FLAGS_SYMBOL(data.flags)) { print_symbol_table(); } #endif de_clips_list(data.symbol_table); #ifdef YYDEBUG print_typedef_table(); #endif de_clips_list(data.typedef_table); /* * Check if memory leak */ if(data.memory) { fprintf(stderr, "Error: memory deallocation error: %d\n",data.memory); } /** check if compiler warnings */ if(data.warnings) fprintf(stderr, "Warning: compiler warnings: %d\n", data.warnings); /** check for errors */ if(data.errors) fprintf(stderr, "Error: compiler errors: %d\n", data.errors); return (data.errors); }
/* * clean-up and exit the software */ int ansi_c_exit( void) { /* * print the typedef table then deallocate it */ #ifdef YYDEBUG print_typedef_table(); #endif de_clips_list( data.typedef_table); /* * print the symbol table */ #ifdef YYDEBUG if( IS_FLAGS_SYMBOL( data.flags)) { print_symbol_table(); } #endif /* * deallocate the symbol table list */ de_clips_list( data.symbol_table); /* * check if memory leak */ if( data.memory) fprintf( stderr, "Error: memory deallocation error: %d\n", data.memory); /* * check if compiler warnings */ if( data.warnings) fprintf( stderr, "Warning: compiler warnings: %d\n", data.warnings); /* * check if compiler errors */ if( data.errors) fprintf( stderr, "Error: compiler errors: %d\n", data.errors); return( data.errors); }
/* * update a value of an identifier in symbol table $$.clips = symbol_init_declarator( $1.clips, $3.clips); */ CLIPS *symbol_init_declarator( CLIPS *declarator, CLIPS *initializer) { CLIPS *lists; /* * can be a list of identifiers */ for( lists = declarator; lists; lists = lists->next) { /* * create a symbol with this value and copy it to identifier list */ create_symbol( 0, initializer->value, lists->buffer, lists->length); lists->value = initializer->value; } /* * free the initializer linked list */ de_clips_list( initializer); return( declarator); }