PIPS
text.h
Go to the documentation of this file.
1 #ifndef _newgen_text_included
2 #define _newgen_text_included
3 #define _gen_text_start 85
4 /*
5  * THIS FILE HAS BEEN AUTOMATICALLY GENERATED BY NEWGEN.
6  *
7  * PLEASE DO NOT MODIFY IT.
8  */
9 
10 #define sentence_domain (_gen_text_start+0)
11 #if !defined(_newgen_sentence_domain_defined_)
12 #define _newgen_sentence_domain_defined_
13 #define SENTENCE_NEWGEN_DOMAIN (sentence_domain)
14 #define sentence_NEWGEN_DOMAIN (sentence_domain)
16 #endif /* _newgen_sentence_domain_defined_ */
17 
18 #define text_domain (_gen_text_start+1)
19 #if !defined(_newgen_text_domain_defined_)
20 #define _newgen_text_domain_defined_
21 #define TEXT_NEWGEN_DOMAIN (text_domain)
22 #define text_NEWGEN_DOMAIN (text_domain)
23 typedef struct _newgen_struct_text_ * text;
24 #endif /* _newgen_text_domain_defined_ */
25 
26 #define unformatted_domain (_gen_text_start+2)
27 #if !defined(_newgen_unformatted_domain_defined_)
28 #define _newgen_unformatted_domain_defined_
29 #define UNFORMATTED_NEWGEN_DOMAIN (unformatted_domain)
30 #define unformatted_NEWGEN_DOMAIN (unformatted_domain)
32 #endif /* _newgen_unformatted_domain_defined_ */
33 
34 /* SENTENCE
35  */
36 #define SENTENCE(x) ((sentence)((x).p))
37 #define sentence_CAST(x) SENTENCE(x)
38 #define SENTENCE_CAST(x) SENTENCE(x)
39 #define SENTENCE_(x) ((x).e)
40 #define SENTENCE_TYPE sentence
41 #define sentence_TYPE sentence
42 #define sentence_undefined ((sentence)gen_chunk_undefined)
43 #define sentence_undefined_p(x) ((x)==sentence_undefined)
44 
46 extern void free_sentence(sentence);
48 extern bool sentence_consistent_p(sentence);
49 extern bool sentence_defined_p(sentence);
50 #define gen_SENTENCE_cons gen_sentence_cons
54 extern void write_sentence(FILE*, sentence);
55 extern sentence read_sentence(FILE*);
59 };
60 extern string sentence_tag_as_string(enum sentence_utype);
61 extern sentence make_sentence(enum sentence_utype, void *);
62 extern sentence make_sentence_formatted(string);
64 
68  union {
69  string _sentence_formatted_; /* formatted:string */
70  unformatted _sentence_unformatted_; /* unformatted:unformatted */
72 };
73 
74 #define sentence_domain_number(x) ((x)->_type_)
75 #define sentence_tag(x) ((x)->_sentence_tag__)
76 #define sentence_formatted_p(x) (sentence_tag(x)==is_sentence_formatted)
77 #define sentence_formatted_(x) sentence_formatted(x) /* old hack compatible */
78 #define sentence_formatted(x) ((x)->_sentence_union_._sentence_formatted_)
79 #define sentence_unformatted_p(x) (sentence_tag(x)==is_sentence_unformatted)
80 #define sentence_unformatted_(x) sentence_unformatted(x) /* old hack compatible */
81 #define sentence_unformatted(x) ((x)->_sentence_union_._sentence_unformatted_)
82 
83 /* TEXT
84  */
85 #define TEXT(x) ((text)((x).p))
86 #define text_CAST(x) TEXT(x)
87 #define TEXT_CAST(x) TEXT(x)
88 #define TEXT_(x) ((x).e)
89 #define TEXT_TYPE text
90 #define text_TYPE text
91 #define text_undefined ((text)gen_chunk_undefined)
92 #define text_undefined_p(x) ((x)==text_undefined)
93 
94 extern text copy_text(text);
95 extern void free_text(text);
96 extern text check_text(text);
97 extern bool text_consistent_p(text);
98 extern bool text_defined_p(text);
99 #define gen_TEXT_cons gen_text_cons
100 extern list gen_text_cons(text, list);
101 extern void text_assign_contents(text, text);
102 extern void text_non_recursive_free(text);
103 extern void write_text(FILE*, text);
104 extern text read_text(FILE*);
105 extern text make_text(list);
106 
110 };
111 
112 #define text_domain_number(x) ((x)->_type_)
113 #define text_sentences(x) ((x)->_text_holder_)
114 
115 /* UNFORMATTED
116  */
117 #define UNFORMATTED(x) ((unformatted)((x).p))
118 #define unformatted_CAST(x) UNFORMATTED(x)
119 #define UNFORMATTED_CAST(x) UNFORMATTED(x)
120 #define UNFORMATTED_(x) ((x).e)
121 #define UNFORMATTED_TYPE unformatted
122 #define unformatted_TYPE unformatted
123 #define unformatted_undefined ((unformatted)gen_chunk_undefined)
124 #define unformatted_undefined_p(x) ((x)==unformatted_undefined)
125 
127 extern void free_unformatted(unformatted);
131 #define gen_UNFORMATTED_cons gen_unformatted_cons
135 extern void write_unformatted(FILE*, unformatted);
136 extern unformatted read_unformatted(FILE*);
138 
141  string _unformatted_label_; /* label:string */
142  intptr_t _unformatted_number_; /* number:int */
143  intptr_t _unformatted_extra_margin_; /* extra_margin:int */
144  list _unformatted_words_; /* words:string* */
145 };
146 
147 #define unformatted_domain_number(x) ((x)->_type_)
148 #define unformatted_label_(x) unformatted_label(x) /* old hack compatible */
149 #define unformatted_label(x) ((x)->_unformatted_label_)
150 #define unformatted_number_(x) unformatted_number(x) /* old hack compatible */
151 #define unformatted_number(x) ((x)->_unformatted_number_)
152 #define unformatted_extra_margin_(x) unformatted_extra_margin(x) /* old hack compatible */
153 #define unformatted_extra_margin(x) ((x)->_unformatted_extra_margin_)
154 #define unformatted_words_(x) unformatted_words(x) /* old hack compatible */
155 #define unformatted_words(x) ((x)->_unformatted_words_)
156 
157 #define text_spec "\
158 --NEWGEN-START 85\n\
159 sentence = formatted:string + unformatted:unformatted;\n\
160 text = sentences:sentence*;\n\
161 unformatted = label:string x number:int x extra_margin:int x words:string*;\n\
162 "
163 #endif
#define intptr_t
Definition: stdint.in.h:294
union _newgen_struct_sentence_::@81 _sentence_union_
enum sentence_utype _sentence_tag__
Definition: text.h:67
unformatted _sentence_unformatted_
formatted:string
Definition: text.h:70
string _sentence_formatted_
Definition: text.h:69
list _text_holder_
Definition: text.h:109
intptr_t _type_
Definition: text.h:108
list _unformatted_words_
extra_margin:int
Definition: text.h:144
intptr_t _unformatted_number_
label:string
Definition: text.h:142
intptr_t _unformatted_extra_margin_
number:int
Definition: text.h:143
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
unformatted copy_unformatted(unformatted)
UNFORMATTED.
Definition: text.c:113
bool unformatted_consistent_p(unformatted)
Definition: text.c:122
void sentence_assign_contents(sentence, sentence)
Definition: text.c:35
sentence make_sentence_unformatted(unformatted)
Definition: text.c:65
void unformatted_non_recursive_free(unformatted)
Definition: text.c:139
list gen_text_cons(text, list)
Definition: text.c:87
bool sentence_defined_p(sentence)
Definition: text.c:29
sentence read_sentence(FILE *)
Definition: text.c:49
void free_unformatted(unformatted)
Definition: text.c:116
string sentence_tag_as_string(enum sentence_utype)
Definition: text.c:52
struct _newgen_struct_text_ * text
Definition: text.h:23
list gen_unformatted_cons(unformatted, list)
Definition: text.c:129
void text_assign_contents(text, text)
Definition: text.c:90
unformatted read_unformatted(FILE *)
Definition: text.c:146
bool sentence_consistent_p(sentence)
Definition: text.c:25
void text_non_recursive_free(text)
Definition: text.c:97
text make_text(list)
Definition: text.c:107
void write_text(FILE *, text)
Definition: text.c:101
list gen_sentence_cons(sentence, list)
Definition: text.c:32
sentence copy_sentence(sentence)
SENTENCE.
Definition: text.c:16
unformatted check_unformatted(unformatted)
Definition: text.c:119
sentence make_sentence_formatted(string)
Definition: text.c:62
void free_sentence(sentence)
Definition: text.c:19
void write_unformatted(FILE *, unformatted)
Definition: text.c:143
sentence check_sentence(sentence)
Definition: text.c:22
void free_text(text)
Definition: text.c:74
bool text_defined_p(text)
Definition: text.c:84
void sentence_non_recursive_free(sentence)
Definition: text.c:42
void unformatted_assign_contents(unformatted, unformatted)
Definition: text.c:132
void write_sentence(FILE *, sentence)
Definition: text.c:46
text check_text(text)
Definition: text.c:77
struct _newgen_struct_unformatted_ * unformatted
Definition: text.h:31
bool unformatted_defined_p(unformatted)
Definition: text.c:126
unformatted make_unformatted(string, intptr_t, intptr_t, list)
Definition: text.c:149
struct _newgen_struct_sentence_ * sentence
Definition: text.h:15
bool text_consistent_p(text)
Definition: text.c:80
sentence_utype
Definition: text.h:56
@ is_sentence_formatted
Definition: text.h:57
@ is_sentence_unformatted
Definition: text.h:58
sentence make_sentence(enum sentence_utype, void *)
Definition: text.c:59
text read_text(FILE *)
Definition: text.c:104
text copy_text(text)
TEXT.
Definition: text.c:71