PIPS
|
#include <stdlib.h>
#include "all.h"
#include "text-util.h"
#include "text.h"
#include "prettyprint.h"
#include "top-level.h"
Go to the source code of this file.
Macros | |
#define | REGION_BUFFER_SIZE 2048 |
print complementary sections More... | |
#define | REGION_FORESYS_PREFIX "C$REG" |
#define | PIPS_NORMAL_PREFIX "C" |
Functions | |
static text | text_statement_array_comp_regions (entity, int, statement) |
static text | text_array_comp_regions (list l_reg) |
}} More... | |
static bool | print_code_with_comp_regions (const char *module_name, string resource_name, string summary_resource_name, string file_suffix) |
bool print_code_with_comp_regions(const char* module_name, list summary_comp_regions) input : the name of the current module, the name of the region and summary region resources and the file suffix the comp_regions are in the global variable local_regions_map. More... | |
static text | get_any_comp_regions_text (const char *module_name, string resource_name, string summary_resource_name, bool give_code_p) |
{{ get any comp_regions text More... | |
text | get_text_comp_regions (const char *module_name) |
}}} More... | |
bool | print_source_comp_regions (char *module_name) const |
bool print_source_regions(const char* module_name) input : the name of the current module modifies : nothing. More... | |
bool | print_code_comp_regions (char *module_name) const |
bool print_code_comp_regions(const char* module_name) input : the name of the current module modifies : nothing. More... | |
static text | text_statement_array_comp_regions (entity __attribute__((unused)) module, int __attribute__((unused)) margin, statement stat) |
}} More... | |
text | text_all_comp_regions (list l_reg) |
}} More... | |
text | text_comp_regions (list l_reg) |
}} More... | |
text | text_comp_region (effect reg) |
}} More... | |
Variables | |
static bool | in_out_comp_regions_p = false |
{{{ function prototype More... | |
static bool | is_user_view_p = false |
static hash_table | nts = hash_table_undefined |
#define PIPS_NORMAL_PREFIX "C" |
Definition at line 57 of file prettyprint.c.
#define REGION_BUFFER_SIZE 2048 |
print complementary sections
{{{ banner package comp_regions : Alexis Platonoff, 5 September 1990,
Beatrice Creusillet, April 1994
This file contains the functions specific to the prettyprinting of comp_regions. }}}
Definition at line 54 of file prettyprint.c.
#define REGION_FORESYS_PREFIX "C$REG" |
Definition at line 56 of file prettyprint.c.
|
static |
{{ get any comp_regions text
load comp_regions corresponding to the current module
change later
To set up the hash table to translate value into value names
prepare the prettyprinting
summary comp_regions first
then code with comp_regions, using text_array_comp_regions
Definition at line 154 of file prettyprint.c.
References allocate_number_to_statement(), build_number_to_statement(), close_prettyprint(), comp_desc_set_to_list(), comp_secs_map_to_listmap(), db_get_memory_resource(), debug_off, debug_on, free_local_comp_regions_map(), get_current_module_entity(), get_current_module_statement(), hash_table_free(), hash_table_undefined, ifdebug, init_prettyprint(), is_user_view_p, local_name_to_top_level_entity(), make_text(), MERGE_TEXTS, module, module_name(), module_to_value_mappings(), NIL, nts, print_number_to_statement(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_proper_rw_effects(), resource_name, set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_local_comp_regions_map(), set_proper_rw_effects(), statement_undefined, text_array_comp_regions(), text_module(), and text_statement_array_comp_regions().
Referenced by get_text_comp_regions(), and print_code_with_comp_regions().
text get_text_comp_regions | ( | const char * | module_name | ) |
}}}
prettyprint.c
module_name | odule_name |
Definition at line 72 of file prettyprint.c.
References get_any_comp_regions_text(), in_out_comp_regions_p, is_user_view_p, and module_name().
bool print_code_comp_regions | ( | char* | module_name | ) | const |
bool print_code_comp_regions(const char* module_name) input : the name of the current module modifies : nothing.
comment : prints the source code with the corresponding regions.
Definition at line 107 of file prettyprint.c.
References in_out_comp_regions_p, is_user_view_p, module_name(), print_code_with_comp_regions(), and SEQUENTIAL_COMPSEC_SUFFIX.
|
static |
bool print_code_with_comp_regions(const char* module_name, list summary_comp_regions) input : the name of the current module, the name of the region and summary region resources and the file suffix the comp_regions are in the global variable local_regions_map.
modifies : nothing. comment : prints the source code with the corresponding comp_regions.
Definition at line 126 of file prettyprint.c.
References concatenate(), file_name, free(), get_any_comp_regions_text(), get_bool_property(), is_user_view_p, make_text_resource(), module_name(), resource_name, and strdup().
Referenced by print_code_comp_regions(), and print_source_comp_regions().
bool print_source_comp_regions | ( | char* | module_name | ) | const |
bool print_source_regions(const char* module_name) input : the name of the current module modifies : nothing.
comment : prints the original source code with the corresponding regions.
Definition at line 89 of file prettyprint.c.
References in_out_comp_regions_p, is_user_view_p, module_name(), print_code_with_comp_regions(), and USER_REGION_SUFFIX.
}}
{{ text all comp_regions text text_all_comp_regions(list l_reg) input : a list of comp_regions output : a text representing this list (with non-array comp_regions)
l_reg | _reg |
Definition at line 329 of file prettyprint.c.
References EFFECT, make_text(), MAP, MERGE_TEXTS, NIL, and text_region().
}}
{{ text array comp_regions static text text_array_comp_regions(list l_reg) input : a list of comp_regions output : a text representing this list of comp_regions. comment : if the number of array comp_regions is not nul, and if PRETTYPRINT_LOOSE is true, then empty lines are added before and after the text of the list of comp_regions.
in case of loose_prettyprint, at least one region to print?
GO: No redundant test anymore, see text_statement_array_comp_regions
Definition at line 284 of file prettyprint.c.
References ADD_SENTENCE_TO_TEXT, get_bool_property(), HASH_UNDEFINED_VALUE, is_sentence_formatted, list_undefined, make_sentence(), make_text(), NIL, and strdup().
Referenced by get_any_comp_regions_text(), and text_statement_array_comp_regions().
}}
{{ text region text text_region(effect reg) input : a region output : a text consisting of several lines of commentaries, representing the region modifies : nothing
reg | eg |
Definition at line 375 of file prettyprint.c.
References ADD_SENTENCE_TO_TEXT, effect_undefined, free_text(), get_bool_property(), make_pred_commentary_sentence(), make_text(), NIL, PIPS_NORMAL_PREFIX, REGION_FORESYS_PREFIX, strdup(), user_log(), words_effect(), and words_predicate_to_commentary().
Referenced by text_comp_regions().
}}
{{ text comp_regions text text_comp_regions(list l_reg) input : a list of comp_regions output : a text representing this list (with non-array comp_regions)
change later
l_reg | _reg |
Definition at line 347 of file prettyprint.c.
References EFFECT, effect_entity(), entity_scalar_p(), make_text(), MAP, MERGE_TEXTS, NIL, and text_comp_region().
|
static |
}}
{{ text statement array comp_regions static text text_statement_array_comp_regions(entity module, int margin, statement stat) output : a text representing the list of array comp_regions associated with the statement stat. comment : if the number of array comp_regions is not nul, then empty lines are added before and after the text of the list of comp_regions.
Necessary because of unreachable statements - In this case, no comp_regions are stored in the statement_mapping, and their values are thus HASH_UNDEFINED_VALUE or list_undefined. BC. 25/07/95.
GO 31/7/95: I replace it by a different test in text_array_comp_regions
Definition at line 245 of file prettyprint.c.
References hash_get(), HASH_UNDEFINED_VALUE, is_user_view_p, load_statement_local_comp_regions(), NIL, nts, statement_number, and text_array_comp_regions().
{{{ function prototype
Definition at line 61 of file prettyprint.c.
Referenced by get_text_comp_regions(), print_code_comp_regions(), and print_source_comp_regions().
Definition at line 62 of file prettyprint.c.
Referenced by get_any_comp_regions_text(), get_text_comp_regions(), print_code_comp_regions(), print_code_with_comp_regions(), print_source_comp_regions(), and text_statement_array_comp_regions().
|
static |
Definition at line 63 of file prettyprint.c.
Referenced by allocate_number_to_statement(), apply_number_to_statement(), build_number_to_statement(), clean_up_control_test(), get_any_comp_regions_text(), print_number_to_statement(), and text_statement_array_comp_regions().