PIPS
|
Go to the source code of this file.
Macros | |
#define | FORESYS_CONTINUATION_PREFIX "C$&" " " |
Warning! Do not modify this file that is automatically generated! More... | |
#define | MAKE_SWORD(s) strdup(s) |
#define | MAKE_IWORD(i) int2a(i) |
#define | MAKE_FWORD(f) f2a(f) |
#define | CHAIN_SWORD(l, s) gen_nconc(l, CONS(STRING, MAKE_SWORD(s), NIL)) |
#define | CHAIN_IWORD(l, i) gen_nconc(l, CONS(STRING, MAKE_IWORD(i), NIL)) |
#define | CHAIN_FWORD(l, f) gen_nconc(l, CONS(STRING, MAKE_FWORD(f), NIL)) |
#define | MAKE_ONE_WORD_SENTENCE(m, s) |
#define | ADD_SENTENCE_TO_TEXT(t, p) |
#define | MERGE_TEXTS(r, t) |
#define | MAX_LINE_LENGTH 72 |
maximum length of a line when prettyprinting... More... | |
Functions | |
void | print_sentence (FILE *, sentence) |
cproto-generated files More... | |
void | print_text (FILE *, text) |
void | dump_sentence (sentence) |
void | dump_text (text) |
FI: print_text() should be fprint_text() and dump_text(), print_text() More... | |
string | words_join (list, const char *) |
string | words_to_string (list) |
Convert a word list into a string and translate the position of eventual attachment accordingly: More... | |
string | sentence_to_string (sentence) |
SG: moved here from icfdg. More... | |
string | text_to_string_gen (text, bool) |
string | text_to_string (text) |
SG: moved here from ricedg. More... | |
string | text_to_string_nl (text) |
void | print_words (FILE *, list) |
void | dump_words (list) |
void | debug_words (list) |
void | debug_sentence (sentence) |
void | debug_text (text) |
char * | int2a (int) |
util.c More... | |
char * | f2a (float) |
void | add_one_unformated_printf_to_text (text, string,...) |
string | first_word_of_sentence (sentence) |
Return the first word of a sentence: More... | |
string | last_word_of_sentence (sentence) |
Return the last word of a sentence: More... | |
void | add_to_current_line (string, const char *, string, text) |
void | close_current_line (string, text, string) |
void | add_words_to_text (text, list) |
Add the word list wl to the end of the last sentence of text t. More... | |
language | get_prettyprint_language (void) |
language.c More... | |
enum language_utype | get_prettyprint_language_tag (void) |
bool | prettyprint_language_is_fortran_p (void) |
bool | prettyprint_language_is_fortran95_p (void) |
bool | prettyprint_language_is_c_p (void) |
void | set_prettyprint_language_from_property (enum language_utype) |
set the prettyprint language according to the property PRETTYPRINT_LANGUAGE @description If the property PRETTYPRINT_LANGUAGE is set to the special value "native" then the language passed in arg is used, usually it's the module native language. More... | |
void | set_prettyprint_language (language) |
set the prettyprint language from a newgen language object More... | |
void | set_prettyprint_language_tag (enum language_utype) |
set the prettyprint language from a language_utype argument More... | |
string | get_C_label_printf_format (const char *) |
Get the prettyprint format of a C label. More... | |
void | begin_attachment_prettyprint (void) |
The translation functions between unique names and objects: More... | |
void | end_attachment_prettyprint (void) |
Clean the things related with the attachment of properties: More... | |
void | attach_loop_to_sentence_up_to_end_of_text (sentence, text, loop) |
The user interface: More... | |
sentence | attach_head_to_sentence (sentence, entity) |
Attach the PROGRAM/FUNCTION head: More... | |
void | attach_reference_to_word_list (string, string, reference) |
Attach a module usage (CALL or function call): More... | |
void | attach_regular_call_to_word (string, call) |
Attach a reference: More... | |
void | attach_declaration_to_words (list, entity) |
Attach a declaration to all the words of the given list: More... | |
void | attach_declaration_type_to_words (list, string) |
Attach a declaration type to all the words of the given list. More... | |
void | attach_declaration_size_type_to_words (list, string, int) |
Attach a declaration type with its size to all the words of the given list. More... | |
void | attach_statement_information_to_text (text, statement) |
Attach some statement information to text: More... | |
void | attach_decoration_to_text (text) |
Attach a decoration: More... | |
void | attach_cumulated_effects_decoration_to_text (text) |
Attach a cumulated effects decoration: More... | |
void | attach_proper_effects_decoration_to_text (text) |
Attach a proper effects decoration: More... | |
void | attach_preconditions_decoration_to_text (text) |
Attach a preconditions decoration: More... | |
void | attach_total_preconditions_decoration_to_text (text) |
void | attach_transformers_decoration_to_text (text) |
Attach a transformers decoration: More... | |
void | deal_with_attachments_at_this_character (char *, int) |
Try to find some attachments in the given character that are printed out. More... | |
void | deal_with_attachments_in_this_string (string, int) |
Try to find some attachments in the given string. More... | |
void | deal_with_attachments_in_this_string_length (string, int, int) |
Try to find some attachments in the a_length first characters of the given string. More... | |
void | relocate_attachments (char *, char *) |
Many pretty-printers format their own pseudo-comment by their own and move in memory words that have attachments on them. More... | |
char * | strcat_word_and_migrate_attachments (char *, const char *) |
Concatenate source to target and update the source attachments to point to the new location: More... | |
char * | strdup_and_migrate_attachments (char *) |
Duplicate a string and update the attachments to point to the new returned string: More... | |
void | write_an_attachment_file (string) |
Add the attachment in Emacs mode by creating a twin file that is decorated with Emacs properties: More... | |
Variables | |
list | attachments_before_sorting |
attachment_pretty_print.c More... | |
#define ADD_SENTENCE_TO_TEXT | ( | t, | |
p | |||
) |
Definition at line 51 of file text-util.h.
Definition at line 45 of file text-util.h.
#define CHAIN_IWORD | ( | l, | |
i | |||
) | gen_nconc(l, CONS(STRING, MAKE_IWORD(i), NIL)) |
Definition at line 44 of file text-util.h.
#define CHAIN_SWORD | ( | l, | |
s | |||
) | gen_nconc(l, CONS(STRING, MAKE_SWORD(s), NIL)) |
Definition at line 43 of file text-util.h.
#define FORESYS_CONTINUATION_PREFIX "C$&" " " |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/text-util/text-util-local.h instead, to add your own modifications. header file built by cproto text_util-local.h
Definition at line 37 of file text-util.h.
Definition at line 41 of file text-util.h.
#define MAKE_IWORD | ( | i | ) | int2a(i) |
Definition at line 40 of file text-util.h.
#define MAKE_ONE_WORD_SENTENCE | ( | m, | |
s | |||
) |
Definition at line 47 of file text-util.h.
#define MAKE_SWORD | ( | s | ) | strdup(s) |
Definition at line 39 of file text-util.h.
#define MAX_LINE_LENGTH 72 |
maximum length of a line when prettyprinting...
from 0 to 69, i.e. 70 chars, plus "\n\0"
Definition at line 70 of file text-util.h.
#define MERGE_TEXTS | ( | r, | |
t | |||
) |
Definition at line 58 of file text-util.h.
beurk
a_format | _format |
Definition at line 59 of file util.c.
References ADD_SENTENCE_TO_TEXT, buffer, is_sentence_formatted, make_sentence(), pips_assert, ret, and vasprintf().
Referenced by ensure_comment_consistency().
special case: appends a sole "," on end of line...
2 = strlen("\n\0")
cannot append the string. must go next line.
save the end of the line
trunc!
happend new line.
now regenerate the beginning of the line
get back saved part
current line + new line are too large. Try to append the buffer alone, before trying to add the new line alone
Append the new line
this shouldn't happen. it can occur if lappend+lcontinuation is too large.
Cut the comment
G: warning: I removed the const modifier here
buffer | uffer |
append | ppend |
continuation | ontinuation |
txt | xt |
Definition at line 140 of file util.c.
References ADD_SENTENCE_TO_TEXT, add_to_current_line(), append, buffer, comment(), continuation, divide, is_sentence_formatted, last_comma_or_clopar(), LINE_SUFFIX, make_sentence(), MAX_LINE_LENGTH, pips_internal_error, same_string_p, and strdup().
Referenced by add_separation(), add_to_current_line(), add_Value_to_current_line(), close_current_line(), constante_to_textline(), contrainte_to_text_2(), contraintes_text_format(), entity_list_text_format(), signed_operation_to_textline(), system_sorted_text_format(), text_directive(), and unsigned_operation_to_textline().
Add the word list wl to the end of the last sentence of text t.
wl | l |
Definition at line 273 of file util.c.
References CAR, ENDP, gen_last(), gen_nconc(), pips_assert, pips_internal_error, SENTENCE, sentence_formatted_p, sentence_unformatted, text_consistent_p(), text_sentences, and unformatted_words.
Referenced by c_text_related_entities().
void attach_cumulated_effects_decoration_to_text | ( | text | t | ) |
Attach a cumulated effects decoration:
Definition at line 416 of file attachment_pretty_print.c.
References attach_to_text(), is_attachee_cumulated_effects, is_emacs_pretty_print_asked, make_attachee(), and UU.
Attach a declaration type with its size to all the words of the given list.
No need to use strdup():
declaration_type | eclaration_type |
size | ize |
Definition at line 374 of file attachment_pretty_print.c.
References attach_declaration_type_to_words(), concatenate(), free(), int2a(), is_emacs_pretty_print_asked, and NIL.
Referenced by text_entity_declaration().
Attach a declaration to all the words of the given list:
Definition at line 348 of file attachment_pretty_print.c.
References attach_to_words(), is_attachee_declaration, is_emacs_pretty_print_asked, and make_attachee().
Referenced by words_declaration().
Attach a declaration type to all the words of the given list.
No need to use strdup(). May accept an empty list:
declaration_type | eclaration_type |
Definition at line 360 of file attachment_pretty_print.c.
References attach_to_words(), is_attachee_type, is_emacs_pretty_print_asked, make_attachee(), NIL, and strdup().
Referenced by attach_declaration_size_type_to_words(), and text_entity_declaration().
void attach_decoration_to_text | ( | text | t | ) |
Attach a decoration:
Some prettyprinters such as effects generate NULL text... Just ignore.
Definition at line 405 of file attachment_pretty_print.c.
References attach_to_text(), is_attachee_decoration, is_emacs_pretty_print_asked, make_attachee(), NIL, text_sentences, and UU.
Referenced by get_semantic_text(), and init_text_statement().
Attach the PROGRAM/FUNCTION head:
module | odule |
Definition at line 313 of file attachment_pretty_print.c.
References attach_to_sentence(), is_attachee_module_head, is_emacs_pretty_print_asked, make_attachee(), and module.
Referenced by ensure_comment_consistency().
The user interface:
Attach a loop:
Definition at line 302 of file attachment_pretty_print.c.
References attach_to_sentence_up_to_end_of_text(), is_attachee_loop, is_emacs_pretty_print_asked, and make_attachee().
Referenced by text_loop_default().
void attach_preconditions_decoration_to_text | ( | text | t | ) |
Attach a preconditions decoration:
Definition at line 434 of file attachment_pretty_print.c.
References attach_to_text(), is_attachee_preconditions, is_emacs_pretty_print_asked, make_attachee(), and UU.
Referenced by get_semantic_text(), and semantic_to_text().
void attach_proper_effects_decoration_to_text | ( | text | t | ) |
Attach a proper effects decoration:
Definition at line 425 of file attachment_pretty_print.c.
References attach_to_text(), is_attachee_proper_effects, is_emacs_pretty_print_asked, make_attachee(), and UU.
Attach a module usage (CALL or function call):
begin_word | egin_word |
end_word | nd_word |
Definition at line 324 of file attachment_pretty_print.c.
References attach_to_word_list(), is_attachee_reference, is_emacs_pretty_print_asked, and make_attachee().
Referenced by effect_words_reference(), and words_any_reference().
Attach a reference:
word | ord |
Definition at line 337 of file attachment_pretty_print.c.
References attach_to_word_list(), is_attachee_call, is_emacs_pretty_print_asked, and make_attachee().
Referenced by words_genuine_regular_call().
Attach some statement information to text:
Some prettyprinters such as effects generate NULL text... Just ignore.
Definition at line 392 of file attachment_pretty_print.c.
References attach_to_text(), is_attachee_statement_line_number, is_emacs_pretty_print_asked, make_attachee(), NIL, statement_number, and text_sentences.
void attach_total_preconditions_decoration_to_text | ( | text | ) |
void attach_transformers_decoration_to_text | ( | text | t | ) |
Attach a transformers decoration:
Definition at line 451 of file attachment_pretty_print.c.
References attach_to_text(), is_attachee_transformers, is_emacs_pretty_print_asked, make_attachee(), and UU.
Referenced by get_semantic_text(), and semantic_to_text().
void begin_attachment_prettyprint | ( | void | ) |
The translation functions between unique names and objects:
Initialize some things related with the attachment of propertie. To be conservative, if a prettyprinter does not call begin_attachment_prettyprint(), all the attachment stuff is disable. Thus, old prettyprinter can go on without Emacs mode:
Definition at line 145 of file attachment_pretty_print.c.
References get_bool_property(), and is_emacs_pretty_print_asked.
Referenced by print_code_or_source(), print_code_semantics(), and print_parallelized_code_common().
do not append an empty line to text
buffer | uffer |
txt | xt |
continuation | ontinuation |
Definition at line 235 of file util.c.
References ADD_SENTENCE_TO_TEXT, add_to_current_line(), buffer, close_current_line(), comment(), continuation, is_sentence_formatted, LINE_SUFFIX, make_sentence(), MAX_LINE_LENGTH, pips_assert, and strdup().
Referenced by close_current_line(), text_continuation(), text_directive(), text_pointer_value(), text_points_to_relation(), text_region_no_action(), and text_transformer().
void deal_with_attachments_at_this_character | ( | char * | a_character, |
int | position_in_the_output | ||
) |
Try to find some attachments in the given character that are printed out.
If any, note the boundary position.
Look for attachment starts:
Look for attachment ends:
a_character | _character |
position_in_the_output | osition_in_the_output |
Definition at line 498 of file attachment_pretty_print.c.
References deal_with_attachment_boundary(), debug(), debug_off, debug_on, is_emacs_pretty_print_asked, and position_in_the_output.
Referenced by deal_with_attachments_in_this_string(), deal_with_attachments_in_this_string_length(), and print_sentence().
Try to find some attachments in the given string.
If any, note the boundary position.
a_string | _string |
position_in_the_output | osition_in_the_output |
Definition at line 526 of file attachment_pretty_print.c.
References a_string, deal_with_attachments_at_this_character(), and position_in_the_output.
Referenced by print_sentence().
void deal_with_attachments_in_this_string_length | ( | string | a_string, |
int | position_in_the_output, | ||
int | a_length | ||
) |
Try to find some attachments in the a_length first characters of the given string.
If any, note the boundary position.
a_string | _string |
position_in_the_output | osition_in_the_output |
a_length | _length |
Definition at line 540 of file attachment_pretty_print.c.
References a_string, deal_with_attachments_at_this_character(), pips_assert, and position_in_the_output.
Referenced by print_sentence().
void debug_sentence | ( | sentence | s | ) |
Definition at line 501 of file text_print.c.
References debug_formatted(), debug_unformatted(), fprintf(), is_sentence_formatted, is_sentence_unformatted, pips_internal_error, sentence_formatted, sentence_tag, and sentence_unformatted.
Referenced by debug_text().
void debug_text | ( | text | t | ) |
Definition at line 519 of file text_print.c.
References debug_sentence(), fprintf(), gen_map(), and text_sentences.
void debug_words | ( | list | l | ) |
l | of string |
Definition at line 481 of file text_print.c.
References debug_word(), and gen_map().
Referenced by debug_unformatted().
void dump_sentence | ( | sentence | s | ) |
Definition at line 190 of file print.c.
References print_sentence().
void dump_text | ( | text | t | ) |
FI: print_text() should be fprint_text() and dump_text(), print_text()
Definition at line 205 of file print.c.
References print_text().
Referenced by get_semantic_text(), and text_transformer().
void dump_words | ( | list | lw | ) |
lw | w |
Definition at line 251 of file print.c.
References print_words().
Referenced by dump_strings(), print_qualifiers(), and print_type().
void end_attachment_prettyprint | ( | void | ) |
Clean the things related with the attachment of properties:
Strings in attachments should already have been freed by print_sentence and attachement it-self (witout "s") by output_an_attachment():
Should be OK since output_the_attachments_for_emacs() has already unlinked the attachment from ord_to_attachments_begin:
ree_names_of_almost_everything_in_a_module();
Definition at line 159 of file attachment_pretty_print.c.
References is_emacs_pretty_print_asked.
Referenced by print_code_or_source(), print_code_semantics(), and print_parallelized_code_common().
char* f2a | ( | float | f | ) |
Return the first word of a sentence:
The sentence is seen as a big word:
From the first word to the last one. Label should is skipped:
Definition at line 76 of file util.c.
References abort, CAR, pips_assert, sentence_formatted, sentence_formatted_p, sentence_unformatted, sentence_unformatted_p, STRING, string_undefined, and unformatted_words.
Referenced by attach_to_sentence_list(), get_vertex_by_string(), print_graph_of_text_to_daVinci(), and safe_make_successor().
string get_C_label_printf_format | ( | const char * | label | ) |
Get the prettyprint format of a C label.
label | a string to render |
If the label begin with a digit, prefix it with a 'l' to be C compatible.
Hmmm, this does not verify that there is no such label in the program already... :-( Should be solved quite earlier anyway...
label | abel |
Definition at line 155 of file language.c.
Referenced by print_sentence().
language get_prettyprint_language | ( | void | ) |
Definition at line 57 of file language.c.
References language_undefined, make_language_fortran(), and prettyprint_language.
Referenced by add_loop_parallel_threshold(), and merge_on_outer().
enum language_utype get_prettyprint_language_tag | ( | void | ) |
Definition at line 57 of file language.c.
Referenced by effect_words_reference(), ensure_comment_consistency(), generate_alternate_return_targets(), get_comment_continuation(), get_comment_sentinel(), loop_annotate(), loop_private_variables(), loop_test(), mark_block(), pragma_to_string(), prettyprint_language_is_c_p(), prettyprint_language_is_fortran95_p(), prettyprint_language_is_fortran_p(), print_code_or_source(), print_parallelized_code_common(), print_sentence(), sentence_head(), sentence_tail(), store_sc_text_line(), text_block_else(), text_block_elseif(), text_block_if(), text_block_ifthen(), text_directive(), text_instruction(), text_io_block_if(), text_logical_if(), text_loop_default(), text_omp_directive(), text_test(), text_trail(), text_whileloop(), this_entity_cdeclaration(), whileloop_test(), words_any_reference(), words_assign_op(), words_basic(), words_declaration(), words_dimension(), words_dimensions(), words_goto_label(), words_io_inst(), words_loop_list(), words_nullary_op(), words_parameters(), words_range(), words_regular_call(), words_subscript_range(), and words_test_list().
char* int2a | ( | int | i | ) |
util.c
Definition at line 42 of file util.c.
References asprintf, and buffer.
Referenced by adg_get_integer_entity(), adg_rename_entities(), attach_declaration_size_type_to_words(), bound_parameter_name(), c_dim_string(), c_reference(), control_rank(), create_pointer_to_array_stub_points_to(), create_stub_entity(), EnterScope(), find_or_create_coeff(), FindEntityFromLocalNameAndPrefix(), make_coeff(), make_datum_movement(), make_HRE_empty_module(), make_movement_scalar_wp65(), make_movements_loop_body_wp65(), module_initial_parameter_pv(), nth_formal_name(), points_to_name(), points_to_rank(), print_call_path(), print_call_precondition(), print_sesam_tasks_buffers_header(), same_or_equivalence_argument_add_aliases(), st_declaration_init(), st_dimension_bound_as_string(), st_dimension_reference_as_string(), st_loop(), task_complexity(), text_equivalence_class(), this_entity_cdeclaration(), update_number_of_use(), words_numerical_dimension(), xml_Argument(), xml_Array(), xml_array_in_task(), xml_AssignArgument(), xml_Bounds(), xml_Bounds_and_Stride(), xml_Call(), xml_Chain_Graph(), xml_declarations(), xml_dim_string(), xml_loop_from_loop(), xml_loop_from_sequence(), xml_Pattern_Paving(), xml_Scalar(), xml_task(), xml_tasks(), and xml_tiling().
Return the last word of a sentence:
The sentence is seen as a big word:
From the first word to the last one. Label should is skipped:
Definition at line 101 of file util.c.
References abort, CAR, end, gen_last(), pips_assert, sentence_formatted, sentence_formatted_p, sentence_unformatted, sentence_unformatted_p, STRING, string_undefined, and unformatted_words.
Referenced by attach_to_sentence_list().
bool prettyprint_language_is_c_p | ( | void | ) |
Definition at line 91 of file language.c.
References get_prettyprint_language_tag(), and is_language_c.
Referenced by compilation_unit_text(), renamed_op_handling(), sentence_head(), text_block_elseif(), text_block_ifthen(), text_whileloop(), words_infix_binary_op(), words_io_inst(), words_prefix_unary_op(), and words_regular_call().
bool prettyprint_language_is_fortran95_p | ( | void | ) |
Definition at line 83 of file language.c.
References get_prettyprint_language_tag(), and is_language_fortran95.
Referenced by f77_f95_style_management(), text_entity_declaration(), and words_infix_binary_op().
bool prettyprint_language_is_fortran_p | ( | void | ) |
Definition at line 75 of file language.c.
References get_prettyprint_language_tag(), and is_language_fortran.
Referenced by close_pragma(), create_module_with_statement(), ensure_comment_consistency(), get_prettyprint_indentation(), marged(), omp_operator_entity(), omp_operator_str(), pragma_to_string(), print_sentence(), reductions_get_omp_pragma_str(), and text_instruction().
void print_sentence | ( | FILE * | fd, |
sentence | s | ||
) |
cproto-generated files
cproto-generated files
print_sentence:
FI: I had to change this module to handle string longer than the space available on one line; I tried to preserve as much as I could of the previous behavior to avoid pseudo-hyphenation at the wrong place and to avoid extensicve problems with validate; the resulting code is lousy, of course; FI, 15 March 1993
RK: the print_sentence could print lower case letter according to a property... 17/12/1993.
FI/FC: Why on earth?!? (void) putc((islower((int) c) ? (char) toupper((int) c) : c), fd);
if the string fits on the current line: no problem
if the string fits on one line: use the 88 algorithm to break as few syntactic constructs as possible
complete current line
start a new line with its prefix
Special label for Cray directives
if the string has to be broken in at least two lines: new algorithmic part to avoid line overflow (FI, March 1993)
complete the current line
start a new line with its prefix but no indentation since string constants may be broken onto two lines
Special label for Cray directives
col: the next column number, starting from 1. it means tha columns 1 to col-1 have been output. I guess. FC.
first 6 columns (0-5)
05/08/2003 - Nga Nguyen - Add code for C prettyprinter
Keep track of the attachment against the padding:
C prettyprinter: a label cannot begin with a number so "l" is added for this case
FI: do not indent too much (9 June 1995)
Initial tabulation, if needed: do not put useless SPACEs in output file. Well, it's difficult to know if it is useful or not. The test below leads to misplaced opening braces.
& gen_length(lw)>1 && !same_string_p(STRING(CAR(lw)), "\n")
Fortran77 start on 7th column
if the string fits on the current line: no problem
if the string fits on one line: use the 88 algorithm to break as few syntactic constructs as possible
Complete current line with the statement line number, if it is significative:
prepare to cut the line
start a new line with its prefix
Special label for Cray directives
if the string has to be broken in at least two lines: new algorithmic part to avoid line overflow (FI, March 1993)
Complete the current line, but not after :-)
start a new line with its prefix but no indentation since string constants may be broken onto two lines
prepare to cut the line
Special label for Cray directives
statement line number starts at different column depending on the used language : C or fortran
fortran case right the line number on the right where characters are ignored by a f77 parser
C and F95 case, try to align the line number on the right using commentaries. The alignment is done modulo C_STATEMENT_LINE_STEP
Output the statement line number on the right end of the line:
fd | d |
Definition at line 53 of file print.c.
References C_STATEMENT_LINE_COLUMN, C_STATEMENT_LINE_STEP, CAR, CDR, deal_with_attachments_at_this_character(), deal_with_attachments_in_this_string(), deal_with_attachments_in_this_string_length(), ENDP, FOREACH, fprintf(), fprintf_sentence(), free(), get_bool_property(), get_C_label_printf_format(), get_prettyprint_language_tag(), is_language_c, is_language_fortran, is_language_fortran95, line, MAX_END_COLUMN_DEFAULT, MAX_END_COLUMN_F77, MAX_END_COLUMN_F95, MAX_LINE_LENGTH, MAX_START_COLUMN, MIN, pips_assert, pips_debug, pips_internal_error, position_in_the_output, prettyprint_language_is_fortran_p(), putc_sentence(), sentence_formatted, sentence_formatted_p, sentence_unformatted, STRING, string_undefined_p, unformatted_extra_margin, unformatted_label, unformatted_number, and unformatted_words.
Referenced by dump_sentence(), make_emulated_shared_variable(), print_text(), and set_dimensions_of_local_variable_family().
void print_text | ( | FILE * | fd, |
text | t | ||
) |
fd | d |
Definition at line 195 of file print.c.
References FOREACH, MAP, print_sentence(), print_sentence_init(), SENTENCE, and text_sentences.
Referenced by add_new_compilation_unit(), add_new_module_from_text(), callgraph_module_name(), compilation_unit_text(), do_recompile_module(), dprint(), dump_text(), ensure_comment_consistency(), fprint_statement(), fprint_statement_complexity(), generate_hpf_remapping_file(), hpfc_print_code(), hpfc_print_common(), init_host_and_node_entities(), make_movements_loop_body_wp65(), make_text_resource(), outliner_independent(), print_loops(), print_loops_list(), print_pointer_value(), print_points_to_list(), print_points_to_relation(), statement_rwt(), step_compile_analysed_module(), stub_text(), text_area_included(), text_block_else(), text_block_elseif(), text_block_if(), text_block_ifthen(), text_logical_if(), text_test(), text_unstructured(), and wp65_debug_print_module().
void print_words | ( | FILE * | fd, |
list | lw | ||
) |
fd | d |
lw | w |
Definition at line 460 of file text_print.c.
References free(), and words_to_string().
Referenced by dump_words().
void relocate_attachments | ( | char * | source, |
char * | new_position | ||
) |
Many pretty-printers format their own pseudo-comment by their own and move in memory words that have attachments on them.
To be able to track them up to the output, we need to overload the movement function to keep track of these.
source | ource |
new_position | ew_position |
Definition at line 560 of file attachment_pretty_print.c.
References debug_off, debug_on, pips_assert, and pips_debug.
Referenced by strcat_word_and_migrate_attachments(), and strdup_and_migrate_attachments().
SG: moved here from icfdg.
SG: moved here from icfdg.
sen | en |
Definition at line 230 of file print.c.
References sentence_formatted, sentence_formatted_p, sentence_unformatted, unformatted_words, and words_to_string().
Referenced by print_graph_of_text_to_daVinci(), print_marged_text_from_starting_node(), print_module_icfg(), text_to_string(), and text_to_string_gen().
void set_prettyprint_language | ( | language | lang | ) |
set the prettyprint language from a newgen language object
lang,the | language to be used to set the prettyprint_language variable, content is copied so caller may free if it was malloced |
lang | ang |
Definition at line 130 of file language.c.
References language_undefined, make_language_fortran(), and prettyprint_language.
void set_prettyprint_language_from_property | ( | enum language_utype | native | ) |
set the prettyprint language according to the property PRETTYPRINT_LANGUAGE @description If the property PRETTYPRINT_LANGUAGE is set to the special value "native" then the language passed in arg is used, usually it's the module native language.
The user can set "F77", "F95", or "C" to force the prettyprint of a language.
native | ative |
Definition at line 103 of file language.c.
References get_string_property(), is_language_c, is_language_fortran, is_language_fortran95, language_tag, language_undefined, make_language_fortran(), pips_internal_error, and prettyprint_language.
Referenced by controlizer(), ensure_comment_consistency(), new_controlizer(), omp_loop_parallel_threshold_set(), omp_merge_pragma(), print_code_or_source(), and static_controlize().
void set_prettyprint_language_tag | ( | enum language_utype | lang | ) |
set the prettyprint language from a language_utype argument
lang,the | language to be used to set the prettyprint_language variable |
lang | ang |
Definition at line 143 of file language.c.
References language_tag, language_undefined, make_language_fortran(), and prettyprint_language.
Referenced by actual_c_parser(), actual_symbol_table_dump(), add_new_module_from_text(), MakeCaseStatement(), missing_file_initializer(), and this_entity_cdeclaration().
char* strcat_word_and_migrate_attachments | ( | char * | target, |
const char * | source | ||
) |
Concatenate source to target and update the source attachments to point to the new location:
The actual copy:
The actual copy:
target | arget |
source | ource |
Definition at line 601 of file attachment_pretty_print.c.
References is_emacs_pretty_print_asked, and relocate_attachments().
Referenced by words_join().
char* strdup_and_migrate_attachments | ( | char * | a_string | ) |
Duplicate a string and update the attachments to point to the new returned string:
a_string | _string |
Definition at line 624 of file attachment_pretty_print.c.
References a_string, is_emacs_pretty_print_asked, relocate_attachments(), and strdup().
SG: moved here from ricedg.
Definition at line 239 of file print.c.
References concatenate(), free(), MAP, SENTENCE, sentence_to_string(), strdup(), text_sentences, and text_to_string_gen().
Referenced by concerned_entity_p(), control_graph(), debug_print_effects_list(), insert_impact_description_as_comment(), prettyprint_dot_label(), region_to_statement(), step_compute_CHAINS_DG_remove_summary_regions(), step_print_directives_regions(), step_translate_and_map(), and subtsitute_variable_in_reference().
with_newline | ith_newline |
Definition at line 428 of file text_print.c.
References FOREACH, free(), sentence_to_string(), sentence_unformatted_p, string_buffer_append(), string_buffer_free(), string_buffer_make(), string_buffer_to_string(), and text_sentences.
Referenced by text_to_string(), and text_to_string_nl().
Definition at line 455 of file text_print.c.
References text_to_string_gen().
Referenced by ensure_comment_consistency().
1 for null termination.
computes the buffer length.
appends to the buffer...
ls | s |
sep | ep |
Definition at line 385 of file text_print.c.
References buffer, FOREACH, malloc(), MAP, pips_assert, strcat_word_and_migrate_attachments(), and STRING.
Referenced by words_to_string().
Convert a word list into a string and translate the position of eventual attachment accordingly:
ls | s |
Definition at line 412 of file text_print.c.
References words_join().
Referenced by print_words(), and sentence_to_string().
void write_an_attachment_file | ( | string | file_name | ) |
Add the attachment in Emacs mode by creating a twin file that is decorated with Emacs properties:
Now include the original plain file:
Strange semantics: must have read the character first:
Just backslashify the '"' and '\':
Actually add the interesting stuff:
file_name | ile_name |
Definition at line 912 of file attachment_pretty_print.c.
References concatenate(), file_name, free(), init_output_the_attachments_for_emacs(), is_emacs_pretty_print_asked, output_the_attachments_for_emacs(), safe_fclose(), safe_fopen(), and strdup().
Referenced by make_resource_from_starting_node(), and make_text_resource().
|
extern |
Definition at line 65 of file attachment_pretty_print.c.
Referenced by output_the_attachments_in_a_sorted_order(), and put_an_attachment_in_the_list().