PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "text.h"
#include "text-util.h"
#include "top-level.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "workspace-util.h"
#include "effects-util.h"
#include "callgraph.h"
#include "database.h"
#include "pipsdbm.h"
#include "resources.h"
#include "misc.h"
#include "properties.h"
#include "prettyprint.h"
#include "transformer.h"
#include "effects-generic.h"
#include "semantics.h"
#include "pips-libs.h"
Go to the source code of this file.
Macros | |
#define | PREC_FORESYS_PREFIX "C$PREC" |
#define | TRAN_FORESYS_PREFIX "C$TRAN" |
#define | append(s) add_to_current_line(crt_line, s, str_prefix, txt) |
#define | MAX_PRED_COMMENTARY_STRLEN 70 |
to convert strings containing predicates to text of commentaries More... | |
Variables | |
static bool | is_transformer |
static bool | is_total_precondition |
static bool | is_user_view |
static bool | is_transformer_filtered |
static hash_table | nts = hash_table_undefined |
#define append | ( | s | ) | add_to_current_line(crt_line, s, str_prefix, txt) |
Definition at line 433 of file prettyprint.c.
#define MAX_PRED_COMMENTARY_STRLEN 70 |
to convert strings containing predicates to text of commentaries
BA, april 1994
Definition at line 560 of file prettyprint.c.
#define PREC_FORESYS_PREFIX "C$PREC" |
Definition at line 67 of file prettyprint.c.
#define TRAN_FORESYS_PREFIX "C$TRAN" |
Definition at line 68 of file prettyprint.c.
|
static |
Definition at line 435 of file prettyprint.c.
References external_value_name(), term_cst, and vecteur_var.
To set up the hash table to translate value into value names
The summary precondition may be in another module's frame
initial version; to be used again when prettyprint really prettyprints
print_text(fd, text_statement(mod, 0, mod_stat));
summary information first
Definition at line 254 of file prettyprint.c.
References allocate_number_to_statement(), attach_decoration_to_text(), attach_preconditions_decoration_to_text(), attach_total_preconditions_decoration_to_text(), attach_transformers_decoration_to_text(), build_number_to_statement(), close_prettyprint(), db_get_memory_resource(), debug_off, debug_on, dump_text(), free_value_mappings(), get_current_module_entity(), get_current_module_statement(), hash_table_free(), hash_table_undefined, ifdebug, init_prettyprint(), is_total_precondition, is_transformer, is_user_view, make_text(), MERGE_TEXTS, mod_stat, module_name(), module_name_to_entity(), module_to_value_mappings(), NIL, nts, pips_debug, print_number_to_statement(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_proper_rw_effects(), reset_semantic_map(), semantic_to_text(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_proper_rw_effects(), set_semantic_map(), statement_undefined, text_consistent_p(), text_module(), text_transformer(), transformer_undefined, and translate_global_values().
Referenced by get_text_preconditions(), get_text_total_preconditions(), get_text_transformers(), and print_code_semantics().
module_name | odule_name |
Definition at line 193 of file prettyprint.c.
References get_bool_property(), get_semantic_text(), is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, and module_name().
Referenced by print_call_graph_with_preconditions().
module_name | odule_name |
Definition at line 203 of file prettyprint.c.
References get_bool_property(), get_semantic_text(), is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, and module_name().
Referenced by print_call_graph_with_total_preconditions().
module_name | odule_name |
Definition at line 184 of file prettyprint.c.
References get_semantic_text(), is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, and module_name().
Referenced by print_call_graph_with_transformers().
sentence make_pred_commentary_sentence(string str_pred, string comment_prefix) input : a substring formatted to be a commentary output : a sentence, containing the commentary form of this string, beginning with the comment_prefix.
modifies : nothing
str_pred | tr_pred |
comment_prefix | omment_prefix |
Definition at line 678 of file prettyprint.c.
References concatenate(), make_sentence_formatted(), sentence_undefined, and strdup().
Referenced by string_predicate_to_commentary(), and text_comp_region().
module_name | odule_name |
Definition at line 712 of file prettyprint.c.
References get_text_preconditions(), module_name(), and print_decorated_call_graph().
module_name | odule_name |
Definition at line 722 of file prettyprint.c.
References get_text_total_preconditions(), module_name(), and print_decorated_call_graph().
module_name | odule_name |
Definition at line 702 of file prettyprint.c.
References get_text_transformers(), module_name(), and print_decorated_call_graph().
mod_name | od_name |
Definition at line 120 of file prettyprint.c.
References print_code_preconditions(), and set_bool_property().
mod_name | od_name |
Definition at line 144 of file prettyprint.c.
References print_code_total_preconditions(), and set_bool_property().
mod_name | od_name |
Definition at line 99 of file prettyprint.c.
References print_code_transformers(), and set_bool_property().
bool print_code_preconditions | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 110 of file prettyprint.c.
References get_bool_property(), is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, module_name(), and print_code_semantics().
Referenced by print_code_as_a_graph_preconditions().
|
static |
Referenced by print_code_preconditions(), print_code_total_preconditions(), print_code_transformers(), print_source_preconditions(), print_source_total_preconditions(), and print_source_transformers().
|
static |
To exploit the language sensitive prettyprint ability of the display
Definition at line 213 of file prettyprint.c.
References begin_attachment_prettyprint(), c_module_p(), concatenate(), end_attachment_prettyprint(), free(), free_text(), get_bool_property(), get_semantic_text(), is_total_precondition, is_transformer, is_user_view, make_text_resource(), module_name(), module_name_to_entity(), resource_name, SEQUENTIAL_PRECONDITION_SUFFIX, SEQUENTIAL_TOTAL_PRECONDITION_SUFFIX, SEQUENTIAL_TRANSFORMER_SUFFIX, strdup(), text_undefined, USER_PRECONDITION_SUFFIX, USER_TOTAL_PRECONDITION_SUFFIX, and USER_TRANSFORMER_SUFFIX.
bool print_code_total_preconditions | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 131 of file prettyprint.c.
References get_bool_property(), is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, module_name(), and print_code_semantics().
Referenced by print_code_as_a_graph_total_preconditions().
bool print_code_transformers | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 90 of file prettyprint.c.
References is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, module_name(), and print_code_semantics().
Referenced by print_code_as_a_graph_transformers().
bool print_source_preconditions | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 164 of file prettyprint.c.
References get_bool_property(), is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, module_name(), and print_code_semantics().
bool print_source_total_preconditions | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 174 of file prettyprint.c.
References get_bool_property(), is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, module_name(), and print_code_semantics().
bool print_source_transformers | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 155 of file prettyprint.c.
References is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, module_name(), and print_code_semantics().
this function name is VERY misleading - it should be changed, sometime FI
module | odule |
margin | argin |
stmt | tmt |
Definition at line 354 of file prettyprint.c.
References apply_number_to_statement(), attach_preconditions_decoration_to_text(), attach_total_preconditions_decoration_to_text(), attach_transformers_decoration_to_text(), filter_transformer(), HASH_UNDEFINED_VALUE, is_total_precondition, is_transformer, is_transformer_filtered, is_user_view, load_cumulated_rw_effects_list(), load_statement_semantic(), module, nts, pips_assert, statement_number, statement_undefined_p, text_transformer(), and transformer_undefined_p.
Referenced by get_semantic_text().
The strange argument type is required by qsort(), deep down in the calls.
FI: what is it supposed to do? Is it allowed to return with equal==0, which leads to an assert failure later above vect_lexicographic_unsafe_compare_generic ().
The constant term is given the highest weight to push constant terms at the end of the constraints and to make those easy to compare. If not, constant 0 will be handled differently from other constants. However, it would be nice to give constant terms the lowest weight to print simple constraints first...
Either I define two comparison functions, or I cheat somewhere else. Let's cheat?
Definition at line 402 of file prettyprint.c.
References entity_name, pips_user_value_name(), term_cst, vect_equal(), and vecteur_var.
Referenced by text_transformer().
void set_prettyprint_transformer | ( | void | ) |
Definition at line 77 of file prettyprint.c.
References is_total_precondition, is_transformer, and is_transformer_filtered.
text string_predicate_to_commentary(string str_pred, string comment_prefix) input : a string, part of which represents a predicate.
output : a text consisting of several lines of commentaries, containing the string str_pred, and beginning with comment_prefix. modifies : str_pred;
if str_pred is too long, it must be splitted in several lines; the hyphenation must be done only between the constraints of the predicate, when there is a "," or a ")". A space is added at the beginning of extra lines, for indentation.
search the maximal substring which length is less than longueur_max
add it to the text
if the remaining string fits in one line
str_pred | tr_pred |
comment_prefix | omment_prefix |
Definition at line 570 of file prettyprint.c.
References ADD_SENTENCE_TO_TEXT, FORESYS_CONTINUATION_PREFIX, get_bool_property(), make_pred_commentary_sentence(), make_text(), MAX_PRED_COMMENTARY_STRLEN, NIL, and strdup().
Referenced by words_predicate_to_commentary().
text text_for_a_transformer | ( | transformer | tran, |
bool | is_a_transformer | ||
) |
call this one from outside.
tran | ran |
is_a_transformer | s_a_transformer |
Definition at line 540 of file prettyprint.c.
References is_total_precondition, is_transformer, text_transformer(), and text_undefined.
Referenced by call_site_to_module_precondition_text().
text text_transformer | ( | transformer | tran | ) |
text text_transformer(transformer tran) input : a transformer representing a transformer or a precondition output : a text containing commentaries representing the transformer modifies : nothing.
Modification: AP, Nov 10th, 1995. Instead of building a (very long) string, I directly use the transformer to build the prettyprint in text format. This is to avoid the problem occuring when the buffer used in transformer[precondition]_to_string() is too small. I also use a static buffer to build each constraint; we are restricted to constraints of lengths smaller than the line length.
If in EMACS mode, does not add any separator line:
tran | ran |
Definition at line 464 of file prettyprint.c.
References ADD_SENTENCE_TO_TEXT, append, close_current_line(), dump_text(), entity_list_text_format(), entity_minimal_name(), FORESYS_CONTINUATION_PREFIX, get_bool_property(), get_comment_continuation(), get_comment_sentinel(), HASH_UNDEFINED_VALUE, ifdebug, is_sentence_formatted, is_total_precondition, is_transformer, list_undefined, make_sentence(), make_text(), MAX_LINE_LENGTH, NIL, pips_debug, pips_user_value_name(), PREC_FORESYS_PREFIX, predicate_system, sc_copy(), sc_lexicographic_sort(), sc_rm(), sc_syst_debug(), semantics_is_inferior_pvarval(), strdup(), system_text_format(), TRAN_FORESYS_PREFIX, transformer_arguments, transformer_relation, and transformer_undefined.
Referenced by get_semantic_text(), print_initial_precondition(), print_program_precondition(), semantic_to_text(), and text_for_a_transformer().
text words_predicate_to_commentary(list w_pred, string comment_prefix) input : a list of strings, one of them representing a predicate.
output : a text of several lines of commentaries containing this list of strings, and beginning with comment_prefix. modifies : nothing.
str_pred is the string corresponding to the concatenation of the strings in w_pred
w_pred | _pred |
comment_prefix | omment_prefix |
Definition at line 653 of file prettyprint.c.
References string_predicate_to_commentary(), and words_to_string().
Referenced by print_any_reductions(), text_comp_region(), text_points_to(), and text_reductions().
|
static |
Definition at line 73 of file prettyprint.c.
Referenced by get_semantic_text(), get_text_preconditions(), get_text_total_preconditions(), get_text_transformers(), print_code_preconditions(), print_code_semantics(), print_code_total_preconditions(), print_code_transformers(), print_source_preconditions(), print_source_total_preconditions(), print_source_transformers(), semantic_to_text(), set_prettyprint_transformer(), text_for_a_transformer(), and text_transformer().
|
static |
Definition at line 72 of file prettyprint.c.
Referenced by get_semantic_text(), get_text_preconditions(), get_text_total_preconditions(), get_text_transformers(), print_code_preconditions(), print_code_semantics(), print_code_total_preconditions(), print_code_transformers(), print_source_preconditions(), print_source_total_preconditions(), print_source_transformers(), semantic_to_text(), set_prettyprint_transformer(), text_for_a_transformer(), and text_transformer().
|
static |
Definition at line 75 of file prettyprint.c.
Referenced by get_text_preconditions(), get_text_total_preconditions(), get_text_transformers(), print_code_preconditions(), print_code_total_preconditions(), print_code_transformers(), print_source_preconditions(), print_source_total_preconditions(), print_source_transformers(), semantic_to_text(), and set_prettyprint_transformer().
|
static |
Definition at line 74 of file prettyprint.c.
Referenced by get_semantic_text(), get_text_preconditions(), get_text_total_preconditions(), get_text_transformers(), print_code_preconditions(), print_code_semantics(), print_code_total_preconditions(), print_code_transformers(), print_source_preconditions(), print_source_total_preconditions(), print_source_transformers(), and semantic_to_text().
|
static |
Definition at line 84 of file prettyprint.c.
Referenced by get_semantic_text(), and semantic_to_text().