]> git.draconx.ca Git - gob-dx.git/blob - src/treefuncs.h
Release 0.93.5
[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         GList * nodes;
106 };
107
108 struct _FuncArg {
109         int type;
110         Type * atype;
111         char * name;
112         GList * checks;
113 };
114
115 struct _Method {
116         int type;
117         int scope;
118         int method;
119         Type * mtype;
120         char * otype;
121         GList * gtktypes;
122         GList * flags;
123         char * id;
124         GList * args;
125         char * onerror;
126         char * defreturn;
127         char * cbuf;
128         int line_no;
129         int ccode_line;
130         gboolean vararg;
131         int unique_id;
132 };
133
134 struct _Type {
135         int type;
136         int stars;
137         char * name;
138         char * postfix;
139 };
140
141 struct _Variable {
142         int type;
143         int scope;
144         Type * vtype;
145         char * id;
146         int line_no;
147         char * destructor;
148         int destructor_line;
149         gboolean destructor_simple;
150         char * initializer;
151         int initializer_line;
152 };
153
154 union _Node {
155         int type;
156         Argument argument;
157         CCode ccode;
158         Check check;
159         Class class;
160         FuncArg funcarg;
161         Method method;
162         Type _type;
163         Variable variable;
164 };
165
166 /* New functions */
167 Node * new_argument (char * gtktype, Type * atype, GList * flags, char * name, char * get, int get_line, char * set, int set_line, int line_no);
168 Node * new_ccode (int cctype, char * cbuf, int line_no);
169 Node * new_check (int chtype, char * number);
170 Node * new_class (char * otype, char * ptype, GList * nodes);
171 Node * new_funcarg (Type * atype, char * name, GList * checks);
172 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);
173 Node * new_type (int stars, char * name, char * postfix);
174 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);
175
176 /* General copy/free functions */
177 Node * copy_node(Node *node);
178 void free_node(Node *node);
179
180 GList * copy_node_list(GList *nodes);
181 void free_node_list(GList *nodes);
182
183 /* Copy functions */
184 Argument * copy_argument (Argument * self);
185 CCode * copy_ccode (CCode * self);
186 Check * copy_check (Check * self);
187 Class * copy_class (Class * self);
188 FuncArg * copy_funcarg (FuncArg * self);
189 Method * copy_method (Method * self);
190 Type * copy_type (Type * self);
191 Variable * copy_variable (Variable * self);
192
193 /* Free functions */
194 void free_argument (Argument * self);
195 void free_ccode (CCode * self);
196 void free_check (Check * self);
197 void free_class (Class * self);
198 void free_funcarg (FuncArg * self);
199 void free_method (Method * self);
200 void free_type (Type * self);
201 void free_variable (Variable * self);
202
203 #endif /*_TREEFUNCS_H_*/