2 * Copyright (c) 1997 - 2005 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 #include <heimqueue.h>
68 typedef enum typetype Typetype;
85 struct objid *objectidentifiervalue;
98 HEIM_TAILQ_ENTRY(member) members;
102 typedef struct member Member;
104 HEIM_TAILQ_HEAD(memhead, member);
111 enum { TE_IMPLICIT, TE_EXPLICIT } tagenv;
116 * We can't represent unsigned 64-bit ranges because max might be
123 enum ctype { CT_CONTENTS, CT_USER, CT_TABLE_CONSTRAINT } ;
125 struct constraint_spec;
127 struct iosclassfield {
130 struct value *defval;
131 HEIM_TAILQ_ENTRY(iosclassfield) fields;
133 unsigned int optional:1;
134 unsigned int unique:1;
137 typedef struct iosclassfield Field;
138 HEIM_TAILQ_HEAD(fieldhead, iosclassfield);
140 struct iosobjectfield {
144 HEIM_TAILQ_ENTRY(iosobjectfield) objfields;
148 typedef struct iosobjectfield ObjectField;
149 HEIM_TAILQ_HEAD(objfieldhead, iosobjectfield);
152 struct symbol *symbol;
153 struct fieldhead *fields;
157 typedef struct iosclass IOSClass;
160 struct symbol *symbol;
161 struct objfieldhead *objfields;
162 ObjectField *typeidf;
164 HEIM_TAILQ_ENTRY(iosobject) objects;
166 unsigned int ellipsis:1;
167 unsigned int optional:1;
170 typedef struct iosobject IOSObject;
171 HEIM_TAILQ_HEAD(objectshead, iosobject);
173 struct iosobjectset {
174 struct symbol *symbol;
176 struct objectshead *objects;
180 typedef struct iosobjectset IOSObjectSet;
182 struct typereference {
184 * For now we don't support link fields, so we don't support chains of more
193 struct memhead *members;
194 struct symbol *symbol;
195 struct type *subtype;
196 struct typereference typeref; /* For type fields */
197 IOSClass *formal_parameter;
198 IOSObjectSet *actual_parameter;
201 struct constraint_spec *constraint;
205 typedef struct type Type;
207 struct component_relation_constraint {
212 struct constraint_spec {
217 struct value *encoding;
218 struct component_relation_constraint crel;
232 enum { SUndefined, SValue, Stype, Sparamtype, Sclass, Sobj, Sobjset } stype;
237 IOSObjectSet *objectset;
238 HEIM_TAILQ_ENTRY(symbol) symlist;
239 unsigned int emitted_declaration:1;
240 unsigned int emitted_definition:1;
241 unsigned int emitted_tag_enums:1;
242 unsigned int emitted_template:1;
245 typedef struct symbol Symbol;
247 //HEIM_TAILQ_HEAD(symhead, symbol);
249 struct symbol *tqh_first;
250 struct symbol **tqh_last;
253 extern struct symhead symbols;
256 Symbol *addsym (char *);
257 Symbol *getsym(char *name);
258 void output_name (char *);
259 int checkundefined(void);
260 void generate_types(void);
261 void emitted_declaration(const Symbol *);
262 void emitted_definition(const Symbol *);
263 void emitted_tag_enums(const Symbol *);