6 #ifndef text_util_header_included
7 #define text_util_header_included
37 #define FORESYS_CONTINUATION_PREFIX "C$&" " "
39 #define MAKE_SWORD(s) strdup(s)
40 #define MAKE_IWORD(i) int2a(i)
41 #define MAKE_FWORD(f) f2a(f)
43 #define CHAIN_SWORD(l,s) gen_nconc(l, CONS(STRING, MAKE_SWORD(s), NIL))
44 #define CHAIN_IWORD(l,i) gen_nconc(l, CONS(STRING, MAKE_IWORD(i), NIL))
45 #define CHAIN_FWORD(l,f) gen_nconc(l, CONS(STRING, MAKE_FWORD(f), NIL))
47 #define MAKE_ONE_WORD_SENTENCE(m, s) \
48 make_sentence(is_sentence_unformatted, \
49 make_unformatted((char *) NULL, 0, m, CHAIN_SWORD(NIL, s)))
51 #define ADD_SENTENCE_TO_TEXT(t,p) \
54 text_sentences(_t_) = \
55 gen_nconc(text_sentences(_t_), CONS(SENTENCE, (p), NIL)); \
58 #define MERGE_TEXTS(r,t) \
60 text _r_ = (r); text _t_ = (t); \
61 text_sentences(_r_) = \
62 gen_nconc(text_sentences(_r_), text_sentences(_t_)); \
63 text_sentences(_t_) = NIL; \
70 #define MAX_LINE_LENGTH 72
89 extern char *
int2a(
int );
90 extern char *
f2a(
float );
The structure used to build lists in NewGen.
sentence attach_head_to_sentence(sentence, entity)
Attach the PROGRAM/FUNCTION head:
void relocate_attachments(char *, char *)
Many pretty-printers format their own pseudo-comment by their own and move in memory words that have ...
char * strdup_and_migrate_attachments(char *)
Duplicate a string and update the attachments to point to the new returned string:
bool prettyprint_language_is_fortran_p(void)
void close_current_line(string, text, string)
void attach_proper_effects_decoration_to_text(text)
Attach a proper effects decoration:
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.
void set_prettyprint_language_from_property(enum language_utype)
set the prettyprint language according to the property PRETTYPRINT_LANGUAGE @description If the prope...
language get_prettyprint_language(void)
language.c
void debug_sentence(sentence)
string get_C_label_printf_format(const char *)
Get the prettyprint format of a C label.
void add_one_unformated_printf_to_text(text, string,...)
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.
string words_to_string(list)
Convert a word list into a string and translate the position of eventual attachment accordingly:
void dump_text(text)
FI: print_text() should be fprint_text() and dump_text(), print_text()
void attach_declaration_type_to_words(list, string)
Attach a declaration type to all the words of the given list.
string words_join(list, const char *)
void deal_with_attachments_in_this_string(string, int)
Try to find some attachments in the given string.
void write_an_attachment_file(string)
Add the attachment in Emacs mode by creating a twin file that is decorated with Emacs properties:
void attach_statement_information_to_text(text, statement)
Attach some statement information to text:
void begin_attachment_prettyprint(void)
The translation functions between unique names and objects:
bool prettyprint_language_is_fortran95_p(void)
void dump_sentence(sentence)
void add_to_current_line(string, const char *, string, text)
void end_attachment_prettyprint(void)
Clean the things related with the attachment of properties:
char * strcat_word_and_migrate_attachments(char *, const char *)
Concatenate source to target and update the source attachments to point to the new location:
string text_to_string(text)
SG: moved here from ricedg.
string first_word_of_sentence(sentence)
Return the first word of a sentence:
void deal_with_attachments_at_this_character(char *, int)
Try to find some attachments in the given character that are printed out.
void attach_reference_to_word_list(string, string, reference)
Attach a module usage (CALL or function call):
void attach_total_preconditions_decoration_to_text(text)
string text_to_string_gen(text, bool)
string sentence_to_string(sentence)
SG: moved here from icfdg.
void attach_loop_to_sentence_up_to_end_of_text(sentence, text, loop)
The user interface:
void print_text(FILE *, text)
void set_prettyprint_language(language)
set the prettyprint language from a newgen language object
void add_words_to_text(text, list)
Add the word list wl to the end of the last sentence of text t.
void attach_regular_call_to_word(string, call)
Attach a reference:
void print_words(FILE *, list)
void set_prettyprint_language_tag(enum language_utype)
set the prettyprint language from a language_utype argument
list attachments_before_sorting
attachment_pretty_print.c
string last_word_of_sentence(sentence)
Return the last word of a sentence:
void attach_transformers_decoration_to_text(text)
Attach a transformers decoration:
void attach_preconditions_decoration_to_text(text)
Attach a preconditions decoration:
bool prettyprint_language_is_c_p(void)
void print_sentence(FILE *, sentence)
cproto-generated files
enum language_utype get_prettyprint_language_tag(void)
void attach_cumulated_effects_decoration_to_text(text)
Attach a cumulated effects decoration:
void attach_decoration_to_text(text)
Attach a decoration:
void attach_declaration_to_words(list, entity)
Attach a declaration to all the words of the given list:
string text_to_string_nl(text)