PIPS
|
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "misc.h"
#include "text-util.h"
Go to the source code of this file.
Macros | |
#define | LINE_SUFFIX "\n" |
Functions | |
char * | int2a (int i) |
util.c More... | |
char * | f2a (float f) |
void | add_one_unformated_printf_to_text (text r, string a_format,...) |
string | first_word_of_sentence (sentence s) |
Return the first word of a sentence: More... | |
string | last_word_of_sentence (sentence s) |
Return the last word of a sentence: More... | |
static int | last_comma_or_clopar (string s) |
returns a possible index where to cut the string. More... | |
void | add_to_current_line (string buffer, const char *append, string continuation, text txt) |
void | close_current_line (string buffer, text txt, string continuation) |
void | add_words_to_text (text t, list wl) |
Add the word list wl to the end of the last sentence of text t. More... | |
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 | current line being processed |
continuation | string to add to this line |
txt | prefix when breaking a line where to append completed lines |
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().
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().
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().
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().
returns a possible index where to cut the string.
0 if none.
Definition at line 130 of file util.c.
Referenced by add_to_current_line().
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().