]> git.draconx.ca Git - gob-dx.git/blob - src/treefuncs.h
Release 1.0.2
[gob-dx.git] / src / treefuncs.h
1 /* Generated by generate_treefuncs.pl from treefuncs.def!
2  * Do not edit by hand! */
3
4
5 #ifndef _TREEFUNCS_H_
6
7 #define _TREEFUNCS_H_
8
9 /* for ccode type */
10 enum {
11         A_CCODE,
12         AT_CCODE,
13         C_CCODE,
14         H_CCODE,
15         HT_CCODE,
16         PH_CCODE
17 };
18
19 /* check type */
20 enum {
21         NULL_CHECK,
22         TYPE_CHECK,
23         LT_CHECK,
24         GT_CHECK,
25         LE_CHECK,
26         GE_CHECK,
27         EQ_CHECK,
28         NE_CHECK
29 };
30
31 /* scope type */
32 enum {
33         NO_SCOPE,
34         PUBLIC_SCOPE,
35         PRIVATE_SCOPE,
36         PROTECTED_SCOPE,
37         CLASS_SCOPE
38 };
39
40 /* method type */
41 enum {
42         REGULAR_METHOD,
43         INIT_METHOD,
44         CLASS_INIT_METHOD,
45         VIRTUAL_METHOD,
46         SIGNAL_LAST_METHOD,
47         SIGNAL_FIRST_METHOD,
48         OVERRIDE_METHOD
49 };
50
51
52 enum {
53         CLASS_NODE,
54         TYPE_NODE,
55         CCODE_NODE,
56         CHECK_NODE,
57         FUNCARG_NODE,
58         ARGUMENT_NODE,
59         METHOD_NODE,
60         VARIABLE_NODE,
61         LAST_NODE_TYPE
62 };
63
64 typedef union _Node Node;
65 typedef struct _Class Class;
66 typedef struct _Type Type;
67 typedef struct _CCode CCode;
68 typedef struct _Check Check;
69 typedef struct _FuncArg FuncArg;
70 typedef struct _Argument Argument;
71 typedef struct _Method Method;
72 typedef struct _Variable Variable;
73
74
75 struct _Argument {
76         int type;
77         char * gtktype;
78         Type * atype;
79         GList * flags;
80         char * name;
81         char * get;
82         int get_line;
83         char * set;
84         int set_line;
85         int line_no;
86 };
87
88 struct _CCode {
89         int type;
90         int cctype;
91         char * cbuf;
92         int line_no;
93 };
94
95 struct _Check {
96         int type;
97         int chtype;
98         char * number;
99 };
100
101 struct _Class {
102         int type;
103         char * otype;
104         char * ptype;
105         char * chunk_size;
106         GList * nodes;
107 };
108
109 struct _FuncArg {
110         int type;
111         Type * atype;
112         char * name;
113         GList * checks;
114 };
115
116 struct _Method {
117         int type;
118         int scope;
119         int method;
120         Type * mtype;
121         char * otype;
122         GList * gtktypes;
123         GList * flags;
124         char * id;
125         GList * args;
126         char * onerror;
127         char * defreturn;
128         char * cbuf;
129         int line_no;
130         int ccode_line;
131         gboolean vararg;
132         int unique_id;
133 };
134
135 struct _Type {
136         int type;
137         char * name;
138         char * pointer;
139         char * postfix;
140 };
141
142 struct _Variable {
143         int type;
144         int scope;
145         Type * vtype;
146         char * id;
147         int line_no;
148         char * destructor;
149         int destructor_line;
150         gboolean destructor_simple;
151         char * initializer;
152         int initializer_line;
153 };
154
155 union _Node {
156         int type;
157         Argument argument;
158         CCode ccode;
159         Check check;
160         Class class;
161         FuncArg funcarg;
162         Method method;
163         Type _type;
164         Variable variable;
165 };
166
167 /* New functions */
168 Node * new_argument (char * gtktype, Type * atype, GList * flags, char * name, char * get, int get_line, char * set, int set_line, int line_no);
169 Node * new_ccode (int cctype, char * cbuf, int line_no);
170 Node * new_check (int chtype, char * number);
171 Node * new_class (char * otype, char * ptype, char * chunk_size, GList * nodes);
172 Node * new_funcarg (Type * atype, char * name, GList * checks);
173 Node * new_method (int scope, int method, Type * mtype, char * otype, GList * gtktypes, GList * flags, char * id, GList * args, char * onerror, char * defreturn, char * cbuf, int line_no, int ccode_line, gboolean vararg, int unique_id);
174 Node * new_type (char * name, char * pointer, char * postfix);
175 Node * new_variable (int scope, Type * vtype, char * id, int line_no, char * destructor, int destructor_line, gboolean destructor_simple, char * initializer, int initializer_line);
176
177 /* General copy/free functions */
178 Node * copy_node(Node *node);
179 void free_node(Node *node);
180
181 GList * copy_node_list(GList *nodes);
182 void free_node_list(GList *nodes);
183
184 /* Copy functions */
185 Argument * copy_argument (Argument * self);
186 CCode * copy_ccode (CCode * self);
187 Check * copy_check (Check * self);
188 Class * copy_class (Class * self);
189 FuncArg * copy_funcarg (FuncArg * self);
190 Method * copy_method (Method * self);
191 Type * copy_type (Type * self);
192 Variable * copy_variable (Variable * self);
193
194 /* Free functions */
195 void free_argument (Argument * self);
196 void free_ccode (CCode * self);
197 void free_check (Check * self);
198 void free_class (Class * self);
199 void free_funcarg (FuncArg * self);
200 void free_method (Method * self);
201 void free_type (Type * self);
202 void free_variable (Variable * self);
203
204 #endif /*_TREEFUNCS_H_*/