PIPS
parser_private.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "parser_private.h"
+ Include dependency graph for parser_private.c:

Go to the source code of this file.

Functions

atom copy_atom (atom p)
 ATOM. More...
 
void free_atom (atom p)
 
atom check_atom (atom p)
 
bool atom_consistent_p (atom p)
 
bool atom_defined_p (atom p)
 
list gen_atom_cons (atom p, list l)
 
void atom_assign_contents (atom r, atom v)
 
void atom_non_recursive_free (atom p)
 
void write_atom (FILE *f, atom p)
 
atom read_atom (FILE *f)
 
atom make_atom (entity a1, intptr_t a2)
 
chain copy_chain (chain p)
 CHAIN. More...
 
void free_chain (chain p)
 
chain check_chain (chain p)
 
bool chain_consistent_p (chain p)
 
bool chain_defined_p (chain p)
 
list gen_chain_cons (chain p, list l)
 
void chain_assign_contents (chain r, chain v)
 
void chain_non_recursive_free (chain p)
 
void write_chain (FILE *f, chain p)
 
chain read_chain (FILE *f)
 
chain make_chain (list a)
 
data copy_data (data p)
 DATA. More...
 
void free_data (data p)
 
data check_data (data p)
 
bool data_consistent_p (data p)
 
bool data_defined_p (data p)
 
list gen_data_cons (data p, list l)
 
void data_assign_contents (data r, data v)
 
void data_non_recursive_free (data p)
 
void write_data (FILE *f, data p)
 
data read_data (FILE *f)
 
data make_data (list a1, list a2)
 
dataval copy_dataval (dataval p)
 DATAVAL. More...
 
void free_dataval (dataval p)
 
dataval check_dataval (dataval p)
 
bool dataval_consistent_p (dataval p)
 
bool dataval_defined_p (dataval p)
 
list gen_dataval_cons (dataval p, list l)
 
void dataval_assign_contents (dataval r, dataval v)
 
void dataval_non_recursive_free (dataval p)
 
void write_dataval (FILE *f, dataval p)
 
dataval read_dataval (FILE *f)
 
dataval make_dataval (constant a1, intptr_t a2)
 
datavar copy_datavar (datavar p)
 DATAVAR. More...
 
void free_datavar (datavar p)
 
datavar check_datavar (datavar p)
 
bool datavar_consistent_p (datavar p)
 
bool datavar_defined_p (datavar p)
 
list gen_datavar_cons (datavar p, list l)
 
void datavar_assign_contents (datavar r, datavar v)
 
void datavar_non_recursive_free (datavar p)
 
void write_datavar (FILE *f, datavar p)
 
datavar read_datavar (FILE *f)
 
datavar make_datavar (entity a1, intptr_t a2)
 
equivalences copy_equivalences (equivalences p)
 EQUIVALENCES. More...
 
void free_equivalences (equivalences p)
 
equivalences check_equivalences (equivalences p)
 
bool equivalences_consistent_p (equivalences p)
 
bool equivalences_defined_p (equivalences p)
 
list gen_equivalences_cons (equivalences p, list l)
 
void equivalences_assign_contents (equivalences r, equivalences v)
 
void equivalences_non_recursive_free (equivalences p)
 
void write_equivalences (FILE *f, equivalences p)
 
equivalences read_equivalences (FILE *f)
 
equivalences make_equivalences (list a)
 

Function Documentation

◆ atom_assign_contents()

void atom_assign_contents ( atom  r,
atom  v 
)

Definition at line 35 of file parser_private.c.

