4 * File name: ir/external/read.h
5 * Purpose: Read descriptions of external effects
7 * Modified by: Boris Boesler
10 * Copyright: (c) 1999-2004 Universität Karlsruhe
11 * Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
21 #include <libxml/xmlmemory.h>
22 #include <libxml/parser.h>
23 #include <libxml/encoding.h>
29 # define MY_ENCODING "ISO-8859-1"
31 # define CHECK(ptr,msg) assert (ptr && msg)
33 # define NODE_NAME(n, m) (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
34 # define CHECK_NAME(n, m) assert (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
36 # define NEW(T) (T*) malloc (sizeof (T))
39 /* first, the xml structures */
41 typedef struct type_str
43 const ident *type_ident;
44 const ident *id; /* id for references */
45 type *f_tp; /* firm type */
46 struct type_str *prev;
49 typedef struct entity_str
51 const ident *ent_ident; /* name of entity */
52 const ident *tp_ident; /* name of type/class */
53 const ident *id; /* id for references */
54 const ident *owner; /* id of owner */
55 entity *f_ent; /* firm entity */
56 struct entity_str *prev;
59 /* now the xml nodes */
60 typedef enum eff_node_kind {
62 eff_valref, // eliminated
63 eff_select, // eliminated
75 typedef struct arg_str
77 const ident *type_ident;
81 typedef struct valref_str
86 typedef struct select_str
91 typedef struct load_str
93 const ident *ptrrefid; /* id of valref node enclosed in select, or -1 */
97 typedef struct store_str
99 const ident *ptrrefid; /* id of ptr valref node enclosed in select, or -1 */
100 const ident *valrefid; /* id of val valref node enclosed in select, or -1 */
104 typedef struct alloc_str
109 typedef struct call_str
111 const ident *valrefid; /* id of enclosed valref node, or -1 */
112 entity_t *ent; /* called entity */
117 typedef struct unknown_str
122 typedef struct join_str
128 typedef struct ret_str
131 } ret_t; /* returned value, or NO_ID */
133 typedef struct raise_str
135 const ident *valref; /* what was that one for? */
139 /* dummy type for all other effects */
140 typedef struct eff_str
142 eff_node_kind_t kind;
143 const ident *id; /* identifier to access this node */
158 struct eff_str *next; /* effects with values are stored in proc.values */
161 typedef struct proc_str
163 const ident *proc_ident; /* name of procedure */
164 const ident *ownerid;
167 struct proc_str *next;
168 eff_t *values; /* @@@ TODO hash set */
172 typedef struct mod_str
175 type_t *types; /* types in module *//* @@@ TODO hash set */
176 entity_t *entities; /* entities in module *//* @@@ TODO hash set */
177 proc_t *procs; /* methods with effects */
178 struct mod_str *next; /* unused - only one module possible */
182 #endif /* defined _READ_T_H_ */
186 Revision 1.1 2004/10/25 13:52:24 boesler
187 seperated read.h (public interface) and read_t.h (types)
189 Revision 1.6 2004/10/22 13:13:27 boesler
190 replaced char* by idents, minor fix in Firm codegen for call
192 Revision 1.5 2004/10/21 15:31:55 boesler
194 - build abstract syntax trees
195 - build Firm graphs for many effects, still todos
197 Revision 1.1 2004/10/11 09:31:06 liekweg
198 First Import of XML reading procs --flo