]> git.draconx.ca Git - gob-dx.git/blob - src/treefuncs.h
d2e9430e567266a625bbcbd8d99d64a02f840afa
[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 };
38
39 /* method type */
40 enum {
41         REGULAR_METHOD,
42         INIT_METHOD,
43         CLASS_INIT_METHOD,
44         VIRTUAL_METHOD,
45         SIGNAL_LAST_METHOD,
46         SIGNAL_FIRST_METHOD,
47         OVERRIDE_METHOD
48 };
49
50
51 enum {
52         CLASS_NODE,
53         TYPE_NODE,
54         CCODE_NODE,
55         CHECK_NODE,
56         FUNCARG_NODE,
57         ARGUMENT_NODE,
58         METHOD_NODE,
59         VARIABLE_NODE,
60         LAST_NODE_TYPE
61 };
62
63 typedef union _Node Node;
64 typedef struct _Class Class;
65 typedef struct _Type Type;
66 typedef struct _CCode CCode;
67 typedef struct _Check Check;
68 typedef struct _FuncArg FuncArg;
69 typedef struct _Argument Argument;
70 typedef struct _Method Method;
71 typedef struct _Variable Variable;
72
73
74 struct _Argument {
75         int type;
76         char * gtktype;
77         Type * atype;
78         GList * flags;
79         char * name;
80         char * get;
81         int get_line;
82         char * set;
83         int set_line;
84         int line_no;
85 };
86
87 struct _CCode {
88         int type;
89         int cctype;
90         char * cbuf;
91         int line_no;
92 };
93
94 struct _Check {
95         int type;
96         int chtype;
97         char * number;
98 };
99
100 struct _Class {
101         int type;
102         char * otype;
103         char * ptype;
104         GList * nodes;
105 };
106
107 struct _FuncArg {
108         int type;
109         Type * atype;
110         char * name;
111         GList * checks;
112 };
113
114 struct _Method {
115         int type;
116         int scope;
117         int method;
118         Type * mtype;
119         char * otype;
120         GList * gtktypes;
121         GList * flags;
122         char * id;
123         GList * args;
124         char * onerror;
125         char * defreturn;
126         char * cbuf;
127         int line_no;
128         int ccode_line;
129         gboolean vararg;
130 };
131
132 struct _Type {
133         int type;
134         int stars;
135         char * name;
136         char * postfix;
137 };
138
139 struct _Variable {
140         int type;
141         int scope;
142         Type * vtype;
143         char * id;
144         int line_no;
145         char * destructor;
146         int destructor_line;
147         gboolean destructor_simple;
148         char * initializer;
149         int initializer_line;
150 };
151
152 union _Node {
153         int type;
154         Argument argument;
155         CCode ccode;
156         Check check;
157         Class class;
158         FuncArg funcarg;
159         Method method;
160         Type _type;
161         Variable variable;
162 };
163
164 /* New functions */
165 Node * new_argument (char * gtktype, Type * atype, GList * flags, char * name, char * get, int get_line, char * set, int set_line, int line_no);
166 Node * new_ccode (int cctype, char * cbuf, int line_no);
167 Node * new_check (int chtype, char * number);
168 Node * new_class (char * otype, char * ptype, GList * nodes);
169 Node * new_funcarg (Type * atype, char * name, GList * checks);
170 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);
171 Node * new_type (int stars, char * name, char * postfix);
172 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);
173
174 /* General copy/free functions */
175 Node * copy_node(Node *node);
176 void free_node(Node *node);
177
178 GList * copy_node_list(GList *nodes);
179 void free_node_list(GList *nodes);
180
181 /* Copy functions */
182 Argument * copy_argument (Argument * self);
183 CCode * copy_ccode (CCode * self);
184 Check * copy_check (Check * self);
185 Class * copy_class (Class * self);
186 FuncArg * copy_funcarg (FuncArg * self);
187 Method * copy_method (Method * self);
188 Type * copy_type (Type * self);
189 Variable * copy_variable (Variable * self);
190
191 /* Free functions */
192 void free_argument (Argument * self);
193 void free_ccode (CCode * self);
194 void free_check (Check * self);
195 void free_class (Class * self);
196 void free_funcarg (FuncArg * self);
197 void free_method (Method * self);
198 void free_type (Type * self);
199 void free_variable (Variable * self);
200
201 #endif /*_TREEFUNCS_H_*/