35  {
36  check_atom(r);
37  check_atom(v);
38  message_assert("defined references to domain atom",
40  memcpy(r, v, sizeof(struct _newgen_struct_atom_));
41 }
atom check_atom(atom p)
bool atom_defined_p(atom p)
#define message_assert(msg, ex)
Definition: newgen_assert.h:47

References atom_defined_p(), check_atom(), and message_assert.

+ Here is the call graph for this function:

◆ atom_consistent_p()

bool atom_consistent_p ( atom  p)

Definition at line 25 of file parser_private.c.

25  {
26  check_atom(p);
27  return gen_consistent_p((gen_chunk*) p);
28 }
int gen_consistent_p(gen_chunk *obj)
GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.
Definition: genClib.c:2398
A gen_chunk is used to store every object.
Definition: genC.h:58

References check_atom(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ atom_defined_p()

bool atom_defined_p ( atom  p)

Definition at line 29 of file parser_private.c.

29  {
30  return gen_defined_p((gen_chunk*) p);
31 }
int gen_defined_p(gen_chunk *obj)
Definition: genClib.c:2438

References gen_defined_p().

+ Here is the call graph for this function:

◆ atom_non_recursive_free()

void atom_non_recursive_free ( atom  p)

Definition at line 42 of file parser_private.c.

42  {
43  // should clear up contents...
44  free(p);
45 }
void free(void *)

References free().

+ Here is the call graph for this function:

◆ chain_assign_contents()

void chain_assign_contents ( chain  r,
chain  v 
)

Definition at line 77 of file parser_private.c.

77  {
78  check_chain(r);
79  check_chain(v);
80  message_assert("defined references to domain chain",
82  memcpy(r, v, sizeof(struct _newgen_struct_chain_));
83 }
chain check_chain(chain p)
bool chain_defined_p(chain p)

References chain_defined_p(), check_chain(), and message_assert.

+ Here is the call graph for this function:

◆ chain_consistent_p()

bool chain_consistent_p ( chain  p)

Definition at line 67 of file parser_private.c.

67  {
68  check_chain(p);
69  return gen_consistent_p((gen_chunk*) p);
70 }

References check_chain(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ chain_defined_p()

bool chain_defined_p ( chain  p)

Definition at line 71 of file parser_private.c.

71  {
72  return gen_defined_p((gen_chunk*) p);
73 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ chain_non_recursive_free()

void chain_non_recursive_free ( chain  p)

Definition at line 84 of file parser_private.c.

84  {
85  // should clear up contents...
86  free(p);
87 }

References free().

+ Here is the call graph for this function:

◆ check_atom()

atom check_atom ( atom  p)

Definition at line 22 of file parser_private.c.

22  {
23  return (atom) gen_check((gen_chunk*) p, atom_domain);
24 }
gen_chunk * gen_check(gen_chunk *obj, int t)
GEN_CHECK checks that the gen_chunk received OBJ is of the appropriate TYPE.
Definition: genClib.c:2356
#define atom_domain
newgen_constant_domain_defined

References atom_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_chain()

chain check_chain ( chain  p)

Definition at line 64 of file parser_private.c.

64  {
65  return (chain) gen_check((gen_chunk*) p, chain_domain);
66 }
#define chain_domain
newgen_atom_domain_defined

References chain_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_data()

data check_data ( data  p)

Definition at line 106 of file parser_private.c.

106  {
107  return (data) gen_check((gen_chunk*) p, data_domain);
108 }
#define data_domain
newgen_chain_domain_defined

References data_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_dataval()

dataval check_dataval ( dataval  p)

Definition at line 148 of file parser_private.c.

148  {
149  return (dataval) gen_check((gen_chunk*) p, dataval_domain);
150 }
#define dataval_domain
newgen_data_domain_defined

References dataval_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_datavar()

datavar check_datavar ( datavar  p)

Definition at line 190 of file parser_private.c.

190  {
191  return (datavar) gen_check((gen_chunk*) p, datavar_domain);
192 }
#define datavar_domain
newgen_dataval_domain_defined

References datavar_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_equivalences()

equivalences check_equivalences ( equivalences  p)

Definition at line 232 of file parser_private.c.

232  {
234 }
#define equivalences_domain
newgen_datavar_domain_defined

References equivalences_domain, and gen_check().

+ Here is the call graph for this function:

◆ copy_atom()

atom copy_atom ( atom  p)

ATOM.

Definition at line 16 of file parser_private.c.

16  {
17  return (atom) gen_copy_tree((gen_chunk*) p);
18 }
gen_chunk * gen_copy_tree(gen_chunk *obj)
Definition: genClib.c:1429

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_chain()

chain copy_chain ( chain  p)

CHAIN.

Definition at line 58 of file parser_private.c.

58  {
59  return (chain) gen_copy_tree((gen_chunk*) p);
60 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_data()

data copy_data ( data  p)

DATA.

Definition at line 100 of file parser_private.c.

100  {
101  return (data) gen_copy_tree((gen_chunk*) p);
102 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_dataval()

dataval copy_dataval ( dataval  p)

DATAVAL.

Definition at line 142 of file parser_private.c.

142  {
143  return (dataval) gen_copy_tree((gen_chunk*) p);
144 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_datavar()

datavar copy_datavar ( datavar  p)

DATAVAR.

Definition at line 184 of file parser_private.c.

184  {
185  return (datavar) gen_copy_tree((gen_chunk*) p);
186 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_equivalences()

equivalences copy_equivalences ( equivalences  p)

EQUIVALENCES.

Definition at line 226 of file parser_private.c.

226  {
227  return (equivalences) gen_copy_tree((gen_chunk*) p);
228 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ data_assign_contents()

void data_assign_contents ( data  r,
data  v 
)

Definition at line 119 of file parser_private.c.

119  {
120  check_data(r);
121  check_data(v);
122  message_assert("defined references to domain data",
123  data_defined_p(r) && data_defined_p(v));
124  memcpy(r, v, sizeof(struct _newgen_struct_data_));
125 }
data check_data(data p)
bool data_defined_p(data p)

References check_data(), data_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ data_consistent_p()

bool data_consistent_p ( data  p)

Definition at line 109 of file parser_private.c.

109  {
110  check_data(p);
111  return gen_consistent_p((gen_chunk*) p);
112 }

References check_data(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ data_defined_p()

bool data_defined_p ( data  p)

Definition at line 113 of file parser_private.c.

113  {
114  return gen_defined_p((gen_chunk*) p);
115 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ data_non_recursive_free()

void data_non_recursive_free ( data  p)

Definition at line 126 of file parser_private.c.

126  {
127  // should clear up contents...
128  free(p);
129 }

References free().

+ Here is the call graph for this function:

◆ dataval_assign_contents()

void dataval_assign_contents ( dataval  r,
dataval  v 
)

Definition at line 161 of file parser_private.c.

161  {
162  check_dataval(r);
163  check_dataval(v);
164  message_assert("defined references to domain dataval",
166  memcpy(r, v, sizeof(struct _newgen_struct_dataval_));
167 }
dataval check_dataval(dataval p)
bool dataval_defined_p(dataval p)

References check_dataval(), dataval_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ dataval_consistent_p()

bool dataval_consistent_p ( dataval  p)

Definition at line 151 of file parser_private.c.

151  {
152  check_dataval(p);
153  return gen_consistent_p((gen_chunk*) p);
154 }

References check_dataval(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ dataval_defined_p()

bool dataval_defined_p ( dataval  p)

Definition at line 155 of file parser_private.c.

155  {
156  return gen_defined_p((gen_chunk*) p);
157 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ dataval_non_recursive_free()

void dataval_non_recursive_free ( dataval  p)

Definition at line 168 of file parser_private.c.

168  {
169  // should clear up contents...
170  free(p);
171 }

References free().

+ Here is the call graph for this function:

◆ datavar_assign_contents()

void datavar_assign_contents ( datavar  r,
datavar  v 
)

Definition at line 203 of file parser_private.c.

203  {
204  check_datavar(r);
205  check_datavar(v);
206  message_assert("defined references to domain datavar",
208  memcpy(r, v, sizeof(struct _newgen_struct_datavar_));
209 }
bool datavar_defined_p(datavar p)
datavar check_datavar(datavar p)

References check_datavar(), datavar_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ datavar_consistent_p()

bool datavar_consistent_p ( datavar  p)

Definition at line 193 of file parser_private.c.

193  {
194  check_datavar(p);
195  return gen_consistent_p((gen_chunk*) p);
196 }

References check_datavar(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ datavar_defined_p()

bool datavar_defined_p ( datavar  p)

Definition at line 197 of file parser_private.c.

197  {
198  return gen_defined_p((gen_chunk*) p);
199 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ datavar_non_recursive_free()

void datavar_non_recursive_free ( datavar  p)

Definition at line 210 of file parser_private.c.

210  {
211  // should clear up contents...
212  free(p);
213 }

References free().

+ Here is the call graph for this function:

◆ equivalences_assign_contents()

void equivalences_assign_contents ( equivalences  r,
equivalences  v 
)

Definition at line 245 of file parser_private.c.

245  {
248  message_assert("defined references to domain equivalences",
250  memcpy(r, v, sizeof(struct _newgen_struct_equivalences_));
251 }
bool equivalences_defined_p(equivalences p)
equivalences check_equivalences(equivalences p)

References check_equivalences(), equivalences_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ equivalences_consistent_p()

bool equivalences_consistent_p ( equivalences  p)

Definition at line 235 of file parser_private.c.

235  {
237  return gen_consistent_p((gen_chunk*) p);
238 }

References check_equivalences(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ equivalences_defined_p()

bool equivalences_defined_p ( equivalences  p)

Definition at line 239 of file parser_private.c.

239  {
240  return gen_defined_p((gen_chunk*) p);
241 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ equivalences_non_recursive_free()

void equivalences_non_recursive_free ( equivalences  p)

Definition at line 252 of file parser_private.c.

252  {
253  // should clear up contents...
254  free(p);
255 }

References free().

+ Here is the call graph for this function:

◆ free_atom()

void free_atom ( atom  p)

Definition at line 19 of file parser_private.c.

19  {
20  gen_free((gen_chunk*) p);
21 }
void gen_free(gen_chunk *obj)
version without shared_pointers.
Definition: genClib.c:992

References gen_free().

+ Here is the call graph for this function:

◆ free_chain()

void free_chain ( chain  p)

Definition at line 61 of file parser_private.c.

61  {
62  gen_free((gen_chunk*) p);
63 }

References gen_free().

+ Here is the call graph for this function:

◆ free_data()

void free_data ( data  p)

Definition at line 103 of file parser_private.c.

103  {
104  gen_free((gen_chunk*) p);
105 }

References gen_free().

+ Here is the call graph for this function:

◆ free_dataval()

void free_dataval ( dataval  p)

Definition at line 145 of file parser_private.c.

145  {
146  gen_free((gen_chunk*) p);
147 }

References gen_free().

+ Here is the call graph for this function:

◆ free_datavar()

void free_datavar ( datavar  p)

Definition at line 187 of file parser_private.c.

187  {
188  gen_free((gen_chunk*) p);
189 }

References gen_free().

+ Here is the call graph for this function:

◆ free_equivalences()

void free_equivalences ( equivalences  p)

Definition at line 229 of file parser_private.c.

229  {
230  gen_free((gen_chunk*) p);
231 }

References gen_free().

+ Here is the call graph for this function:

◆ gen_atom_cons()

list gen_atom_cons ( atom  p,
list  l 
)

Definition at line 32 of file parser_private.c.

32  {
33  return gen_typed_cons(ATOM_NEWGEN_DOMAIN, p, l);
34 }
list gen_typed_cons(_int type, const void *item, const list next)
CONS a list with minimal type checking this cannot be done within the CONS macro because possible fun...
Definition: list.c:900
#define ATOM_NEWGEN_DOMAIN

References ATOM_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_chain_cons()

list gen_chain_cons ( chain  p,
list  l 
)

Definition at line 74 of file parser_private.c.

74  {
75  return gen_typed_cons(CHAIN_NEWGEN_DOMAIN, p, l);
76 }
#define CHAIN_NEWGEN_DOMAIN

References CHAIN_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_data_cons()

list gen_data_cons ( data  p,
list  l 
)

Definition at line 116 of file parser_private.c.

116  {
117  return gen_typed_cons(DATA_NEWGEN_DOMAIN, p, l);
118 }
#define DATA_NEWGEN_DOMAIN

References DATA_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_dataval_cons()

list gen_dataval_cons ( dataval  p,
list  l 
)

Definition at line 158 of file parser_private.c.

158  {
160 }
#define DATAVAL_NEWGEN_DOMAIN

References DATAVAL_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_datavar_cons()

list gen_datavar_cons ( datavar  p,
list  l 
)

Definition at line 200 of file parser_private.c.

200  {
202 }
#define DATAVAR_NEWGEN_DOMAIN

References DATAVAR_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_equivalences_cons()

list gen_equivalences_cons ( equivalences  p,
list  l 
)

Definition at line 242 of file parser_private.c.

242  {
244 }
#define EQUIVALENCES_NEWGEN_DOMAIN

References EQUIVALENCES_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ make_atom()

atom make_atom ( entity  a1,
intptr_t  a2 
)

Definition at line 52 of file parser_private.c.

52  {
53  return (atom) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, atom_domain, a1, a2);
54 }
#define GEN_CHECK_ALLOC
Definition: genC.h:307
gen_chunk * gen_alloc(int size, int gen_check_p, int dom,...)
allocates something in newgen.
Definition: genClib.c:298

References atom_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_chain()

chain make_chain ( list  a)

Definition at line 94 of file parser_private.c.

94  {
95  return (chain) gen_alloc(2*sizeof(gen_chunk), GEN_CHECK_ALLOC, chain_domain, a);
96 }

References chain_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_data()

data make_data ( list  a1,
list  a2 
)

Definition at line 136 of file parser_private.c.

136  {
137  return (data) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, data_domain, a1, a2);
138 }

References data_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_dataval()

dataval make_dataval ( constant  a1,
intptr_t  a2 
)

Definition at line 178 of file parser_private.c.

178  {
179  return (dataval) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, dataval_domain, a1, a2);
180 }

References dataval_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_datavar()

datavar make_datavar ( entity  a1,
intptr_t  a2 
)

Definition at line 220 of file parser_private.c.

220  {
221  return (datavar) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, datavar_domain, a1, a2);
222 }

References datavar_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_equivalences()

equivalences make_equivalences ( list  a)

Definition at line 262 of file parser_private.c.

262  {
264 }

References equivalences_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ read_atom()

atom read_atom ( FILE *  f)

Definition at line 49 of file parser_private.c.

49  {
50  return (atom) gen_read(f);
51 }
gen_chunk * gen_read(FILE *file)
GEN_READ reads any object from the FILE stream.
Definition: genClib.c:2323
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_chain()

chain read_chain ( FILE *  f)

Definition at line 91 of file parser_private.c.

91  {
92  return (chain) gen_read(f);
93 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_data()

data read_data ( FILE *  f)

Definition at line 133 of file parser_private.c.

133  {
134  return (data) gen_read(f);
135 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_dataval()

dataval read_dataval ( FILE *  f)

Definition at line 175 of file parser_private.c.

175  {
176  return (dataval) gen_read(f);
177 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_datavar()

datavar read_datavar ( FILE *  f)

Definition at line 217 of file parser_private.c.

217  {
218  return (datavar) gen_read(f);
219 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_equivalences()

equivalences read_equivalences ( FILE *  f)

Definition at line 259 of file parser_private.c.

259  {
260  return (equivalences) gen_read(f);
261 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ write_atom()

void write_atom ( FILE *  f,
atom  p 
)

Definition at line 46 of file parser_private.c.

46  {
47  gen_write(f, (gen_chunk*) p);
48 }
void gen_write(FILE *fd, gen_chunk *obj)
GEN_WRITE writes the OBJect on the stream FD.
Definition: genClib.c:1745

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_chain()

void write_chain ( FILE *  f,
chain  p 
)

Definition at line 88 of file parser_private.c.

88  {
89  gen_write(f, (gen_chunk*) p);
90 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_data()

void write_data ( FILE *  f,
data  p 
)

Definition at line 130 of file parser_private.c.

130  {
131  gen_write(f, (gen_chunk*) p);
132 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_dataval()

void write_dataval ( FILE *  f,
dataval  p 
)

Definition at line 172 of file parser_private.c.

172  {
173  gen_write(f, (gen_chunk*) p);
174 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_datavar()

void write_datavar ( FILE *  f,
datavar  p 
)

Definition at line 214 of file parser_private.c.

214  {
215  gen_write(f, (gen_chunk*) p);
216 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_equivalences()

void write_equivalences ( FILE *  f,
equivalences  p 
)

Definition at line 256 of file parser_private.c.

256  {
257  gen_write(f, (gen_chunk*) p);
258 }

References f(), and gen_write().

+ Here is the call graph for this function: