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