25 #include "pips_config.h"
58 #include "resources.h"
76 read_action_interpretation =
"read",
77 write_action_interpretation =
"write";
81 read_action_interpretation = r;
82 write_action_interpretation = w;
87 read_action_interpretation =
"read";
88 write_action_interpretation =
"write";
94 read_action_interpretation : write_action_interpretation;
108 static bool prettyprint_with_attachments_p =
false;
113 prettyprint_with_attachments_p = attachments_p;
128 prettyprint_stuff, *p_prettyprint_stuff;
152 p_prettyprint_stuff pps =
153 (p_prettyprint_stuff)
malloc(
sizeof(prettyprint_stuff));
156 pps->is_a_summary = is_a_summary;
159 pps->prettyprint = tp;
181 for (l=lp; l;
POP(l))
183 p_prettyprint_stuff pps = (p_prettyprint_stuff)
STRING(
CAR(l));
207 p_prettyprint_stuff pps)
212 pips_assert(
"must not be a summary", !pps->is_a_summary);
235 (*(pps->prettyprint))(l_eff);
240 l_eff_text = (*(pps->get_text))(l_eff);
250 text_summary_any_effect_type(
255 for (l=lp; l;
POP(l))
257 p_prettyprint_stuff pps = (p_prettyprint_stuff)
STRING(
CAR(l));
258 if (pps->is_a_summary) {
259 pips_debug(5,
"considering resource %s\n", pps->name);
271 text_statement_any_effect_type(
278 for (l=lp; l;
POP(l))
280 p_prettyprint_stuff pps = (p_prettyprint_stuff)
STRING(
CAR(l));
281 if (!pps->is_a_summary) {
282 pips_debug(5,
"considering resource %s\n", pps->name);
291 get_any_effects_text(
293 bool give_code_p,
bool use_values)
417 (
"PRETTYPRINT_UNSTRUCTURED_AS_A_GRAPH") ?
425 DBR_GRAPH_PRINTED_FILE :
428 if (prettyprint_with_attachments_p)
435 get_any_effects_text(
module_name,
true, use_values));
437 if (prettyprint_with_attachments_p)
452 string summary_resource_name)
476 string summary_resource_name,
481 txt = get_any_effects_text(
module_name, give_code_p,
false);
492 string summary_resource_name,
518 (*effect_consistent_p_func)(e);
519 (*effect_prettyprint_func)(e);
bool effects_consistent_p(effects p)
effects apply_statement_effects(statement_effects f, statement k)
void begin_attachment_prettyprint(void)
The translation functions between unique names and objects:
void end_attachment_prettyprint(void)
Clean the things related with the attachment of properties:
struct _newgen_struct_statement_ * statement
static bool is_user_view_p
struct _newgen_struct_resource_ * resource
void(* generic_prettyprint_function)(list)
text(* generic_text_function)(list)
prettyprint function types:
void(* generic_attachment_function)(text)
void set_is_user_view_p(bool)
string action_interpretation(int tag)
void reset_action_interpretation(void)
void add_a_generic_prettyprint(string, bool, generic_text_function, generic_prettyprint_function, generic_attachment_function)
void(* attach_effects_decoration_to_text_func)(text)
bool print_source_or_code_effects_engine(const char *, string, bool)
text get_any_effect_type_text(const char *, string, string, bool)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
text(* effects_to_text_func)(list)
void set_cumulated_rw_effects(statement_effects)
void set_action_interpretation(string, string)
prettyprint.c
void reset_generic_prettyprints(void)
void set_prettyprint_with_attachments(bool)
void generic_print_effects(list)
void(* effects_prettyprint_func)(list)
void set_a_generic_prettyprint(string, bool, gen_chunk *, generic_text_function, generic_prettyprint_function, generic_attachment_function)
bool print_source_or_code_with_any_effects_engine(const char *, string, string, string, bool)
void reset_cumulated_rw_effects(void)
bool store_effect_p(effect)
#define effects_effects(x)
const char * module_name(const char *s)
Return the module part of an entity name.
char * get_string_property(const char *)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_chunk_undefined
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
void gen_map(gen_iter_func_t fp, const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define list_undefined
Undefined list definition :-)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
statement apply_number_to_statement(hash_table, _int)
hash_table allocate_number_to_statement(void)
hash_table build_number_to_statement(hash_table, statement)
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
void set_prettyprint_language_from_property(enum language_utype native)
set the prettyprint language according to the property PRETTYPRINT_LANGUAGE @description If the prope...
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
#define hash_table_undefined
Value of an undefined hash_table.
#define string_undefined_p(s)
void close_prettyprint()
because some prettyprint functions may be used for debug, so the last hook set by somebody may have s...
void init_prettyprint(text(*hook)(entity, int, statement))
checks that the prettyprint hook was actually reset...
text text_module(entity, statement)
bool make_text_resource_and_free(const char *, const char *, const char *, text)
void print_number_to_statement(hash_table)
bool user_view_p(void)
print_code or print_source
void set_string_property(const char *, const char *)
bool c_module_p(entity m)
Test if a module "m" is written in C.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
#define statement_undefined_p(x)
#define statement_number(x)
#define statement_undefined
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
static bool __attribute__((unused))
The structure used to build lists in NewGen.
#define MERGE_TEXTS(r, t)
A gen_chunk is used to store every object.