~ubuntu-branches/debian/jessie/sqlheavy/jessie

« back to all changes in this revision

Viewing changes to utils/sqlheavy-gen-orm.c

  • Committer: Package Import Robot
  • Author(s): Devid Antonio Filoni
  • Date: 2012-05-17 09:47:17 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120517094717-ue17pqaud5tywjj5
Tags: 0.1.1-1
* New upstream release (Closes: #663320).
* Fix debug-package-should-be-priority-extra lintian warning.
* debian/control: switch to vala-0.16 in Build-Depends field.
* debian/libsqlheavy-dev.install, debian/libsqlheavygtk-dev.install:
  install files in vala-0.16 dir.
* Update libsqlheavy0.1-0.symbols.amd64 file.
* debian/rules: update override_dh_makeshlibs target.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* sqlheavy-gen-orm.c generated by valac 0.12.1, the Vala compiler
 
1
/* sqlheavy-gen-orm.c generated by valac 0.16.0, the Vala compiler
2
2
 * generated from sqlheavy-gen-orm.vala, do not modify */
3
3
 
4
4
 
9
9
#include <string.h>
10
10
#include <valagee.h>
11
11
#include <SQLHeavy.h>
 
12
#include <stdio.h>
12
13
#include <glib/gstdio.h>
13
 
#include <stdio.h>
14
14
 
15
15
 
16
16
#define SQL_HEAVY_TYPE_GENERATOR (sql_heavy_generator_get_type ())
34
34
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
35
35
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
36
36
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
37
#define _vala_source_reference_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_reference_unref (var), NULL)))
 
38
#define _vala_source_file_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_file_unref (var), NULL)))
37
39
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
38
40
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
39
41
#define _vala_code_visitor_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_visitor_unref (var), NULL)))
40
42
#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
41
 
#define _vala_source_file_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_file_unref (var), NULL)))
42
43
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
43
44
 
44
45
typedef enum  {
95
96
gboolean sql_heavy_generator_symbol_is_hidden (SQLHeavyGenerator* self, const gchar* symbol);
96
97
static ValaDataType* sql_heavy_generator_type_from_string (const gchar* datatype);
97
98
static ValaDataType* sql_heavy_generator_get_data_type (SQLHeavyGenerator* self, const gchar* symbol);
98
 
static void sql_heavy_generator_parse_field (SQLHeavyGenerator* self, SQLHeavyTable* table, gint field, ValaClass* cl, ValaSwitchStatement* signals, GError** error);
99
 
static void sql_heavy_generator_parse_table (SQLHeavyGenerator* self, SQLHeavyTable* table, ValaNamespace* ns, GError** error);
 
99
static void sql_heavy_generator_parse_field (SQLHeavyGenerator* self, SQLHeavyTable* table, gint field, ValaClass* cl, ValaSwitchStatement* signals, ValaSourceReference* source_reference, GError** error);
 
100
static void sql_heavy_generator_parse_table (SQLHeavyGenerator* self, SQLHeavyTable* table, ValaNamespace* ns, ValaSourceReference* source_reference, GError** error);
100
101
static void sql_heavy_generator_parse_database (SQLHeavyGenerator* self, SQLHeavyDatabase* db, GError** error);
101
102
void sql_heavy_generator_run (SQLHeavyGenerator* self, GError** error);
102
103
static gchar* sql_heavy_generator_parse_selector (const gchar* selector, gboolean* wildcard, GError** error);
110
111
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
111
112
static gint _vala_array_length (gpointer array);
112
113
 
113
 
static const GOptionEntry SQL_HEAVY_GENERATOR_options[7] = {{"metadata", 'm', 0, G_OPTION_ARG_FILENAME, &sql_heavy_generator_metadata_location, "Load metadata from FILE", "FILE..."}, {"vapidir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &sql_heavy_generator_vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..."}, {"pkg", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &sql_heavy_generator_packages, "Include binding for PACKAGE", "PACKAGE..."}, {"output", 'o', 0, G_OPTION_ARG_FILENAME, &sql_heavy_generator_output_location, "Output to FILE (default is stdout)", "FILE..."}, {"properties", 'p', 0, G_OPTION_ARG_NONE, &sql_heavy_generator_write_properties, "Write properties instead of methods", NULL}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &sql_heavy_generator_sources, "SQLite databases", "DATABASE..."}, {NULL}};
 
114
static const GOptionEntry SQL_HEAVY_GENERATOR_options[7] = {{"metadata", 'm', 0, G_OPTION_ARG_FILENAME, &sql_heavy_generator_metadata_location, "Load metadata from FILE", "FILE..."}, {"vapidir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &sql_heavy_generator_vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..."}, {"pkg", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &sql_heavy_generator_packages, "Include binding for PACKAGE", "PACKAGE..."}, {"output", 'o', 0, G_OPTION_ARG_FILENAME, &sql_heavy_generator_output_location, "Output to FILE", "FILE..."}, {"properties", 'p', 0, G_OPTION_ARG_NONE, &sql_heavy_generator_write_properties, "Write properties instead of methods", NULL}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &sql_heavy_generator_sources, "SQLite databases", "DATABASE..."}, {NULL}};
114
115
 
115
116
GQuark sql_heavy_generator_error_quark (void) {
116
117
        return g_quark_from_static_string ("sql_heavy_generator_error-quark");
130
131
 
131
132
static ValaHashMap* sql_heavy_generator_get_symbol_properties (SQLHeavyGenerator* self, const gchar* symbol) {
132
133
        ValaHashMap* result = NULL;
133
 
        gpointer _tmp0_ = NULL;
 
134
        ValaHashMap* _tmp0_;
 
135
        const gchar* _tmp1_;
 
136
        gpointer _tmp2_ = NULL;
134
137
        ValaHashMap* map;
135
 
        ValaHashMap* _tmp1_ = NULL;
 
138
        ValaHashMap* _tmp3_;
 
139
        GHashFunc _tmp4_;
 
140
        GEqualFunc _tmp5_;
 
141
        GEqualFunc _tmp6_;
 
142
        ValaHashMap* _tmp7_;
 
143
        ValaHashMap* _tmp38_;
 
144
        const gchar* _tmp39_;
 
145
        ValaHashMap* _tmp40_;
136
146
        g_return_val_if_fail (self != NULL, NULL);
137
147
        g_return_val_if_fail (symbol != NULL, NULL);
138
 
        _tmp0_ = vala_map_get ((ValaMap*) self->priv->cache, symbol);
139
 
        map = (ValaHashMap*) _tmp0_;
140
 
        if (map != NULL) {
 
148
        _tmp0_ = self->priv->cache;
 
149
        _tmp1_ = symbol;
 
150
        _tmp2_ = vala_map_get ((ValaMap*) _tmp0_, _tmp1_);
 
151
        map = (ValaHashMap*) _tmp2_;
 
152
        _tmp3_ = map;
 
153
        if (_tmp3_ != NULL) {
141
154
                result = map;
142
155
                return result;
143
156
        }
144
 
        _tmp1_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_str_hash, g_str_equal, g_str_equal);
 
157
        _tmp4_ = g_str_hash;
 
158
        _tmp5_ = g_str_equal;
 
159
        _tmp6_ = g_str_equal;
 
160
        _tmp7_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp4_, _tmp5_, _tmp6_);
145
161
        _vala_map_unref0 (map);
146
 
        map = _tmp1_;
 
162
        map = _tmp7_;
147
163
        {
148
 
                ValaSet* _tmp2_ = NULL;
149
 
                ValaSet* _tmp3_;
150
 
                ValaIterator* _tmp4_ = NULL;
151
 
                ValaIterator* _tmp5_;
 
164
                ValaHashMap* _tmp8_;
 
165
                ValaSet* _tmp9_ = NULL;
 
166
                ValaSet* _tmp10_;
 
167
                ValaIterator* _tmp11_ = NULL;
 
168
                ValaIterator* _tmp12_;
152
169
                ValaIterator* _selector_it;
153
 
                _tmp2_ = vala_map_get_keys ((ValaMap*) self->priv->wildcard_cache);
154
 
                _tmp3_ = _tmp2_;
155
 
                _tmp4_ = vala_iterable_iterator ((ValaIterable*) _tmp3_);
156
 
                _tmp5_ = _tmp4_;
157
 
                _vala_iterable_unref0 (_tmp3_);
158
 
                _selector_it = _tmp5_;
 
170
                _tmp8_ = self->priv->wildcard_cache;
 
171
                _tmp9_ = vala_map_get_keys ((ValaMap*) _tmp8_);
 
172
                _tmp10_ = _tmp9_;
 
173
                _tmp11_ = vala_iterable_iterator ((ValaIterable*) _tmp10_);
 
174
                _tmp12_ = _tmp11_;
 
175
                _vala_iterable_unref0 (_tmp10_);
 
176
                _selector_it = _tmp12_;
159
177
                while (TRUE) {
160
 
                        gboolean _tmp6_;
161
 
                        gpointer _tmp7_ = NULL;
 
178
                        ValaIterator* _tmp13_;
 
179
                        gboolean _tmp14_ = FALSE;
 
180
                        ValaIterator* _tmp15_;
 
181
                        gpointer _tmp16_ = NULL;
162
182
                        gchar* selector;
163
 
                        gboolean _tmp8_;
164
 
                        _tmp6_ = vala_iterator_next (_selector_it);
165
 
                        if (!_tmp6_) {
 
183
                        const gchar* _tmp17_;
 
184
                        const gchar* _tmp18_;
 
185
                        gboolean _tmp19_ = FALSE;
 
186
                        _tmp13_ = _selector_it;
 
187
                        _tmp14_ = vala_iterator_next (_tmp13_);
 
188
                        if (!_tmp14_) {
166
189
                                break;
167
190
                        }
168
 
                        _tmp7_ = vala_iterator_get (_selector_it);
169
 
                        selector = (gchar*) _tmp7_;
170
 
                        _tmp8_ = g_pattern_match_simple (selector, symbol);
171
 
                        if (_tmp8_) {
172
 
                                gpointer _tmp9_ = NULL;
 
191
                        _tmp15_ = _selector_it;
 
192
                        _tmp16_ = vala_iterator_get (_tmp15_);
 
193
                        selector = (gchar*) _tmp16_;
 
194
                        _tmp17_ = selector;
 
195
                        _tmp18_ = symbol;
 
196
                        _tmp19_ = g_pattern_match_simple (_tmp17_, _tmp18_);
 
197
                        if (_tmp19_) {
 
198
                                ValaHashMap* _tmp20_;
 
199
                                const gchar* _tmp21_;
 
200
                                gpointer _tmp22_ = NULL;
173
201
                                ValaHashMap* wmap;
174
 
                                _tmp9_ = vala_map_get ((ValaMap*) self->priv->wildcard_cache, selector);
175
 
                                wmap = (ValaHashMap*) _tmp9_;
 
202
                                _tmp20_ = self->priv->wildcard_cache;
 
203
                                _tmp21_ = selector;
 
204
                                _tmp22_ = vala_map_get ((ValaMap*) _tmp20_, _tmp21_);
 
205
                                wmap = (ValaHashMap*) _tmp22_;
176
206
                                {
177
 
                                        ValaSet* _tmp10_ = NULL;
178
 
                                        ValaSet* _tmp11_;
179
 
                                        ValaIterator* _tmp12_ = NULL;
180
 
                                        ValaIterator* _tmp13_;
 
207
                                        ValaHashMap* _tmp23_;
 
208
                                        ValaSet* _tmp24_ = NULL;
 
209
                                        ValaSet* _tmp25_;
 
210
                                        ValaIterator* _tmp26_ = NULL;
 
211
                                        ValaIterator* _tmp27_;
181
212
                                        ValaIterator* _key_it;
182
 
                                        _tmp10_ = vala_map_get_keys ((ValaMap*) wmap);
183
 
                                        _tmp11_ = _tmp10_;
184
 
                                        _tmp12_ = vala_iterable_iterator ((ValaIterable*) _tmp11_);
185
 
                                        _tmp13_ = _tmp12_;
186
 
                                        _vala_iterable_unref0 (_tmp11_);
187
 
                                        _key_it = _tmp13_;
 
213
                                        _tmp23_ = wmap;
 
214
                                        _tmp24_ = vala_map_get_keys ((ValaMap*) _tmp23_);
 
215
                                        _tmp25_ = _tmp24_;
 
216
                                        _tmp26_ = vala_iterable_iterator ((ValaIterable*) _tmp25_);
 
217
                                        _tmp27_ = _tmp26_;
 
218
                                        _vala_iterable_unref0 (_tmp25_);
 
219
                                        _key_it = _tmp27_;
188
220
                                        while (TRUE) {
189
 
                                                gboolean _tmp14_;
190
 
                                                gpointer _tmp15_ = NULL;
 
221
                                                ValaIterator* _tmp28_;
 
222
                                                gboolean _tmp29_ = FALSE;
 
223
                                                ValaIterator* _tmp30_;
 
224
                                                gpointer _tmp31_ = NULL;
191
225
                                                gchar* key;
192
 
                                                gpointer _tmp16_ = NULL;
193
 
                                                gchar* _tmp17_;
194
 
                                                _tmp14_ = vala_iterator_next (_key_it);
195
 
                                                if (!_tmp14_) {
 
226
                                                ValaHashMap* _tmp32_;
 
227
                                                const gchar* _tmp33_;
 
228
                                                ValaHashMap* _tmp34_;
 
229
                                                const gchar* _tmp35_;
 
230
                                                gpointer _tmp36_ = NULL;
 
231
                                                gchar* _tmp37_;
 
232
                                                _tmp28_ = _key_it;
 
233
                                                _tmp29_ = vala_iterator_next (_tmp28_);
 
234
                                                if (!_tmp29_) {
196
235
                                                        break;
197
236
                                                }
198
 
                                                _tmp15_ = vala_iterator_get (_key_it);
199
 
                                                key = (gchar*) _tmp15_;
200
 
                                                _tmp16_ = vala_map_get ((ValaMap*) wmap, key);
201
 
                                                _tmp17_ = (gchar*) _tmp16_;
202
 
                                                vala_map_set ((ValaMap*) map, key, _tmp17_);
203
 
                                                _g_free0 (_tmp17_);
 
237
                                                _tmp30_ = _key_it;
 
238
                                                _tmp31_ = vala_iterator_get (_tmp30_);
 
239
                                                key = (gchar*) _tmp31_;
 
240
                                                _tmp32_ = map;
 
241
                                                _tmp33_ = key;
 
242
                                                _tmp34_ = wmap;
 
243
                                                _tmp35_ = key;
 
244
                                                _tmp36_ = vala_map_get ((ValaMap*) _tmp34_, _tmp35_);
 
245
                                                _tmp37_ = (gchar*) _tmp36_;
 
246
                                                vala_map_set ((ValaMap*) _tmp32_, _tmp33_, _tmp37_);
 
247
                                                _g_free0 (_tmp37_);
204
248
                                                _g_free0 (key);
205
249
                                        }
206
250
                                        _vala_iterator_unref0 (_key_it);
211
255
                }
212
256
                _vala_iterator_unref0 (_selector_it);
213
257
        }
214
 
        vala_map_set ((ValaMap*) self->priv->cache, symbol, map);
 
258
        _tmp38_ = self->priv->cache;
 
259
        _tmp39_ = symbol;
 
260
        _tmp40_ = map;
 
261
        vala_map_set ((ValaMap*) _tmp38_, _tmp39_, _tmp40_);
215
262
        result = map;
216
263
        return result;
217
264
}
218
265
 
219
266
 
220
267
static void sql_heavy_generator_set_symbol_property (SQLHeavyGenerator* self, const gchar* symbol, const gchar* key, const gchar* value) {
221
 
        ValaHashMap* _tmp0_ = NULL;
222
 
        ValaHashMap* _tmp1_;
 
268
        const gchar* _tmp0_;
 
269
        ValaHashMap* _tmp1_ = NULL;
 
270
        ValaHashMap* _tmp2_;
 
271
        const gchar* _tmp3_;
 
272
        const gchar* _tmp4_;
223
273
        g_return_if_fail (self != NULL);
224
274
        g_return_if_fail (symbol != NULL);
225
275
        g_return_if_fail (key != NULL);
226
276
        g_return_if_fail (value != NULL);
227
 
        _tmp0_ = sql_heavy_generator_get_symbol_properties (self, symbol);
228
 
        _tmp1_ = _tmp0_;
229
 
        vala_map_set ((ValaMap*) _tmp1_, key, value);
230
 
        _vala_map_unref0 (_tmp1_);
 
277
        _tmp0_ = symbol;
 
278
        _tmp1_ = sql_heavy_generator_get_symbol_properties (self, _tmp0_);
 
279
        _tmp2_ = _tmp1_;
 
280
        _tmp3_ = key;
 
281
        _tmp4_ = value;
 
282
        vala_map_set ((ValaMap*) _tmp2_, _tmp3_, _tmp4_);
 
283
        _vala_map_unref0 (_tmp2_);
231
284
}
232
285
 
233
286
 
234
287
static gchar* sql_heavy_generator_get_symbol_property (SQLHeavyGenerator* self, const gchar* symbol, const gchar* key) {
235
288
        gchar* result = NULL;
236
 
        ValaHashMap* _tmp0_ = NULL;
237
 
        ValaHashMap* _tmp1_;
238
 
        gpointer _tmp2_ = NULL;
239
 
        gchar* _tmp3_;
 
289
        const gchar* _tmp0_;
 
290
        ValaHashMap* _tmp1_ = NULL;
 
291
        ValaHashMap* _tmp2_;
 
292
        const gchar* _tmp3_;
 
293
        gpointer _tmp4_ = NULL;
 
294
        gchar* _tmp5_;
240
295
        g_return_val_if_fail (self != NULL, NULL);
241
296
        g_return_val_if_fail (symbol != NULL, NULL);
242
297
        g_return_val_if_fail (key != NULL, NULL);
243
 
        _tmp0_ = sql_heavy_generator_get_symbol_properties (self, symbol);
244
 
        _tmp1_ = _tmp0_;
245
 
        _tmp2_ = vala_map_get ((ValaMap*) _tmp1_, key);
246
 
        _tmp3_ = (gchar*) _tmp2_;
247
 
        _vala_map_unref0 (_tmp1_);
248
 
        result = _tmp3_;
 
298
        _tmp0_ = symbol;
 
299
        _tmp1_ = sql_heavy_generator_get_symbol_properties (self, _tmp0_);
 
300
        _tmp2_ = _tmp1_;
 
301
        _tmp3_ = key;
 
302
        _tmp4_ = vala_map_get ((ValaMap*) _tmp2_, _tmp3_);
 
303
        _tmp5_ = (gchar*) _tmp4_;
 
304
        _vala_map_unref0 (_tmp2_);
 
305
        result = _tmp5_;
249
306
        return result;
250
307
}
251
308
 
252
309
 
253
310
static const gchar* string_offset (const gchar* self, glong offset) {
254
311
        const gchar* result = NULL;
 
312
        glong _tmp0_;
255
313
        g_return_val_if_fail (self != NULL, NULL);
256
 
        result = (const gchar*) (((gchar*) self) + offset);
 
314
        _tmp0_ = offset;
 
315
        result = (const gchar*) (((gchar*) self) + _tmp0_);
257
316
        return result;
258
317
}
259
318
 
260
319
 
261
320
static gchar* sql_heavy_generator_get_symbol_name (SQLHeavyGenerator* self, const gchar* symbol) {
262
321
        gchar* result = NULL;
263
 
        gchar* _tmp0_ = NULL;
 
322
        const gchar* _tmp0_;
 
323
        gchar* _tmp1_ = NULL;
264
324
        gchar* sym;
 
325
        const gchar* _tmp2_;
265
326
        gint sym_t;
266
327
        gboolean tb;
267
328
        gboolean sb;
268
329
        gboolean tf;
269
 
        gint _tmp1_;
270
 
        GString* _tmp2_ = NULL;
 
330
        const gchar* _tmp3_;
 
331
        gint _tmp4_;
 
332
        gint _tmp5_;
 
333
        GString* _tmp6_;
271
334
        GString* name;
272
 
        gchar* _tmp25_;
 
335
        const gchar* _tmp80_;
 
336
        GString* _tmp81_;
 
337
        const gchar* _tmp82_;
 
338
        GString* _tmp83_;
 
339
        const gchar* _tmp84_;
 
340
        gchar* _tmp85_;
273
341
        g_return_val_if_fail (self != NULL, NULL);
274
342
        g_return_val_if_fail (symbol != NULL, NULL);
275
 
        _tmp0_ = sql_heavy_generator_get_symbol_property (self, symbol, "name");
276
 
        sym = _tmp0_;
277
 
        if (sym != NULL) {
 
343
        _tmp0_ = symbol;
 
344
        _tmp1_ = sql_heavy_generator_get_symbol_property (self, _tmp0_, "name");
 
345
        sym = _tmp1_;
 
346
        _tmp2_ = sym;
 
347
        if (_tmp2_ != NULL) {
278
348
                result = sym;
279
349
                return result;
280
350
        }
282
352
        tb = TRUE;
283
353
        sb = TRUE;
284
354
        tf = TRUE;
285
 
        _tmp1_ = strlen (symbol);
286
 
        _tmp2_ = g_string_sized_new ((gsize) (_tmp1_ * 2));
287
 
        name = _tmp2_;
 
355
        _tmp3_ = symbol;
 
356
        _tmp4_ = strlen (_tmp3_);
 
357
        _tmp5_ = _tmp4_;
 
358
        _tmp6_ = g_string_sized_new ((gsize) (_tmp5_ * 2));
 
359
        name = _tmp6_;
288
360
        {
289
 
                gchar* _tmp3_;
290
 
                gboolean _tmp4_;
291
 
                _tmp3_ = g_strdup (symbol);
 
361
                const gchar* _tmp7_;
 
362
                gchar* _tmp8_;
 
363
                gboolean _tmp9_;
 
364
                _tmp7_ = symbol;
 
365
                _tmp8_ = g_strdup (_tmp7_);
292
366
                _g_free0 (sym);
293
 
                sym = _tmp3_;
294
 
                _tmp4_ = TRUE;
 
367
                sym = _tmp8_;
 
368
                _tmp9_ = TRUE;
295
369
                while (TRUE) {
296
 
                        gunichar _tmp7_;
 
370
                        gboolean _tmp10_;
 
371
                        const gchar* _tmp14_;
 
372
                        gunichar _tmp15_ = 0U;
297
373
                        gunichar c;
298
 
                        gboolean _tmp9_ = FALSE;
299
 
                        gboolean _tmp10_;
300
 
                        gunichar _tmp20_ = 0U;
301
 
                        if (!_tmp4_) {
302
 
                                const gchar* _tmp5_ = NULL;
303
 
                                gchar* _tmp6_;
304
 
                                _tmp5_ = string_offset (sym, (glong) 1);
305
 
                                _tmp6_ = g_strdup (_tmp5_);
 
374
                        gunichar _tmp16_;
 
375
                        gboolean _tmp17_;
 
376
                        gunichar _tmp20_;
 
377
                        gboolean _tmp27_ = FALSE;
 
378
                        gunichar _tmp28_;
 
379
                        gboolean _tmp29_ = FALSE;
 
380
                        gboolean _tmp31_;
 
381
                        gunichar _tmp67_ = 0U;
 
382
                        gboolean _tmp68_;
 
383
                        GString* _tmp78_;
 
384
                        gunichar _tmp79_;
 
385
                        _tmp10_ = _tmp9_;
 
386
                        if (!_tmp10_) {
 
387
                                const gchar* _tmp11_;
 
388
                                const gchar* _tmp12_ = NULL;
 
389
                                gchar* _tmp13_;
 
390
                                _tmp11_ = sym;
 
391
                                _tmp12_ = string_offset (_tmp11_, (glong) 1);
 
392
                                _tmp13_ = g_strdup (_tmp12_);
306
393
                                _g_free0 (sym);
307
 
                                sym = _tmp6_;
 
394
                                sym = _tmp13_;
308
395
                        }
309
 
                        _tmp4_ = FALSE;
310
 
                        _tmp7_ = g_utf8_get_char_validated (sym, (gssize) (-1));
311
 
                        c = _tmp7_;
312
 
                        if (c <= 0) {
 
396
                        _tmp9_ = FALSE;
 
397
                        _tmp14_ = sym;
 
398
                        _tmp15_ = g_utf8_get_char_validated (_tmp14_, (gssize) (-1));
 
399
                        c = _tmp15_;
 
400
                        _tmp16_ = c;
 
401
                        if (_tmp16_ <= ((gunichar) 0)) {
313
402
                                break;
314
403
                        }
315
 
                        if (sb) {
316
 
                                if (c == '@') {
 
404
                        _tmp17_ = sb;
 
405
                        if (_tmp17_) {
 
406
                                gunichar _tmp18_;
 
407
                                _tmp18_ = c;
 
408
                                if (_tmp18_ == ((gunichar) '@')) {
317
409
                                        sym_t = 1;
318
410
                                        continue;
319
411
                                } else {
320
 
                                        if (c == '%') {
 
412
                                        gunichar _tmp19_;
 
413
                                        _tmp19_ = c;
 
414
                                        if (_tmp19_ == ((gunichar) '%')) {
321
415
                                                sym_t = 2;
322
416
                                                continue;
323
417
                                        }
324
418
                                }
325
419
                        }
326
 
                        if (c == '_') {
 
420
                        _tmp20_ = c;
 
421
                        if (_tmp20_ == ((gunichar) '_')) {
327
422
                                tb = TRUE;
328
423
                                tf = TRUE;
329
424
                                continue;
330
425
                        } else {
331
 
                                if (c == '/') {
332
 
                                        gint _tmp8_;
333
 
                                        _tmp8_ = MIN (3, sym_t + 1);
334
 
                                        sym_t = _tmp8_;
 
426
                                gunichar _tmp21_;
 
427
                                _tmp21_ = c;
 
428
                                if (_tmp21_ == ((gunichar) '/')) {
 
429
                                        gint _tmp22_;
 
430
                                        gint _tmp23_ = 0;
 
431
                                        gboolean _tmp24_;
 
432
                                        gboolean _tmp25_;
 
433
                                        GString* _tmp26_;
 
434
                                        _tmp22_ = sym_t;
 
435
                                        _tmp23_ = MIN (3, _tmp22_ + 1);
 
436
                                        sym_t = _tmp23_;
335
437
                                        sb = TRUE;
336
 
                                        tb = sb;
337
 
                                        tf = tb;
338
 
                                        g_string_truncate (name, (gsize) 0);
 
438
                                        _tmp24_ = sb;
 
439
                                        tb = _tmp24_;
 
440
                                        _tmp25_ = tb;
 
441
                                        tf = _tmp25_;
 
442
                                        _tmp26_ = name;
 
443
                                        g_string_truncate (_tmp26_, (gsize) 0);
339
444
                                        continue;
340
445
                                }
341
446
                        }
342
 
                        _tmp10_ = g_unichar_isupper (c);
343
 
                        if (_tmp10_) {
344
 
                                _tmp9_ = !tb;
 
447
                        _tmp28_ = c;
 
448
                        _tmp29_ = g_unichar_isupper (_tmp28_);
 
449
                        if (_tmp29_) {
 
450
                                gboolean _tmp30_;
 
451
                                _tmp30_ = tb;
 
452
                                _tmp27_ = !_tmp30_;
345
453
                        } else {
346
 
                                _tmp9_ = FALSE;
 
454
                                _tmp27_ = FALSE;
347
455
                        }
348
 
                        if (_tmp9_) {
349
 
                                gunichar _tmp11_ = 0U;
350
 
                                if (sym_t == 3) {
351
 
                                        g_string_append_c (name, '_');
 
456
                        _tmp31_ = _tmp27_;
 
457
                        if (_tmp31_) {
 
458
                                gint _tmp32_;
 
459
                                gunichar _tmp34_ = 0U;
 
460
                                gint _tmp35_;
 
461
                                GString* _tmp40_;
 
462
                                gunichar _tmp41_;
 
463
                                _tmp32_ = sym_t;
 
464
                                if (_tmp32_ == 3) {
 
465
                                        GString* _tmp33_;
 
466
                                        _tmp33_ = name;
 
467
                                        g_string_append_c (_tmp33_, '_');
352
468
                                }
353
469
                                tb = TRUE;
354
470
                                tf = FALSE;
355
 
                                if (sym_t == 3) {
356
 
                                        gunichar _tmp12_;
357
 
                                        _tmp12_ = g_unichar_tolower (c);
358
 
                                        _tmp11_ = _tmp12_;
 
471
                                _tmp35_ = sym_t;
 
472
                                if (_tmp35_ == 3) {
 
473
                                        gunichar _tmp36_;
 
474
                                        gunichar _tmp37_ = 0U;
 
475
                                        _tmp36_ = c;
 
476
                                        _tmp37_ = g_unichar_tolower (_tmp36_);
 
477
                                        _tmp34_ = _tmp37_;
359
478
                                } else {
360
 
                                        gunichar _tmp13_;
361
 
                                        _tmp13_ = g_unichar_toupper (c);
362
 
                                        _tmp11_ = _tmp13_;
 
479
                                        gunichar _tmp38_;
 
480
                                        gunichar _tmp39_ = 0U;
 
481
                                        _tmp38_ = c;
 
482
                                        _tmp39_ = g_unichar_toupper (_tmp38_);
 
483
                                        _tmp34_ = _tmp39_;
363
484
                                }
364
 
                                g_string_append_unichar (name, _tmp11_);
 
485
                                _tmp40_ = name;
 
486
                                _tmp41_ = _tmp34_;
 
487
                                g_string_append_unichar (_tmp40_, _tmp41_);
365
488
                                continue;
366
489
                        } else {
367
 
                                gboolean _tmp14_ = FALSE;
368
 
                                gboolean _tmp15_;
369
 
                                _tmp15_ = g_unichar_islower (c);
370
 
                                if (_tmp15_) {
371
 
                                        _tmp14_ = tb;
 
490
                                gboolean _tmp42_ = FALSE;
 
491
                                gunichar _tmp43_;
 
492
                                gboolean _tmp44_ = FALSE;
 
493
                                gboolean _tmp46_;
 
494
                                _tmp43_ = c;
 
495
                                _tmp44_ = g_unichar_islower (_tmp43_);
 
496
                                if (_tmp44_) {
 
497
                                        gboolean _tmp45_;
 
498
                                        _tmp45_ = tb;
 
499
                                        _tmp42_ = _tmp45_;
372
500
                                } else {
373
 
                                        _tmp14_ = FALSE;
 
501
                                        _tmp42_ = FALSE;
374
502
                                }
375
 
                                if (_tmp14_) {
376
 
                                        gboolean _tmp16_ = FALSE;
377
 
                                        if (tf) {
378
 
                                                _tmp16_ = sym_t != 3;
 
503
                                _tmp46_ = _tmp42_;
 
504
                                if (_tmp46_) {
 
505
                                        gboolean _tmp47_ = FALSE;
 
506
                                        gboolean _tmp48_;
 
507
                                        gboolean _tmp50_;
 
508
                                        gboolean _tmp66_;
 
509
                                        _tmp48_ = tf;
 
510
                                        if (_tmp48_) {
 
511
                                                gint _tmp49_;
 
512
                                                _tmp49_ = sym_t;
 
513
                                                _tmp47_ = _tmp49_ != 3;
379
514
                                        } else {
380
 
                                                _tmp16_ = FALSE;
 
515
                                                _tmp47_ = FALSE;
381
516
                                        }
382
 
                                        if (_tmp16_) {
383
 
                                                gunichar _tmp17_;
384
 
                                                _tmp17_ = g_unichar_toupper (c);
385
 
                                                g_string_append_unichar (name, _tmp17_);
 
517
                                        _tmp50_ = _tmp47_;
 
518
                                        if (_tmp50_) {
 
519
                                                GString* _tmp51_;
 
520
                                                gunichar _tmp52_;
 
521
                                                gunichar _tmp53_ = 0U;
 
522
                                                _tmp51_ = name;
 
523
                                                _tmp52_ = c;
 
524
                                                _tmp53_ = g_unichar_toupper (_tmp52_);
 
525
                                                g_string_append_unichar (_tmp51_, _tmp53_);
386
526
                                        } else {
387
 
                                                gboolean _tmp18_ = FALSE;
388
 
                                                gboolean _tmp19_ = FALSE;
389
 
                                                if (tf) {
390
 
                                                        _tmp19_ = !sb;
391
 
                                                } else {
392
 
                                                        _tmp19_ = FALSE;
393
 
                                                }
394
 
                                                if (_tmp19_) {
395
 
                                                        _tmp18_ = sym_t == 3;
396
 
                                                } else {
397
 
                                                        _tmp18_ = FALSE;
398
 
                                                }
399
 
                                                if (_tmp18_) {
400
 
                                                        g_string_append_c (name, '_');
401
 
                                                        g_string_append_unichar (name, c);
402
 
                                                } else {
403
 
                                                        g_string_append_unichar (name, c);
 
527
                                                gboolean _tmp54_ = FALSE;
 
528
                                                gboolean _tmp55_ = FALSE;
 
529
                                                gboolean _tmp56_;
 
530
                                                gboolean _tmp58_;
 
531
                                                gboolean _tmp60_;
 
532
                                                _tmp56_ = tf;
 
533
                                                if (_tmp56_) {
 
534
                                                        gboolean _tmp57_;
 
535
                                                        _tmp57_ = sb;
 
536
                                                        _tmp55_ = !_tmp57_;
 
537
                                                } else {
 
538
                                                        _tmp55_ = FALSE;
 
539
                                                }
 
540
                                                _tmp58_ = _tmp55_;
 
541
                                                if (_tmp58_) {
 
542
                                                        gint _tmp59_;
 
543
                                                        _tmp59_ = sym_t;
 
544
                                                        _tmp54_ = _tmp59_ == 3;
 
545
                                                } else {
 
546
                                                        _tmp54_ = FALSE;
 
547
                                                }
 
548
                                                _tmp60_ = _tmp54_;
 
549
                                                if (_tmp60_) {
 
550
                                                        GString* _tmp61_;
 
551
                                                        GString* _tmp62_;
 
552
                                                        gunichar _tmp63_;
 
553
                                                        _tmp61_ = name;
 
554
                                                        g_string_append_c (_tmp61_, '_');
 
555
                                                        _tmp62_ = name;
 
556
                                                        _tmp63_ = c;
 
557
                                                        g_string_append_unichar (_tmp62_, _tmp63_);
 
558
                                                } else {
 
559
                                                        GString* _tmp64_;
 
560
                                                        gunichar _tmp65_;
 
561
                                                        _tmp64_ = name;
 
562
                                                        _tmp65_ = c;
 
563
                                                        g_string_append_unichar (_tmp64_, _tmp65_);
404
564
                                                }
405
565
                                        }
406
566
                                        tf = FALSE;
407
 
                                        tb = tf;
 
567
                                        _tmp66_ = tf;
 
568
                                        tb = _tmp66_;
408
569
                                        continue;
409
570
                                }
410
571
                        }
411
572
                        sb = FALSE;
412
 
                        if (tb) {
413
 
                                gunichar _tmp21_ = 0U;
414
 
                                if (sym_t == 3) {
415
 
                                        gunichar _tmp22_;
416
 
                                        _tmp22_ = g_unichar_tolower (c);
417
 
                                        _tmp21_ = _tmp22_;
 
573
                        _tmp68_ = tb;
 
574
                        if (_tmp68_) {
 
575
                                gunichar _tmp69_ = 0U;
 
576
                                gint _tmp70_;
 
577
                                gunichar _tmp75_;
 
578
                                _tmp70_ = sym_t;
 
579
                                if (_tmp70_ == 3) {
 
580
                                        gunichar _tmp71_;
 
581
                                        gunichar _tmp72_ = 0U;
 
582
                                        _tmp71_ = c;
 
583
                                        _tmp72_ = g_unichar_tolower (_tmp71_);
 
584
                                        _tmp69_ = _tmp72_;
418
585
                                } else {
419
 
                                        gunichar _tmp23_;
420
 
                                        _tmp23_ = g_unichar_toupper (c);
421
 
                                        _tmp21_ = _tmp23_;
 
586
                                        gunichar _tmp73_;
 
587
                                        gunichar _tmp74_ = 0U;
 
588
                                        _tmp73_ = c;
 
589
                                        _tmp74_ = g_unichar_toupper (_tmp73_);
 
590
                                        _tmp69_ = _tmp74_;
422
591
                                }
423
 
                                _tmp20_ = _tmp21_;
 
592
                                _tmp75_ = _tmp69_;
 
593
                                _tmp67_ = _tmp75_;
424
594
                        } else {
425
 
                                gunichar _tmp24_;
426
 
                                _tmp24_ = g_unichar_tolower (c);
427
 
                                _tmp20_ = _tmp24_;
 
595
                                gunichar _tmp76_;
 
596
                                gunichar _tmp77_ = 0U;
 
597
                                _tmp76_ = c;
 
598
                                _tmp77_ = g_unichar_tolower (_tmp76_);
 
599
                                _tmp67_ = _tmp77_;
428
600
                        }
429
 
                        g_string_append_unichar (name, _tmp20_);
 
601
                        _tmp78_ = name;
 
602
                        _tmp79_ = _tmp67_;
 
603
                        g_string_append_unichar (_tmp78_, _tmp79_);
430
604
                        tf = FALSE;
431
605
                }
432
606
        }
433
 
        sql_heavy_generator_set_symbol_property (self, symbol, "name", name->str);
434
 
        _tmp25_ = g_strdup (name->str);
435
 
        result = _tmp25_;
 
607
        _tmp80_ = symbol;
 
608
        _tmp81_ = name;
 
609
        _tmp82_ = _tmp81_->str;
 
610
        sql_heavy_generator_set_symbol_property (self, _tmp80_, "name", _tmp82_);
 
611
        _tmp83_ = name;
 
612
        _tmp84_ = _tmp83_->str;
 
613
        _tmp85_ = g_strdup (_tmp84_);
 
614
        result = _tmp85_;
436
615
        _g_string_free0 (name);
437
616
        _g_free0 (sym);
438
617
        return result;
441
620
 
442
621
gboolean sql_heavy_generator_symbol_is_hidden (SQLHeavyGenerator* self, const gchar* symbol) {
443
622
        gboolean result = FALSE;
444
 
        gchar* _tmp0_ = NULL;
 
623
        const gchar* _tmp0_;
 
624
        gchar* _tmp1_ = NULL;
445
625
        gchar* p;
446
 
        gboolean _tmp1_ = FALSE;
 
626
        gboolean _tmp2_ = FALSE;
 
627
        const gchar* _tmp3_;
 
628
        gboolean _tmp11_;
447
629
        g_return_val_if_fail (self != NULL, FALSE);
448
630
        g_return_val_if_fail (symbol != NULL, FALSE);
449
 
        _tmp0_ = sql_heavy_generator_get_symbol_property (self, symbol, "hidden");
450
 
        p = _tmp0_;
451
 
        if (p != NULL) {
452
 
                gboolean _tmp2_ = FALSE;
453
 
                gboolean _tmp3_ = FALSE;
454
 
                if (g_strcmp0 (p, "1") == 0) {
455
 
                        _tmp3_ = TRUE;
456
 
                } else {
457
 
                        _tmp3_ = g_strcmp0 (p, "true") == 0;
458
 
                }
459
 
                if (_tmp3_) {
460
 
                        _tmp2_ = TRUE;
461
 
                } else {
462
 
                        _tmp2_ = g_strcmp0 (p, "yes") == 0;
463
 
                }
464
 
                _tmp1_ = _tmp2_;
 
631
        _tmp0_ = symbol;
 
632
        _tmp1_ = sql_heavy_generator_get_symbol_property (self, _tmp0_, "hidden");
 
633
        p = _tmp1_;
 
634
        _tmp3_ = p;
 
635
        if (_tmp3_ != NULL) {
 
636
                gboolean _tmp4_ = FALSE;
 
637
                gboolean _tmp5_ = FALSE;
 
638
                const gchar* _tmp6_;
 
639
                gboolean _tmp8_;
 
640
                gboolean _tmp10_;
 
641
                _tmp6_ = p;
 
642
                if (g_strcmp0 (_tmp6_, "1") == 0) {
 
643
                        _tmp5_ = TRUE;
 
644
                } else {
 
645
                        const gchar* _tmp7_;
 
646
                        _tmp7_ = p;
 
647
                        _tmp5_ = g_strcmp0 (_tmp7_, "true") == 0;
 
648
                }
 
649
                _tmp8_ = _tmp5_;
 
650
                if (_tmp8_) {
 
651
                        _tmp4_ = TRUE;
 
652
                } else {
 
653
                        const gchar* _tmp9_;
 
654
                        _tmp9_ = p;
 
655
                        _tmp4_ = g_strcmp0 (_tmp9_, "yes") == 0;
 
656
                }
 
657
                _tmp10_ = _tmp4_;
 
658
                _tmp2_ = _tmp10_;
465
659
        } else {
466
 
                _tmp1_ = FALSE;
 
660
                _tmp2_ = FALSE;
467
661
        }
468
 
        result = _tmp1_;
 
662
        _tmp11_ = _tmp2_;
 
663
        result = _tmp11_;
469
664
        _g_free0 (p);
470
665
        return result;
471
666
}
473
668
 
474
669
static glong string_strnlen (gchar* str, glong maxlen) {
475
670
        glong result = 0L;
476
 
        gchar* _tmp0_ = NULL;
 
671
        gchar* _tmp0_;
 
672
        glong _tmp1_;
 
673
        gchar* _tmp2_ = NULL;
477
674
        gchar* end;
478
 
        _tmp0_ = memchr (str, 0, (gsize) maxlen);
479
 
        end = _tmp0_;
480
 
        if (end == NULL) {
481
 
                result = maxlen;
 
675
        gchar* _tmp3_;
 
676
        _tmp0_ = str;
 
677
        _tmp1_ = maxlen;
 
678
        _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
 
679
        end = _tmp2_;
 
680
        _tmp3_ = end;
 
681
        if (_tmp3_ == NULL) {
 
682
                glong _tmp4_;
 
683
                _tmp4_ = maxlen;
 
684
                result = _tmp4_;
482
685
                return result;
483
686
        } else {
484
 
                result = (glong) (end - str);
 
687
                gchar* _tmp5_;
 
688
                gchar* _tmp6_;
 
689
                _tmp5_ = end;
 
690
                _tmp6_ = str;
 
691
                result = (glong) (_tmp5_ - _tmp6_);
485
692
                return result;
486
693
        }
487
694
}
491
698
        gchar* result = NULL;
492
699
        glong string_length = 0L;
493
700
        gboolean _tmp0_ = FALSE;
494
 
        gchar* _tmp3_ = NULL;
 
701
        glong _tmp1_;
 
702
        gboolean _tmp3_;
 
703
        glong _tmp9_;
 
704
        glong _tmp15_;
 
705
        glong _tmp18_;
 
706
        glong _tmp19_;
 
707
        glong _tmp20_;
 
708
        glong _tmp21_;
 
709
        glong _tmp22_;
 
710
        gchar* _tmp23_ = NULL;
495
711
        g_return_val_if_fail (self != NULL, NULL);
496
 
        if (offset >= 0) {
497
 
                _tmp0_ = len >= 0;
 
712
        _tmp1_ = offset;
 
713
        if (_tmp1_ >= ((glong) 0)) {
 
714
                glong _tmp2_;
 
715
                _tmp2_ = len;
 
716
                _tmp0_ = _tmp2_ >= ((glong) 0);
498
717
        } else {
499
718
                _tmp0_ = FALSE;
500
719
        }
501
 
        if (_tmp0_) {
502
 
                glong _tmp1_;
503
 
                _tmp1_ = string_strnlen ((gchar*) self, offset + len);
504
 
                string_length = _tmp1_;
505
 
        } else {
506
 
                gint _tmp2_;
507
 
                _tmp2_ = strlen (self);
508
 
                string_length = (glong) _tmp2_;
509
 
        }
510
 
        if (offset < 0) {
511
 
                offset = string_length + offset;
512
 
                g_return_val_if_fail (offset >= 0, NULL);
513
 
        } else {
514
 
                g_return_val_if_fail (offset <= string_length, NULL);
515
 
        }
516
 
        if (len < 0) {
517
 
                len = string_length - offset;
518
 
        }
519
 
        g_return_val_if_fail ((offset + len) <= string_length, NULL);
520
 
        _tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
521
 
        result = _tmp3_;
 
720
        _tmp3_ = _tmp0_;
 
721
        if (_tmp3_) {
 
722
                glong _tmp4_;
 
723
                glong _tmp5_;
 
724
                glong _tmp6_ = 0L;
 
725
                _tmp4_ = offset;
 
726
                _tmp5_ = len;
 
727
                _tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
 
728
                string_length = _tmp6_;
 
729
        } else {
 
730
                gint _tmp7_;
 
731
                gint _tmp8_;
 
732
                _tmp7_ = strlen (self);
 
733
                _tmp8_ = _tmp7_;
 
734
                string_length = (glong) _tmp8_;
 
735
        }
 
736
        _tmp9_ = offset;
 
737
        if (_tmp9_ < ((glong) 0)) {
 
738
                glong _tmp10_;
 
739
                glong _tmp11_;
 
740
                glong _tmp12_;
 
741
                _tmp10_ = string_length;
 
742
                _tmp11_ = offset;
 
743
                offset = _tmp10_ + _tmp11_;
 
744
                _tmp12_ = offset;
 
745
                g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
 
746
        } else {
 
747
                glong _tmp13_;
 
748
                glong _tmp14_;
 
749
                _tmp13_ = offset;
 
750
                _tmp14_ = string_length;
 
751
                g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
 
752
        }
 
753
        _tmp15_ = len;
 
754
        if (_tmp15_ < ((glong) 0)) {
 
755
                glong _tmp16_;
 
756
                glong _tmp17_;
 
757
                _tmp16_ = string_length;
 
758
                _tmp17_ = offset;
 
759
                len = _tmp16_ - _tmp17_;
 
760
        }
 
761
        _tmp18_ = offset;
 
762
        _tmp19_ = len;
 
763
        _tmp20_ = string_length;
 
764
        g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
 
765
        _tmp21_ = offset;
 
766
        _tmp22_ = len;
 
767
        _tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
 
768
        result = _tmp23_;
522
769
        return result;
523
770
}
524
771
 
526
773
static ValaDataType* sql_heavy_generator_type_from_string (const gchar* datatype) {
527
774
        ValaDataType* result = NULL;
528
775
        gboolean is_array;
529
 
        gchar* _tmp0_;
 
776
        const gchar* _tmp0_;
 
777
        gchar* _tmp1_;
530
778
        gchar* internal_datatype;
531
779
        ValaUnresolvedSymbol* symbol;
532
 
        gboolean _tmp1_;
533
 
        gchar** _tmp3_;
534
 
        gchar** _tmp4_ = NULL;
535
 
        ValaUnresolvedType* _tmp6_ = NULL;
 
780
        const gchar* _tmp2_;
 
781
        gboolean _tmp3_ = FALSE;
 
782
        const gchar* _tmp6_;
 
783
        gchar** _tmp7_;
 
784
        gchar** _tmp8_ = NULL;
 
785
        ValaUnresolvedSymbol* _tmp12_;
 
786
        ValaUnresolvedType* _tmp13_;
536
787
        ValaUnresolvedType* data_type;
 
788
        gboolean _tmp14_;
537
789
        g_return_val_if_fail (datatype != NULL, NULL);
538
790
        is_array = FALSE;
539
 
        _tmp0_ = g_strdup (datatype);
540
 
        internal_datatype = _tmp0_;
 
791
        _tmp0_ = datatype;
 
792
        _tmp1_ = g_strdup (_tmp0_);
 
793
        internal_datatype = _tmp1_;
541
794
        symbol = NULL;
542
 
        _tmp1_ = g_str_has_suffix (datatype, "[]");
543
 
        if (_tmp1_) {
544
 
                gchar* _tmp2_ = NULL;
545
 
                _tmp2_ = string_substring (internal_datatype, (glong) 0, (glong) (-2));
 
795
        _tmp2_ = datatype;
 
796
        _tmp3_ = g_str_has_suffix (_tmp2_, "[]");
 
797
        if (_tmp3_) {
 
798
                const gchar* _tmp4_;
 
799
                gchar* _tmp5_ = NULL;
 
800
                _tmp4_ = internal_datatype;
 
801
                _tmp5_ = string_substring (_tmp4_, (glong) 0, (glong) (-2));
546
802
                _g_free0 (internal_datatype);
547
 
                internal_datatype = _tmp2_;
 
803
                internal_datatype = _tmp5_;
548
804
                is_array = TRUE;
549
805
        }
550
 
        _tmp4_ = _tmp3_ = g_strsplit (internal_datatype, ".", 0);
 
806
        _tmp6_ = internal_datatype;
 
807
        _tmp8_ = _tmp7_ = g_strsplit (_tmp6_, ".", 0);
551
808
        {
552
 
                gchar** m_collection;
553
 
                int m_collection_length1;
554
 
                int m_it;
555
 
                m_collection = _tmp4_;
556
 
                m_collection_length1 = _vala_array_length (_tmp3_);
557
 
                for (m_it = 0; m_it < _vala_array_length (_tmp3_); m_it = m_it + 1) {
558
 
                        const gchar* m;
 
809
                gchar** m_collection = NULL;
 
810
                gint m_collection_length1 = 0;
 
811
                gint _m_collection_size_ = 0;
 
812
                gint m_it = 0;
 
813
                m_collection = _tmp8_;
 
814
                m_collection_length1 = _vala_array_length (_tmp7_);
 
815
                for (m_it = 0; m_it < _vala_array_length (_tmp7_); m_it = m_it + 1) {
 
816
                        const gchar* m = NULL;
559
817
                        m = m_collection[m_it];
560
818
                        {
561
 
                                ValaUnresolvedSymbol* _tmp5_ = NULL;
562
 
                                _tmp5_ = vala_unresolved_symbol_new (symbol, m, NULL);
 
819
                                ValaUnresolvedSymbol* _tmp9_;
 
820
                                const gchar* _tmp10_;
 
821
                                ValaUnresolvedSymbol* _tmp11_;
 
822
                                _tmp9_ = symbol;
 
823
                                _tmp10_ = m;
 
824
                                _tmp11_ = vala_unresolved_symbol_new (_tmp9_, _tmp10_, NULL);
563
825
                                _vala_code_node_unref0 (symbol);
564
 
                                symbol = _tmp5_;
 
826
                                symbol = _tmp11_;
565
827
                        }
566
828
                }
567
829
                m_collection = (_vala_array_free (m_collection, m_collection_length1, (GDestroyNotify) g_free), NULL);
568
830
        }
569
 
        _tmp6_ = vala_unresolved_type_new_from_symbol (symbol, NULL);
570
 
        data_type = _tmp6_;
571
 
        if (is_array) {
572
 
                ValaArrayType* _tmp7_ = NULL;
573
 
                _tmp7_ = vala_array_type_new ((ValaDataType*) data_type, 1, NULL);
574
 
                result = (ValaDataType*) _tmp7_;
 
831
        _tmp12_ = symbol;
 
832
        _tmp13_ = vala_unresolved_type_new_from_symbol (_tmp12_, NULL);
 
833
        data_type = _tmp13_;
 
834
        _tmp14_ = is_array;
 
835
        if (_tmp14_) {
 
836
                ValaUnresolvedType* _tmp15_;
 
837
                ValaArrayType* _tmp16_;
 
838
                _tmp15_ = data_type;
 
839
                _tmp16_ = vala_array_type_new ((ValaDataType*) _tmp15_, 1, NULL);
 
840
                result = (ValaDataType*) _tmp16_;
575
841
                _vala_code_node_unref0 (data_type);
576
842
                _vala_code_node_unref0 (symbol);
577
843
                _g_free0 (internal_datatype);
590
856
 
591
857
static ValaDataType* sql_heavy_generator_get_data_type (SQLHeavyGenerator* self, const gchar* symbol) {
592
858
        ValaDataType* result = NULL;
593
 
        gchar* _tmp0_ = NULL;
 
859
        const gchar* _tmp0_;
 
860
        gchar* _tmp1_ = NULL;
594
861
        gchar* name;
595
 
        ValaDataType* _tmp1_ = NULL;
 
862
        ValaDataType* _tmp2_ = NULL;
 
863
        const gchar* _tmp3_;
596
864
        g_return_val_if_fail (self != NULL, NULL);
597
865
        g_return_val_if_fail (symbol != NULL, NULL);
598
 
        _tmp0_ = sql_heavy_generator_get_symbol_property (self, symbol, "type");
599
 
        name = _tmp0_;
600
 
        if (name == NULL) {
601
 
                _vala_code_node_unref0 (_tmp1_);
602
 
                _tmp1_ = NULL;
 
866
        _tmp0_ = symbol;
 
867
        _tmp1_ = sql_heavy_generator_get_symbol_property (self, _tmp0_, "type");
 
868
        name = _tmp1_;
 
869
        _tmp3_ = name;
 
870
        if (_tmp3_ == NULL) {
 
871
                _vala_code_node_unref0 (_tmp2_);
 
872
                _tmp2_ = NULL;
603
873
        } else {
604
 
                ValaDataType* _tmp2_ = NULL;
605
 
                _tmp2_ = sql_heavy_generator_type_from_string (name);
606
 
                _vala_code_node_unref0 (_tmp1_);
607
 
                _tmp1_ = _tmp2_;
 
874
                const gchar* _tmp4_;
 
875
                ValaDataType* _tmp5_ = NULL;
 
876
                _tmp4_ = name;
 
877
                _tmp5_ = sql_heavy_generator_type_from_string (_tmp4_);
 
878
                _vala_code_node_unref0 (_tmp2_);
 
879
                _tmp2_ = _tmp5_;
608
880
        }
609
 
        result = _tmp1_;
 
881
        result = _tmp2_;
610
882
        _g_free0 (name);
611
883
        return result;
612
884
}
622
894
 
623
895
static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
624
896
        gchar* result = NULL;
625
 
        gchar* _tmp0_ = NULL;
626
 
        gchar* _tmp1_;
627
 
        GRegex* _tmp2_ = NULL;
628
 
        GRegex* _tmp3_;
629
 
        GRegex* regex;
630
 
        gchar* _tmp4_ = NULL;
631
 
        gchar* _tmp5_;
632
897
        GError * _inner_error_ = NULL;
633
898
        g_return_val_if_fail (self != NULL, NULL);
634
899
        g_return_val_if_fail (old != NULL, NULL);
635
900
        g_return_val_if_fail (replacement != NULL, NULL);
636
 
        _tmp0_ = g_regex_escape_string (old, -1);
637
 
        _tmp1_ = _tmp0_;
638
 
        _tmp2_ = g_regex_new (_tmp1_, 0, 0, &_inner_error_);
639
 
        _tmp3_ = _tmp2_;
640
 
        _g_free0 (_tmp1_);
641
 
        regex = _tmp3_;
642
 
        if (_inner_error_ != NULL) {
643
 
                if (_inner_error_->domain == G_REGEX_ERROR) {
644
 
                        goto __catch0_g_regex_error;
645
 
                }
646
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
647
 
                g_clear_error (&_inner_error_);
648
 
                return NULL;
649
 
        }
650
 
        _tmp4_ = g_regex_replace_literal (regex, self, (gssize) (-1), 0, replacement, 0, &_inner_error_);
651
 
        _tmp5_ = _tmp4_;
652
 
        if (_inner_error_ != NULL) {
653
 
                _g_regex_unref0 (regex);
654
 
                if (_inner_error_->domain == G_REGEX_ERROR) {
655
 
                        goto __catch0_g_regex_error;
656
 
                }
657
 
                _g_regex_unref0 (regex);
658
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
659
 
                g_clear_error (&_inner_error_);
660
 
                return NULL;
661
 
        }
662
 
        result = _tmp5_;
663
 
        _g_regex_unref0 (regex);
664
 
        return result;
665
 
        _g_regex_unref0 (regex);
 
901
        {
 
902
                const gchar* _tmp0_;
 
903
                gchar* _tmp1_ = NULL;
 
904
                gchar* _tmp2_;
 
905
                GRegex* _tmp3_;
 
906
                GRegex* _tmp4_;
 
907
                GRegex* regex;
 
908
                GRegex* _tmp5_;
 
909
                const gchar* _tmp6_;
 
910
                gchar* _tmp7_ = NULL;
 
911
                gchar* _tmp8_;
 
912
                _tmp0_ = old;
 
913
                _tmp1_ = g_regex_escape_string (_tmp0_, -1);
 
914
                _tmp2_ = _tmp1_;
 
915
                _tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
 
916
                _tmp4_ = _tmp3_;
 
917
                _g_free0 (_tmp2_);
 
918
                regex = _tmp4_;
 
919
                if (_inner_error_ != NULL) {
 
920
                        if (_inner_error_->domain == G_REGEX_ERROR) {
 
921
                                goto __catch0_g_regex_error;
 
922
                        }
 
923
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
924
                        g_clear_error (&_inner_error_);
 
925
                        return NULL;
 
926
                }
 
927
                _tmp5_ = regex;
 
928
                _tmp6_ = replacement;
 
929
                _tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_);
 
930
                _tmp8_ = _tmp7_;
 
931
                if (_inner_error_ != NULL) {
 
932
                        _g_regex_unref0 (regex);
 
933
                        if (_inner_error_->domain == G_REGEX_ERROR) {
 
934
                                goto __catch0_g_regex_error;
 
935
                        }
 
936
                        _g_regex_unref0 (regex);
 
937
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
938
                        g_clear_error (&_inner_error_);
 
939
                        return NULL;
 
940
                }
 
941
                result = _tmp8_;
 
942
                _g_regex_unref0 (regex);
 
943
                return result;
 
944
        }
666
945
        goto __finally0;
667
946
        __catch0_g_regex_error:
668
947
        {
669
 
                GError * e;
 
948
                GError* e = NULL;
670
949
                e = _inner_error_;
671
950
                _inner_error_ = NULL;
672
951
                g_assert_not_reached ();
681
960
}
682
961
 
683
962
 
684
 
static void sql_heavy_generator_parse_field (SQLHeavyGenerator* self, SQLHeavyTable* table, gint field, ValaClass* cl, ValaSwitchStatement* signals, GError** error) {
685
 
        SQLHeavyQueryable* _tmp0_ = NULL;
686
 
        SQLHeavyDatabase* _tmp1_ = NULL;
 
963
static void sql_heavy_generator_parse_field (SQLHeavyGenerator* self, SQLHeavyTable* table, gint field, ValaClass* cl, ValaSwitchStatement* signals, ValaSourceReference* source_reference, GError** error) {
 
964
        SQLHeavyTable* _tmp0_;
 
965
        SQLHeavyQueryable* _tmp1_;
 
966
        SQLHeavyQueryable* _tmp2_;
 
967
        SQLHeavyDatabase* _tmp3_;
 
968
        SQLHeavyDatabase* _tmp4_;
687
969
        SQLHeavyDatabase* db;
688
 
        const gchar* _tmp2_ = NULL;
689
 
        gchar* _tmp3_ = NULL;
690
 
        gchar* _tmp4_;
691
 
        gchar** _tmp5_;
692
 
        gchar** _tmp6_ = NULL;
693
 
        gchar** _tmp7_;
694
 
        gint _tmp7__length1;
695
 
        gchar* _tmp8_;
 
970
        SQLHeavyDatabase* _tmp5_;
 
971
        const gchar* _tmp6_;
 
972
        const gchar* _tmp7_;
 
973
        gchar* _tmp8_ = NULL;
696
974
        gchar* _tmp9_;
 
975
        gchar** _tmp10_;
 
976
        gchar** _tmp11_ = NULL;
 
977
        gchar** _tmp12_;
 
978
        gint _tmp12__length1;
 
979
        const gchar* _tmp13_;
 
980
        gchar* _tmp14_;
 
981
        gchar* _tmp15_;
697
982
        gchar* db_symbol;
698
 
        gchar* _tmp10_ = NULL;
699
 
        gchar* _tmp11_;
700
 
        gchar* _tmp12_ = NULL;
701
 
        gchar* _tmp13_;
702
 
        const gchar* _tmp14_ = NULL;
703
 
        const gchar* _tmp15_ = NULL;
704
 
        const gchar* _tmp16_ = NULL;
705
 
        gchar* _tmp17_;
706
 
        const gchar* _tmp18_ = NULL;
707
 
        gchar* _tmp19_ = NULL;
708
 
        gchar* _tmp20_;
709
 
        gchar* symbol;
 
983
        SQLHeavyTable* _tmp16_;
 
984
        gint _tmp17_;
 
985
        gchar* _tmp18_ = NULL;
 
986
        gchar* _tmp19_;
 
987
        const gchar* _tmp20_;
710
988
        gchar* _tmp21_ = NULL;
 
989
        gchar* _tmp22_;
 
990
        const gchar* _tmp23_ = NULL;
 
991
        SQLHeavyTable* _tmp24_;
 
992
        const gchar* _tmp25_;
 
993
        const gchar* _tmp26_;
 
994
        const gchar* _tmp27_ = NULL;
 
995
        gchar* _tmp28_;
 
996
        const gchar* _tmp29_ = NULL;
 
997
        gchar* _tmp30_ = NULL;
 
998
        gchar* _tmp31_;
 
999
        gchar* symbol;
 
1000
        const gchar* _tmp32_;
 
1001
        gchar* _tmp33_ = NULL;
711
1002
        gchar* name;
712
 
        gboolean _tmp22_;
713
 
        ValaDataType* _tmp23_ = NULL;
 
1003
        const gchar* _tmp34_;
 
1004
        gboolean _tmp35_ = FALSE;
 
1005
        const gchar* _tmp36_;
 
1006
        ValaDataType* _tmp37_ = NULL;
714
1007
        ValaDataType* data_type;
715
 
        ValaDataType* _tmp46_ = NULL;
 
1008
        ValaDataType* _tmp38_;
 
1009
        ValaDataType* _tmp86_;
 
1010
        ValaDataType* _tmp87_ = NULL;
716
1011
        ValaDataType* data_type_get;
717
 
        ValaSwitchSection* _tmp47_ = NULL;
 
1012
        ValaDataType* _tmp88_;
 
1013
        ValaSourceReference* _tmp89_;
 
1014
        ValaSwitchSection* _tmp90_;
718
1015
        ValaSwitchSection* switch_section;
719
 
        const gchar* _tmp48_ = NULL;
720
 
        gchar* _tmp49_ = NULL;
721
 
        gchar* _tmp50_;
722
 
        ValaStringLiteral* _tmp51_ = NULL;
723
 
        ValaStringLiteral* _tmp52_;
724
 
        ValaSwitchLabel* _tmp53_ = NULL;
725
 
        ValaSwitchLabel* _tmp54_;
 
1016
        ValaSwitchStatement* _tmp91_;
 
1017
        ValaSwitchSection* _tmp92_;
 
1018
        ValaSwitchSection* _tmp93_;
 
1019
        const gchar* _tmp94_;
 
1020
        const gchar* _tmp95_ = NULL;
 
1021
        gchar* _tmp96_ = NULL;
 
1022
        gchar* _tmp97_;
 
1023
        ValaSourceReference* _tmp98_;
 
1024
        ValaStringLiteral* _tmp99_;
 
1025
        ValaStringLiteral* _tmp100_;
 
1026
        ValaSourceReference* _tmp101_;
 
1027
        ValaSwitchLabel* _tmp102_;
 
1028
        ValaSwitchLabel* _tmp103_;
726
1029
        ValaMethodCall* emit_changed_notify = NULL;
727
 
        ValaExpressionStatement* _tmp250_ = NULL;
728
 
        ValaExpressionStatement* _tmp251_;
729
 
        ValaBreakStatement* _tmp252_ = NULL;
730
 
        ValaBreakStatement* _tmp253_;
 
1030
        gboolean _tmp104_;
 
1031
        ValaSwitchSection* _tmp440_;
 
1032
        ValaMethodCall* _tmp441_;
 
1033
        ValaSourceReference* _tmp442_;
 
1034
        ValaExpressionStatement* _tmp443_;
 
1035
        ValaExpressionStatement* _tmp444_;
 
1036
        ValaSwitchSection* _tmp445_;
 
1037
        ValaSourceReference* _tmp446_;
 
1038
        ValaBreakStatement* _tmp447_;
 
1039
        ValaBreakStatement* _tmp448_;
731
1040
        GError * _inner_error_ = NULL;
732
1041
        g_return_if_fail (self != NULL);
733
1042
        g_return_if_fail (table != NULL);
734
1043
        g_return_if_fail (cl != NULL);
735
1044
        g_return_if_fail (signals != NULL);
736
 
        _tmp0_ = sql_heavy_table_get_queryable (table);
737
 
        _tmp1_ = sql_heavy_queryable_get_database (_tmp0_);
738
 
        db = _tmp1_;
739
 
        _tmp2_ = sql_heavy_database_get_filename (db);
740
 
        _tmp3_ = g_path_get_basename (_tmp2_);
 
1045
        g_return_if_fail (source_reference != NULL);
 
1046
        _tmp0_ = table;
 
1047
        _tmp1_ = sql_heavy_table_get_queryable (_tmp0_);
 
1048
        _tmp2_ = _tmp1_;
 
1049
        _tmp3_ = sql_heavy_queryable_get_database (_tmp2_);
741
1050
        _tmp4_ = _tmp3_;
742
 
        _tmp6_ = _tmp5_ = g_strsplit (_tmp4_, ".", 2);
 
1051
        db = _tmp4_;
 
1052
        _tmp5_ = db;
 
1053
        _tmp6_ = sql_heavy_database_get_filename (_tmp5_);
743
1054
        _tmp7_ = _tmp6_;
744
 
        _tmp7__length1 = _vala_array_length (_tmp5_);
745
 
        _tmp8_ = g_strdup (_tmp7_[0]);
 
1055
        _tmp8_ = g_path_get_basename (_tmp7_);
746
1056
        _tmp9_ = _tmp8_;
747
 
        _tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
748
 
        _g_free0 (_tmp4_);
749
 
        db_symbol = _tmp9_;
750
 
        _tmp10_ = sql_heavy_table_field_name (table, field, &_inner_error_);
751
 
        _tmp11_ = _tmp10_;
 
1057
        _tmp11_ = _tmp10_ = g_strsplit (_tmp9_, ".", 2);
 
1058
        _tmp12_ = _tmp11_;
 
1059
        _tmp12__length1 = _vala_array_length (_tmp10_);
 
1060
        _tmp13_ = _tmp12_[0];
 
1061
        _tmp14_ = g_strdup (_tmp13_);
 
1062
        _tmp15_ = _tmp14_;
 
1063
        _tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
 
1064
        _g_free0 (_tmp9_);
 
1065
        db_symbol = _tmp15_;
 
1066
        _tmp16_ = table;
 
1067
        _tmp17_ = field;
 
1068
        _tmp18_ = sql_heavy_table_field_name (_tmp16_, _tmp17_, &_inner_error_);
 
1069
        _tmp19_ = _tmp18_;
752
1070
        if (_inner_error_ != NULL) {
753
1071
                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
754
1072
                        g_propagate_error (error, _inner_error_);
763
1081
                        return;
764
1082
                }
765
1083
        }
766
 
        _tmp12_ = g_path_get_basename (db_symbol);
767
 
        _tmp13_ = _tmp12_;
768
 
        _tmp14_ = string_to_string (_tmp13_);
769
 
        _tmp15_ = sql_heavy_table_get_name (table);
770
 
        _tmp16_ = string_to_string (_tmp15_);
771
 
        _tmp17_ = _tmp11_;
772
 
        _tmp18_ = string_to_string (_tmp17_);
773
 
        _tmp19_ = g_strconcat ("@", _tmp14_, "/", _tmp16_, "/", _tmp18_, NULL);
774
 
        _tmp20_ = _tmp19_;
775
 
        _g_free0 (_tmp17_);
776
 
        _g_free0 (_tmp13_);
777
 
        symbol = _tmp20_;
778
 
        _tmp21_ = sql_heavy_generator_get_symbol_name (self, symbol);
779
 
        name = _tmp21_;
780
 
        _tmp22_ = sql_heavy_generator_symbol_is_hidden (self, symbol);
781
 
        if (_tmp22_) {
 
1084
        _tmp20_ = db_symbol;
 
1085
        _tmp21_ = g_path_get_basename (_tmp20_);
 
1086
        _tmp22_ = _tmp21_;
 
1087
        _tmp23_ = string_to_string (_tmp22_);
 
1088
        _tmp24_ = table;
 
1089
        _tmp25_ = sql_heavy_table_get_name (_tmp24_);
 
1090
        _tmp26_ = _tmp25_;
 
1091
        _tmp27_ = string_to_string (_tmp26_);
 
1092
        _tmp28_ = _tmp19_;
 
1093
        _tmp29_ = string_to_string (_tmp28_);
 
1094
        _tmp30_ = g_strconcat ("@", _tmp23_, "/", _tmp27_, "/", _tmp29_, NULL);
 
1095
        _tmp31_ = _tmp30_;
 
1096
        _g_free0 (_tmp28_);
 
1097
        _g_free0 (_tmp22_);
 
1098
        symbol = _tmp31_;
 
1099
        _tmp32_ = symbol;
 
1100
        _tmp33_ = sql_heavy_generator_get_symbol_name (self, _tmp32_);
 
1101
        name = _tmp33_;
 
1102
        _tmp34_ = symbol;
 
1103
        _tmp35_ = sql_heavy_generator_symbol_is_hidden (self, _tmp34_);
 
1104
        if (_tmp35_) {
782
1105
                _g_free0 (name);
783
1106
                _g_free0 (symbol);
784
1107
                _g_free0 (db_symbol);
785
1108
                _g_object_unref0 (db);
786
1109
                return;
787
1110
        }
788
 
        _tmp23_ = sql_heavy_generator_get_data_type (self, symbol);
789
 
        data_type = _tmp23_;
790
 
        if (data_type == NULL) {
791
 
                gchar* _tmp24_ = NULL;
792
 
                gchar* _tmp25_;
793
 
                gchar* _tmp26_;
794
 
                gchar* _tmp27_ = NULL;
795
 
                gchar* _tmp28_;
796
 
                gchar** _tmp29_;
797
 
                gchar** _tmp30_ = NULL;
798
 
                gchar** _tmp31_;
 
1111
        _tmp36_ = symbol;
 
1112
        _tmp37_ = sql_heavy_generator_get_data_type (self, _tmp36_);
 
1113
        data_type = _tmp37_;
 
1114
        _tmp38_ = data_type;
 
1115
        if (_tmp38_ == NULL) {
 
1116
                SQLHeavyTable* _tmp39_;
 
1117
                gint _tmp40_;
 
1118
                gchar* _tmp41_ = NULL;
 
1119
                gchar* _tmp42_;
 
1120
                gchar* _tmp43_;
 
1121
                gchar* _tmp44_ = NULL;
 
1122
                gchar* _tmp45_;
 
1123
                gchar** _tmp46_;
 
1124
                gchar** _tmp47_ = NULL;
 
1125
                gchar** _tmp48_;
 
1126
                gint _tmp48__length1;
799
1127
                gchar** affinity;
800
1128
                gint affinity_length1;
801
1129
                gint _affinity_size_;
802
 
                ValaDataType* _tmp45_ = NULL;
803
 
                _tmp24_ = sql_heavy_table_field_affinity (table, field, &_inner_error_);
804
 
                _tmp25_ = _tmp24_;
 
1130
                gchar** _tmp49_;
 
1131
                gint _tmp49__length1;
 
1132
                const gchar* _tmp50_;
 
1133
                gchar** _tmp83_;
 
1134
                gint _tmp83__length1;
 
1135
                const gchar* _tmp84_;
 
1136
                ValaDataType* _tmp85_ = NULL;
 
1137
                _tmp39_ = table;
 
1138
                _tmp40_ = field;
 
1139
                _tmp41_ = sql_heavy_table_field_affinity (_tmp39_, _tmp40_, &_inner_error_);
 
1140
                _tmp42_ = _tmp41_;
805
1141
                if (_inner_error_ != NULL) {
806
1142
                        if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
807
1143
                                g_propagate_error (error, _inner_error_);
822
1158
                                return;
823
1159
                        }
824
1160
                }
825
 
                _tmp26_ = _tmp25_;
826
 
                _tmp27_ = g_utf8_strdown (_tmp26_, (gssize) (-1));
827
 
                _tmp28_ = _tmp27_;
828
 
                _tmp30_ = _tmp29_ = g_strsplit (_tmp28_, " ", 0);
829
 
                _tmp31_ = _tmp30_;
830
 
                _g_free0 (_tmp28_);
831
 
                _g_free0 (_tmp26_);
832
 
                affinity = _tmp31_;
833
 
                affinity_length1 = _vala_array_length (_tmp29_);
834
 
                _affinity_size_ = _vala_array_length (_tmp29_);
835
 
                if (g_strcmp0 (affinity[0], "integer") == 0) {
836
 
                        gchar* _tmp32_;
837
 
                        gchar* _tmp33_;
838
 
                        _tmp32_ = g_strdup ("int");
839
 
                        _tmp33_ = _tmp32_;
840
 
                        _g_free0 (affinity[0]);
841
 
                        affinity[0] = _tmp33_;
 
1161
                _tmp43_ = _tmp42_;
 
1162
                _tmp44_ = g_utf8_strdown (_tmp43_, (gssize) (-1));
 
1163
                _tmp45_ = _tmp44_;
 
1164
                _tmp47_ = _tmp46_ = g_strsplit (_tmp45_, " ", 0);
 
1165
                _tmp48_ = _tmp47_;
 
1166
                _tmp48__length1 = _vala_array_length (_tmp46_);
 
1167
                _g_free0 (_tmp45_);
 
1168
                _g_free0 (_tmp43_);
 
1169
                affinity = _tmp48_;
 
1170
                affinity_length1 = _tmp48__length1;
 
1171
                _affinity_size_ = affinity_length1;
 
1172
                _tmp49_ = affinity;
 
1173
                _tmp49__length1 = affinity_length1;
 
1174
                _tmp50_ = _tmp49_[0];
 
1175
                if (g_strcmp0 (_tmp50_, "integer") == 0) {
 
1176
                        gchar** _tmp51_;
 
1177
                        gint _tmp51__length1;
 
1178
                        gchar* _tmp52_;
 
1179
                        gchar* _tmp53_;
 
1180
                        _tmp51_ = affinity;
 
1181
                        _tmp51__length1 = affinity_length1;
 
1182
                        _tmp52_ = g_strdup ("int");
 
1183
                        _g_free0 (_tmp51_[0]);
 
1184
                        _tmp51_[0] = _tmp52_;
 
1185
                        _tmp53_ = _tmp51_[0];
842
1186
                } else {
843
 
                        gboolean _tmp34_ = FALSE;
844
 
                        gboolean _tmp35_ = FALSE;
845
 
                        if (g_strcmp0 (affinity[0], "text") == 0) {
846
 
                                _tmp35_ = TRUE;
847
 
                        } else {
848
 
                                gboolean _tmp36_;
849
 
                                _tmp36_ = g_str_has_prefix (affinity[0], "varchar");
850
 
                                _tmp35_ = _tmp36_;
851
 
                        }
852
 
                        if (_tmp35_) {
853
 
                                _tmp34_ = TRUE;
854
 
                        } else {
855
 
                                gboolean _tmp37_;
856
 
                                _tmp37_ = g_str_has_prefix (affinity[0], "char");
857
 
                                _tmp34_ = _tmp37_;
858
 
                        }
859
 
                        if (_tmp34_) {
860
 
                                gchar* _tmp38_;
861
 
                                gchar* _tmp39_;
862
 
                                _tmp38_ = g_strdup ("string");
863
 
                                _tmp39_ = _tmp38_;
864
 
                                _g_free0 (affinity[0]);
865
 
                                affinity[0] = _tmp39_;
866
 
                        } else {
867
 
                                if (g_strcmp0 (affinity[0], "blob") == 0) {
868
 
                                        gchar* _tmp40_;
869
 
                                        gchar* _tmp41_;
870
 
                                        _tmp40_ = g_strdup ("uint8[]");
871
 
                                        _tmp41_ = _tmp40_;
872
 
                                        _g_free0 (affinity[0]);
873
 
                                        affinity[0] = _tmp41_;
 
1187
                        gboolean _tmp54_ = FALSE;
 
1188
                        gboolean _tmp55_ = FALSE;
 
1189
                        gchar** _tmp56_;
 
1190
                        gint _tmp56__length1;
 
1191
                        const gchar* _tmp57_;
 
1192
                        gboolean _tmp61_;
 
1193
                        gboolean _tmp65_;
 
1194
                        _tmp56_ = affinity;
 
1195
                        _tmp56__length1 = affinity_length1;
 
1196
                        _tmp57_ = _tmp56_[0];
 
1197
                        if (g_strcmp0 (_tmp57_, "text") == 0) {
 
1198
                                _tmp55_ = TRUE;
 
1199
                        } else {
 
1200
                                gchar** _tmp58_;
 
1201
                                gint _tmp58__length1;
 
1202
                                const gchar* _tmp59_;
 
1203
                                gboolean _tmp60_ = FALSE;
 
1204
                                _tmp58_ = affinity;
 
1205
                                _tmp58__length1 = affinity_length1;
 
1206
                                _tmp59_ = _tmp58_[0];
 
1207
                                _tmp60_ = g_str_has_prefix (_tmp59_, "varchar");
 
1208
                                _tmp55_ = _tmp60_;
 
1209
                        }
 
1210
                        _tmp61_ = _tmp55_;
 
1211
                        if (_tmp61_) {
 
1212
                                _tmp54_ = TRUE;
 
1213
                        } else {
 
1214
                                gchar** _tmp62_;
 
1215
                                gint _tmp62__length1;
 
1216
                                const gchar* _tmp63_;
 
1217
                                gboolean _tmp64_ = FALSE;
 
1218
                                _tmp62_ = affinity;
 
1219
                                _tmp62__length1 = affinity_length1;
 
1220
                                _tmp63_ = _tmp62_[0];
 
1221
                                _tmp64_ = g_str_has_prefix (_tmp63_, "char");
 
1222
                                _tmp54_ = _tmp64_;
 
1223
                        }
 
1224
                        _tmp65_ = _tmp54_;
 
1225
                        if (_tmp65_) {
 
1226
                                gchar** _tmp66_;
 
1227
                                gint _tmp66__length1;
 
1228
                                gchar* _tmp67_;
 
1229
                                gchar* _tmp68_;
 
1230
                                _tmp66_ = affinity;
 
1231
                                _tmp66__length1 = affinity_length1;
 
1232
                                _tmp67_ = g_strdup ("string");
 
1233
                                _g_free0 (_tmp66_[0]);
 
1234
                                _tmp66_[0] = _tmp67_;
 
1235
                                _tmp68_ = _tmp66_[0];
 
1236
                        } else {
 
1237
                                gchar** _tmp69_;
 
1238
                                gint _tmp69__length1;
 
1239
                                const gchar* _tmp70_;
 
1240
                                _tmp69_ = affinity;
 
1241
                                _tmp69__length1 = affinity_length1;
 
1242
                                _tmp70_ = _tmp69_[0];
 
1243
                                if (g_strcmp0 (_tmp70_, "blob") == 0) {
 
1244
                                        gchar** _tmp71_;
 
1245
                                        gint _tmp71__length1;
 
1246
                                        gchar* _tmp72_;
 
1247
                                        gchar* _tmp73_;
 
1248
                                        _tmp71_ = affinity;
 
1249
                                        _tmp71__length1 = affinity_length1;
 
1250
                                        _tmp72_ = g_strdup ("uint8[]");
 
1251
                                        _g_free0 (_tmp71_[0]);
 
1252
                                        _tmp71_[0] = _tmp72_;
 
1253
                                        _tmp73_ = _tmp71_[0];
874
1254
                                } else {
875
 
                                        gboolean _tmp42_ = FALSE;
876
 
                                        if (g_strcmp0 (affinity[0], "timestamp") == 0) {
877
 
                                                _tmp42_ = TRUE;
 
1255
                                        gboolean _tmp74_ = FALSE;
 
1256
                                        gchar** _tmp75_;
 
1257
                                        gint _tmp75__length1;
 
1258
                                        const gchar* _tmp76_;
 
1259
                                        gboolean _tmp79_;
 
1260
                                        _tmp75_ = affinity;
 
1261
                                        _tmp75__length1 = affinity_length1;
 
1262
                                        _tmp76_ = _tmp75_[0];
 
1263
                                        if (g_strcmp0 (_tmp76_, "timestamp") == 0) {
 
1264
                                                _tmp74_ = TRUE;
878
1265
                                        } else {
879
 
                                                _tmp42_ = g_strcmp0 (affinity[0], "datetime") == 0;
 
1266
                                                gchar** _tmp77_;
 
1267
                                                gint _tmp77__length1;
 
1268
                                                const gchar* _tmp78_;
 
1269
                                                _tmp77_ = affinity;
 
1270
                                                _tmp77__length1 = affinity_length1;
 
1271
                                                _tmp78_ = _tmp77_[0];
 
1272
                                                _tmp74_ = g_strcmp0 (_tmp78_, "datetime") == 0;
880
1273
                                        }
881
 
                                        if (_tmp42_) {
882
 
                                                gchar* _tmp43_;
883
 
                                                gchar* _tmp44_;
884
 
                                                _tmp43_ = g_strdup ("time_t");
885
 
                                                _tmp44_ = _tmp43_;
886
 
                                                _g_free0 (affinity[0]);
887
 
                                                affinity[0] = _tmp44_;
 
1274
                                        _tmp79_ = _tmp74_;
 
1275
                                        if (_tmp79_) {
 
1276
                                                gchar** _tmp80_;
 
1277
                                                gint _tmp80__length1;
 
1278
                                                gchar* _tmp81_;
 
1279
                                                gchar* _tmp82_;
 
1280
                                                _tmp80_ = affinity;
 
1281
                                                _tmp80__length1 = affinity_length1;
 
1282
                                                _tmp81_ = g_strdup ("time_t");
 
1283
                                                _g_free0 (_tmp80_[0]);
 
1284
                                                _tmp80_[0] = _tmp81_;
 
1285
                                                _tmp82_ = _tmp80_[0];
888
1286
                                        }
889
1287
                                }
890
1288
                        }
891
1289
                }
892
 
                _tmp45_ = sql_heavy_generator_type_from_string (affinity[0]);
 
1290
                _tmp83_ = affinity;
 
1291
                _tmp83__length1 = affinity_length1;
 
1292
                _tmp84_ = _tmp83_[0];
 
1293
                _tmp85_ = sql_heavy_generator_type_from_string (_tmp84_);
893
1294
                _vala_code_node_unref0 (data_type);
894
 
                data_type = _tmp45_;
 
1295
                data_type = _tmp85_;
895
1296
                affinity = (_vala_array_free (affinity, affinity_length1, (GDestroyNotify) g_free), NULL);
896
1297
        }
897
 
        _tmp46_ = vala_data_type_copy (data_type);
898
 
        data_type_get = _tmp46_;
899
 
        vala_data_type_set_value_owned (data_type_get, TRUE);
900
 
        _tmp47_ = vala_switch_section_new (NULL);
901
 
        switch_section = _tmp47_;
902
 
        vala_switch_statement_add_section (signals, switch_section);
903
 
        _tmp48_ = string_to_string (name);
904
 
        _tmp49_ = g_strconcat ("\"", _tmp48_, "\"", NULL);
905
 
        _tmp50_ = _tmp49_;
906
 
        _tmp51_ = vala_string_literal_new (_tmp50_, NULL);
907
 
        _tmp52_ = _tmp51_;
908
 
        _tmp53_ = vala_switch_label_new ((ValaExpression*) _tmp52_, NULL);
909
 
        _tmp54_ = _tmp53_;
910
 
        vala_switch_section_add_label (switch_section, _tmp54_);
911
 
        _vala_code_node_unref0 (_tmp54_);
912
 
        _vala_code_node_unref0 (_tmp52_);
913
 
        _g_free0 (_tmp50_);
914
 
        if (!sql_heavy_generator_write_properties) {
915
 
                const gchar* _tmp55_ = NULL;
916
 
                gchar* _tmp56_ = NULL;
917
 
                gchar* _tmp57_;
918
 
                ValaVoidType* _tmp58_ = NULL;
919
 
                ValaVoidType* _tmp59_;
920
 
                ValaSignal* _tmp60_ = NULL;
921
 
                ValaSignal* _tmp61_;
 
1298
        _tmp86_ = data_type;
 
1299
        _tmp87_ = vala_data_type_copy (_tmp86_);
 
1300
        data_type_get = _tmp87_;
 
1301
        _tmp88_ = data_type_get;
 
1302
        vala_data_type_set_value_owned (_tmp88_, TRUE);
 
1303
        _tmp89_ = source_reference;
 
1304
        _tmp90_ = vala_switch_section_new (_tmp89_);
 
1305
        switch_section = _tmp90_;
 
1306
        _tmp91_ = signals;
 
1307
        _tmp92_ = switch_section;
 
1308
        vala_switch_statement_add_section (_tmp91_, _tmp92_);
 
1309
        _tmp93_ = switch_section;
 
1310
        _tmp94_ = name;
 
1311
        _tmp95_ = string_to_string (_tmp94_);
 
1312
        _tmp96_ = g_strconcat ("\"", _tmp95_, "\"", NULL);
 
1313
        _tmp97_ = _tmp96_;
 
1314
        _tmp98_ = source_reference;
 
1315
        _tmp99_ = vala_string_literal_new (_tmp97_, _tmp98_);
 
1316
        _tmp100_ = _tmp99_;
 
1317
        _tmp101_ = source_reference;
 
1318
        _tmp102_ = vala_switch_label_new ((ValaExpression*) _tmp100_, _tmp101_);
 
1319
        _tmp103_ = _tmp102_;
 
1320
        vala_switch_section_add_label (_tmp93_, _tmp103_);
 
1321
        _vala_code_node_unref0 (_tmp103_);
 
1322
        _vala_code_node_unref0 (_tmp100_);
 
1323
        _g_free0 (_tmp97_);
 
1324
        _tmp104_ = sql_heavy_generator_write_properties;
 
1325
        if (!_tmp104_) {
 
1326
                const gchar* _tmp105_;
 
1327
                const gchar* _tmp106_ = NULL;
 
1328
                gchar* _tmp107_ = NULL;
 
1329
                gchar* _tmp108_;
 
1330
                ValaSourceReference* _tmp109_;
 
1331
                ValaVoidType* _tmp110_;
 
1332
                ValaVoidType* _tmp111_;
 
1333
                ValaSourceReference* _tmp112_;
 
1334
                ValaSignal* _tmp113_;
 
1335
                ValaSignal* _tmp114_;
922
1336
                ValaSignal* changed_signal;
923
 
                ValaStringLiteral* _tmp62_ = NULL;
924
 
                ValaStringLiteral* _tmp63_;
925
 
                const gchar* _tmp64_ = NULL;
926
 
                gchar* _tmp65_ = NULL;
927
 
                gchar* _tmp66_;
928
 
                ValaMemberAccess* _tmp67_ = NULL;
929
 
                ValaMemberAccess* _tmp68_;
930
 
                ValaMethodCall* _tmp69_ = NULL;
931
 
                _tmp55_ = string_to_string (name);
932
 
                _tmp56_ = g_strconcat (_tmp55_, "_changed", NULL);
933
 
                _tmp57_ = _tmp56_;
934
 
                _tmp58_ = vala_void_type_new (NULL);
935
 
                _tmp59_ = _tmp58_;
936
 
                _tmp60_ = vala_signal_new (_tmp57_, (ValaDataType*) _tmp59_, NULL, NULL);
937
 
                _tmp61_ = _tmp60_;
938
 
                _vala_code_node_unref0 (_tmp59_);
939
 
                _g_free0 (_tmp57_);
940
 
                changed_signal = _tmp61_;
941
 
                vala_symbol_set_access ((ValaSymbol*) changed_signal, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
942
 
                vala_symbol_add_signal ((ValaSymbol*) cl, changed_signal);
943
 
                _tmp62_ = vala_string_literal_new ("this", NULL);
944
 
                _tmp63_ = _tmp62_;
945
 
                _tmp64_ = string_to_string (name);
946
 
                _tmp65_ = g_strconcat (_tmp64_, "_changed", NULL);
947
 
                _tmp66_ = _tmp65_;
948
 
                _tmp67_ = vala_member_access_new ((ValaExpression*) _tmp63_, _tmp66_, NULL);
949
 
                _tmp68_ = _tmp67_;
950
 
                _tmp69_ = vala_method_call_new ((ValaExpression*) _tmp68_, NULL);
 
1337
                ValaSignal* _tmp115_;
 
1338
                ValaClass* _tmp116_;
 
1339
                ValaSignal* _tmp117_;
 
1340
                ValaStringLiteral* _tmp118_;
 
1341
                ValaStringLiteral* _tmp119_;
 
1342
                const gchar* _tmp120_;
 
1343
                const gchar* _tmp121_ = NULL;
 
1344
                gchar* _tmp122_ = NULL;
 
1345
                gchar* _tmp123_;
 
1346
                ValaSourceReference* _tmp124_;
 
1347
                ValaMemberAccess* _tmp125_;
 
1348
                ValaMemberAccess* _tmp126_;
 
1349
                ValaSourceReference* _tmp127_;
 
1350
                ValaMethodCall* _tmp128_;
 
1351
                _tmp105_ = name;
 
1352
                _tmp106_ = string_to_string (_tmp105_);
 
1353
                _tmp107_ = g_strconcat (_tmp106_, "_changed", NULL);
 
1354
                _tmp108_ = _tmp107_;
 
1355
                _tmp109_ = source_reference;
 
1356
                _tmp110_ = vala_void_type_new (_tmp109_);
 
1357
                _tmp111_ = _tmp110_;
 
1358
                _tmp112_ = source_reference;
 
1359
                _tmp113_ = vala_signal_new (_tmp108_, (ValaDataType*) _tmp111_, _tmp112_, NULL);
 
1360
                _tmp114_ = _tmp113_;
 
1361
                _vala_code_node_unref0 (_tmp111_);
 
1362
                _g_free0 (_tmp108_);
 
1363
                changed_signal = _tmp114_;
 
1364
                _tmp115_ = changed_signal;
 
1365
                vala_symbol_set_access ((ValaSymbol*) _tmp115_, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
 
1366
                _tmp116_ = cl;
 
1367
                _tmp117_ = changed_signal;
 
1368
                vala_symbol_add_signal ((ValaSymbol*) _tmp116_, _tmp117_);
 
1369
                _tmp118_ = vala_string_literal_new ("this", NULL);
 
1370
                _tmp119_ = _tmp118_;
 
1371
                _tmp120_ = name;
 
1372
                _tmp121_ = string_to_string (_tmp120_);
 
1373
                _tmp122_ = g_strconcat (_tmp121_, "_changed", NULL);
 
1374
                _tmp123_ = _tmp122_;
 
1375
                _tmp124_ = source_reference;
 
1376
                _tmp125_ = vala_member_access_new ((ValaExpression*) _tmp119_, _tmp123_, _tmp124_);
 
1377
                _tmp126_ = _tmp125_;
 
1378
                _tmp127_ = source_reference;
 
1379
                _tmp128_ = vala_method_call_new ((ValaExpression*) _tmp126_, _tmp127_);
951
1380
                _vala_code_node_unref0 (emit_changed_notify);
952
 
                emit_changed_notify = _tmp69_;
953
 
                _vala_code_node_unref0 (_tmp68_);
954
 
                _g_free0 (_tmp66_);
955
 
                _vala_code_node_unref0 (_tmp63_);
 
1381
                emit_changed_notify = _tmp128_;
 
1382
                _vala_code_node_unref0 (_tmp126_);
 
1383
                _g_free0 (_tmp123_);
 
1384
                _vala_code_node_unref0 (_tmp119_);
956
1385
                {
957
 
                        const gchar* _tmp70_ = NULL;
958
 
                        gchar* _tmp71_ = NULL;
959
 
                        gchar* _tmp72_;
960
 
                        ValaMethod* _tmp73_ = NULL;
961
 
                        ValaMethod* _tmp74_;
 
1386
                        const gchar* _tmp129_;
 
1387
                        const gchar* _tmp130_ = NULL;
 
1388
                        gchar* _tmp131_ = NULL;
 
1389
                        gchar* _tmp132_;
 
1390
                        ValaDataType* _tmp133_;
 
1391
                        ValaSourceReference* _tmp134_;
 
1392
                        ValaMethod* _tmp135_;
 
1393
                        ValaMethod* _tmp136_;
962
1394
                        ValaMethod* get_method;
963
 
                        ValaDataType* _tmp75_ = NULL;
964
 
                        ValaDataType* _tmp76_;
965
 
                        ValaBlock* _tmp77_ = NULL;
966
 
                        ValaBlock* block;
967
 
                        ValaStringLiteral* _tmp78_ = NULL;
968
 
                        ValaStringLiteral* _tmp79_;
969
 
                        gchar* _tmp80_ = NULL;
970
 
                        gchar* _tmp81_;
971
 
                        const gchar* _tmp82_ = NULL;
972
 
                        gchar* _tmp83_ = NULL;
973
 
                        gchar* _tmp84_;
974
 
                        ValaMemberAccess* _tmp85_ = NULL;
975
 
                        ValaMemberAccess* _tmp86_;
976
 
                        ValaMethodCall* _tmp87_ = NULL;
977
 
                        ValaMethodCall* _tmp88_;
978
 
                        ValaMethodCall* call;
979
 
                        gchar* _tmp89_ = NULL;
980
 
                        gchar* _tmp90_;
981
 
                        gchar* _tmp91_;
982
 
                        const gchar* _tmp92_ = NULL;
983
 
                        gchar* _tmp93_ = NULL;
984
 
                        gchar* _tmp94_;
985
 
                        ValaStringLiteral* _tmp95_ = NULL;
986
 
                        ValaStringLiteral* _tmp96_;
987
 
                        ValaReturnStatement* _tmp97_ = NULL;
988
 
                        ValaReturnStatement* _tmp98_;
989
 
                        _tmp70_ = string_to_string (name);
990
 
                        _tmp71_ = g_strconcat ("get_", _tmp70_, NULL);
991
 
                        _tmp72_ = _tmp71_;
992
 
                        _tmp73_ = vala_method_new (_tmp72_, data_type_get, NULL, NULL);
993
 
                        _tmp74_ = _tmp73_;
994
 
                        _g_free0 (_tmp72_);
995
 
                        get_method = _tmp74_;
996
 
                        vala_symbol_add_method ((ValaSymbol*) cl, get_method);
997
 
                        vala_symbol_set_access ((ValaSymbol*) get_method, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
998
 
                        _tmp75_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
999
 
                        _tmp76_ = _tmp75_;
1000
 
                        vala_code_node_add_error_type ((ValaCodeNode*) get_method, _tmp76_);
1001
 
                        _vala_code_node_unref0 (_tmp76_);
1002
 
                        _tmp77_ = vala_block_new (NULL);
1003
 
                        block = _tmp77_;
1004
 
                        _tmp78_ = vala_string_literal_new ("this", NULL);
1005
 
                        _tmp79_ = _tmp78_;
1006
 
                        _tmp80_ = vala_code_node_to_string ((ValaCodeNode*) data_type_get);
1007
 
                        _tmp81_ = _tmp80_;
1008
 
                        _tmp82_ = string_to_string (_tmp81_);
1009
 
                        _tmp83_ = g_strconcat ("get_", _tmp82_, NULL);
1010
 
                        _tmp84_ = _tmp83_;
1011
 
                        _tmp85_ = vala_member_access_new ((ValaExpression*) _tmp79_, _tmp84_, NULL);
1012
 
                        _tmp86_ = _tmp85_;
1013
 
                        _tmp87_ = vala_method_call_new ((ValaExpression*) _tmp86_, NULL);
1014
 
                        _tmp88_ = _tmp87_;
1015
 
                        _vala_code_node_unref0 (_tmp86_);
1016
 
                        _g_free0 (_tmp84_);
1017
 
                        _g_free0 (_tmp81_);
1018
 
                        _vala_code_node_unref0 (_tmp79_);
1019
 
                        call = _tmp88_;
1020
 
                        _tmp89_ = sql_heavy_table_field_name (table, field, &_inner_error_);
1021
 
                        _tmp90_ = _tmp89_;
1022
 
                        if (_inner_error_ != NULL) {
1023
 
                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
1024
 
                                        g_propagate_error (error, _inner_error_);
1025
 
                                        _vala_code_node_unref0 (call);
1026
 
                                        _vala_code_node_unref0 (block);
1027
 
                                        _vala_code_node_unref0 (get_method);
1028
 
                                        _vala_code_node_unref0 (changed_signal);
1029
 
                                        _vala_code_node_unref0 (emit_changed_notify);
1030
 
                                        _vala_code_node_unref0 (switch_section);
1031
 
                                        _vala_code_node_unref0 (data_type_get);
1032
 
                                        _vala_code_node_unref0 (data_type);
1033
 
                                        _g_free0 (name);
1034
 
                                        _g_free0 (symbol);
1035
 
                                        _g_free0 (db_symbol);
1036
 
                                        _g_object_unref0 (db);
1037
 
                                        return;
1038
 
                                } else {
1039
 
                                        _vala_code_node_unref0 (call);
1040
 
                                        _vala_code_node_unref0 (block);
1041
 
                                        _vala_code_node_unref0 (get_method);
1042
 
                                        _vala_code_node_unref0 (changed_signal);
1043
 
                                        _vala_code_node_unref0 (emit_changed_notify);
1044
 
                                        _vala_code_node_unref0 (switch_section);
1045
 
                                        _vala_code_node_unref0 (data_type_get);
1046
 
                                        _vala_code_node_unref0 (data_type);
1047
 
                                        _g_free0 (name);
1048
 
                                        _g_free0 (symbol);
1049
 
                                        _g_free0 (db_symbol);
1050
 
                                        _g_object_unref0 (db);
1051
 
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1052
 
                                        g_clear_error (&_inner_error_);
1053
 
                                        return;
1054
 
                                }
1055
 
                        }
1056
 
                        _tmp91_ = _tmp90_;
1057
 
                        _tmp92_ = string_to_string (_tmp91_);
1058
 
                        _tmp93_ = g_strconcat ("\"", _tmp92_, "\"", NULL);
1059
 
                        _tmp94_ = _tmp93_;
1060
 
                        _tmp95_ = vala_string_literal_new (_tmp94_, NULL);
1061
 
                        _tmp96_ = _tmp95_;
1062
 
                        vala_method_call_add_argument (call, (ValaExpression*) _tmp96_);
1063
 
                        _vala_code_node_unref0 (_tmp96_);
1064
 
                        _g_free0 (_tmp94_);
1065
 
                        _g_free0 (_tmp91_);
1066
 
                        _tmp97_ = vala_return_statement_new ((ValaExpression*) call, NULL);
1067
 
                        _tmp98_ = _tmp97_;
1068
 
                        vala_block_add_statement (block, (ValaStatement*) _tmp98_);
1069
 
                        _vala_code_node_unref0 (_tmp98_);
1070
 
                        vala_subroutine_set_body ((ValaSubroutine*) get_method, block);
1071
 
                        _vala_code_node_unref0 (call);
1072
 
                        _vala_code_node_unref0 (block);
1073
 
                        _vala_code_node_unref0 (get_method);
1074
 
                }
1075
 
                {
1076
 
                        const gchar* _tmp99_ = NULL;
1077
 
                        gchar* _tmp100_ = NULL;
1078
 
                        gchar* _tmp101_;
1079
 
                        ValaVoidType* _tmp102_ = NULL;
1080
 
                        ValaVoidType* _tmp103_;
1081
 
                        ValaMethod* _tmp104_ = NULL;
1082
 
                        ValaMethod* _tmp105_;
1083
 
                        ValaMethod* set_method;
1084
 
                        ValaParameter* _tmp106_ = NULL;
1085
 
                        ValaParameter* _tmp107_;
1086
 
                        ValaDataType* _tmp108_ = NULL;
1087
 
                        ValaDataType* _tmp109_;
1088
 
                        ValaBlock* _tmp110_ = NULL;
1089
 
                        ValaBlock* block;
1090
 
                        ValaStringLiteral* _tmp111_ = NULL;
1091
 
                        ValaStringLiteral* _tmp112_;
1092
 
                        gchar* _tmp113_ = NULL;
1093
 
                        gchar* _tmp114_;
1094
 
                        const gchar* _tmp115_ = NULL;
1095
 
                        gchar* _tmp116_ = NULL;
1096
 
                        gchar* _tmp117_;
1097
 
                        ValaMemberAccess* _tmp118_ = NULL;
1098
 
                        ValaMemberAccess* _tmp119_;
1099
 
                        ValaMethodCall* _tmp120_ = NULL;
1100
 
                        ValaMethodCall* _tmp121_;
1101
 
                        ValaMethodCall* call;
1102
 
                        gchar* _tmp122_ = NULL;
1103
 
                        gchar* _tmp123_;
1104
 
                        gchar* _tmp124_;
1105
 
                        const gchar* _tmp125_ = NULL;
1106
 
                        gchar* _tmp126_ = NULL;
1107
 
                        gchar* _tmp127_;
1108
 
                        ValaStringLiteral* _tmp128_ = NULL;
1109
 
                        ValaStringLiteral* _tmp129_;
1110
 
                        ValaExpressionStatement* _tmp130_ = NULL;
1111
 
                        ValaExpressionStatement* _tmp131_;
1112
 
                        _tmp99_ = string_to_string (name);
1113
 
                        _tmp100_ = g_strconcat ("set_", _tmp99_, NULL);
1114
 
                        _tmp101_ = _tmp100_;
1115
 
                        _tmp102_ = vala_void_type_new (NULL);
1116
 
                        _tmp103_ = _tmp102_;
1117
 
                        _tmp104_ = vala_method_new (_tmp101_, (ValaDataType*) _tmp103_, NULL, NULL);
1118
 
                        _tmp105_ = _tmp104_;
1119
 
                        _vala_code_node_unref0 (_tmp103_);
1120
 
                        _g_free0 (_tmp101_);
1121
 
                        set_method = _tmp105_;
1122
 
                        _tmp106_ = vala_parameter_new ("value", data_type, NULL);
1123
 
                        _tmp107_ = _tmp106_;
1124
 
                        vala_method_add_parameter (set_method, _tmp107_);
1125
 
                        _vala_code_node_unref0 (_tmp107_);
1126
 
                        vala_symbol_add_method ((ValaSymbol*) cl, set_method);
1127
 
                        vala_symbol_set_access ((ValaSymbol*) set_method, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
1128
 
                        _tmp108_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
1129
 
                        _tmp109_ = _tmp108_;
1130
 
                        vala_code_node_add_error_type ((ValaCodeNode*) set_method, _tmp109_);
1131
 
                        _vala_code_node_unref0 (_tmp109_);
1132
 
                        _tmp110_ = vala_block_new (NULL);
1133
 
                        block = _tmp110_;
1134
 
                        _tmp111_ = vala_string_literal_new ("this", NULL);
1135
 
                        _tmp112_ = _tmp111_;
1136
 
                        _tmp113_ = vala_code_node_to_string ((ValaCodeNode*) data_type);
1137
 
                        _tmp114_ = _tmp113_;
1138
 
                        _tmp115_ = string_to_string (_tmp114_);
1139
 
                        _tmp116_ = g_strconcat ("set_", _tmp115_, NULL);
1140
 
                        _tmp117_ = _tmp116_;
1141
 
                        _tmp118_ = vala_member_access_new ((ValaExpression*) _tmp112_, _tmp117_, NULL);
1142
 
                        _tmp119_ = _tmp118_;
1143
 
                        _tmp120_ = vala_method_call_new ((ValaExpression*) _tmp119_, NULL);
1144
 
                        _tmp121_ = _tmp120_;
1145
 
                        _vala_code_node_unref0 (_tmp119_);
1146
 
                        _g_free0 (_tmp117_);
1147
 
                        _g_free0 (_tmp114_);
1148
 
                        _vala_code_node_unref0 (_tmp112_);
1149
 
                        call = _tmp121_;
1150
 
                        _tmp122_ = sql_heavy_table_field_name (table, field, &_inner_error_);
1151
 
                        _tmp123_ = _tmp122_;
1152
 
                        if (_inner_error_ != NULL) {
1153
 
                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
1154
 
                                        g_propagate_error (error, _inner_error_);
1155
 
                                        _vala_code_node_unref0 (call);
1156
 
                                        _vala_code_node_unref0 (block);
1157
 
                                        _vala_code_node_unref0 (set_method);
1158
 
                                        _vala_code_node_unref0 (changed_signal);
1159
 
                                        _vala_code_node_unref0 (emit_changed_notify);
1160
 
                                        _vala_code_node_unref0 (switch_section);
1161
 
                                        _vala_code_node_unref0 (data_type_get);
1162
 
                                        _vala_code_node_unref0 (data_type);
1163
 
                                        _g_free0 (name);
1164
 
                                        _g_free0 (symbol);
1165
 
                                        _g_free0 (db_symbol);
1166
 
                                        _g_object_unref0 (db);
1167
 
                                        return;
1168
 
                                } else {
1169
 
                                        _vala_code_node_unref0 (call);
1170
 
                                        _vala_code_node_unref0 (block);
1171
 
                                        _vala_code_node_unref0 (set_method);
1172
 
                                        _vala_code_node_unref0 (changed_signal);
1173
 
                                        _vala_code_node_unref0 (emit_changed_notify);
1174
 
                                        _vala_code_node_unref0 (switch_section);
1175
 
                                        _vala_code_node_unref0 (data_type_get);
1176
 
                                        _vala_code_node_unref0 (data_type);
1177
 
                                        _g_free0 (name);
1178
 
                                        _g_free0 (symbol);
1179
 
                                        _g_free0 (db_symbol);
1180
 
                                        _g_object_unref0 (db);
1181
 
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1182
 
                                        g_clear_error (&_inner_error_);
1183
 
                                        return;
1184
 
                                }
1185
 
                        }
1186
 
                        _tmp124_ = _tmp123_;
1187
 
                        _tmp125_ = string_to_string (_tmp124_);
1188
 
                        _tmp126_ = g_strconcat ("\"", _tmp125_, "\"", NULL);
1189
 
                        _tmp127_ = _tmp126_;
1190
 
                        _tmp128_ = vala_string_literal_new (_tmp127_, NULL);
1191
 
                        _tmp129_ = _tmp128_;
1192
 
                        vala_method_call_add_argument (call, (ValaExpression*) _tmp129_);
1193
 
                        _vala_code_node_unref0 (_tmp129_);
1194
 
                        _g_free0 (_tmp127_);
1195
 
                        _g_free0 (_tmp124_);
1196
 
                        _tmp130_ = vala_expression_statement_new ((ValaExpression*) call, NULL);
1197
 
                        _tmp131_ = _tmp130_;
1198
 
                        vala_block_add_statement (block, (ValaStatement*) _tmp131_);
1199
 
                        _vala_code_node_unref0 (_tmp131_);
1200
 
                        vala_subroutine_set_body ((ValaSubroutine*) set_method, block);
1201
 
                        _vala_code_node_unref0 (call);
1202
 
                        _vala_code_node_unref0 (block);
1203
 
                        _vala_code_node_unref0 (set_method);
1204
 
                }
1205
 
                _vala_code_node_unref0 (changed_signal);
1206
 
        } else {
1207
 
                ValaPropertyAccessor* get_accessor = NULL;
1208
 
                ValaPropertyAccessor* set_accessor = NULL;
1209
 
                ValaStringLiteral* _tmp132_ = NULL;
1210
 
                ValaStringLiteral* _tmp133_;
1211
 
                ValaMemberAccess* _tmp134_ = NULL;
1212
 
                ValaMemberAccess* _tmp135_;
1213
 
                ValaMethodCall* _tmp136_ = NULL;
1214
 
                gchar* _tmp137_ = NULL;
1215
 
                gchar* _tmp138_;
1216
 
                gchar* _tmp139_;
1217
 
                gchar* _tmp140_;
1218
 
                gchar* _tmp141_;
1219
 
                gchar* _tmp142_;
1220
 
                ValaStringLiteral* _tmp143_ = NULL;
1221
 
                ValaStringLiteral* _tmp144_;
1222
 
                ValaProperty* _tmp249_ = NULL;
1223
 
                ValaProperty* prop;
1224
 
                _tmp132_ = vala_string_literal_new ("this", NULL);
1225
 
                _tmp133_ = _tmp132_;
1226
 
                _tmp134_ = vala_member_access_new ((ValaExpression*) _tmp133_, "notify_property", NULL);
1227
 
                _tmp135_ = _tmp134_;
1228
 
                _tmp136_ = vala_method_call_new ((ValaExpression*) _tmp135_, NULL);
1229
 
                _vala_code_node_unref0 (emit_changed_notify);
1230
 
                emit_changed_notify = _tmp136_;
1231
 
                _vala_code_node_unref0 (_tmp135_);
1232
 
                _vala_code_node_unref0 (_tmp133_);
1233
 
                _tmp137_ = string_replace (name, "_", "-");
1234
 
                _tmp138_ = _tmp137_;
1235
 
                _tmp139_ = g_strconcat ("\"", _tmp138_, NULL);
1236
 
                _tmp140_ = _tmp139_;
1237
 
                _tmp141_ = g_strconcat (_tmp140_, "\"", NULL);
1238
 
                _tmp142_ = _tmp141_;
1239
 
                _tmp143_ = vala_string_literal_new (_tmp142_, NULL);
1240
 
                _tmp144_ = _tmp143_;
1241
 
                vala_method_call_add_argument (emit_changed_notify, (ValaExpression*) _tmp144_);
1242
 
                _vala_code_node_unref0 (_tmp144_);
1243
 
                _g_free0 (_tmp142_);
1244
 
                _g_free0 (_tmp140_);
1245
 
                _g_free0 (_tmp138_);
1246
 
                {
1247
 
                        ValaBlock* _tmp145_ = NULL;
1248
 
                        ValaBlock* block;
1249
 
                        ValaBlock* _tmp146_ = NULL;
1250
 
                        ValaBlock* try_block;
1251
 
                        ValaBlock* _tmp147_ = NULL;
1252
 
                        ValaBlock* catch_block;
1253
 
                        ValaTryStatement* _tmp148_ = NULL;
1254
 
                        ValaTryStatement* try_stmt;
1255
 
                        ValaStringLiteral* _tmp149_ = NULL;
1256
 
                        ValaStringLiteral* _tmp150_;
 
1395
                        ValaClass* _tmp137_;
 
1396
                        ValaMethod* _tmp138_;
 
1397
                        ValaMethod* _tmp139_;
 
1398
                        ValaMethod* _tmp140_;
 
1399
                        ValaDataType* _tmp141_ = NULL;
 
1400
                        ValaDataType* _tmp142_;
 
1401
                        ValaSourceReference* _tmp143_;
 
1402
                        ValaBlock* _tmp144_;
 
1403
                        ValaBlock* block;
 
1404
                        ValaStringLiteral* _tmp145_;
 
1405
                        ValaStringLiteral* _tmp146_;
 
1406
                        ValaDataType* _tmp147_;
 
1407
                        gchar* _tmp148_ = NULL;
 
1408
                        gchar* _tmp149_;
 
1409
                        const gchar* _tmp150_ = NULL;
1257
1410
                        gchar* _tmp151_ = NULL;
1258
1411
                        gchar* _tmp152_;
1259
 
                        const gchar* _tmp153_ = NULL;
1260
 
                        gchar* _tmp154_ = NULL;
1261
 
                        gchar* _tmp155_;
1262
 
                        ValaMemberAccess* _tmp156_ = NULL;
1263
 
                        ValaMemberAccess* _tmp157_;
1264
 
                        ValaMethodCall* _tmp158_ = NULL;
1265
 
                        ValaMethodCall* _tmp159_;
 
1412
                        ValaSourceReference* _tmp153_;
 
1413
                        ValaMemberAccess* _tmp154_;
 
1414
                        ValaMemberAccess* _tmp155_;
 
1415
                        ValaSourceReference* _tmp156_;
 
1416
                        ValaMethodCall* _tmp157_;
 
1417
                        ValaMethodCall* _tmp158_;
1266
1418
                        ValaMethodCall* call;
1267
 
                        gchar* _tmp160_ = NULL;
1268
 
                        gchar* _tmp161_;
 
1419
                        SQLHeavyTable* _tmp159_;
 
1420
                        gint _tmp160_;
 
1421
                        gchar* _tmp161_ = NULL;
1269
1422
                        gchar* _tmp162_;
1270
 
                        const gchar* _tmp163_ = NULL;
1271
 
                        gchar* _tmp164_ = NULL;
1272
 
                        gchar* _tmp165_;
1273
 
                        ValaStringLiteral* _tmp166_ = NULL;
1274
 
                        ValaStringLiteral* _tmp167_;
1275
 
                        ValaReturnStatement* _tmp168_ = NULL;
1276
 
                        ValaReturnStatement* _tmp169_;
1277
 
                        ValaStringLiteral* _tmp170_ = NULL;
1278
 
                        ValaStringLiteral* _tmp171_;
1279
 
                        ValaMemberAccess* _tmp172_ = NULL;
1280
 
                        ValaMemberAccess* _tmp173_;
1281
 
                        ValaMethodCall* _tmp174_ = NULL;
1282
 
                        ValaMethodCall* _tmp175_;
1283
 
                        ValaMethodCall* error_call;
1284
 
                        const gchar* _tmp176_ = NULL;
1285
 
                        gchar* _tmp177_ = NULL;
1286
 
                        gchar* _tmp178_;
1287
 
                        ValaStringLiteral* _tmp179_ = NULL;
1288
 
                        ValaStringLiteral* _tmp180_;
1289
 
                        ValaMemberAccess* _tmp181_ = NULL;
1290
 
                        ValaMemberAccess* _tmp182_;
1291
 
                        ValaMemberAccess* _tmp183_ = NULL;
1292
 
                        ValaMemberAccess* _tmp184_;
1293
 
                        ValaExpressionStatement* _tmp185_ = NULL;
1294
 
                        ValaExpressionStatement* _tmp186_;
1295
 
                        ValaStringLiteral* _tmp187_ = NULL;
1296
 
                        ValaStringLiteral* _tmp188_;
1297
 
                        ValaMemberAccess* _tmp189_ = NULL;
1298
 
                        ValaMemberAccess* _tmp190_;
1299
 
                        ValaMethodCall* _tmp191_ = NULL;
1300
 
                        ValaMethodCall* _tmp192_;
1301
 
                        ValaMethodCall* anr;
1302
 
                        ValaExpressionStatement* _tmp193_ = NULL;
1303
 
                        ValaExpressionStatement* _tmp194_;
1304
 
                        ValaDataType* _tmp195_ = NULL;
1305
 
                        ValaDataType* _tmp196_;
1306
 
                        ValaCatchClause* _tmp197_ = NULL;
1307
 
                        ValaCatchClause* _tmp198_;
1308
 
                        ValaPropertyAccessor* _tmp199_ = NULL;
1309
 
                        _tmp145_ = vala_block_new (NULL);
1310
 
                        block = _tmp145_;
1311
 
                        _tmp146_ = vala_block_new (NULL);
1312
 
                        try_block = _tmp146_;
1313
 
                        _tmp147_ = vala_block_new (NULL);
1314
 
                        catch_block = _tmp147_;
1315
 
                        _tmp148_ = vala_try_statement_new (try_block, NULL, NULL);
1316
 
                        try_stmt = _tmp148_;
1317
 
                        _tmp149_ = vala_string_literal_new ("this", NULL);
1318
 
                        _tmp150_ = _tmp149_;
1319
 
                        _tmp151_ = vala_code_node_to_string ((ValaCodeNode*) data_type_get);
 
1423
                        ValaMethodCall* _tmp163_;
 
1424
                        gchar* _tmp164_;
 
1425
                        const gchar* _tmp165_ = NULL;
 
1426
                        gchar* _tmp166_ = NULL;
 
1427
                        gchar* _tmp167_;
 
1428
                        ValaSourceReference* _tmp168_;
 
1429
                        ValaStringLiteral* _tmp169_;
 
1430
                        ValaStringLiteral* _tmp170_;
 
1431
                        ValaBlock* _tmp171_;
 
1432
                        ValaMethodCall* _tmp172_;
 
1433
                        ValaSourceReference* _tmp173_;
 
1434
                        ValaReturnStatement* _tmp174_;
 
1435
                        ValaReturnStatement* _tmp175_;
 
1436
                        ValaMethod* _tmp176_;
 
1437
                        ValaBlock* _tmp177_;
 
1438
                        _tmp129_ = name;
 
1439
                        _tmp130_ = string_to_string (_tmp129_);
 
1440
                        _tmp131_ = g_strconcat ("get_", _tmp130_, NULL);
 
1441
                        _tmp132_ = _tmp131_;
 
1442
                        _tmp133_ = data_type_get;
 
1443
                        _tmp134_ = source_reference;
 
1444
                        _tmp135_ = vala_method_new (_tmp132_, _tmp133_, _tmp134_, NULL);
 
1445
                        _tmp136_ = _tmp135_;
 
1446
                        _g_free0 (_tmp132_);
 
1447
                        get_method = _tmp136_;
 
1448
                        _tmp137_ = cl;
 
1449
                        _tmp138_ = get_method;
 
1450
                        vala_symbol_add_method ((ValaSymbol*) _tmp137_, _tmp138_);
 
1451
                        _tmp139_ = get_method;
 
1452
                        vala_symbol_set_access ((ValaSymbol*) _tmp139_, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
 
1453
                        _tmp140_ = get_method;
 
1454
                        _tmp141_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
 
1455
                        _tmp142_ = _tmp141_;
 
1456
                        vala_code_node_add_error_type ((ValaCodeNode*) _tmp140_, _tmp142_);
 
1457
                        _vala_code_node_unref0 (_tmp142_);
 
1458
                        _tmp143_ = source_reference;
 
1459
                        _tmp144_ = vala_block_new (_tmp143_);
 
1460
                        block = _tmp144_;
 
1461
                        _tmp145_ = vala_string_literal_new ("this", NULL);
 
1462
                        _tmp146_ = _tmp145_;
 
1463
                        _tmp147_ = data_type_get;
 
1464
                        _tmp148_ = vala_code_node_to_string ((ValaCodeNode*) _tmp147_);
 
1465
                        _tmp149_ = _tmp148_;
 
1466
                        _tmp150_ = string_to_string (_tmp149_);
 
1467
                        _tmp151_ = g_strconcat ("get_", _tmp150_, NULL);
1320
1468
                        _tmp152_ = _tmp151_;
1321
 
                        _tmp153_ = string_to_string (_tmp152_);
1322
 
                        _tmp154_ = g_strconcat ("get_", _tmp153_, NULL);
 
1469
                        _tmp153_ = source_reference;
 
1470
                        _tmp154_ = vala_member_access_new ((ValaExpression*) _tmp146_, _tmp152_, _tmp153_);
1323
1471
                        _tmp155_ = _tmp154_;
1324
 
                        _tmp156_ = vala_member_access_new ((ValaExpression*) _tmp150_, _tmp155_, NULL);
1325
 
                        _tmp157_ = _tmp156_;
1326
 
                        _tmp158_ = vala_method_call_new ((ValaExpression*) _tmp157_, NULL);
1327
 
                        _tmp159_ = _tmp158_;
1328
 
                        _vala_code_node_unref0 (_tmp157_);
1329
 
                        _g_free0 (_tmp155_);
 
1472
                        _tmp156_ = source_reference;
 
1473
                        _tmp157_ = vala_method_call_new ((ValaExpression*) _tmp155_, _tmp156_);
 
1474
                        _tmp158_ = _tmp157_;
 
1475
                        _vala_code_node_unref0 (_tmp155_);
1330
1476
                        _g_free0 (_tmp152_);
1331
 
                        _vala_code_node_unref0 (_tmp150_);
1332
 
                        call = _tmp159_;
1333
 
                        _tmp160_ = sql_heavy_table_field_name (table, field, &_inner_error_);
1334
 
                        _tmp161_ = _tmp160_;
1335
 
                        if (_inner_error_ != NULL) {
1336
 
                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
1337
 
                                        g_propagate_error (error, _inner_error_);
1338
 
                                        _vala_code_node_unref0 (call);
1339
 
                                        _vala_code_node_unref0 (try_stmt);
1340
 
                                        _vala_code_node_unref0 (catch_block);
1341
 
                                        _vala_code_node_unref0 (try_block);
1342
 
                                        _vala_code_node_unref0 (block);
1343
 
                                        _vala_code_node_unref0 (set_accessor);
1344
 
                                        _vala_code_node_unref0 (get_accessor);
1345
 
                                        _vala_code_node_unref0 (emit_changed_notify);
1346
 
                                        _vala_code_node_unref0 (switch_section);
1347
 
                                        _vala_code_node_unref0 (data_type_get);
1348
 
                                        _vala_code_node_unref0 (data_type);
1349
 
                                        _g_free0 (name);
1350
 
                                        _g_free0 (symbol);
1351
 
                                        _g_free0 (db_symbol);
1352
 
                                        _g_object_unref0 (db);
1353
 
                                        return;
1354
 
                                } else {
1355
 
                                        _vala_code_node_unref0 (call);
1356
 
                                        _vala_code_node_unref0 (try_stmt);
1357
 
                                        _vala_code_node_unref0 (catch_block);
1358
 
                                        _vala_code_node_unref0 (try_block);
1359
 
                                        _vala_code_node_unref0 (block);
1360
 
                                        _vala_code_node_unref0 (set_accessor);
1361
 
                                        _vala_code_node_unref0 (get_accessor);
1362
 
                                        _vala_code_node_unref0 (emit_changed_notify);
1363
 
                                        _vala_code_node_unref0 (switch_section);
1364
 
                                        _vala_code_node_unref0 (data_type_get);
1365
 
                                        _vala_code_node_unref0 (data_type);
1366
 
                                        _g_free0 (name);
1367
 
                                        _g_free0 (symbol);
1368
 
                                        _g_free0 (db_symbol);
1369
 
                                        _g_object_unref0 (db);
1370
 
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1371
 
                                        g_clear_error (&_inner_error_);
1372
 
                                        return;
1373
 
                                }
1374
 
                        }
 
1477
                        _g_free0 (_tmp149_);
 
1478
                        _vala_code_node_unref0 (_tmp146_);
 
1479
                        call = _tmp158_;
 
1480
                        _tmp159_ = table;
 
1481
                        _tmp160_ = field;
 
1482
                        _tmp161_ = sql_heavy_table_field_name (_tmp159_, _tmp160_, &_inner_error_);
1375
1483
                        _tmp162_ = _tmp161_;
1376
 
                        _tmp163_ = string_to_string (_tmp162_);
1377
 
                        _tmp164_ = g_strconcat ("\"", _tmp163_, "\"", NULL);
1378
 
                        _tmp165_ = _tmp164_;
1379
 
                        _tmp166_ = vala_string_literal_new (_tmp165_, NULL);
 
1484
                        if (_inner_error_ != NULL) {
 
1485
                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
 
1486
                                        g_propagate_error (error, _inner_error_);
 
1487
                                        _vala_code_node_unref0 (call);
 
1488
                                        _vala_code_node_unref0 (block);
 
1489
                                        _vala_code_node_unref0 (get_method);
 
1490
                                        _vala_code_node_unref0 (changed_signal);
 
1491
                                        _vala_code_node_unref0 (emit_changed_notify);
 
1492
                                        _vala_code_node_unref0 (switch_section);
 
1493
                                        _vala_code_node_unref0 (data_type_get);
 
1494
                                        _vala_code_node_unref0 (data_type);
 
1495
                                        _g_free0 (name);
 
1496
                                        _g_free0 (symbol);
 
1497
                                        _g_free0 (db_symbol);
 
1498
                                        _g_object_unref0 (db);
 
1499
                                        return;
 
1500
                                } else {
 
1501
                                        _vala_code_node_unref0 (call);
 
1502
                                        _vala_code_node_unref0 (block);
 
1503
                                        _vala_code_node_unref0 (get_method);
 
1504
                                        _vala_code_node_unref0 (changed_signal);
 
1505
                                        _vala_code_node_unref0 (emit_changed_notify);
 
1506
                                        _vala_code_node_unref0 (switch_section);
 
1507
                                        _vala_code_node_unref0 (data_type_get);
 
1508
                                        _vala_code_node_unref0 (data_type);
 
1509
                                        _g_free0 (name);
 
1510
                                        _g_free0 (symbol);
 
1511
                                        _g_free0 (db_symbol);
 
1512
                                        _g_object_unref0 (db);
 
1513
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1514
                                        g_clear_error (&_inner_error_);
 
1515
                                        return;
 
1516
                                }
 
1517
                        }
 
1518
                        _tmp163_ = call;
 
1519
                        _tmp164_ = _tmp162_;
 
1520
                        _tmp165_ = string_to_string (_tmp164_);
 
1521
                        _tmp166_ = g_strconcat ("\"", _tmp165_, "\"", NULL);
1380
1522
                        _tmp167_ = _tmp166_;
1381
 
                        vala_method_call_add_argument (call, (ValaExpression*) _tmp167_);
1382
 
                        _vala_code_node_unref0 (_tmp167_);
1383
 
                        _g_free0 (_tmp165_);
1384
 
                        _g_free0 (_tmp162_);
1385
 
                        _tmp168_ = vala_return_statement_new ((ValaExpression*) call, NULL);
1386
 
                        _tmp169_ = _tmp168_;
1387
 
                        vala_block_add_statement (try_block, (ValaStatement*) _tmp169_);
1388
 
                        _vala_code_node_unref0 (_tmp169_);
1389
 
                        _tmp170_ = vala_string_literal_new ("GLib", NULL);
1390
 
                        _tmp171_ = _tmp170_;
1391
 
                        _tmp172_ = vala_member_access_new ((ValaExpression*) _tmp171_, "error", NULL);
1392
 
                        _tmp173_ = _tmp172_;
1393
 
                        _tmp174_ = vala_method_call_new ((ValaExpression*) _tmp173_, NULL);
 
1523
                        _tmp168_ = source_reference;
 
1524
                        _tmp169_ = vala_string_literal_new (_tmp167_, _tmp168_);
 
1525
                        _tmp170_ = _tmp169_;
 
1526
                        vala_method_call_add_argument (_tmp163_, (ValaExpression*) _tmp170_);
 
1527
                        _vala_code_node_unref0 (_tmp170_);
 
1528
                        _g_free0 (_tmp167_);
 
1529
                        _g_free0 (_tmp164_);
 
1530
                        _tmp171_ = block;
 
1531
                        _tmp172_ = call;
 
1532
                        _tmp173_ = source_reference;
 
1533
                        _tmp174_ = vala_return_statement_new ((ValaExpression*) _tmp172_, _tmp173_);
1394
1534
                        _tmp175_ = _tmp174_;
1395
 
                        _vala_code_node_unref0 (_tmp173_);
1396
 
                        _vala_code_node_unref0 (_tmp171_);
1397
 
                        error_call = _tmp175_;
1398
 
                        _tmp176_ = string_to_string (name);
1399
 
                        _tmp177_ = g_strconcat ("\"Unable to retrieve `", _tmp176_, "': %s\"", NULL);
1400
 
                        _tmp178_ = _tmp177_;
1401
 
                        _tmp179_ = vala_string_literal_new (_tmp178_, NULL);
1402
 
                        _tmp180_ = _tmp179_;
1403
 
                        vala_method_call_add_argument (error_call, (ValaExpression*) _tmp180_);
1404
 
                        _vala_code_node_unref0 (_tmp180_);
1405
 
                        _g_free0 (_tmp178_);
1406
 
                        _tmp181_ = vala_member_access_new (NULL, "e", NULL);
1407
 
                        _tmp182_ = _tmp181_;
1408
 
                        _tmp183_ = vala_member_access_new ((ValaExpression*) _tmp182_, "message", NULL);
 
1535
                        vala_block_add_statement (_tmp171_, (ValaStatement*) _tmp175_);
 
1536
                        _vala_code_node_unref0 (_tmp175_);
 
1537
                        _tmp176_ = get_method;
 
1538
                        _tmp177_ = block;
 
1539
                        vala_subroutine_set_body ((ValaSubroutine*) _tmp176_, _tmp177_);
 
1540
                        _vala_code_node_unref0 (call);
 
1541
                        _vala_code_node_unref0 (block);
 
1542
                        _vala_code_node_unref0 (get_method);
 
1543
                }
 
1544
                {
 
1545
                        const gchar* _tmp178_;
 
1546
                        const gchar* _tmp179_ = NULL;
 
1547
                        gchar* _tmp180_ = NULL;
 
1548
                        gchar* _tmp181_;
 
1549
                        ValaSourceReference* _tmp182_;
 
1550
                        ValaVoidType* _tmp183_;
 
1551
                        ValaVoidType* _tmp184_;
 
1552
                        ValaSourceReference* _tmp185_;
 
1553
                        ValaMethod* _tmp186_;
 
1554
                        ValaMethod* _tmp187_;
 
1555
                        ValaMethod* set_method;
 
1556
                        ValaMethod* _tmp188_;
 
1557
                        ValaDataType* _tmp189_;
 
1558
                        ValaSourceReference* _tmp190_;
 
1559
                        ValaParameter* _tmp191_;
 
1560
                        ValaParameter* _tmp192_;
 
1561
                        ValaClass* _tmp193_;
 
1562
                        ValaMethod* _tmp194_;
 
1563
                        ValaMethod* _tmp195_;
 
1564
                        ValaMethod* _tmp196_;
 
1565
                        ValaDataType* _tmp197_ = NULL;
 
1566
                        ValaDataType* _tmp198_;
 
1567
                        ValaSourceReference* _tmp199_;
 
1568
                        ValaBlock* _tmp200_;
 
1569
                        ValaBlock* block;
 
1570
                        ValaStringLiteral* _tmp201_;
 
1571
                        ValaStringLiteral* _tmp202_;
 
1572
                        ValaDataType* _tmp203_;
 
1573
                        gchar* _tmp204_ = NULL;
 
1574
                        gchar* _tmp205_;
 
1575
                        const gchar* _tmp206_ = NULL;
 
1576
                        gchar* _tmp207_ = NULL;
 
1577
                        gchar* _tmp208_;
 
1578
                        ValaSourceReference* _tmp209_;
 
1579
                        ValaMemberAccess* _tmp210_;
 
1580
                        ValaMemberAccess* _tmp211_;
 
1581
                        ValaSourceReference* _tmp212_;
 
1582
                        ValaMethodCall* _tmp213_;
 
1583
                        ValaMethodCall* _tmp214_;
 
1584
                        ValaMethodCall* call;
 
1585
                        SQLHeavyTable* _tmp215_;
 
1586
                        gint _tmp216_;
 
1587
                        gchar* _tmp217_ = NULL;
 
1588
                        gchar* _tmp218_;
 
1589
                        ValaMethodCall* _tmp219_;
 
1590
                        gchar* _tmp220_;
 
1591
                        const gchar* _tmp221_ = NULL;
 
1592
                        gchar* _tmp222_ = NULL;
 
1593
                        gchar* _tmp223_;
 
1594
                        ValaSourceReference* _tmp224_;
 
1595
                        ValaStringLiteral* _tmp225_;
 
1596
                        ValaStringLiteral* _tmp226_;
 
1597
                        ValaBlock* _tmp227_;
 
1598
                        ValaMethodCall* _tmp228_;
 
1599
                        ValaSourceReference* _tmp229_;
 
1600
                        ValaExpressionStatement* _tmp230_;
 
1601
                        ValaExpressionStatement* _tmp231_;
 
1602
                        ValaMethod* _tmp232_;
 
1603
                        ValaBlock* _tmp233_;
 
1604
                        _tmp178_ = name;
 
1605
                        _tmp179_ = string_to_string (_tmp178_);
 
1606
                        _tmp180_ = g_strconcat ("set_", _tmp179_, NULL);
 
1607
                        _tmp181_ = _tmp180_;
 
1608
                        _tmp182_ = source_reference;
 
1609
                        _tmp183_ = vala_void_type_new (_tmp182_);
1409
1610
                        _tmp184_ = _tmp183_;
1410
 
                        vala_method_call_add_argument (error_call, (ValaExpression*) _tmp184_);
 
1611
                        _tmp185_ = source_reference;
 
1612
                        _tmp186_ = vala_method_new (_tmp181_, (ValaDataType*) _tmp184_, _tmp185_, NULL);
 
1613
                        _tmp187_ = _tmp186_;
1411
1614
                        _vala_code_node_unref0 (_tmp184_);
1412
 
                        _vala_code_node_unref0 (_tmp182_);
1413
 
                        _tmp185_ = vala_expression_statement_new ((ValaExpression*) error_call, NULL);
1414
 
                        _tmp186_ = _tmp185_;
1415
 
                        vala_block_add_statement (catch_block, (ValaStatement*) _tmp186_);
1416
 
                        _vala_code_node_unref0 (_tmp186_);
1417
 
                        _tmp187_ = vala_string_literal_new ("GLib", NULL);
1418
 
                        _tmp188_ = _tmp187_;
1419
 
                        _tmp189_ = vala_member_access_new ((ValaExpression*) _tmp188_, "assert_not_reached", NULL);
1420
 
                        _tmp190_ = _tmp189_;
1421
 
                        _tmp191_ = vala_method_call_new ((ValaExpression*) _tmp190_, NULL);
 
1615
                        _g_free0 (_tmp181_);
 
1616
                        set_method = _tmp187_;
 
1617
                        _tmp188_ = set_method;
 
1618
                        _tmp189_ = data_type;
 
1619
                        _tmp190_ = source_reference;
 
1620
                        _tmp191_ = vala_parameter_new ("value", _tmp189_, _tmp190_);
1422
1621
                        _tmp192_ = _tmp191_;
1423
 
                        _vala_code_node_unref0 (_tmp190_);
1424
 
                        _vala_code_node_unref0 (_tmp188_);
1425
 
                        anr = _tmp192_;
1426
 
                        _tmp193_ = vala_expression_statement_new ((ValaExpression*) anr, NULL);
1427
 
                        _tmp194_ = _tmp193_;
1428
 
                        vala_block_add_statement (catch_block, (ValaStatement*) _tmp194_);
1429
 
                        _vala_code_node_unref0 (_tmp194_);
1430
 
                        _tmp195_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
1431
 
                        _tmp196_ = _tmp195_;
1432
 
                        _tmp197_ = vala_catch_clause_new (_tmp196_, "e", catch_block, NULL);
 
1622
                        vala_method_add_parameter (_tmp188_, _tmp192_);
 
1623
                        _vala_code_node_unref0 (_tmp192_);
 
1624
                        _tmp193_ = cl;
 
1625
                        _tmp194_ = set_method;
 
1626
                        vala_symbol_add_method ((ValaSymbol*) _tmp193_, _tmp194_);
 
1627
                        _tmp195_ = set_method;
 
1628
                        vala_symbol_set_access ((ValaSymbol*) _tmp195_, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
 
1629
                        _tmp196_ = set_method;
 
1630
                        _tmp197_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
1433
1631
                        _tmp198_ = _tmp197_;
1434
 
                        vala_try_statement_add_catch_clause (try_stmt, _tmp198_);
 
1632
                        vala_code_node_add_error_type ((ValaCodeNode*) _tmp196_, _tmp198_);
1435
1633
                        _vala_code_node_unref0 (_tmp198_);
1436
 
                        _vala_code_node_unref0 (_tmp196_);
1437
 
                        vala_block_add_statement (block, (ValaStatement*) try_stmt);
1438
 
                        _tmp199_ = vala_property_accessor_new (TRUE, FALSE, FALSE, data_type_get, block, NULL, NULL);
1439
 
                        _vala_code_node_unref0 (get_accessor);
1440
 
                        get_accessor = _tmp199_;
1441
 
                        _vala_code_node_unref0 (anr);
1442
 
                        _vala_code_node_unref0 (error_call);
1443
 
                        _vala_code_node_unref0 (call);
1444
 
                        _vala_code_node_unref0 (try_stmt);
1445
 
                        _vala_code_node_unref0 (catch_block);
1446
 
                        _vala_code_node_unref0 (try_block);
1447
 
                        _vala_code_node_unref0 (block);
1448
 
                }
1449
 
                {
1450
 
                        ValaBlock* _tmp200_ = NULL;
1451
 
                        ValaBlock* block;
1452
 
                        ValaBlock* _tmp201_ = NULL;
1453
 
                        ValaBlock* try_block;
1454
 
                        ValaBlock* _tmp202_ = NULL;
1455
 
                        ValaBlock* catch_block;
1456
 
                        ValaTryStatement* _tmp203_ = NULL;
1457
 
                        ValaTryStatement* try_stmt;
1458
 
                        ValaStringLiteral* _tmp204_ = NULL;
1459
 
                        ValaStringLiteral* _tmp205_;
1460
 
                        gchar* _tmp206_ = NULL;
1461
 
                        gchar* _tmp207_;
1462
 
                        const gchar* _tmp208_ = NULL;
1463
 
                        gchar* _tmp209_ = NULL;
1464
 
                        gchar* _tmp210_;
1465
 
                        ValaMemberAccess* _tmp211_ = NULL;
1466
 
                        ValaMemberAccess* _tmp212_;
1467
 
                        ValaMethodCall* _tmp213_ = NULL;
1468
 
                        ValaMethodCall* _tmp214_;
1469
 
                        ValaMethodCall* call;
1470
 
                        gchar* _tmp215_ = NULL;
1471
 
                        gchar* _tmp216_;
1472
 
                        gchar* _tmp217_;
1473
 
                        const gchar* _tmp218_ = NULL;
1474
 
                        gchar* _tmp219_ = NULL;
1475
 
                        gchar* _tmp220_;
1476
 
                        ValaStringLiteral* _tmp221_ = NULL;
1477
 
                        ValaStringLiteral* _tmp222_;
1478
 
                        ValaMemberAccess* _tmp223_ = NULL;
1479
 
                        ValaMemberAccess* _tmp224_;
1480
 
                        ValaExpressionStatement* _tmp225_ = NULL;
1481
 
                        ValaExpressionStatement* _tmp226_;
1482
 
                        ValaStringLiteral* _tmp227_ = NULL;
1483
 
                        ValaStringLiteral* _tmp228_;
1484
 
                        ValaMemberAccess* _tmp229_ = NULL;
1485
 
                        ValaMemberAccess* _tmp230_;
1486
 
                        ValaMethodCall* _tmp231_ = NULL;
1487
 
                        ValaMethodCall* _tmp232_;
1488
 
                        ValaMethodCall* error_call;
1489
 
                        const gchar* _tmp233_ = NULL;
1490
 
                        gchar* _tmp234_ = NULL;
1491
 
                        gchar* _tmp235_;
1492
 
                        ValaStringLiteral* _tmp236_ = NULL;
1493
 
                        ValaStringLiteral* _tmp237_;
1494
 
                        ValaMemberAccess* _tmp238_ = NULL;
1495
 
                        ValaMemberAccess* _tmp239_;
1496
 
                        ValaMemberAccess* _tmp240_ = NULL;
1497
 
                        ValaMemberAccess* _tmp241_;
1498
 
                        ValaExpressionStatement* _tmp242_ = NULL;
1499
 
                        ValaExpressionStatement* _tmp243_;
1500
 
                        ValaDataType* _tmp244_ = NULL;
1501
 
                        ValaDataType* _tmp245_;
1502
 
                        ValaCatchClause* _tmp246_ = NULL;
1503
 
                        ValaCatchClause* _tmp247_;
1504
 
                        ValaPropertyAccessor* _tmp248_ = NULL;
1505
 
                        _tmp200_ = vala_block_new (NULL);
 
1634
                        _tmp199_ = source_reference;
 
1635
                        _tmp200_ = vala_block_new (_tmp199_);
1506
1636
                        block = _tmp200_;
1507
 
                        _tmp201_ = vala_block_new (NULL);
1508
 
                        try_block = _tmp201_;
1509
 
                        _tmp202_ = vala_block_new (NULL);
1510
 
                        catch_block = _tmp202_;
1511
 
                        _tmp203_ = vala_try_statement_new (try_block, NULL, NULL);
1512
 
                        try_stmt = _tmp203_;
1513
 
                        _tmp204_ = vala_string_literal_new ("this", NULL);
 
1637
                        _tmp201_ = vala_string_literal_new ("this", NULL);
 
1638
                        _tmp202_ = _tmp201_;
 
1639
                        _tmp203_ = data_type;
 
1640
                        _tmp204_ = vala_code_node_to_string ((ValaCodeNode*) _tmp203_);
1514
1641
                        _tmp205_ = _tmp204_;
1515
 
                        _tmp206_ = vala_code_node_to_string ((ValaCodeNode*) data_type_get);
1516
 
                        _tmp207_ = _tmp206_;
1517
 
                        _tmp208_ = string_to_string (_tmp207_);
1518
 
                        _tmp209_ = g_strconcat ("set_", _tmp208_, NULL);
1519
 
                        _tmp210_ = _tmp209_;
1520
 
                        _tmp211_ = vala_member_access_new ((ValaExpression*) _tmp205_, _tmp210_, NULL);
1521
 
                        _tmp212_ = _tmp211_;
1522
 
                        _tmp213_ = vala_method_call_new ((ValaExpression*) _tmp212_, NULL);
 
1642
                        _tmp206_ = string_to_string (_tmp205_);
 
1643
                        _tmp207_ = g_strconcat ("set_", _tmp206_, NULL);
 
1644
                        _tmp208_ = _tmp207_;
 
1645
                        _tmp209_ = source_reference;
 
1646
                        _tmp210_ = vala_member_access_new ((ValaExpression*) _tmp202_, _tmp208_, _tmp209_);
 
1647
                        _tmp211_ = _tmp210_;
 
1648
                        _tmp212_ = source_reference;
 
1649
                        _tmp213_ = vala_method_call_new ((ValaExpression*) _tmp211_, _tmp212_);
1523
1650
                        _tmp214_ = _tmp213_;
1524
 
                        _vala_code_node_unref0 (_tmp212_);
1525
 
                        _g_free0 (_tmp210_);
1526
 
                        _g_free0 (_tmp207_);
1527
 
                        _vala_code_node_unref0 (_tmp205_);
 
1651
                        _vala_code_node_unref0 (_tmp211_);
 
1652
                        _g_free0 (_tmp208_);
 
1653
                        _g_free0 (_tmp205_);
 
1654
                        _vala_code_node_unref0 (_tmp202_);
1528
1655
                        call = _tmp214_;
1529
 
                        _tmp215_ = sql_heavy_table_field_name (table, field, &_inner_error_);
1530
 
                        _tmp216_ = _tmp215_;
 
1656
                        _tmp215_ = table;
 
1657
                        _tmp216_ = field;
 
1658
                        _tmp217_ = sql_heavy_table_field_name (_tmp215_, _tmp216_, &_inner_error_);
 
1659
                        _tmp218_ = _tmp217_;
1531
1660
                        if (_inner_error_ != NULL) {
1532
1661
                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
1533
1662
                                        g_propagate_error (error, _inner_error_);
1534
1663
                                        _vala_code_node_unref0 (call);
1535
 
                                        _vala_code_node_unref0 (try_stmt);
1536
 
                                        _vala_code_node_unref0 (catch_block);
1537
 
                                        _vala_code_node_unref0 (try_block);
1538
1664
                                        _vala_code_node_unref0 (block);
1539
 
                                        _vala_code_node_unref0 (set_accessor);
1540
 
                                        _vala_code_node_unref0 (get_accessor);
 
1665
                                        _vala_code_node_unref0 (set_method);
 
1666
                                        _vala_code_node_unref0 (changed_signal);
1541
1667
                                        _vala_code_node_unref0 (emit_changed_notify);
1542
1668
                                        _vala_code_node_unref0 (switch_section);
1543
1669
                                        _vala_code_node_unref0 (data_type_get);
1549
1675
                                        return;
1550
1676
                                } else {
1551
1677
                                        _vala_code_node_unref0 (call);
1552
 
                                        _vala_code_node_unref0 (try_stmt);
1553
 
                                        _vala_code_node_unref0 (catch_block);
1554
 
                                        _vala_code_node_unref0 (try_block);
1555
1678
                                        _vala_code_node_unref0 (block);
1556
 
                                        _vala_code_node_unref0 (set_accessor);
1557
 
                                        _vala_code_node_unref0 (get_accessor);
 
1679
                                        _vala_code_node_unref0 (set_method);
 
1680
                                        _vala_code_node_unref0 (changed_signal);
1558
1681
                                        _vala_code_node_unref0 (emit_changed_notify);
1559
1682
                                        _vala_code_node_unref0 (switch_section);
1560
1683
                                        _vala_code_node_unref0 (data_type_get);
1568
1691
                                        return;
1569
1692
                                }
1570
1693
                        }
1571
 
                        _tmp217_ = _tmp216_;
1572
 
                        _tmp218_ = string_to_string (_tmp217_);
1573
 
                        _tmp219_ = g_strconcat ("\"", _tmp218_, "\"", NULL);
1574
 
                        _tmp220_ = _tmp219_;
1575
 
                        _tmp221_ = vala_string_literal_new (_tmp220_, NULL);
1576
 
                        _tmp222_ = _tmp221_;
1577
 
                        vala_method_call_add_argument (call, (ValaExpression*) _tmp222_);
1578
 
                        _vala_code_node_unref0 (_tmp222_);
1579
 
                        _g_free0 (_tmp220_);
1580
 
                        _g_free0 (_tmp217_);
1581
 
                        _tmp223_ = vala_member_access_new (NULL, "value", NULL);
1582
 
                        _tmp224_ = _tmp223_;
1583
 
                        vala_method_call_add_argument (call, (ValaExpression*) _tmp224_);
1584
 
                        _vala_code_node_unref0 (_tmp224_);
1585
 
                        _tmp225_ = vala_expression_statement_new ((ValaExpression*) call, NULL);
 
1694
                        _tmp219_ = call;
 
1695
                        _tmp220_ = _tmp218_;
 
1696
                        _tmp221_ = string_to_string (_tmp220_);
 
1697
                        _tmp222_ = g_strconcat ("\"", _tmp221_, "\"", NULL);
 
1698
                        _tmp223_ = _tmp222_;
 
1699
                        _tmp224_ = source_reference;
 
1700
                        _tmp225_ = vala_string_literal_new (_tmp223_, _tmp224_);
1586
1701
                        _tmp226_ = _tmp225_;
1587
 
                        vala_block_add_statement (try_block, (ValaStatement*) _tmp226_);
 
1702
                        vala_method_call_add_argument (_tmp219_, (ValaExpression*) _tmp226_);
1588
1703
                        _vala_code_node_unref0 (_tmp226_);
1589
 
                        _tmp227_ = vala_string_literal_new ("GLib", NULL);
1590
 
                        _tmp228_ = _tmp227_;
1591
 
                        _tmp229_ = vala_member_access_new ((ValaExpression*) _tmp228_, "error", NULL);
1592
 
                        _tmp230_ = _tmp229_;
1593
 
                        _tmp231_ = vala_method_call_new ((ValaExpression*) _tmp230_, NULL);
1594
 
                        _tmp232_ = _tmp231_;
1595
 
                        _vala_code_node_unref0 (_tmp230_);
1596
 
                        _vala_code_node_unref0 (_tmp228_);
1597
 
                        error_call = _tmp232_;
1598
 
                        _tmp233_ = string_to_string (name);
1599
 
                        _tmp234_ = g_strconcat ("\"Unable to set `", _tmp233_, "': %s\"", NULL);
1600
 
                        _tmp235_ = _tmp234_;
1601
 
                        _tmp236_ = vala_string_literal_new (_tmp235_, NULL);
1602
 
                        _tmp237_ = _tmp236_;
1603
 
                        vala_method_call_add_argument (error_call, (ValaExpression*) _tmp237_);
1604
 
                        _vala_code_node_unref0 (_tmp237_);
1605
 
                        _g_free0 (_tmp235_);
1606
 
                        _tmp238_ = vala_member_access_new (NULL, "e", NULL);
1607
 
                        _tmp239_ = _tmp238_;
1608
 
                        _tmp240_ = vala_member_access_new ((ValaExpression*) _tmp239_, "message", NULL);
1609
 
                        _tmp241_ = _tmp240_;
1610
 
                        vala_method_call_add_argument (error_call, (ValaExpression*) _tmp241_);
1611
 
                        _vala_code_node_unref0 (_tmp241_);
1612
 
                        _vala_code_node_unref0 (_tmp239_);
1613
 
                        _tmp242_ = vala_expression_statement_new ((ValaExpression*) error_call, NULL);
1614
 
                        _tmp243_ = _tmp242_;
1615
 
                        vala_block_add_statement (catch_block, (ValaStatement*) _tmp243_);
1616
 
                        _vala_code_node_unref0 (_tmp243_);
1617
 
                        _tmp244_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
1618
 
                        _tmp245_ = _tmp244_;
1619
 
                        _tmp246_ = vala_catch_clause_new (_tmp245_, "e", catch_block, NULL);
1620
 
                        _tmp247_ = _tmp246_;
1621
 
                        vala_try_statement_add_catch_clause (try_stmt, _tmp247_);
1622
 
                        _vala_code_node_unref0 (_tmp247_);
1623
 
                        _vala_code_node_unref0 (_tmp245_);
1624
 
                        vala_block_add_statement (block, (ValaStatement*) try_stmt);
1625
 
                        _tmp248_ = vala_property_accessor_new (FALSE, TRUE, FALSE, data_type, block, NULL, NULL);
 
1704
                        _g_free0 (_tmp223_);
 
1705
                        _g_free0 (_tmp220_);
 
1706
                        _tmp227_ = block;
 
1707
                        _tmp228_ = call;
 
1708
                        _tmp229_ = source_reference;
 
1709
                        _tmp230_ = vala_expression_statement_new ((ValaExpression*) _tmp228_, _tmp229_);
 
1710
                        _tmp231_ = _tmp230_;
 
1711
                        vala_block_add_statement (_tmp227_, (ValaStatement*) _tmp231_);
 
1712
                        _vala_code_node_unref0 (_tmp231_);
 
1713
                        _tmp232_ = set_method;
 
1714
                        _tmp233_ = block;
 
1715
                        vala_subroutine_set_body ((ValaSubroutine*) _tmp232_, _tmp233_);
 
1716
                        _vala_code_node_unref0 (call);
 
1717
                        _vala_code_node_unref0 (block);
 
1718
                        _vala_code_node_unref0 (set_method);
 
1719
                }
 
1720
                _vala_code_node_unref0 (changed_signal);
 
1721
        } else {
 
1722
                ValaPropertyAccessor* get_accessor = NULL;
 
1723
                ValaPropertyAccessor* set_accessor = NULL;
 
1724
                ValaSourceReference* _tmp234_;
 
1725
                ValaStringLiteral* _tmp235_;
 
1726
                ValaStringLiteral* _tmp236_;
 
1727
                ValaSourceReference* _tmp237_;
 
1728
                ValaMemberAccess* _tmp238_;
 
1729
                ValaMemberAccess* _tmp239_;
 
1730
                ValaSourceReference* _tmp240_;
 
1731
                ValaMethodCall* _tmp241_;
 
1732
                ValaMethodCall* _tmp242_;
 
1733
                const gchar* _tmp243_;
 
1734
                gchar* _tmp244_ = NULL;
 
1735
                gchar* _tmp245_;
 
1736
                gchar* _tmp246_;
 
1737
                gchar* _tmp247_;
 
1738
                gchar* _tmp248_;
 
1739
                gchar* _tmp249_;
 
1740
                ValaSourceReference* _tmp250_;
 
1741
                ValaStringLiteral* _tmp251_;
 
1742
                ValaStringLiteral* _tmp252_;
 
1743
                const gchar* _tmp431_;
 
1744
                ValaDataType* _tmp432_;
 
1745
                ValaPropertyAccessor* _tmp433_;
 
1746
                ValaPropertyAccessor* _tmp434_;
 
1747
                ValaSourceReference* _tmp435_;
 
1748
                ValaProperty* _tmp436_;
 
1749
                ValaProperty* prop;
 
1750
                ValaProperty* _tmp437_;
 
1751
                ValaClass* _tmp438_;
 
1752
                ValaProperty* _tmp439_;
 
1753
                _tmp234_ = source_reference;
 
1754
                _tmp235_ = vala_string_literal_new ("this", _tmp234_);
 
1755
                _tmp236_ = _tmp235_;
 
1756
                _tmp237_ = source_reference;
 
1757
                _tmp238_ = vala_member_access_new ((ValaExpression*) _tmp236_, "notify_property", _tmp237_);
 
1758
                _tmp239_ = _tmp238_;
 
1759
                _tmp240_ = source_reference;
 
1760
                _tmp241_ = vala_method_call_new ((ValaExpression*) _tmp239_, _tmp240_);
 
1761
                _vala_code_node_unref0 (emit_changed_notify);
 
1762
                emit_changed_notify = _tmp241_;
 
1763
                _vala_code_node_unref0 (_tmp239_);
 
1764
                _vala_code_node_unref0 (_tmp236_);
 
1765
                _tmp242_ = emit_changed_notify;
 
1766
                _tmp243_ = name;
 
1767
                _tmp244_ = string_replace (_tmp243_, "_", "-");
 
1768
                _tmp245_ = _tmp244_;
 
1769
                _tmp246_ = g_strconcat ("\"", _tmp245_, NULL);
 
1770
                _tmp247_ = _tmp246_;
 
1771
                _tmp248_ = g_strconcat (_tmp247_, "\"", NULL);
 
1772
                _tmp249_ = _tmp248_;
 
1773
                _tmp250_ = source_reference;
 
1774
                _tmp251_ = vala_string_literal_new (_tmp249_, _tmp250_);
 
1775
                _tmp252_ = _tmp251_;
 
1776
                vala_method_call_add_argument (_tmp242_, (ValaExpression*) _tmp252_);
 
1777
                _vala_code_node_unref0 (_tmp252_);
 
1778
                _g_free0 (_tmp249_);
 
1779
                _g_free0 (_tmp247_);
 
1780
                _g_free0 (_tmp245_);
 
1781
                {
 
1782
                        ValaSourceReference* _tmp253_;
 
1783
                        ValaBlock* _tmp254_;
 
1784
                        ValaBlock* block;
 
1785
                        ValaSourceReference* _tmp255_;
 
1786
                        ValaBlock* _tmp256_;
 
1787
                        ValaBlock* try_block;
 
1788
                        ValaSourceReference* _tmp257_;
 
1789
                        ValaBlock* _tmp258_;
 
1790
                        ValaBlock* catch_block;
 
1791
                        ValaBlock* _tmp259_;
 
1792
                        ValaSourceReference* _tmp260_;
 
1793
                        ValaTryStatement* _tmp261_;
 
1794
                        ValaTryStatement* try_stmt;
 
1795
                        ValaStringLiteral* _tmp262_;
 
1796
                        ValaStringLiteral* _tmp263_;
 
1797
                        ValaDataType* _tmp264_;
 
1798
                        gchar* _tmp265_ = NULL;
 
1799
                        gchar* _tmp266_;
 
1800
                        const gchar* _tmp267_ = NULL;
 
1801
                        gchar* _tmp268_ = NULL;
 
1802
                        gchar* _tmp269_;
 
1803
                        ValaSourceReference* _tmp270_;
 
1804
                        ValaMemberAccess* _tmp271_;
 
1805
                        ValaMemberAccess* _tmp272_;
 
1806
                        ValaSourceReference* _tmp273_;
 
1807
                        ValaMethodCall* _tmp274_;
 
1808
                        ValaMethodCall* _tmp275_;
 
1809
                        ValaMethodCall* call;
 
1810
                        SQLHeavyTable* _tmp276_;
 
1811
                        gint _tmp277_;
 
1812
                        gchar* _tmp278_ = NULL;
 
1813
                        gchar* _tmp279_;
 
1814
                        ValaMethodCall* _tmp280_;
 
1815
                        gchar* _tmp281_;
 
1816
                        const gchar* _tmp282_ = NULL;
 
1817
                        gchar* _tmp283_ = NULL;
 
1818
                        gchar* _tmp284_;
 
1819
                        ValaSourceReference* _tmp285_;
 
1820
                        ValaStringLiteral* _tmp286_;
 
1821
                        ValaStringLiteral* _tmp287_;
 
1822
                        ValaBlock* _tmp288_;
 
1823
                        ValaMethodCall* _tmp289_;
 
1824
                        ValaSourceReference* _tmp290_;
 
1825
                        ValaReturnStatement* _tmp291_;
 
1826
                        ValaReturnStatement* _tmp292_;
 
1827
                        ValaStringLiteral* _tmp293_;
 
1828
                        ValaStringLiteral* _tmp294_;
 
1829
                        ValaSourceReference* _tmp295_;
 
1830
                        ValaMemberAccess* _tmp296_;
 
1831
                        ValaMemberAccess* _tmp297_;
 
1832
                        ValaSourceReference* _tmp298_;
 
1833
                        ValaMethodCall* _tmp299_;
 
1834
                        ValaMethodCall* _tmp300_;
 
1835
                        ValaMethodCall* error_call;
 
1836
                        ValaMethodCall* _tmp301_;
 
1837
                        const gchar* _tmp302_;
 
1838
                        const gchar* _tmp303_ = NULL;
 
1839
                        gchar* _tmp304_ = NULL;
 
1840
                        gchar* _tmp305_;
 
1841
                        ValaSourceReference* _tmp306_;
 
1842
                        ValaStringLiteral* _tmp307_;
 
1843
                        ValaStringLiteral* _tmp308_;
 
1844
                        ValaMethodCall* _tmp309_;
 
1845
                        ValaMemberAccess* _tmp310_;
 
1846
                        ValaMemberAccess* _tmp311_;
 
1847
                        ValaSourceReference* _tmp312_;
 
1848
                        ValaMemberAccess* _tmp313_;
 
1849
                        ValaMemberAccess* _tmp314_;
 
1850
                        ValaBlock* _tmp315_;
 
1851
                        ValaMethodCall* _tmp316_;
 
1852
                        ValaSourceReference* _tmp317_;
 
1853
                        ValaExpressionStatement* _tmp318_;
 
1854
                        ValaExpressionStatement* _tmp319_;
 
1855
                        ValaSourceReference* _tmp320_;
 
1856
                        ValaStringLiteral* _tmp321_;
 
1857
                        ValaStringLiteral* _tmp322_;
 
1858
                        ValaSourceReference* _tmp323_;
 
1859
                        ValaMemberAccess* _tmp324_;
 
1860
                        ValaMemberAccess* _tmp325_;
 
1861
                        ValaMethodCall* _tmp326_;
 
1862
                        ValaMethodCall* _tmp327_;
 
1863
                        ValaMethodCall* anr;
 
1864
                        ValaBlock* _tmp328_;
 
1865
                        ValaMethodCall* _tmp329_;
 
1866
                        ValaSourceReference* _tmp330_;
 
1867
                        ValaExpressionStatement* _tmp331_;
 
1868
                        ValaExpressionStatement* _tmp332_;
 
1869
                        ValaTryStatement* _tmp333_;
 
1870
                        ValaDataType* _tmp334_ = NULL;
 
1871
                        ValaDataType* _tmp335_;
 
1872
                        ValaBlock* _tmp336_;
 
1873
                        ValaSourceReference* _tmp337_;
 
1874
                        ValaCatchClause* _tmp338_;
 
1875
                        ValaCatchClause* _tmp339_;
 
1876
                        ValaBlock* _tmp340_;
 
1877
                        ValaTryStatement* _tmp341_;
 
1878
                        ValaDataType* _tmp342_;
 
1879
                        ValaBlock* _tmp343_;
 
1880
                        ValaSourceReference* _tmp344_;
 
1881
                        ValaPropertyAccessor* _tmp345_;
 
1882
                        _tmp253_ = source_reference;
 
1883
                        _tmp254_ = vala_block_new (_tmp253_);
 
1884
                        block = _tmp254_;
 
1885
                        _tmp255_ = source_reference;
 
1886
                        _tmp256_ = vala_block_new (_tmp255_);
 
1887
                        try_block = _tmp256_;
 
1888
                        _tmp257_ = source_reference;
 
1889
                        _tmp258_ = vala_block_new (_tmp257_);
 
1890
                        catch_block = _tmp258_;
 
1891
                        _tmp259_ = try_block;
 
1892
                        _tmp260_ = source_reference;
 
1893
                        _tmp261_ = vala_try_statement_new (_tmp259_, NULL, _tmp260_);
 
1894
                        try_stmt = _tmp261_;
 
1895
                        _tmp262_ = vala_string_literal_new ("this", NULL);
 
1896
                        _tmp263_ = _tmp262_;
 
1897
                        _tmp264_ = data_type_get;
 
1898
                        _tmp265_ = vala_code_node_to_string ((ValaCodeNode*) _tmp264_);
 
1899
                        _tmp266_ = _tmp265_;
 
1900
                        _tmp267_ = string_to_string (_tmp266_);
 
1901
                        _tmp268_ = g_strconcat ("get_", _tmp267_, NULL);
 
1902
                        _tmp269_ = _tmp268_;
 
1903
                        _tmp270_ = source_reference;
 
1904
                        _tmp271_ = vala_member_access_new ((ValaExpression*) _tmp263_, _tmp269_, _tmp270_);
 
1905
                        _tmp272_ = _tmp271_;
 
1906
                        _tmp273_ = source_reference;
 
1907
                        _tmp274_ = vala_method_call_new ((ValaExpression*) _tmp272_, _tmp273_);
 
1908
                        _tmp275_ = _tmp274_;
 
1909
                        _vala_code_node_unref0 (_tmp272_);
 
1910
                        _g_free0 (_tmp269_);
 
1911
                        _g_free0 (_tmp266_);
 
1912
                        _vala_code_node_unref0 (_tmp263_);
 
1913
                        call = _tmp275_;
 
1914
                        _tmp276_ = table;
 
1915
                        _tmp277_ = field;
 
1916
                        _tmp278_ = sql_heavy_table_field_name (_tmp276_, _tmp277_, &_inner_error_);
 
1917
                        _tmp279_ = _tmp278_;
 
1918
                        if (_inner_error_ != NULL) {
 
1919
                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
 
1920
                                        g_propagate_error (error, _inner_error_);
 
1921
                                        _vala_code_node_unref0 (call);
 
1922
                                        _vala_code_node_unref0 (try_stmt);
 
1923
                                        _vala_code_node_unref0 (catch_block);
 
1924
                                        _vala_code_node_unref0 (try_block);
 
1925
                                        _vala_code_node_unref0 (block);
 
1926
                                        _vala_code_node_unref0 (set_accessor);
 
1927
                                        _vala_code_node_unref0 (get_accessor);
 
1928
                                        _vala_code_node_unref0 (emit_changed_notify);
 
1929
                                        _vala_code_node_unref0 (switch_section);
 
1930
                                        _vala_code_node_unref0 (data_type_get);
 
1931
                                        _vala_code_node_unref0 (data_type);
 
1932
                                        _g_free0 (name);
 
1933
                                        _g_free0 (symbol);
 
1934
                                        _g_free0 (db_symbol);
 
1935
                                        _g_object_unref0 (db);
 
1936
                                        return;
 
1937
                                } else {
 
1938
                                        _vala_code_node_unref0 (call);
 
1939
                                        _vala_code_node_unref0 (try_stmt);
 
1940
                                        _vala_code_node_unref0 (catch_block);
 
1941
                                        _vala_code_node_unref0 (try_block);
 
1942
                                        _vala_code_node_unref0 (block);
 
1943
                                        _vala_code_node_unref0 (set_accessor);
 
1944
                                        _vala_code_node_unref0 (get_accessor);
 
1945
                                        _vala_code_node_unref0 (emit_changed_notify);
 
1946
                                        _vala_code_node_unref0 (switch_section);
 
1947
                                        _vala_code_node_unref0 (data_type_get);
 
1948
                                        _vala_code_node_unref0 (data_type);
 
1949
                                        _g_free0 (name);
 
1950
                                        _g_free0 (symbol);
 
1951
                                        _g_free0 (db_symbol);
 
1952
                                        _g_object_unref0 (db);
 
1953
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1954
                                        g_clear_error (&_inner_error_);
 
1955
                                        return;
 
1956
                                }
 
1957
                        }
 
1958
                        _tmp280_ = call;
 
1959
                        _tmp281_ = _tmp279_;
 
1960
                        _tmp282_ = string_to_string (_tmp281_);
 
1961
                        _tmp283_ = g_strconcat ("\"", _tmp282_, "\"", NULL);
 
1962
                        _tmp284_ = _tmp283_;
 
1963
                        _tmp285_ = source_reference;
 
1964
                        _tmp286_ = vala_string_literal_new (_tmp284_, _tmp285_);
 
1965
                        _tmp287_ = _tmp286_;
 
1966
                        vala_method_call_add_argument (_tmp280_, (ValaExpression*) _tmp287_);
 
1967
                        _vala_code_node_unref0 (_tmp287_);
 
1968
                        _g_free0 (_tmp284_);
 
1969
                        _g_free0 (_tmp281_);
 
1970
                        _tmp288_ = try_block;
 
1971
                        _tmp289_ = call;
 
1972
                        _tmp290_ = source_reference;
 
1973
                        _tmp291_ = vala_return_statement_new ((ValaExpression*) _tmp289_, _tmp290_);
 
1974
                        _tmp292_ = _tmp291_;
 
1975
                        vala_block_add_statement (_tmp288_, (ValaStatement*) _tmp292_);
 
1976
                        _vala_code_node_unref0 (_tmp292_);
 
1977
                        _tmp293_ = vala_string_literal_new ("GLib", NULL);
 
1978
                        _tmp294_ = _tmp293_;
 
1979
                        _tmp295_ = source_reference;
 
1980
                        _tmp296_ = vala_member_access_new ((ValaExpression*) _tmp294_, "error", _tmp295_);
 
1981
                        _tmp297_ = _tmp296_;
 
1982
                        _tmp298_ = source_reference;
 
1983
                        _tmp299_ = vala_method_call_new ((ValaExpression*) _tmp297_, _tmp298_);
 
1984
                        _tmp300_ = _tmp299_;
 
1985
                        _vala_code_node_unref0 (_tmp297_);
 
1986
                        _vala_code_node_unref0 (_tmp294_);
 
1987
                        error_call = _tmp300_;
 
1988
                        _tmp301_ = error_call;
 
1989
                        _tmp302_ = name;
 
1990
                        _tmp303_ = string_to_string (_tmp302_);
 
1991
                        _tmp304_ = g_strconcat ("\"Unable to retrieve `", _tmp303_, "': %s\"", NULL);
 
1992
                        _tmp305_ = _tmp304_;
 
1993
                        _tmp306_ = source_reference;
 
1994
                        _tmp307_ = vala_string_literal_new (_tmp305_, _tmp306_);
 
1995
                        _tmp308_ = _tmp307_;
 
1996
                        vala_method_call_add_argument (_tmp301_, (ValaExpression*) _tmp308_);
 
1997
                        _vala_code_node_unref0 (_tmp308_);
 
1998
                        _g_free0 (_tmp305_);
 
1999
                        _tmp309_ = error_call;
 
2000
                        _tmp310_ = vala_member_access_new (NULL, "e", NULL);
 
2001
                        _tmp311_ = _tmp310_;
 
2002
                        _tmp312_ = source_reference;
 
2003
                        _tmp313_ = vala_member_access_new ((ValaExpression*) _tmp311_, "message", _tmp312_);
 
2004
                        _tmp314_ = _tmp313_;
 
2005
                        vala_method_call_add_argument (_tmp309_, (ValaExpression*) _tmp314_);
 
2006
                        _vala_code_node_unref0 (_tmp314_);
 
2007
                        _vala_code_node_unref0 (_tmp311_);
 
2008
                        _tmp315_ = catch_block;
 
2009
                        _tmp316_ = error_call;
 
2010
                        _tmp317_ = source_reference;
 
2011
                        _tmp318_ = vala_expression_statement_new ((ValaExpression*) _tmp316_, _tmp317_);
 
2012
                        _tmp319_ = _tmp318_;
 
2013
                        vala_block_add_statement (_tmp315_, (ValaStatement*) _tmp319_);
 
2014
                        _vala_code_node_unref0 (_tmp319_);
 
2015
                        _tmp320_ = source_reference;
 
2016
                        _tmp321_ = vala_string_literal_new ("GLib", _tmp320_);
 
2017
                        _tmp322_ = _tmp321_;
 
2018
                        _tmp323_ = source_reference;
 
2019
                        _tmp324_ = vala_member_access_new ((ValaExpression*) _tmp322_, "assert_not_reached", _tmp323_);
 
2020
                        _tmp325_ = _tmp324_;
 
2021
                        _tmp326_ = vala_method_call_new ((ValaExpression*) _tmp325_, NULL);
 
2022
                        _tmp327_ = _tmp326_;
 
2023
                        _vala_code_node_unref0 (_tmp325_);
 
2024
                        _vala_code_node_unref0 (_tmp322_);
 
2025
                        anr = _tmp327_;
 
2026
                        _tmp328_ = catch_block;
 
2027
                        _tmp329_ = anr;
 
2028
                        _tmp330_ = source_reference;
 
2029
                        _tmp331_ = vala_expression_statement_new ((ValaExpression*) _tmp329_, _tmp330_);
 
2030
                        _tmp332_ = _tmp331_;
 
2031
                        vala_block_add_statement (_tmp328_, (ValaStatement*) _tmp332_);
 
2032
                        _vala_code_node_unref0 (_tmp332_);
 
2033
                        _tmp333_ = try_stmt;
 
2034
                        _tmp334_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
 
2035
                        _tmp335_ = _tmp334_;
 
2036
                        _tmp336_ = catch_block;
 
2037
                        _tmp337_ = source_reference;
 
2038
                        _tmp338_ = vala_catch_clause_new (_tmp335_, "e", _tmp336_, _tmp337_);
 
2039
                        _tmp339_ = _tmp338_;
 
2040
                        vala_try_statement_add_catch_clause (_tmp333_, _tmp339_);
 
2041
                        _vala_code_node_unref0 (_tmp339_);
 
2042
                        _vala_code_node_unref0 (_tmp335_);
 
2043
                        _tmp340_ = block;
 
2044
                        _tmp341_ = try_stmt;
 
2045
                        vala_block_add_statement (_tmp340_, (ValaStatement*) _tmp341_);
 
2046
                        _tmp342_ = data_type_get;
 
2047
                        _tmp343_ = block;
 
2048
                        _tmp344_ = source_reference;
 
2049
                        _tmp345_ = vala_property_accessor_new (TRUE, FALSE, FALSE, _tmp342_, _tmp343_, _tmp344_, NULL);
 
2050
                        _vala_code_node_unref0 (get_accessor);
 
2051
                        get_accessor = _tmp345_;
 
2052
                        _vala_code_node_unref0 (anr);
 
2053
                        _vala_code_node_unref0 (error_call);
 
2054
                        _vala_code_node_unref0 (call);
 
2055
                        _vala_code_node_unref0 (try_stmt);
 
2056
                        _vala_code_node_unref0 (catch_block);
 
2057
                        _vala_code_node_unref0 (try_block);
 
2058
                        _vala_code_node_unref0 (block);
 
2059
                }
 
2060
                {
 
2061
                        ValaSourceReference* _tmp346_;
 
2062
                        ValaBlock* _tmp347_;
 
2063
                        ValaBlock* block;
 
2064
                        ValaSourceReference* _tmp348_;
 
2065
                        ValaBlock* _tmp349_;
 
2066
                        ValaBlock* try_block;
 
2067
                        ValaSourceReference* _tmp350_;
 
2068
                        ValaBlock* _tmp351_;
 
2069
                        ValaBlock* catch_block;
 
2070
                        ValaBlock* _tmp352_;
 
2071
                        ValaSourceReference* _tmp353_;
 
2072
                        ValaTryStatement* _tmp354_;
 
2073
                        ValaTryStatement* try_stmt;
 
2074
                        ValaSourceReference* _tmp355_;
 
2075
                        ValaStringLiteral* _tmp356_;
 
2076
                        ValaStringLiteral* _tmp357_;
 
2077
                        ValaDataType* _tmp358_;
 
2078
                        gchar* _tmp359_ = NULL;
 
2079
                        gchar* _tmp360_;
 
2080
                        const gchar* _tmp361_ = NULL;
 
2081
                        gchar* _tmp362_ = NULL;
 
2082
                        gchar* _tmp363_;
 
2083
                        ValaSourceReference* _tmp364_;
 
2084
                        ValaMemberAccess* _tmp365_;
 
2085
                        ValaMemberAccess* _tmp366_;
 
2086
                        ValaSourceReference* _tmp367_;
 
2087
                        ValaMethodCall* _tmp368_;
 
2088
                        ValaMethodCall* _tmp369_;
 
2089
                        ValaMethodCall* call;
 
2090
                        SQLHeavyTable* _tmp370_;
 
2091
                        gint _tmp371_;
 
2092
                        gchar* _tmp372_ = NULL;
 
2093
                        gchar* _tmp373_;
 
2094
                        ValaMethodCall* _tmp374_;
 
2095
                        gchar* _tmp375_;
 
2096
                        const gchar* _tmp376_ = NULL;
 
2097
                        gchar* _tmp377_ = NULL;
 
2098
                        gchar* _tmp378_;
 
2099
                        ValaSourceReference* _tmp379_;
 
2100
                        ValaStringLiteral* _tmp380_;
 
2101
                        ValaStringLiteral* _tmp381_;
 
2102
                        ValaMethodCall* _tmp382_;
 
2103
                        ValaSourceReference* _tmp383_;
 
2104
                        ValaMemberAccess* _tmp384_;
 
2105
                        ValaMemberAccess* _tmp385_;
 
2106
                        ValaBlock* _tmp386_;
 
2107
                        ValaMethodCall* _tmp387_;
 
2108
                        ValaSourceReference* _tmp388_;
 
2109
                        ValaExpressionStatement* _tmp389_;
 
2110
                        ValaExpressionStatement* _tmp390_;
 
2111
                        ValaStringLiteral* _tmp391_;
 
2112
                        ValaStringLiteral* _tmp392_;
 
2113
                        ValaSourceReference* _tmp393_;
 
2114
                        ValaMemberAccess* _tmp394_;
 
2115
                        ValaMemberAccess* _tmp395_;
 
2116
                        ValaSourceReference* _tmp396_;
 
2117
                        ValaMethodCall* _tmp397_;
 
2118
                        ValaMethodCall* _tmp398_;
 
2119
                        ValaMethodCall* error_call;
 
2120
                        ValaMethodCall* _tmp399_;
 
2121
                        const gchar* _tmp400_;
 
2122
                        const gchar* _tmp401_ = NULL;
 
2123
                        gchar* _tmp402_ = NULL;
 
2124
                        gchar* _tmp403_;
 
2125
                        ValaSourceReference* _tmp404_;
 
2126
                        ValaStringLiteral* _tmp405_;
 
2127
                        ValaStringLiteral* _tmp406_;
 
2128
                        ValaMethodCall* _tmp407_;
 
2129
                        ValaMemberAccess* _tmp408_;
 
2130
                        ValaMemberAccess* _tmp409_;
 
2131
                        ValaSourceReference* _tmp410_;
 
2132
                        ValaMemberAccess* _tmp411_;
 
2133
                        ValaMemberAccess* _tmp412_;
 
2134
                        ValaBlock* _tmp413_;
 
2135
                        ValaMethodCall* _tmp414_;
 
2136
                        ValaSourceReference* _tmp415_;
 
2137
                        ValaExpressionStatement* _tmp416_;
 
2138
                        ValaExpressionStatement* _tmp417_;
 
2139
                        ValaTryStatement* _tmp418_;
 
2140
                        ValaDataType* _tmp419_ = NULL;
 
2141
                        ValaDataType* _tmp420_;
 
2142
                        ValaBlock* _tmp421_;
 
2143
                        ValaSourceReference* _tmp422_;
 
2144
                        ValaCatchClause* _tmp423_;
 
2145
                        ValaCatchClause* _tmp424_;
 
2146
                        ValaBlock* _tmp425_;
 
2147
                        ValaTryStatement* _tmp426_;
 
2148
                        ValaDataType* _tmp427_;
 
2149
                        ValaBlock* _tmp428_;
 
2150
                        ValaSourceReference* _tmp429_;
 
2151
                        ValaPropertyAccessor* _tmp430_;
 
2152
                        _tmp346_ = source_reference;
 
2153
                        _tmp347_ = vala_block_new (_tmp346_);
 
2154
                        block = _tmp347_;
 
2155
                        _tmp348_ = source_reference;
 
2156
                        _tmp349_ = vala_block_new (_tmp348_);
 
2157
                        try_block = _tmp349_;
 
2158
                        _tmp350_ = source_reference;
 
2159
                        _tmp351_ = vala_block_new (_tmp350_);
 
2160
                        catch_block = _tmp351_;
 
2161
                        _tmp352_ = try_block;
 
2162
                        _tmp353_ = source_reference;
 
2163
                        _tmp354_ = vala_try_statement_new (_tmp352_, NULL, _tmp353_);
 
2164
                        try_stmt = _tmp354_;
 
2165
                        _tmp355_ = source_reference;
 
2166
                        _tmp356_ = vala_string_literal_new ("this", _tmp355_);
 
2167
                        _tmp357_ = _tmp356_;
 
2168
                        _tmp358_ = data_type_get;
 
2169
                        _tmp359_ = vala_code_node_to_string ((ValaCodeNode*) _tmp358_);
 
2170
                        _tmp360_ = _tmp359_;
 
2171
                        _tmp361_ = string_to_string (_tmp360_);
 
2172
                        _tmp362_ = g_strconcat ("set_", _tmp361_, NULL);
 
2173
                        _tmp363_ = _tmp362_;
 
2174
                        _tmp364_ = source_reference;
 
2175
                        _tmp365_ = vala_member_access_new ((ValaExpression*) _tmp357_, _tmp363_, _tmp364_);
 
2176
                        _tmp366_ = _tmp365_;
 
2177
                        _tmp367_ = source_reference;
 
2178
                        _tmp368_ = vala_method_call_new ((ValaExpression*) _tmp366_, _tmp367_);
 
2179
                        _tmp369_ = _tmp368_;
 
2180
                        _vala_code_node_unref0 (_tmp366_);
 
2181
                        _g_free0 (_tmp363_);
 
2182
                        _g_free0 (_tmp360_);
 
2183
                        _vala_code_node_unref0 (_tmp357_);
 
2184
                        call = _tmp369_;
 
2185
                        _tmp370_ = table;
 
2186
                        _tmp371_ = field;
 
2187
                        _tmp372_ = sql_heavy_table_field_name (_tmp370_, _tmp371_, &_inner_error_);
 
2188
                        _tmp373_ = _tmp372_;
 
2189
                        if (_inner_error_ != NULL) {
 
2190
                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
 
2191
                                        g_propagate_error (error, _inner_error_);
 
2192
                                        _vala_code_node_unref0 (call);
 
2193
                                        _vala_code_node_unref0 (try_stmt);
 
2194
                                        _vala_code_node_unref0 (catch_block);
 
2195
                                        _vala_code_node_unref0 (try_block);
 
2196
                                        _vala_code_node_unref0 (block);
 
2197
                                        _vala_code_node_unref0 (set_accessor);
 
2198
                                        _vala_code_node_unref0 (get_accessor);
 
2199
                                        _vala_code_node_unref0 (emit_changed_notify);
 
2200
                                        _vala_code_node_unref0 (switch_section);
 
2201
                                        _vala_code_node_unref0 (data_type_get);
 
2202
                                        _vala_code_node_unref0 (data_type);
 
2203
                                        _g_free0 (name);
 
2204
                                        _g_free0 (symbol);
 
2205
                                        _g_free0 (db_symbol);
 
2206
                                        _g_object_unref0 (db);
 
2207
                                        return;
 
2208
                                } else {
 
2209
                                        _vala_code_node_unref0 (call);
 
2210
                                        _vala_code_node_unref0 (try_stmt);
 
2211
                                        _vala_code_node_unref0 (catch_block);
 
2212
                                        _vala_code_node_unref0 (try_block);
 
2213
                                        _vala_code_node_unref0 (block);
 
2214
                                        _vala_code_node_unref0 (set_accessor);
 
2215
                                        _vala_code_node_unref0 (get_accessor);
 
2216
                                        _vala_code_node_unref0 (emit_changed_notify);
 
2217
                                        _vala_code_node_unref0 (switch_section);
 
2218
                                        _vala_code_node_unref0 (data_type_get);
 
2219
                                        _vala_code_node_unref0 (data_type);
 
2220
                                        _g_free0 (name);
 
2221
                                        _g_free0 (symbol);
 
2222
                                        _g_free0 (db_symbol);
 
2223
                                        _g_object_unref0 (db);
 
2224
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
2225
                                        g_clear_error (&_inner_error_);
 
2226
                                        return;
 
2227
                                }
 
2228
                        }
 
2229
                        _tmp374_ = call;
 
2230
                        _tmp375_ = _tmp373_;
 
2231
                        _tmp376_ = string_to_string (_tmp375_);
 
2232
                        _tmp377_ = g_strconcat ("\"", _tmp376_, "\"", NULL);
 
2233
                        _tmp378_ = _tmp377_;
 
2234
                        _tmp379_ = source_reference;
 
2235
                        _tmp380_ = vala_string_literal_new (_tmp378_, _tmp379_);
 
2236
                        _tmp381_ = _tmp380_;
 
2237
                        vala_method_call_add_argument (_tmp374_, (ValaExpression*) _tmp381_);
 
2238
                        _vala_code_node_unref0 (_tmp381_);
 
2239
                        _g_free0 (_tmp378_);
 
2240
                        _g_free0 (_tmp375_);
 
2241
                        _tmp382_ = call;
 
2242
                        _tmp383_ = source_reference;
 
2243
                        _tmp384_ = vala_member_access_new (NULL, "value", _tmp383_);
 
2244
                        _tmp385_ = _tmp384_;
 
2245
                        vala_method_call_add_argument (_tmp382_, (ValaExpression*) _tmp385_);
 
2246
                        _vala_code_node_unref0 (_tmp385_);
 
2247
                        _tmp386_ = try_block;
 
2248
                        _tmp387_ = call;
 
2249
                        _tmp388_ = source_reference;
 
2250
                        _tmp389_ = vala_expression_statement_new ((ValaExpression*) _tmp387_, _tmp388_);
 
2251
                        _tmp390_ = _tmp389_;
 
2252
                        vala_block_add_statement (_tmp386_, (ValaStatement*) _tmp390_);
 
2253
                        _vala_code_node_unref0 (_tmp390_);
 
2254
                        _tmp391_ = vala_string_literal_new ("GLib", NULL);
 
2255
                        _tmp392_ = _tmp391_;
 
2256
                        _tmp393_ = source_reference;
 
2257
                        _tmp394_ = vala_member_access_new ((ValaExpression*) _tmp392_, "error", _tmp393_);
 
2258
                        _tmp395_ = _tmp394_;
 
2259
                        _tmp396_ = source_reference;
 
2260
                        _tmp397_ = vala_method_call_new ((ValaExpression*) _tmp395_, _tmp396_);
 
2261
                        _tmp398_ = _tmp397_;
 
2262
                        _vala_code_node_unref0 (_tmp395_);
 
2263
                        _vala_code_node_unref0 (_tmp392_);
 
2264
                        error_call = _tmp398_;
 
2265
                        _tmp399_ = error_call;
 
2266
                        _tmp400_ = name;
 
2267
                        _tmp401_ = string_to_string (_tmp400_);
 
2268
                        _tmp402_ = g_strconcat ("\"Unable to set `", _tmp401_, "': %s\"", NULL);
 
2269
                        _tmp403_ = _tmp402_;
 
2270
                        _tmp404_ = source_reference;
 
2271
                        _tmp405_ = vala_string_literal_new (_tmp403_, _tmp404_);
 
2272
                        _tmp406_ = _tmp405_;
 
2273
                        vala_method_call_add_argument (_tmp399_, (ValaExpression*) _tmp406_);
 
2274
                        _vala_code_node_unref0 (_tmp406_);
 
2275
                        _g_free0 (_tmp403_);
 
2276
                        _tmp407_ = error_call;
 
2277
                        _tmp408_ = vala_member_access_new (NULL, "e", NULL);
 
2278
                        _tmp409_ = _tmp408_;
 
2279
                        _tmp410_ = source_reference;
 
2280
                        _tmp411_ = vala_member_access_new ((ValaExpression*) _tmp409_, "message", _tmp410_);
 
2281
                        _tmp412_ = _tmp411_;
 
2282
                        vala_method_call_add_argument (_tmp407_, (ValaExpression*) _tmp412_);
 
2283
                        _vala_code_node_unref0 (_tmp412_);
 
2284
                        _vala_code_node_unref0 (_tmp409_);
 
2285
                        _tmp413_ = catch_block;
 
2286
                        _tmp414_ = error_call;
 
2287
                        _tmp415_ = source_reference;
 
2288
                        _tmp416_ = vala_expression_statement_new ((ValaExpression*) _tmp414_, _tmp415_);
 
2289
                        _tmp417_ = _tmp416_;
 
2290
                        vala_block_add_statement (_tmp413_, (ValaStatement*) _tmp417_);
 
2291
                        _vala_code_node_unref0 (_tmp417_);
 
2292
                        _tmp418_ = try_stmt;
 
2293
                        _tmp419_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
 
2294
                        _tmp420_ = _tmp419_;
 
2295
                        _tmp421_ = catch_block;
 
2296
                        _tmp422_ = source_reference;
 
2297
                        _tmp423_ = vala_catch_clause_new (_tmp420_, "e", _tmp421_, _tmp422_);
 
2298
                        _tmp424_ = _tmp423_;
 
2299
                        vala_try_statement_add_catch_clause (_tmp418_, _tmp424_);
 
2300
                        _vala_code_node_unref0 (_tmp424_);
 
2301
                        _vala_code_node_unref0 (_tmp420_);
 
2302
                        _tmp425_ = block;
 
2303
                        _tmp426_ = try_stmt;
 
2304
                        vala_block_add_statement (_tmp425_, (ValaStatement*) _tmp426_);
 
2305
                        _tmp427_ = data_type;
 
2306
                        _tmp428_ = block;
 
2307
                        _tmp429_ = source_reference;
 
2308
                        _tmp430_ = vala_property_accessor_new (FALSE, TRUE, FALSE, _tmp427_, _tmp428_, _tmp429_, NULL);
1626
2309
                        _vala_code_node_unref0 (set_accessor);
1627
 
                        set_accessor = _tmp248_;
 
2310
                        set_accessor = _tmp430_;
1628
2311
                        _vala_code_node_unref0 (error_call);
1629
2312
                        _vala_code_node_unref0 (call);
1630
2313
                        _vala_code_node_unref0 (try_stmt);
1632
2315
                        _vala_code_node_unref0 (try_block);
1633
2316
                        _vala_code_node_unref0 (block);
1634
2317
                }
1635
 
                _tmp249_ = vala_property_new (name, data_type, get_accessor, set_accessor, NULL, NULL);
1636
 
                prop = _tmp249_;
1637
 
                vala_symbol_set_access ((ValaSymbol*) prop, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
1638
 
                vala_symbol_add_property ((ValaSymbol*) cl, prop);
 
2318
                _tmp431_ = name;
 
2319
                _tmp432_ = data_type;
 
2320
                _tmp433_ = get_accessor;
 
2321
                _tmp434_ = set_accessor;
 
2322
                _tmp435_ = source_reference;
 
2323
                _tmp436_ = vala_property_new (_tmp431_, _tmp432_, _tmp433_, _tmp434_, _tmp435_, NULL);
 
2324
                prop = _tmp436_;
 
2325
                _tmp437_ = prop;
 
2326
                vala_symbol_set_access ((ValaSymbol*) _tmp437_, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
 
2327
                _tmp438_ = cl;
 
2328
                _tmp439_ = prop;
 
2329
                vala_symbol_add_property ((ValaSymbol*) _tmp438_, _tmp439_);
1639
2330
                _vala_code_node_unref0 (prop);
1640
2331
                _vala_code_node_unref0 (set_accessor);
1641
2332
                _vala_code_node_unref0 (get_accessor);
1642
2333
        }
1643
 
        _tmp250_ = vala_expression_statement_new ((ValaExpression*) emit_changed_notify, NULL);
1644
 
        _tmp251_ = _tmp250_;
1645
 
        vala_block_add_statement ((ValaBlock*) switch_section, (ValaStatement*) _tmp251_);
1646
 
        _vala_code_node_unref0 (_tmp251_);
1647
 
        _tmp252_ = vala_break_statement_new (NULL);
1648
 
        _tmp253_ = _tmp252_;
1649
 
        vala_block_add_statement ((ValaBlock*) switch_section, (ValaStatement*) _tmp253_);
1650
 
        _vala_code_node_unref0 (_tmp253_);
 
2334
        _tmp440_ = switch_section;
 
2335
        _tmp441_ = emit_changed_notify;
 
2336
        _tmp442_ = source_reference;
 
2337
        _tmp443_ = vala_expression_statement_new ((ValaExpression*) _tmp441_, _tmp442_);
 
2338
        _tmp444_ = _tmp443_;
 
2339
        vala_block_add_statement ((ValaBlock*) _tmp440_, (ValaStatement*) _tmp444_);
 
2340
        _vala_code_node_unref0 (_tmp444_);
 
2341
        _tmp445_ = switch_section;
 
2342
        _tmp446_ = source_reference;
 
2343
        _tmp447_ = vala_break_statement_new (_tmp446_);
 
2344
        _tmp448_ = _tmp447_;
 
2345
        vala_block_add_statement ((ValaBlock*) _tmp445_, (ValaStatement*) _tmp448_);
 
2346
        _vala_code_node_unref0 (_tmp448_);
1651
2347
        _vala_code_node_unref0 (emit_changed_notify);
1652
2348
        _vala_code_node_unref0 (switch_section);
1653
2349
        _vala_code_node_unref0 (data_type_get);
1659
2355
}
1660
2356
 
1661
2357
 
1662
 
static void sql_heavy_generator_parse_table (SQLHeavyGenerator* self, SQLHeavyTable* table, ValaNamespace* ns, GError** error) {
1663
 
        SQLHeavyQueryable* _tmp0_ = NULL;
1664
 
        SQLHeavyDatabase* _tmp1_ = NULL;
 
2358
static void sql_heavy_generator_parse_table (SQLHeavyGenerator* self, SQLHeavyTable* table, ValaNamespace* ns, ValaSourceReference* source_reference, GError** error) {
 
2359
        SQLHeavyTable* _tmp0_;
 
2360
        SQLHeavyQueryable* _tmp1_;
 
2361
        SQLHeavyQueryable* _tmp2_;
 
2362
        SQLHeavyDatabase* _tmp3_;
 
2363
        SQLHeavyDatabase* _tmp4_;
1665
2364
        SQLHeavyDatabase* db;
1666
 
        const gchar* _tmp2_ = NULL;
1667
 
        gchar* _tmp3_ = NULL;
1668
 
        gchar* _tmp4_;
1669
 
        gchar** _tmp5_;
1670
 
        gchar** _tmp6_ = NULL;
1671
 
        gchar** _tmp7_;
1672
 
        gint _tmp7__length1;
1673
 
        gchar* _tmp8_;
 
2365
        SQLHeavyDatabase* _tmp5_;
 
2366
        const gchar* _tmp6_;
 
2367
        const gchar* _tmp7_;
 
2368
        gchar* _tmp8_ = NULL;
1674
2369
        gchar* _tmp9_;
 
2370
        gchar** _tmp10_;
 
2371
        gchar** _tmp11_ = NULL;
 
2372
        gchar** _tmp12_;
 
2373
        gint _tmp12__length1;
 
2374
        const gchar* _tmp13_;
 
2375
        gchar* _tmp14_;
 
2376
        gchar* _tmp15_;
1675
2377
        gchar* db_symbol;
1676
 
        gchar* _tmp10_ = NULL;
1677
 
        gchar* _tmp11_;
1678
 
        const gchar* _tmp12_ = NULL;
1679
 
        const gchar* _tmp13_ = NULL;
1680
 
        const gchar* _tmp14_ = NULL;
1681
 
        gchar* _tmp15_ = NULL;
1682
 
        gchar* _tmp16_;
1683
 
        gchar* symbol;
 
2378
        const gchar* _tmp16_;
1684
2379
        gchar* _tmp17_ = NULL;
 
2380
        gchar* _tmp18_;
 
2381
        const gchar* _tmp19_ = NULL;
 
2382
        SQLHeavyTable* _tmp20_;
 
2383
        const gchar* _tmp21_;
 
2384
        const gchar* _tmp22_;
 
2385
        const gchar* _tmp23_ = NULL;
 
2386
        gchar* _tmp24_ = NULL;
 
2387
        gchar* _tmp25_;
 
2388
        gchar* symbol;
 
2389
        const gchar* _tmp26_;
 
2390
        gchar* _tmp27_ = NULL;
1685
2391
        gchar* symbol_name;
1686
 
        gboolean _tmp18_;
1687
 
        ValaScope* _tmp19_ = NULL;
1688
 
        ValaSymbol* _tmp20_ = NULL;
1689
 
        ValaSymbol* _tmp21_;
 
2392
        const gchar* _tmp28_;
 
2393
        gboolean _tmp29_ = FALSE;
 
2394
        ValaNamespace* _tmp30_;
 
2395
        ValaScope* _tmp31_;
 
2396
        ValaScope* _tmp32_;
 
2397
        const gchar* _tmp33_;
 
2398
        ValaSymbol* _tmp34_ = NULL;
1690
2399
        ValaClass* cl;
1691
 
        ValaDataType* _tmp23_ = NULL;
1692
 
        ValaDataType* _tmp24_;
 
2400
        ValaClass* _tmp35_;
 
2401
        ValaClass* _tmp42_;
 
2402
        ValaDataType* _tmp43_ = NULL;
 
2403
        ValaDataType* _tmp44_;
1693
2404
        ValaSwitchStatement* signals_switch = NULL;
1694
 
        ValaConstructor* _tmp80_ = NULL;
 
2405
        ValaSourceReference* _tmp136_;
 
2406
        ValaConstructor* _tmp137_;
1695
2407
        ValaConstructor* con;
1696
 
        ValaBlock* _tmp81_ = NULL;
1697
 
        ValaBlock* _tmp82_;
1698
 
        ValaStringLiteral* _tmp83_ = NULL;
1699
 
        ValaStringLiteral* _tmp84_;
1700
 
        ValaMemberAccess* _tmp85_ = NULL;
1701
 
        ValaMemberAccess* _tmp86_;
1702
 
        ValaMemberAccess* _tmp87_ = NULL;
1703
 
        ValaMemberAccess* _tmp88_;
1704
 
        ValaMethodCall* _tmp89_ = NULL;
1705
 
        ValaMethodCall* _tmp90_;
 
2408
        ValaConstructor* _tmp138_;
 
2409
        ValaSourceReference* _tmp139_;
 
2410
        ValaBlock* _tmp140_;
 
2411
        ValaBlock* _tmp141_;
 
2412
        ValaStringLiteral* _tmp142_;
 
2413
        ValaStringLiteral* _tmp143_;
 
2414
        ValaSourceReference* _tmp144_;
 
2415
        ValaMemberAccess* _tmp145_;
 
2416
        ValaMemberAccess* _tmp146_;
 
2417
        ValaSourceReference* _tmp147_;
 
2418
        ValaMemberAccess* _tmp148_;
 
2419
        ValaMemberAccess* _tmp149_;
 
2420
        ValaSourceReference* _tmp150_;
 
2421
        ValaMethodCall* _tmp151_;
 
2422
        ValaMethodCall* _tmp152_;
1706
2423
        ValaMethodCall* conn_call;
1707
 
        ValaStringLiteral* _tmp91_ = NULL;
1708
 
        ValaStringLiteral* _tmp92_;
1709
 
        ValaMemberAccess* _tmp93_ = NULL;
1710
 
        ValaMemberAccess* _tmp94_;
1711
 
        ValaBlock* _tmp95_ = NULL;
1712
 
        ValaExpressionStatement* _tmp96_ = NULL;
1713
 
        ValaExpressionStatement* _tmp97_;
 
2424
        ValaMethodCall* _tmp153_;
 
2425
        ValaStringLiteral* _tmp154_;
 
2426
        ValaStringLiteral* _tmp155_;
 
2427
        ValaSourceReference* _tmp156_;
 
2428
        ValaMemberAccess* _tmp157_;
 
2429
        ValaMemberAccess* _tmp158_;
 
2430
        ValaConstructor* _tmp159_;
 
2431
        ValaBlock* _tmp160_;
 
2432
        ValaBlock* _tmp161_;
 
2433
        ValaMethodCall* _tmp162_;
 
2434
        ValaSourceReference* _tmp163_;
 
2435
        ValaExpressionStatement* _tmp164_;
 
2436
        ValaExpressionStatement* _tmp165_;
 
2437
        ValaClass* _tmp166_;
 
2438
        ValaConstructor* _tmp167_;
1714
2439
        GError * _inner_error_ = NULL;
1715
2440
        g_return_if_fail (self != NULL);
1716
2441
        g_return_if_fail (table != NULL);
1717
2442
        g_return_if_fail (ns != NULL);
1718
 
        _tmp0_ = sql_heavy_table_get_queryable (table);
1719
 
        _tmp1_ = sql_heavy_queryable_get_database (_tmp0_);
1720
 
        db = _tmp1_;
1721
 
        _tmp2_ = sql_heavy_database_get_filename (db);
1722
 
        _tmp3_ = g_path_get_basename (_tmp2_);
 
2443
        g_return_if_fail (source_reference != NULL);
 
2444
        _tmp0_ = table;
 
2445
        _tmp1_ = sql_heavy_table_get_queryable (_tmp0_);
 
2446
        _tmp2_ = _tmp1_;
 
2447
        _tmp3_ = sql_heavy_queryable_get_database (_tmp2_);
1723
2448
        _tmp4_ = _tmp3_;
1724
 
        _tmp6_ = _tmp5_ = g_strsplit (_tmp4_, ".", 2);
 
2449
        db = _tmp4_;
 
2450
        _tmp5_ = db;
 
2451
        _tmp6_ = sql_heavy_database_get_filename (_tmp5_);
1725
2452
        _tmp7_ = _tmp6_;
1726
 
        _tmp7__length1 = _vala_array_length (_tmp5_);
1727
 
        _tmp8_ = g_strdup (_tmp7_[0]);
 
2453
        _tmp8_ = g_path_get_basename (_tmp7_);
1728
2454
        _tmp9_ = _tmp8_;
1729
 
        _tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
1730
 
        _g_free0 (_tmp4_);
1731
 
        db_symbol = _tmp9_;
1732
 
        _tmp10_ = g_path_get_basename (db_symbol);
1733
 
        _tmp11_ = _tmp10_;
1734
 
        _tmp12_ = string_to_string (_tmp11_);
1735
 
        _tmp13_ = sql_heavy_table_get_name (table);
1736
 
        _tmp14_ = string_to_string (_tmp13_);
1737
 
        _tmp15_ = g_strconcat ("@", _tmp12_, "/", _tmp14_, NULL);
1738
 
        _tmp16_ = _tmp15_;
1739
 
        _g_free0 (_tmp11_);
1740
 
        symbol = _tmp16_;
1741
 
        _tmp17_ = sql_heavy_generator_get_symbol_name (self, symbol);
1742
 
        symbol_name = _tmp17_;
1743
 
        _tmp18_ = sql_heavy_generator_symbol_is_hidden (self, symbol);
1744
 
        if (_tmp18_) {
 
2455
        _tmp11_ = _tmp10_ = g_strsplit (_tmp9_, ".", 2);
 
2456
        _tmp12_ = _tmp11_;
 
2457
        _tmp12__length1 = _vala_array_length (_tmp10_);
 
2458
        _tmp13_ = _tmp12_[0];
 
2459
        _tmp14_ = g_strdup (_tmp13_);
 
2460
        _tmp15_ = _tmp14_;
 
2461
        _tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
 
2462
        _g_free0 (_tmp9_);
 
2463
        db_symbol = _tmp15_;
 
2464
        _tmp16_ = db_symbol;
 
2465
        _tmp17_ = g_path_get_basename (_tmp16_);
 
2466
        _tmp18_ = _tmp17_;
 
2467
        _tmp19_ = string_to_string (_tmp18_);
 
2468
        _tmp20_ = table;
 
2469
        _tmp21_ = sql_heavy_table_get_name (_tmp20_);
 
2470
        _tmp22_ = _tmp21_;
 
2471
        _tmp23_ = string_to_string (_tmp22_);
 
2472
        _tmp24_ = g_strconcat ("@", _tmp19_, "/", _tmp23_, NULL);
 
2473
        _tmp25_ = _tmp24_;
 
2474
        _g_free0 (_tmp18_);
 
2475
        symbol = _tmp25_;
 
2476
        _tmp26_ = symbol;
 
2477
        _tmp27_ = sql_heavy_generator_get_symbol_name (self, _tmp26_);
 
2478
        symbol_name = _tmp27_;
 
2479
        _tmp28_ = symbol;
 
2480
        _tmp29_ = sql_heavy_generator_symbol_is_hidden (self, _tmp28_);
 
2481
        if (_tmp29_) {
1745
2482
                _g_free0 (symbol_name);
1746
2483
                _g_free0 (symbol);
1747
2484
                _g_free0 (db_symbol);
1748
2485
                _g_object_unref0 (db);
1749
2486
                return;
1750
2487
        }
1751
 
        _tmp19_ = vala_symbol_get_scope ((ValaSymbol*) ns);
1752
 
        _tmp20_ = vala_scope_lookup (_tmp19_, symbol_name);
1753
 
        _tmp21_ = _tmp20_;
1754
 
        cl = VALA_IS_CLASS (_tmp21_) ? ((ValaClass*) _tmp21_) : NULL;
1755
 
        if (cl == NULL) {
1756
 
                ValaClass* _tmp22_ = NULL;
1757
 
                _tmp22_ = vala_class_new (symbol_name, NULL, NULL);
 
2488
        _tmp30_ = ns;
 
2489
        _tmp31_ = vala_symbol_get_scope ((ValaSymbol*) _tmp30_);
 
2490
        _tmp32_ = _tmp31_;
 
2491
        _tmp33_ = symbol_name;
 
2492
        _tmp34_ = vala_scope_lookup (_tmp32_, _tmp33_);
 
2493
        cl = VALA_IS_CLASS (_tmp34_) ? ((ValaClass*) _tmp34_) : NULL;
 
2494
        _tmp35_ = cl;
 
2495
        if (_tmp35_ == NULL) {
 
2496
                const gchar* _tmp36_;
 
2497
                ValaSourceReference* _tmp37_;
 
2498
                ValaClass* _tmp38_;
 
2499
                ValaClass* _tmp39_;
 
2500
                ValaNamespace* _tmp40_;
 
2501
                ValaClass* _tmp41_;
 
2502
                _tmp36_ = symbol_name;
 
2503
                _tmp37_ = source_reference;
 
2504
                _tmp38_ = vala_class_new (_tmp36_, _tmp37_, NULL);
1758
2505
                _vala_code_node_unref0 (cl);
1759
 
                cl = _tmp22_;
1760
 
                vala_symbol_set_access ((ValaSymbol*) cl, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
1761
 
                vala_symbol_add_class ((ValaSymbol*) ns, cl);
 
2506
                cl = _tmp38_;
 
2507
                _tmp39_ = cl;
 
2508
                vala_symbol_set_access ((ValaSymbol*) _tmp39_, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
 
2509
                _tmp40_ = ns;
 
2510
                _tmp41_ = cl;
 
2511
                vala_symbol_add_class ((ValaSymbol*) _tmp40_, _tmp41_);
1762
2512
        }
1763
 
        _tmp23_ = sql_heavy_generator_type_from_string ("SQLHeavy.Row");
1764
 
        _tmp24_ = _tmp23_;
1765
 
        vala_class_add_base_type (cl, _tmp24_);
1766
 
        _vala_code_node_unref0 (_tmp24_);
 
2513
        _tmp42_ = cl;
 
2514
        _tmp43_ = sql_heavy_generator_type_from_string ("SQLHeavy.Row");
 
2515
        _tmp44_ = _tmp43_;
 
2516
        vala_class_add_base_type (_tmp42_, _tmp44_);
 
2517
        _vala_code_node_unref0 (_tmp44_);
1767
2518
        {
1768
 
                ValaVoidType* _tmp25_ = NULL;
1769
 
                ValaVoidType* _tmp26_;
1770
 
                ValaMethod* _tmp27_ = NULL;
1771
 
                ValaMethod* _tmp28_;
 
2519
                ValaVoidType* _tmp45_;
 
2520
                ValaVoidType* _tmp46_;
 
2521
                ValaMethod* _tmp47_;
 
2522
                ValaMethod* _tmp48_;
1772
2523
                ValaMethod* register_notify;
1773
 
                ValaDataType* _tmp29_ = NULL;
1774
 
                ValaDataType* _tmp30_;
1775
 
                ValaParameter* _tmp31_ = NULL;
1776
 
                ValaParameter* _tmp32_;
1777
 
                ValaBlock* _tmp33_ = NULL;
 
2524
                ValaMethod* _tmp49_;
 
2525
                ValaMethod* _tmp50_;
 
2526
                ValaDataType* _tmp51_ = NULL;
 
2527
                ValaDataType* _tmp52_;
 
2528
                ValaParameter* _tmp53_;
 
2529
                ValaParameter* _tmp54_;
 
2530
                ValaSourceReference* _tmp55_;
 
2531
                ValaBlock* _tmp56_;
1778
2532
                ValaBlock* block;
1779
 
                ValaBlock* _tmp34_ = NULL;
 
2533
                ValaSourceReference* _tmp57_;
 
2534
                ValaBlock* _tmp58_;
1780
2535
                ValaBlock* try_block;
1781
 
                ValaBlock* _tmp35_ = NULL;
 
2536
                ValaSourceReference* _tmp59_;
 
2537
                ValaBlock* _tmp60_;
1782
2538
                ValaBlock* catch_block;
1783
 
                ValaTryStatement* _tmp36_ = NULL;
 
2539
                ValaBlock* _tmp61_;
 
2540
                ValaSourceReference* _tmp62_;
 
2541
                ValaTryStatement* _tmp63_;
1784
2542
                ValaTryStatement* try_stmt;
1785
 
                ValaDataType* _tmp37_ = NULL;
1786
 
                ValaDataType* _tmp38_;
1787
 
                ValaStringLiteral* _tmp39_ = NULL;
1788
 
                ValaStringLiteral* _tmp40_;
1789
 
                ValaLocalVariable* _tmp41_ = NULL;
1790
 
                ValaLocalVariable* _tmp42_;
 
2543
                ValaDataType* _tmp64_ = NULL;
 
2544
                ValaDataType* _tmp65_;
 
2545
                ValaStringLiteral* _tmp66_;
 
2546
                ValaStringLiteral* _tmp67_;
 
2547
                ValaSourceReference* _tmp68_;
 
2548
                ValaLocalVariable* _tmp69_;
 
2549
                ValaLocalVariable* _tmp70_;
1791
2550
                ValaLocalVariable* field_name;
1792
 
                ValaDeclarationStatement* _tmp43_ = NULL;
1793
 
                ValaDeclarationStatement* _tmp44_;
1794
 
                ValaStringLiteral* _tmp45_ = NULL;
1795
 
                ValaStringLiteral* _tmp46_;
1796
 
                ValaMemberAccess* _tmp47_ = NULL;
1797
 
                ValaMemberAccess* _tmp48_;
1798
 
                ValaMethodCall* _tmp49_ = NULL;
1799
 
                ValaMethodCall* _tmp50_;
 
2551
                ValaBlock* _tmp71_;
 
2552
                ValaLocalVariable* _tmp72_;
 
2553
                ValaSourceReference* _tmp73_;
 
2554
                ValaDeclarationStatement* _tmp74_;
 
2555
                ValaDeclarationStatement* _tmp75_;
 
2556
                ValaBlock* _tmp76_;
 
2557
                ValaTryStatement* _tmp77_;
 
2558
                ValaStringLiteral* _tmp78_;
 
2559
                ValaStringLiteral* _tmp79_;
 
2560
                ValaMemberAccess* _tmp80_;
 
2561
                ValaMemberAccess* _tmp81_;
 
2562
                ValaMethodCall* _tmp82_;
 
2563
                ValaMethodCall* _tmp83_;
1800
2564
                ValaMethodCall* get_field_name;
1801
 
                ValaMemberAccess* _tmp51_ = NULL;
1802
 
                ValaMemberAccess* _tmp52_;
1803
 
                ValaStringLiteral* _tmp53_ = NULL;
1804
 
                ValaStringLiteral* _tmp54_;
1805
 
                ValaAssignment* _tmp55_ = NULL;
1806
 
                ValaAssignment* _tmp56_;
1807
 
                ValaExpressionStatement* _tmp57_ = NULL;
1808
 
                ValaExpressionStatement* _tmp58_;
1809
 
                ValaStringLiteral* _tmp59_ = NULL;
1810
 
                ValaStringLiteral* _tmp60_;
1811
 
                ValaMemberAccess* _tmp61_ = NULL;
1812
 
                ValaMemberAccess* _tmp62_;
1813
 
                ValaMethodCall* _tmp63_ = NULL;
1814
 
                ValaMethodCall* _tmp64_;
 
2565
                ValaMethodCall* _tmp84_;
 
2566
                ValaMemberAccess* _tmp85_;
 
2567
                ValaMemberAccess* _tmp86_;
 
2568
                ValaBlock* _tmp87_;
 
2569
                ValaStringLiteral* _tmp88_;
 
2570
                ValaStringLiteral* _tmp89_;
 
2571
                ValaMethodCall* _tmp90_;
 
2572
                ValaAssignment* _tmp91_;
 
2573
                ValaAssignment* _tmp92_;
 
2574
                ValaExpressionStatement* _tmp93_;
 
2575
                ValaExpressionStatement* _tmp94_;
 
2576
                ValaStringLiteral* _tmp95_;
 
2577
                ValaStringLiteral* _tmp96_;
 
2578
                ValaMemberAccess* _tmp97_;
 
2579
                ValaMemberAccess* _tmp98_;
 
2580
                ValaSourceReference* _tmp99_;
 
2581
                ValaMethodCall* _tmp100_;
 
2582
                ValaMethodCall* _tmp101_;
1815
2583
                ValaMethodCall* warn_call;
1816
 
                ValaStringLiteral* _tmp65_ = NULL;
1817
 
                ValaStringLiteral* _tmp66_;
1818
 
                ValaMemberAccess* _tmp67_ = NULL;
1819
 
                ValaMemberAccess* _tmp68_;
1820
 
                ValaExpressionStatement* _tmp69_ = NULL;
1821
 
                ValaExpressionStatement* _tmp70_;
1822
 
                ValaReturnStatement* _tmp71_ = NULL;
1823
 
                ValaReturnStatement* _tmp72_;
1824
 
                ValaDataType* _tmp73_ = NULL;
1825
 
                ValaDataType* _tmp74_;
1826
 
                ValaCatchClause* _tmp75_ = NULL;
1827
 
                ValaCatchClause* _tmp76_;
1828
 
                ValaStringLiteral* _tmp77_ = NULL;
1829
 
                ValaStringLiteral* _tmp78_;
1830
 
                ValaSwitchStatement* _tmp79_ = NULL;
1831
 
                _tmp25_ = vala_void_type_new (NULL);
1832
 
                _tmp26_ = _tmp25_;
1833
 
                _tmp27_ = vala_method_new ("emit_change_notification", (ValaDataType*) _tmp26_, NULL, NULL);
1834
 
                _tmp28_ = _tmp27_;
1835
 
                _vala_code_node_unref0 (_tmp26_);
1836
 
                register_notify = _tmp28_;
1837
 
                vala_symbol_set_access ((ValaSymbol*) register_notify, VALA_SYMBOL_ACCESSIBILITY_PRIVATE);
1838
 
                _tmp29_ = sql_heavy_generator_type_from_string ("int");
1839
 
                _tmp30_ = _tmp29_;
1840
 
                _tmp31_ = vala_parameter_new ("field", _tmp30_, NULL);
1841
 
                _tmp32_ = _tmp31_;
1842
 
                vala_method_add_parameter (register_notify, _tmp32_);
1843
 
                _vala_code_node_unref0 (_tmp32_);
1844
 
                _vala_code_node_unref0 (_tmp30_);
1845
 
                _tmp33_ = vala_block_new (NULL);
1846
 
                block = _tmp33_;
1847
 
                _tmp34_ = vala_block_new (NULL);
1848
 
                try_block = _tmp34_;
1849
 
                _tmp35_ = vala_block_new (NULL);
1850
 
                catch_block = _tmp35_;
1851
 
                _tmp36_ = vala_try_statement_new (try_block, NULL, NULL);
1852
 
                try_stmt = _tmp36_;
1853
 
                _tmp37_ = sql_heavy_generator_type_from_string ("string");
1854
 
                _tmp38_ = _tmp37_;
1855
 
                _tmp39_ = vala_string_literal_new ("null", NULL);
1856
 
                _tmp40_ = _tmp39_;
1857
 
                _tmp41_ = vala_local_variable_new (_tmp38_, "field_name", (ValaExpression*) _tmp40_, NULL);
1858
 
                _tmp42_ = _tmp41_;
1859
 
                _vala_code_node_unref0 (_tmp40_);
1860
 
                _vala_code_node_unref0 (_tmp38_);
1861
 
                field_name = _tmp42_;
1862
 
                _tmp43_ = vala_declaration_statement_new ((ValaSymbol*) field_name, NULL);
1863
 
                _tmp44_ = _tmp43_;
1864
 
                vala_block_add_statement (block, (ValaStatement*) _tmp44_);
1865
 
                _vala_code_node_unref0 (_tmp44_);
1866
 
                vala_block_add_statement (block, (ValaStatement*) try_stmt);
1867
 
                _tmp45_ = vala_string_literal_new ("this", NULL);
 
2584
                ValaMethodCall* _tmp102_;
 
2585
                ValaSourceReference* _tmp103_;
 
2586
                ValaStringLiteral* _tmp104_;
 
2587
                ValaStringLiteral* _tmp105_;
 
2588
                ValaMethodCall* _tmp106_;
 
2589
                ValaSourceReference* _tmp107_;
 
2590
                ValaMemberAccess* _tmp108_;
 
2591
                ValaMemberAccess* _tmp109_;
 
2592
                ValaBlock* _tmp110_;
 
2593
                ValaMethodCall* _tmp111_;
 
2594
                ValaSourceReference* _tmp112_;
 
2595
                ValaExpressionStatement* _tmp113_;
 
2596
                ValaExpressionStatement* _tmp114_;
 
2597
                ValaBlock* _tmp115_;
 
2598
                ValaSourceReference* _tmp116_;
 
2599
                ValaReturnStatement* _tmp117_;
 
2600
                ValaReturnStatement* _tmp118_;
 
2601
                ValaTryStatement* _tmp119_;
 
2602
                ValaDataType* _tmp120_ = NULL;
 
2603
                ValaDataType* _tmp121_;
 
2604
                ValaBlock* _tmp122_;
 
2605
                ValaSourceReference* _tmp123_;
 
2606
                ValaCatchClause* _tmp124_;
 
2607
                ValaCatchClause* _tmp125_;
 
2608
                ValaStringLiteral* _tmp126_;
 
2609
                ValaStringLiteral* _tmp127_;
 
2610
                ValaSourceReference* _tmp128_;
 
2611
                ValaSwitchStatement* _tmp129_;
 
2612
                ValaBlock* _tmp130_;
 
2613
                ValaSwitchStatement* _tmp131_;
 
2614
                ValaMethod* _tmp132_;
 
2615
                ValaBlock* _tmp133_;
 
2616
                ValaClass* _tmp134_;
 
2617
                ValaMethod* _tmp135_;
 
2618
                _tmp45_ = vala_void_type_new (NULL);
1868
2619
                _tmp46_ = _tmp45_;
1869
 
                _tmp47_ = vala_member_access_new ((ValaExpression*) _tmp46_, "field_name", NULL);
 
2620
                _tmp47_ = vala_method_new ("emit_change_notification", (ValaDataType*) _tmp46_, NULL, NULL);
1870
2621
                _tmp48_ = _tmp47_;
1871
 
                _tmp49_ = vala_method_call_new ((ValaExpression*) _tmp48_, NULL);
1872
 
                _tmp50_ = _tmp49_;
1873
 
                _vala_code_node_unref0 (_tmp48_);
1874
2622
                _vala_code_node_unref0 (_tmp46_);
1875
 
                get_field_name = _tmp50_;
1876
 
                _tmp51_ = vala_member_access_new (NULL, "field", NULL);
 
2623
                register_notify = _tmp48_;
 
2624
                _tmp49_ = register_notify;
 
2625
                vala_symbol_set_access ((ValaSymbol*) _tmp49_, VALA_SYMBOL_ACCESSIBILITY_PRIVATE);
 
2626
                _tmp50_ = register_notify;
 
2627
                _tmp51_ = sql_heavy_generator_type_from_string ("int");
1877
2628
                _tmp52_ = _tmp51_;
1878
 
                vala_method_call_add_argument (get_field_name, (ValaExpression*) _tmp52_);
1879
 
                _vala_code_node_unref0 (_tmp52_);
1880
 
                _tmp53_ = vala_string_literal_new ("field_name", NULL);
 
2629
                _tmp53_ = vala_parameter_new ("field", _tmp52_, NULL);
1881
2630
                _tmp54_ = _tmp53_;
1882
 
                _tmp55_ = vala_assignment_new ((ValaExpression*) _tmp54_, (ValaExpression*) get_field_name, VALA_ASSIGNMENT_OPERATOR_SIMPLE, NULL);
1883
 
                _tmp56_ = _tmp55_;
1884
 
                _tmp57_ = vala_expression_statement_new ((ValaExpression*) _tmp56_, NULL);
1885
 
                _tmp58_ = _tmp57_;
1886
 
                vala_block_add_statement (try_block, (ValaStatement*) _tmp58_);
1887
 
                _vala_code_node_unref0 (_tmp58_);
1888
 
                _vala_code_node_unref0 (_tmp56_);
 
2631
                vala_method_add_parameter (_tmp50_, _tmp54_);
1889
2632
                _vala_code_node_unref0 (_tmp54_);
1890
 
                _tmp59_ = vala_string_literal_new ("GLib", NULL);
1891
 
                _tmp60_ = _tmp59_;
1892
 
                _tmp61_ = vala_member_access_new ((ValaExpression*) _tmp60_, "warning", NULL);
1893
 
                _tmp62_ = _tmp61_;
1894
 
                _tmp63_ = vala_method_call_new ((ValaExpression*) _tmp62_, NULL);
1895
 
                _tmp64_ = _tmp63_;
1896
 
                _vala_code_node_unref0 (_tmp62_);
1897
 
                _vala_code_node_unref0 (_tmp60_);
1898
 
                warn_call = _tmp64_;
1899
 
                _tmp65_ = vala_string_literal_new ("\"" "Unknown field: %d" "\"", NULL);
1900
 
                _tmp66_ = _tmp65_;
1901
 
                vala_method_call_add_argument (warn_call, (ValaExpression*) _tmp66_);
1902
 
                _vala_code_node_unref0 (_tmp66_);
1903
 
                _tmp67_ = vala_member_access_new (NULL, "field", NULL);
1904
 
                _tmp68_ = _tmp67_;
1905
 
                vala_method_call_add_argument (warn_call, (ValaExpression*) _tmp68_);
1906
 
                _vala_code_node_unref0 (_tmp68_);
1907
 
                _tmp69_ = vala_expression_statement_new ((ValaExpression*) warn_call, NULL);
 
2633
                _vala_code_node_unref0 (_tmp52_);
 
2634
                _tmp55_ = source_reference;
 
2635
                _tmp56_ = vala_block_new (_tmp55_);
 
2636
                block = _tmp56_;
 
2637
                _tmp57_ = source_reference;
 
2638
                _tmp58_ = vala_block_new (_tmp57_);
 
2639
                try_block = _tmp58_;
 
2640
                _tmp59_ = source_reference;
 
2641
                _tmp60_ = vala_block_new (_tmp59_);
 
2642
                catch_block = _tmp60_;
 
2643
                _tmp61_ = try_block;
 
2644
                _tmp62_ = source_reference;
 
2645
                _tmp63_ = vala_try_statement_new (_tmp61_, NULL, _tmp62_);
 
2646
                try_stmt = _tmp63_;
 
2647
                _tmp64_ = sql_heavy_generator_type_from_string ("string");
 
2648
                _tmp65_ = _tmp64_;
 
2649
                _tmp66_ = vala_string_literal_new ("null", NULL);
 
2650
                _tmp67_ = _tmp66_;
 
2651
                _tmp68_ = source_reference;
 
2652
                _tmp69_ = vala_local_variable_new (_tmp65_, "field_name", (ValaExpression*) _tmp67_, _tmp68_);
1908
2653
                _tmp70_ = _tmp69_;
1909
 
                vala_block_add_statement (catch_block, (ValaStatement*) _tmp70_);
1910
 
                _vala_code_node_unref0 (_tmp70_);
1911
 
                _tmp71_ = vala_return_statement_new (NULL, NULL);
1912
 
                _tmp72_ = _tmp71_;
1913
 
                vala_block_add_statement (catch_block, (ValaStatement*) _tmp72_);
1914
 
                _vala_code_node_unref0 (_tmp72_);
1915
 
                _tmp73_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
1916
 
                _tmp74_ = _tmp73_;
1917
 
                _tmp75_ = vala_catch_clause_new (_tmp74_, "e", catch_block, NULL);
1918
 
                _tmp76_ = _tmp75_;
1919
 
                vala_try_statement_add_catch_clause (try_stmt, _tmp76_);
1920
 
                _vala_code_node_unref0 (_tmp76_);
1921
 
                _vala_code_node_unref0 (_tmp74_);
1922
 
                _tmp77_ = vala_string_literal_new ("field_name", NULL);
1923
 
                _tmp78_ = _tmp77_;
1924
 
                _tmp79_ = vala_switch_statement_new ((ValaExpression*) _tmp78_, NULL);
 
2654
                _vala_code_node_unref0 (_tmp67_);
 
2655
                _vala_code_node_unref0 (_tmp65_);
 
2656
                field_name = _tmp70_;
 
2657
                _tmp71_ = block;
 
2658
                _tmp72_ = field_name;
 
2659
                _tmp73_ = source_reference;
 
2660
                _tmp74_ = vala_declaration_statement_new ((ValaSymbol*) _tmp72_, _tmp73_);
 
2661
                _tmp75_ = _tmp74_;
 
2662
                vala_block_add_statement (_tmp71_, (ValaStatement*) _tmp75_);
 
2663
                _vala_code_node_unref0 (_tmp75_);
 
2664
                _tmp76_ = block;
 
2665
                _tmp77_ = try_stmt;
 
2666
                vala_block_add_statement (_tmp76_, (ValaStatement*) _tmp77_);
 
2667
                _tmp78_ = vala_string_literal_new ("this", NULL);
 
2668
                _tmp79_ = _tmp78_;
 
2669
                _tmp80_ = vala_member_access_new ((ValaExpression*) _tmp79_, "field_name", NULL);
 
2670
                _tmp81_ = _tmp80_;
 
2671
                _tmp82_ = vala_method_call_new ((ValaExpression*) _tmp81_, NULL);
 
2672
                _tmp83_ = _tmp82_;
 
2673
                _vala_code_node_unref0 (_tmp81_);
 
2674
                _vala_code_node_unref0 (_tmp79_);
 
2675
                get_field_name = _tmp83_;
 
2676
                _tmp84_ = get_field_name;
 
2677
                _tmp85_ = vala_member_access_new (NULL, "field", NULL);
 
2678
                _tmp86_ = _tmp85_;
 
2679
                vala_method_call_add_argument (_tmp84_, (ValaExpression*) _tmp86_);
 
2680
                _vala_code_node_unref0 (_tmp86_);
 
2681
                _tmp87_ = try_block;
 
2682
                _tmp88_ = vala_string_literal_new ("field_name", NULL);
 
2683
                _tmp89_ = _tmp88_;
 
2684
                _tmp90_ = get_field_name;
 
2685
                _tmp91_ = vala_assignment_new ((ValaExpression*) _tmp89_, (ValaExpression*) _tmp90_, VALA_ASSIGNMENT_OPERATOR_SIMPLE, NULL);
 
2686
                _tmp92_ = _tmp91_;
 
2687
                _tmp93_ = vala_expression_statement_new ((ValaExpression*) _tmp92_, NULL);
 
2688
                _tmp94_ = _tmp93_;
 
2689
                vala_block_add_statement (_tmp87_, (ValaStatement*) _tmp94_);
 
2690
                _vala_code_node_unref0 (_tmp94_);
 
2691
                _vala_code_node_unref0 (_tmp92_);
 
2692
                _vala_code_node_unref0 (_tmp89_);
 
2693
                _tmp95_ = vala_string_literal_new ("GLib", NULL);
 
2694
                _tmp96_ = _tmp95_;
 
2695
                _tmp97_ = vala_member_access_new ((ValaExpression*) _tmp96_, "warning", NULL);
 
2696
                _tmp98_ = _tmp97_;
 
2697
                _tmp99_ = source_reference;
 
2698
                _tmp100_ = vala_method_call_new ((ValaExpression*) _tmp98_, _tmp99_);
 
2699
                _tmp101_ = _tmp100_;
 
2700
                _vala_code_node_unref0 (_tmp98_);
 
2701
                _vala_code_node_unref0 (_tmp96_);
 
2702
                warn_call = _tmp101_;
 
2703
                _tmp102_ = warn_call;
 
2704
                _tmp103_ = source_reference;
 
2705
                _tmp104_ = vala_string_literal_new ("\"" "Unknown field: %d" "\"", _tmp103_);
 
2706
                _tmp105_ = _tmp104_;
 
2707
                vala_method_call_add_argument (_tmp102_, (ValaExpression*) _tmp105_);
 
2708
                _vala_code_node_unref0 (_tmp105_);
 
2709
                _tmp106_ = warn_call;
 
2710
                _tmp107_ = source_reference;
 
2711
                _tmp108_ = vala_member_access_new (NULL, "field", _tmp107_);
 
2712
                _tmp109_ = _tmp108_;
 
2713
                vala_method_call_add_argument (_tmp106_, (ValaExpression*) _tmp109_);
 
2714
                _vala_code_node_unref0 (_tmp109_);
 
2715
                _tmp110_ = catch_block;
 
2716
                _tmp111_ = warn_call;
 
2717
                _tmp112_ = source_reference;
 
2718
                _tmp113_ = vala_expression_statement_new ((ValaExpression*) _tmp111_, _tmp112_);
 
2719
                _tmp114_ = _tmp113_;
 
2720
                vala_block_add_statement (_tmp110_, (ValaStatement*) _tmp114_);
 
2721
                _vala_code_node_unref0 (_tmp114_);
 
2722
                _tmp115_ = catch_block;
 
2723
                _tmp116_ = source_reference;
 
2724
                _tmp117_ = vala_return_statement_new (NULL, _tmp116_);
 
2725
                _tmp118_ = _tmp117_;
 
2726
                vala_block_add_statement (_tmp115_, (ValaStatement*) _tmp118_);
 
2727
                _vala_code_node_unref0 (_tmp118_);
 
2728
                _tmp119_ = try_stmt;
 
2729
                _tmp120_ = sql_heavy_generator_type_from_string ("SQLHeavy.Error");
 
2730
                _tmp121_ = _tmp120_;
 
2731
                _tmp122_ = catch_block;
 
2732
                _tmp123_ = source_reference;
 
2733
                _tmp124_ = vala_catch_clause_new (_tmp121_, "e", _tmp122_, _tmp123_);
 
2734
                _tmp125_ = _tmp124_;
 
2735
                vala_try_statement_add_catch_clause (_tmp119_, _tmp125_);
 
2736
                _vala_code_node_unref0 (_tmp125_);
 
2737
                _vala_code_node_unref0 (_tmp121_);
 
2738
                _tmp126_ = vala_string_literal_new ("field_name", NULL);
 
2739
                _tmp127_ = _tmp126_;
 
2740
                _tmp128_ = source_reference;
 
2741
                _tmp129_ = vala_switch_statement_new ((ValaExpression*) _tmp127_, _tmp128_);
1925
2742
                _vala_code_node_unref0 (signals_switch);
1926
 
                signals_switch = _tmp79_;
1927
 
                _vala_code_node_unref0 (_tmp78_);
1928
 
                vala_block_add_statement (block, (ValaStatement*) signals_switch);
1929
 
                vala_subroutine_set_body ((ValaSubroutine*) register_notify, block);
1930
 
                vala_symbol_add_method ((ValaSymbol*) cl, register_notify);
 
2743
                signals_switch = _tmp129_;
 
2744
                _vala_code_node_unref0 (_tmp127_);
 
2745
                _tmp130_ = block;
 
2746
                _tmp131_ = signals_switch;
 
2747
                vala_block_add_statement (_tmp130_, (ValaStatement*) _tmp131_);
 
2748
                _tmp132_ = register_notify;
 
2749
                _tmp133_ = block;
 
2750
                vala_subroutine_set_body ((ValaSubroutine*) _tmp132_, _tmp133_);
 
2751
                _tmp134_ = cl;
 
2752
                _tmp135_ = register_notify;
 
2753
                vala_symbol_add_method ((ValaSymbol*) _tmp134_, _tmp135_);
1931
2754
                _vala_code_node_unref0 (warn_call);
1932
2755
                _vala_code_node_unref0 (get_field_name);
1933
2756
                _vala_code_node_unref0 (field_name);
1937
2760
                _vala_code_node_unref0 (block);
1938
2761
                _vala_code_node_unref0 (register_notify);
1939
2762
        }
1940
 
        _tmp80_ = vala_constructor_new (NULL);
1941
 
        con = _tmp80_;
1942
 
        _tmp81_ = vala_block_new (NULL);
1943
 
        _tmp82_ = _tmp81_;
1944
 
        vala_subroutine_set_body ((ValaSubroutine*) con, _tmp82_);
1945
 
        _vala_code_node_unref0 (_tmp82_);
1946
 
        _tmp83_ = vala_string_literal_new ("this", NULL);
1947
 
        _tmp84_ = _tmp83_;
1948
 
        _tmp85_ = vala_member_access_new ((ValaExpression*) _tmp84_, "field_changed", NULL);
1949
 
        _tmp86_ = _tmp85_;
1950
 
        _tmp87_ = vala_member_access_new ((ValaExpression*) _tmp86_, "connect", NULL);
1951
 
        _tmp88_ = _tmp87_;
1952
 
        _tmp89_ = vala_method_call_new ((ValaExpression*) _tmp88_, NULL);
1953
 
        _tmp90_ = _tmp89_;
1954
 
        _vala_code_node_unref0 (_tmp88_);
1955
 
        _vala_code_node_unref0 (_tmp86_);
1956
 
        _vala_code_node_unref0 (_tmp84_);
1957
 
        conn_call = _tmp90_;
1958
 
        _tmp91_ = vala_string_literal_new ("this", NULL);
1959
 
        _tmp92_ = _tmp91_;
1960
 
        _tmp93_ = vala_member_access_new ((ValaExpression*) _tmp92_, "emit_change_notification", NULL);
1961
 
        _tmp94_ = _tmp93_;
1962
 
        vala_method_call_add_argument (conn_call, (ValaExpression*) _tmp94_);
1963
 
        _vala_code_node_unref0 (_tmp94_);
1964
 
        _vala_code_node_unref0 (_tmp92_);
1965
 
        _tmp95_ = vala_subroutine_get_body ((ValaSubroutine*) con);
1966
 
        _tmp96_ = vala_expression_statement_new ((ValaExpression*) conn_call, NULL);
1967
 
        _tmp97_ = _tmp96_;
1968
 
        vala_block_add_statement (_tmp95_, (ValaStatement*) _tmp97_);
1969
 
        _vala_code_node_unref0 (_tmp97_);
1970
 
        vala_class_set_constructor (cl, con);
 
2763
        _tmp136_ = source_reference;
 
2764
        _tmp137_ = vala_constructor_new (_tmp136_);
 
2765
        con = _tmp137_;
 
2766
        _tmp138_ = con;
 
2767
        _tmp139_ = source_reference;
 
2768
        _tmp140_ = vala_block_new (_tmp139_);
 
2769
        _tmp141_ = _tmp140_;
 
2770
        vala_subroutine_set_body ((ValaSubroutine*) _tmp138_, _tmp141_);
 
2771
        _vala_code_node_unref0 (_tmp141_);
 
2772
        _tmp142_ = vala_string_literal_new ("this", NULL);
 
2773
        _tmp143_ = _tmp142_;
 
2774
        _tmp144_ = source_reference;
 
2775
        _tmp145_ = vala_member_access_new ((ValaExpression*) _tmp143_, "field_changed", _tmp144_);
 
2776
        _tmp146_ = _tmp145_;
 
2777
        _tmp147_ = source_reference;
 
2778
        _tmp148_ = vala_member_access_new ((ValaExpression*) _tmp146_, "connect", _tmp147_);
 
2779
        _tmp149_ = _tmp148_;
 
2780
        _tmp150_ = source_reference;
 
2781
        _tmp151_ = vala_method_call_new ((ValaExpression*) _tmp149_, _tmp150_);
 
2782
        _tmp152_ = _tmp151_;
 
2783
        _vala_code_node_unref0 (_tmp149_);
 
2784
        _vala_code_node_unref0 (_tmp146_);
 
2785
        _vala_code_node_unref0 (_tmp143_);
 
2786
        conn_call = _tmp152_;
 
2787
        _tmp153_ = conn_call;
 
2788
        _tmp154_ = vala_string_literal_new ("this", NULL);
 
2789
        _tmp155_ = _tmp154_;
 
2790
        _tmp156_ = source_reference;
 
2791
        _tmp157_ = vala_member_access_new ((ValaExpression*) _tmp155_, "emit_change_notification", _tmp156_);
 
2792
        _tmp158_ = _tmp157_;
 
2793
        vala_method_call_add_argument (_tmp153_, (ValaExpression*) _tmp158_);
 
2794
        _vala_code_node_unref0 (_tmp158_);
 
2795
        _vala_code_node_unref0 (_tmp155_);
 
2796
        _tmp159_ = con;
 
2797
        _tmp160_ = vala_subroutine_get_body ((ValaSubroutine*) _tmp159_);
 
2798
        _tmp161_ = _tmp160_;
 
2799
        _tmp162_ = conn_call;
 
2800
        _tmp163_ = source_reference;
 
2801
        _tmp164_ = vala_expression_statement_new ((ValaExpression*) _tmp162_, _tmp163_);
 
2802
        _tmp165_ = _tmp164_;
 
2803
        vala_block_add_statement (_tmp161_, (ValaStatement*) _tmp165_);
 
2804
        _vala_code_node_unref0 (_tmp165_);
 
2805
        _tmp166_ = cl;
 
2806
        _tmp167_ = con;
 
2807
        vala_class_set_constructor (_tmp166_, _tmp167_);
1971
2808
        {
1972
2809
                gint field;
1973
2810
                field = 0;
1974
2811
                {
1975
 
                        gboolean _tmp98_;
1976
 
                        _tmp98_ = TRUE;
 
2812
                        gboolean _tmp168_;
 
2813
                        _tmp168_ = TRUE;
1977
2814
                        while (TRUE) {
1978
 
                                gint _tmp99_;
1979
 
                                if (!_tmp98_) {
1980
 
                                        field++;
 
2815
                                gboolean _tmp169_;
 
2816
                                gint _tmp171_;
 
2817
                                SQLHeavyTable* _tmp172_;
 
2818
                                gint _tmp173_;
 
2819
                                gint _tmp174_;
 
2820
                                SQLHeavyTable* _tmp175_;
 
2821
                                gint _tmp176_;
 
2822
                                ValaClass* _tmp177_;
 
2823
                                ValaSwitchStatement* _tmp178_;
 
2824
                                ValaSourceReference* _tmp179_;
 
2825
                                _tmp169_ = _tmp168_;
 
2826
                                if (!_tmp169_) {
 
2827
                                        gint _tmp170_;
 
2828
                                        _tmp170_ = field;
 
2829
                                        field = _tmp170_ + 1;
1981
2830
                                }
1982
 
                                _tmp98_ = FALSE;
1983
 
                                _tmp99_ = sql_heavy_table_get_field_count (table);
1984
 
                                if (!(field < _tmp99_)) {
 
2831
                                _tmp168_ = FALSE;
 
2832
                                _tmp171_ = field;
 
2833
                                _tmp172_ = table;
 
2834
                                _tmp173_ = sql_heavy_table_get_field_count (_tmp172_);
 
2835
                                _tmp174_ = _tmp173_;
 
2836
                                if (!(_tmp171_ < _tmp174_)) {
1985
2837
                                        break;
1986
2838
                                }
1987
 
                                sql_heavy_generator_parse_field (self, table, field, cl, signals_switch, &_inner_error_);
 
2839
                                _tmp175_ = table;
 
2840
                                _tmp176_ = field;
 
2841
                                _tmp177_ = cl;
 
2842
                                _tmp178_ = signals_switch;
 
2843
                                _tmp179_ = source_reference;
 
2844
                                sql_heavy_generator_parse_field (self, _tmp175_, _tmp176_, _tmp177_, _tmp178_, _tmp179_, &_inner_error_);
1988
2845
                                if (_inner_error_ != NULL) {
1989
2846
                                        if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == SQL_HEAVY_ERROR)) {
1990
2847
                                                g_propagate_error (error, _inner_error_);
2026
2883
 
2027
2884
 
2028
2885
static void sql_heavy_generator_parse_database (SQLHeavyGenerator* self, SQLHeavyDatabase* db, GError** error) {
2029
 
        const gchar* _tmp0_ = NULL;
2030
 
        gchar* _tmp1_ = NULL;
2031
 
        gchar* _tmp2_;
2032
 
        gchar** _tmp3_;
2033
 
        gchar** _tmp4_ = NULL;
 
2886
        SQLHeavyDatabase* _tmp0_;
 
2887
        const gchar* _tmp1_;
 
2888
        const gchar* _tmp2_;
 
2889
        gchar* _tmp3_ = NULL;
 
2890
        gchar* _tmp4_;
2034
2891
        gchar** _tmp5_;
2035
 
        gint _tmp5__length1;
2036
 
        gchar* _tmp6_ = NULL;
2037
 
        gchar* _tmp7_;
 
2892
        gchar** _tmp6_ = NULL;
 
2893
        gchar** _tmp7_;
 
2894
        gint _tmp7__length1;
 
2895
        const gchar* _tmp8_;
 
2896
        gchar* _tmp9_ = NULL;
 
2897
        gchar* _tmp10_;
2038
2898
        gchar* symbol;
2039
 
        gchar* _tmp8_ = NULL;
 
2899
        const gchar* _tmp11_;
 
2900
        gchar* _tmp12_ = NULL;
2040
2901
        gchar* symbol_name;
2041
 
        ValaNamespace* _tmp9_ = NULL;
2042
 
        ValaScope* _tmp10_ = NULL;
2043
 
        ValaSymbol* _tmp11_ = NULL;
2044
 
        ValaSymbol* _tmp12_;
 
2902
        ValaCodeContext* _tmp13_;
 
2903
        ValaNamespace* _tmp14_;
 
2904
        ValaNamespace* _tmp15_;
 
2905
        ValaScope* _tmp16_;
 
2906
        ValaScope* _tmp17_;
 
2907
        const gchar* _tmp18_;
 
2908
        ValaSymbol* _tmp19_ = NULL;
2045
2909
        ValaNamespace* ns;
2046
 
        gboolean _tmp15_;
2047
 
        GHashTable* _tmp16_ = NULL;
2048
 
        GHashTable* tables;
2049
 
        GList* _tmp17_ = NULL;
 
2910
        ValaCodeContext* _tmp20_;
 
2911
        SQLHeavyDatabase* _tmp21_;
 
2912
        const gchar* _tmp22_;
 
2913
        const gchar* _tmp23_;
 
2914
        ValaSourceFile* _tmp24_;
 
2915
        ValaSourceFile* source_file;
 
2916
        ValaSourceFile* _tmp25_;
 
2917
        ValaSourceReference* _tmp26_;
 
2918
        ValaSourceReference* source_reference;
 
2919
        ValaNamespace* _tmp27_;
 
2920
        const gchar* _tmp35_;
 
2921
        gboolean _tmp36_ = FALSE;
2050
2922
        GError * _inner_error_ = NULL;
2051
2923
        g_return_if_fail (self != NULL);
2052
2924
        g_return_if_fail (db != NULL);
2053
 
        _tmp0_ = sql_heavy_database_get_filename (db);
2054
 
        _tmp1_ = g_path_get_basename (_tmp0_);
 
2925
        _tmp0_ = db;
 
2926
        _tmp1_ = sql_heavy_database_get_filename (_tmp0_);
2055
2927
        _tmp2_ = _tmp1_;
2056
 
        _tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ".", 2);
2057
 
        _tmp5_ = _tmp4_;
2058
 
        _tmp5__length1 = _vala_array_length (_tmp3_);
2059
 
        _tmp6_ = g_strconcat ("@", _tmp5_[0], NULL);
 
2928
        _tmp3_ = g_path_get_basename (_tmp2_);
 
2929
        _tmp4_ = _tmp3_;
 
2930
        _tmp6_ = _tmp5_ = g_strsplit (_tmp4_, ".", 2);
2060
2931
        _tmp7_ = _tmp6_;
2061
 
        _tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
2062
 
        _g_free0 (_tmp2_);
2063
 
        symbol = _tmp7_;
2064
 
        _tmp8_ = sql_heavy_generator_get_symbol_name (self, symbol);
2065
 
        symbol_name = _tmp8_;
2066
 
        _tmp9_ = vala_code_context_get_root (self->priv->context);
2067
 
        _tmp10_ = vala_symbol_get_scope ((ValaSymbol*) _tmp9_);
2068
 
        _tmp11_ = vala_scope_lookup (_tmp10_, symbol_name);
2069
 
        _tmp12_ = _tmp11_;
2070
 
        ns = VALA_IS_NAMESPACE (_tmp12_) ? ((ValaNamespace*) _tmp12_) : NULL;
2071
 
        if (ns == NULL) {
2072
 
                ValaNamespace* _tmp13_ = NULL;
2073
 
                ValaNamespace* _tmp14_ = NULL;
2074
 
                _tmp13_ = vala_namespace_new (symbol_name, NULL);
2075
 
                _vala_code_node_unref0 (ns);
2076
 
                ns = _tmp13_;
2077
 
                _tmp14_ = vala_code_context_get_root (self->priv->context);
2078
 
                vala_symbol_add_namespace ((ValaSymbol*) _tmp14_, ns);
2079
 
        }
2080
 
        _tmp15_ = sql_heavy_generator_symbol_is_hidden (self, symbol);
2081
 
        if (_tmp15_) {
2082
 
                _vala_code_node_unref0 (ns);
2083
 
                _g_free0 (symbol_name);
2084
 
                _g_free0 (symbol);
2085
 
                return;
2086
 
        }
2087
 
        _tmp16_ = sql_heavy_database_get_tables (db, &_inner_error_);
2088
 
        tables = _tmp16_;
2089
 
        if (_inner_error_ != NULL) {
2090
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
2091
 
                        goto __catch1_sql_heavy_error;
2092
 
                }
2093
 
                _vala_code_node_unref0 (ns);
2094
 
                _g_free0 (symbol_name);
2095
 
                _g_free0 (symbol);
2096
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2097
 
                g_clear_error (&_inner_error_);
2098
 
                return;
2099
 
        }
2100
 
        _tmp17_ = g_hash_table_get_values (tables);
 
2932
        _tmp7__length1 = _vala_array_length (_tmp5_);
 
2933
        _tmp8_ = _tmp7_[0];
 
2934
        _tmp9_ = g_strconcat ("@", _tmp8_, NULL);
 
2935
        _tmp10_ = _tmp9_;
 
2936
        _tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
 
2937
        _g_free0 (_tmp4_);
 
2938
        symbol = _tmp10_;
 
2939
        _tmp11_ = symbol;
 
2940
        _tmp12_ = sql_heavy_generator_get_symbol_name (self, _tmp11_);
 
2941
        symbol_name = _tmp12_;
 
2942
        _tmp13_ = self->priv->context;
 
2943
        _tmp14_ = vala_code_context_get_root (_tmp13_);
 
2944
        _tmp15_ = _tmp14_;
 
2945
        _tmp16_ = vala_symbol_get_scope ((ValaSymbol*) _tmp15_);
 
2946
        _tmp17_ = _tmp16_;
 
2947
        _tmp18_ = symbol_name;
 
2948
        _tmp19_ = vala_scope_lookup (_tmp17_, _tmp18_);
 
2949
        ns = VALA_IS_NAMESPACE (_tmp19_) ? ((ValaNamespace*) _tmp19_) : NULL;
 
2950
        _tmp20_ = self->priv->context;
 
2951
        _tmp21_ = db;
 
2952
        _tmp22_ = sql_heavy_database_get_filename (_tmp21_);
 
2953
        _tmp23_ = _tmp22_;
 
2954
        _tmp24_ = vala_source_file_new (_tmp20_, VALA_SOURCE_FILE_TYPE_NONE, _tmp23_, NULL, FALSE);
 
2955
        source_file = _tmp24_;
 
2956
        _tmp25_ = source_file;
 
2957
        _tmp26_ = vala_source_reference_new (_tmp25_, 0, 0, 0, 0);
 
2958
        source_reference = _tmp26_;
 
2959
        _tmp27_ = ns;
 
2960
        if (_tmp27_ == NULL) {
 
2961
                const gchar* _tmp28_;
 
2962
                ValaSourceReference* _tmp29_;
 
2963
                ValaNamespace* _tmp30_;
 
2964
                ValaCodeContext* _tmp31_;
 
2965
                ValaNamespace* _tmp32_;
 
2966
                ValaNamespace* _tmp33_;
 
2967
                ValaNamespace* _tmp34_;
 
2968
                _tmp28_ = symbol_name;
 
2969
                _tmp29_ = source_reference;
 
2970
                _tmp30_ = vala_namespace_new (_tmp28_, _tmp29_);
 
2971
                _vala_code_node_unref0 (ns);
 
2972
                ns = _tmp30_;
 
2973
                _tmp31_ = self->priv->context;
 
2974
                _tmp32_ = vala_code_context_get_root (_tmp31_);
 
2975
                _tmp33_ = _tmp32_;
 
2976
                _tmp34_ = ns;
 
2977
                vala_symbol_add_namespace ((ValaSymbol*) _tmp33_, _tmp34_);
 
2978
        }
 
2979
        _tmp35_ = symbol;
 
2980
        _tmp36_ = sql_heavy_generator_symbol_is_hidden (self, _tmp35_);
 
2981
        if (_tmp36_) {
 
2982
                _vala_source_reference_unref0 (source_reference);
 
2983
                _vala_source_file_unref0 (source_file);
 
2984
                _vala_code_node_unref0 (ns);
 
2985
                _g_free0 (symbol_name);
 
2986
                _g_free0 (symbol);
 
2987
                return;
 
2988
        }
2101
2989
        {
2102
 
                GList* table_collection;
2103
 
                GList* table_it;
2104
 
                table_collection = _tmp17_;
2105
 
                for (table_it = table_collection; table_it != NULL; table_it = table_it->next) {
2106
 
                        SQLHeavyTable* table;
2107
 
                        table = (SQLHeavyTable*) table_it->data;
2108
 
                        {
2109
 
                                sql_heavy_generator_parse_table (self, table, ns, &_inner_error_);
2110
 
                                if (_inner_error_ != NULL) {
2111
 
                                        _g_list_free0 (table_collection);
2112
 
                                        _g_hash_table_unref0 (tables);
2113
 
                                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
2114
 
                                                goto __catch1_sql_heavy_error;
 
2990
                SQLHeavyDatabase* _tmp37_;
 
2991
                GHashTable* _tmp38_ = NULL;
 
2992
                GHashTable* tables;
 
2993
                GHashTable* _tmp39_;
 
2994
                GList* _tmp40_ = NULL;
 
2995
                _tmp37_ = db;
 
2996
                _tmp38_ = sql_heavy_database_get_tables (_tmp37_, &_inner_error_);
 
2997
                tables = _tmp38_;
 
2998
                if (_inner_error_ != NULL) {
 
2999
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
3000
                                goto __catch1_sql_heavy_error;
 
3001
                        }
 
3002
                        _vala_source_reference_unref0 (source_reference);
 
3003
                        _vala_source_file_unref0 (source_file);
 
3004
                        _vala_code_node_unref0 (ns);
 
3005
                        _g_free0 (symbol_name);
 
3006
                        _g_free0 (symbol);
 
3007
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
3008
                        g_clear_error (&_inner_error_);
 
3009
                        return;
 
3010
                }
 
3011
                _tmp39_ = tables;
 
3012
                _tmp40_ = g_hash_table_get_values (_tmp39_);
 
3013
                {
 
3014
                        GList* table_collection = NULL;
 
3015
                        GList* table_it = NULL;
 
3016
                        table_collection = _tmp40_;
 
3017
                        for (table_it = table_collection; table_it != NULL; table_it = table_it->next) {
 
3018
                                SQLHeavyTable* table = NULL;
 
3019
                                table = (SQLHeavyTable*) table_it->data;
 
3020
                                {
 
3021
                                        SQLHeavyTable* _tmp41_;
 
3022
                                        ValaNamespace* _tmp42_;
 
3023
                                        ValaSourceReference* _tmp43_;
 
3024
                                        _tmp41_ = table;
 
3025
                                        _tmp42_ = ns;
 
3026
                                        _tmp43_ = source_reference;
 
3027
                                        sql_heavy_generator_parse_table (self, _tmp41_, _tmp42_, _tmp43_, &_inner_error_);
 
3028
                                        if (_inner_error_ != NULL) {
 
3029
                                                _g_list_free0 (table_collection);
 
3030
                                                _g_hash_table_unref0 (tables);
 
3031
                                                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
3032
                                                        goto __catch1_sql_heavy_error;
 
3033
                                                }
 
3034
                                                goto __finally1;
2115
3035
                                        }
2116
 
                                        goto __finally1;
2117
3036
                                }
2118
3037
                        }
 
3038
                        _g_list_free0 (table_collection);
2119
3039
                }
2120
 
                _g_list_free0 (table_collection);
 
3040
                _g_hash_table_unref0 (tables);
2121
3041
        }
2122
 
        _g_hash_table_unref0 (tables);
2123
3042
        goto __finally1;
2124
3043
        __catch1_sql_heavy_error:
2125
3044
        {
2126
 
                GError * e;
2127
 
                GError* _tmp18_ = NULL;
 
3045
                GError* e = NULL;
 
3046
                GError* _tmp44_;
 
3047
                const gchar* _tmp45_;
 
3048
                GError* _tmp46_;
2128
3049
                e = _inner_error_;
2129
3050
                _inner_error_ = NULL;
2130
 
                _tmp18_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_DATABASE, "Database error: %s", e->message);
2131
 
                _inner_error_ = _tmp18_;
 
3051
                _tmp44_ = e;
 
3052
                _tmp45_ = _tmp44_->message;
 
3053
                _tmp46_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_DATABASE, "Database error: %s", _tmp45_);
 
3054
                _inner_error_ = _tmp46_;
2132
3055
                _g_error_free0 (e);
2133
3056
                goto __finally1;
2134
3057
        }
2136
3059
        if (_inner_error_ != NULL) {
2137
3060
                if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
2138
3061
                        g_propagate_error (error, _inner_error_);
 
3062
                        _vala_source_reference_unref0 (source_reference);
 
3063
                        _vala_source_file_unref0 (source_file);
2139
3064
                        _vala_code_node_unref0 (ns);
2140
3065
                        _g_free0 (symbol_name);
2141
3066
                        _g_free0 (symbol);
2142
3067
                        return;
2143
3068
                } else {
 
3069
                        _vala_source_reference_unref0 (source_reference);
 
3070
                        _vala_source_file_unref0 (source_file);
2144
3071
                        _vala_code_node_unref0 (ns);
2145
3072
                        _g_free0 (symbol_name);
2146
3073
                        _g_free0 (symbol);
2149
3076
                        return;
2150
3077
                }
2151
3078
        }
 
3079
        _vala_source_reference_unref0 (source_reference);
 
3080
        _vala_source_file_unref0 (source_file);
2152
3081
        _vala_code_node_unref0 (ns);
2153
3082
        _g_free0 (symbol_name);
2154
3083
        _g_free0 (symbol);
2156
3085
 
2157
3086
 
2158
3087
void sql_heavy_generator_run (SQLHeavyGenerator* self, GError** error) {
2159
 
        ValaParser* _tmp0_ = NULL;
 
3088
        const gchar* _tmp0_;
 
3089
        ValaParser* _tmp2_;
2160
3090
        ValaParser* parser;
2161
 
        ValaSymbolResolver* _tmp4_ = NULL;
 
3091
        ValaParser* _tmp3_;
 
3092
        ValaCodeContext* _tmp4_;
 
3093
        GSList* _tmp5_;
 
3094
        ValaSymbolResolver* _tmp13_;
2162
3095
        ValaSymbolResolver* resolver;
2163
 
        ValaReport* _tmp5_ = NULL;
2164
 
        gint _tmp6_;
2165
 
        ValaSemanticAnalyzer* _tmp8_ = NULL;
2166
 
        ValaSemanticAnalyzer* analyzer;
2167
 
        ValaCodeWriter* _tmp9_ = NULL;
 
3096
        ValaSymbolResolver* _tmp14_;
 
3097
        ValaCodeContext* _tmp15_;
 
3098
        ValaCodeContext* _tmp16_;
 
3099
        ValaReport* _tmp17_;
 
3100
        ValaReport* _tmp18_;
 
3101
        gint _tmp19_ = 0;
 
3102
        ValaCodeContext* _tmp21_;
 
3103
        ValaSemanticAnalyzer* _tmp22_;
 
3104
        ValaSemanticAnalyzer* _tmp23_;
 
3105
        ValaCodeContext* _tmp24_;
 
3106
        ValaCodeWriter* _tmp25_;
2168
3107
        ValaCodeWriter* code_writer;
2169
 
        gchar* _tmp10_;
2170
 
        gchar* _tmp11_;
 
3108
        ValaCodeWriter* _tmp26_;
 
3109
        ValaCodeContext* _tmp27_;
 
3110
        const gchar* _tmp28_;
2171
3111
        GError * _inner_error_ = NULL;
2172
3112
        g_return_if_fail (self != NULL);
2173
 
        _tmp0_ = vala_parser_new ();
2174
 
        parser = _tmp0_;
2175
 
        vala_parser_parse (parser, self->priv->context);
 
3113
        _tmp0_ = sql_heavy_generator_output_location;
 
3114
        if (_tmp0_ == NULL) {
 
3115
                FILE* _tmp1_;
 
3116
                _tmp1_ = stderr;
 
3117
                fprintf (_tmp1_, "You must supply an output location\n");
 
3118
                return;
 
3119
        }
 
3120
        _tmp2_ = vala_parser_new ();
 
3121
        parser = _tmp2_;
 
3122
        _tmp3_ = parser;
 
3123
        _tmp4_ = self->priv->context;
 
3124
        vala_parser_parse (_tmp3_, _tmp4_);
 
3125
        _tmp5_ = self->priv->databases;
2176
3126
        {
2177
 
                GSList* dbfile_collection;
2178
 
                GSList* dbfile_it;
2179
 
                dbfile_collection = self->priv->databases;
 
3127
                GSList* dbfile_collection = NULL;
 
3128
                GSList* dbfile_it = NULL;
 
3129
                dbfile_collection = _tmp5_;
2180
3130
                for (dbfile_it = dbfile_collection; dbfile_it != NULL; dbfile_it = dbfile_it->next) {
2181
 
                        const gchar* dbfile;
 
3131
                        const gchar* dbfile = NULL;
2182
3132
                        dbfile = (const gchar*) dbfile_it->data;
2183
3133
                        {
2184
3134
                                SQLHeavyDatabase* db = NULL;
2185
 
                                SQLHeavyDatabase* _tmp1_ = NULL;
2186
 
                                SQLHeavyDatabase* _tmp2_;
2187
 
                                _tmp1_ = sql_heavy_database_new (dbfile, SQL_HEAVY_FILE_MODE_READ, &_inner_error_);
2188
 
                                _tmp2_ = _tmp1_;
2189
 
                                if (_inner_error_ != NULL) {
2190
 
                                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
2191
 
                                                goto __catch2_sql_heavy_error;
 
3135
                                SQLHeavyDatabase* _tmp12_;
 
3136
                                {
 
3137
                                        const gchar* _tmp6_;
 
3138
                                        SQLHeavyDatabase* _tmp7_;
 
3139
                                        SQLHeavyDatabase* _tmp8_;
 
3140
                                        _tmp6_ = dbfile;
 
3141
                                        _tmp7_ = sql_heavy_database_new (_tmp6_, SQL_HEAVY_FILE_MODE_READ, &_inner_error_);
 
3142
                                        _tmp8_ = _tmp7_;
 
3143
                                        if (_inner_error_ != NULL) {
 
3144
                                                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
3145
                                                        goto __catch2_sql_heavy_error;
 
3146
                                                }
 
3147
                                                _g_object_unref0 (db);
 
3148
                                                _vala_code_visitor_unref0 (parser);
 
3149
                                                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
3150
                                                g_clear_error (&_inner_error_);
 
3151
                                                return;
2192
3152
                                        }
2193
3153
                                        _g_object_unref0 (db);
2194
 
                                        _vala_code_visitor_unref0 (parser);
2195
 
                                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2196
 
                                        g_clear_error (&_inner_error_);
2197
 
                                        return;
 
3154
                                        db = _tmp8_;
2198
3155
                                }
2199
 
                                _g_object_unref0 (db);
2200
 
                                db = _tmp2_;
2201
3156
                                goto __finally2;
2202
3157
                                __catch2_sql_heavy_error:
2203
3158
                                {
2204
 
                                        GError * e;
2205
 
                                        GError* _tmp3_ = NULL;
 
3159
                                        GError* e = NULL;
 
3160
                                        GError* _tmp9_;
 
3161
                                        const gchar* _tmp10_;
 
3162
                                        GError* _tmp11_;
2206
3163
                                        e = _inner_error_;
2207
3164
                                        _inner_error_ = NULL;
2208
 
                                        _tmp3_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, "Unable to open database: %s", e->message);
2209
 
                                        _inner_error_ = _tmp3_;
 
3165
                                        _tmp9_ = e;
 
3166
                                        _tmp10_ = _tmp9_->message;
 
3167
                                        _tmp11_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, "Unable to open database: %s", _tmp10_);
 
3168
                                        _inner_error_ = _tmp11_;
2210
3169
                                        _g_error_free0 (e);
2211
3170
                                        goto __finally2;
2212
3171
                                }
2225
3184
                                                return;
2226
3185
                                        }
2227
3186
                                }
2228
 
                                sql_heavy_generator_parse_database (self, db, &_inner_error_);
 
3187
                                _tmp12_ = db;
 
3188
                                sql_heavy_generator_parse_database (self, _tmp12_, &_inner_error_);
2229
3189
                                if (_inner_error_ != NULL) {
2230
3190
                                        if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
2231
3191
                                                g_propagate_error (error, _inner_error_);
2244
3204
                        }
2245
3205
                }
2246
3206
        }
2247
 
        _tmp4_ = vala_symbol_resolver_new ();
2248
 
        resolver = _tmp4_;
2249
 
        vala_symbol_resolver_resolve (resolver, self->priv->context);
2250
 
        _tmp5_ = vala_code_context_get_report (self->priv->context);
2251
 
        _tmp6_ = vala_report_get_errors (_tmp5_);
2252
 
        if (_tmp6_ > 0) {
2253
 
                GError* _tmp7_ = NULL;
2254
 
                _tmp7_ = g_error_new_literal (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_SYMBOL_RESOLVER, "Error resolving symbols.");
2255
 
                _inner_error_ = _tmp7_;
 
3207
        _tmp13_ = vala_symbol_resolver_new ();
 
3208
        resolver = _tmp13_;
 
3209
        _tmp14_ = resolver;
 
3210
        _tmp15_ = self->priv->context;
 
3211
        vala_symbol_resolver_resolve (_tmp14_, _tmp15_);
 
3212
        _tmp16_ = self->priv->context;
 
3213
        _tmp17_ = vala_code_context_get_report (_tmp16_);
 
3214
        _tmp18_ = _tmp17_;
 
3215
        _tmp19_ = vala_report_get_errors (_tmp18_);
 
3216
        if (_tmp19_ > 0) {
 
3217
                GError* _tmp20_;
 
3218
                _tmp20_ = g_error_new_literal (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_SYMBOL_RESOLVER, "Error resolving symbols.");
 
3219
                _inner_error_ = _tmp20_;
2256
3220
                if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
2257
3221
                        g_propagate_error (error, _inner_error_);
2258
3222
                        _vala_code_visitor_unref0 (resolver);
2266
3230
                        return;
2267
3231
                }
2268
3232
        }
2269
 
        _tmp8_ = vala_semantic_analyzer_new ();
2270
 
        analyzer = _tmp8_;
2271
 
        vala_semantic_analyzer_analyze (analyzer, self->priv->context);
2272
 
        _tmp9_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_EXTERNAL);
2273
 
        code_writer = _tmp9_;
2274
 
        _tmp10_ = g_strdup (sql_heavy_generator_output_location);
2275
 
        _tmp11_ = _tmp10_;
2276
 
        if (_tmp11_ == NULL) {
2277
 
                gchar* _tmp12_;
2278
 
                _tmp12_ = g_strdup ("/dev/stdout");
2279
 
                _g_free0 (_tmp11_);
2280
 
                _tmp11_ = _tmp12_;
2281
 
        }
2282
 
        vala_code_writer_write_file (code_writer, self->priv->context, _tmp11_);
2283
 
        _g_free0 (_tmp11_);
 
3233
        _tmp21_ = self->priv->context;
 
3234
        _tmp22_ = vala_code_context_get_analyzer (_tmp21_);
 
3235
        _tmp23_ = _tmp22_;
 
3236
        _tmp24_ = self->priv->context;
 
3237
        vala_semantic_analyzer_analyze (_tmp23_, _tmp24_);
 
3238
        _tmp25_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_DUMP);
 
3239
        code_writer = _tmp25_;
 
3240
        _tmp26_ = code_writer;
 
3241
        _tmp27_ = self->priv->context;
 
3242
        _tmp28_ = sql_heavy_generator_output_location;
 
3243
        vala_code_writer_write_file (_tmp26_, _tmp27_, _tmp28_);
2284
3244
        _vala_code_visitor_unref0 (code_writer);
2285
 
        _vala_code_visitor_unref0 (analyzer);
2286
3245
        _vala_code_visitor_unref0 (resolver);
2287
3246
        _vala_code_visitor_unref0 (parser);
2288
3247
}
2290
3249
 
2291
3250
static gunichar string_get_char (const gchar* self, glong index) {
2292
3251
        gunichar result = 0U;
2293
 
        gunichar _tmp0_;
 
3252
        glong _tmp0_;
 
3253
        gunichar _tmp1_ = 0U;
2294
3254
        g_return_val_if_fail (self != NULL, 0U);
2295
 
        _tmp0_ = g_utf8_get_char (((gchar*) self) + index);
2296
 
        result = _tmp0_;
 
3255
        _tmp0_ = index;
 
3256
        _tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
 
3257
        result = _tmp1_;
2297
3258
        return result;
2298
3259
}
2299
3260
 
2300
3261
 
2301
3262
static gchar* sql_heavy_generator_parse_selector (const gchar* selector, gboolean* wildcard, GError** error) {
2302
 
        gboolean _wildcard = FALSE;
 
3263
        gboolean _vala_wildcard = FALSE;
2303
3264
        gchar* result = NULL;
2304
3265
        gchar** _tmp0_ = NULL;
2305
3266
        gchar** real_selector;
2306
3267
        gint real_selector_length1;
2307
3268
        gint _real_selector_size_;
2308
 
        gchar** _tmp1_;
2309
 
        gchar** _tmp2_ = NULL;
 
3269
        const gchar* _tmp1_;
 
3270
        gchar** _tmp2_;
 
3271
        gchar** _tmp3_ = NULL;
2310
3272
        gchar** segments;
2311
3273
        gint segments_length1;
2312
3274
        gint _segments_size_;
2313
3275
        gint pos;
2314
 
        gchar* _tmp20_ = NULL;
 
3276
        gchar** _tmp62_;
 
3277
        gint _tmp62__length1;
 
3278
        gchar* _tmp63_ = NULL;
2315
3279
        GError * _inner_error_ = NULL;
2316
3280
        g_return_val_if_fail (selector != NULL, NULL);
2317
 
        _wildcard = FALSE;
 
3281
        _vala_wildcard = FALSE;
2318
3282
        _tmp0_ = g_new0 (gchar*, 3 + 1);
2319
3283
        real_selector = _tmp0_;
2320
3284
        real_selector_length1 = 3;
2321
 
        _real_selector_size_ = 3;
2322
 
        _tmp2_ = _tmp1_ = g_strsplit (selector, "/", 3);
2323
 
        segments = _tmp2_;
2324
 
        segments_length1 = _vala_array_length (_tmp1_);
2325
 
        _segments_size_ = _vala_array_length (_tmp1_);
 
3285
        _real_selector_size_ = real_selector_length1;
 
3286
        _tmp1_ = selector;
 
3287
        _tmp3_ = _tmp2_ = g_strsplit (_tmp1_, "/", 3);
 
3288
        segments = _tmp3_;
 
3289
        segments_length1 = _vala_array_length (_tmp2_);
 
3290
        _segments_size_ = segments_length1;
2326
3291
        pos = 0;
2327
3292
        {
2328
3293
                gint seg;
2329
3294
                seg = 0;
2330
3295
                {
2331
 
                        gboolean _tmp3_;
2332
 
                        _tmp3_ = TRUE;
 
3296
                        gboolean _tmp4_;
 
3297
                        _tmp4_ = TRUE;
2333
3298
                        while (TRUE) {
2334
 
                                gunichar _tmp4_;
 
3299
                                gboolean _tmp5_;
 
3300
                                gint _tmp7_;
 
3301
                                gchar** _tmp8_;
 
3302
                                gint _tmp8__length1;
 
3303
                                gchar** _tmp9_;
 
3304
                                gint _tmp9__length1;
 
3305
                                gint _tmp10_;
 
3306
                                const gchar* _tmp11_;
 
3307
                                gunichar _tmp12_ = 0U;
2335
3308
                                gunichar first_char;
2336
 
                                gboolean _tmp5_ = FALSE;
2337
 
                                gboolean _tmp16_ = FALSE;
2338
 
                                gchar* _tmp18_;
2339
 
                                gchar* _tmp19_;
2340
 
                                if (!_tmp3_) {
2341
 
                                        seg++;
 
3309
                                gboolean _tmp13_ = FALSE;
 
3310
                                gunichar _tmp14_;
 
3311
                                gboolean _tmp16_;
 
3312
                                gchar** _tmp43_;
 
3313
                                gint _tmp43__length1;
 
3314
                                gint _tmp44_;
 
3315
                                const gchar* _tmp45_;
 
3316
                                gboolean _tmp46_ = FALSE;
 
3317
                                gint _tmp47_;
 
3318
                                gboolean _tmp51_;
 
3319
                                gchar** _tmp54_;
 
3320
                                gint _tmp54__length1;
 
3321
                                gint _tmp55_;
 
3322
                                gchar** _tmp56_;
 
3323
                                gint _tmp56__length1;
 
3324
                                gint _tmp57_;
 
3325
                                const gchar* _tmp58_;
 
3326
                                gchar* _tmp59_;
 
3327
                                gchar* _tmp60_;
 
3328
                                gint _tmp61_;
 
3329
                                _tmp5_ = _tmp4_;
 
3330
                                if (!_tmp5_) {
 
3331
                                        gint _tmp6_;
 
3332
                                        _tmp6_ = seg;
 
3333
                                        seg = _tmp6_ + 1;
2342
3334
                                }
2343
 
                                _tmp3_ = FALSE;
2344
 
                                if (!(seg < segments_length1)) {
 
3335
                                _tmp4_ = FALSE;
 
3336
                                _tmp7_ = seg;
 
3337
                                _tmp8_ = segments;
 
3338
                                _tmp8__length1 = segments_length1;
 
3339
                                if (!(_tmp7_ < _tmp8__length1)) {
2345
3340
                                        break;
2346
3341
                                }
2347
 
                                _tmp4_ = string_get_char (segments[seg], (glong) 0);
2348
 
                                first_char = _tmp4_;
2349
 
                                if (first_char == '%') {
2350
 
                                        _tmp5_ = TRUE;
 
3342
                                _tmp9_ = segments;
 
3343
                                _tmp9__length1 = segments_length1;
 
3344
                                _tmp10_ = seg;
 
3345
                                _tmp11_ = _tmp9_[_tmp10_];
 
3346
                                _tmp12_ = string_get_char (_tmp11_, (glong) 0);
 
3347
                                first_char = _tmp12_;
 
3348
                                _tmp14_ = first_char;
 
3349
                                if (_tmp14_ == ((gunichar) '%')) {
 
3350
                                        _tmp13_ = TRUE;
2351
3351
                                } else {
2352
 
                                        _tmp5_ = first_char == '@';
 
3352
                                        gunichar _tmp15_;
 
3353
                                        _tmp15_ = first_char;
 
3354
                                        _tmp13_ = _tmp15_ == ((gunichar) '@');
2353
3355
                                }
2354
 
                                if (_tmp5_) {
 
3356
                                _tmp16_ = _tmp13_;
 
3357
                                if (_tmp16_) {
2355
3358
                                        gint dest_pos = 0;
2356
 
                                        if (first_char == '%') {
2357
 
                                                const gchar* _tmp6_ = NULL;
2358
 
                                                gchar* _tmp7_;
2359
 
                                                gchar* _tmp8_;
2360
 
                                                _tmp6_ = string_offset (segments[seg], (glong) 1);
2361
 
                                                _tmp7_ = g_strdup (_tmp6_);
2362
 
                                                _tmp8_ = _tmp7_;
2363
 
                                                _g_free0 (segments[seg]);
2364
 
                                                segments[seg] = _tmp8_;
 
3359
                                        gunichar _tmp17_;
 
3360
                                        _tmp17_ = first_char;
 
3361
                                        if (_tmp17_ == ((gunichar) '%')) {
 
3362
                                                gchar** _tmp18_;
 
3363
                                                gint _tmp18__length1;
 
3364
                                                gint _tmp19_;
 
3365
                                                gchar** _tmp20_;
 
3366
                                                gint _tmp20__length1;
 
3367
                                                gint _tmp21_;
 
3368
                                                const gchar* _tmp22_;
 
3369
                                                const gchar* _tmp23_ = NULL;
 
3370
                                                gchar* _tmp24_;
 
3371
                                                gchar* _tmp25_;
 
3372
                                                _tmp18_ = segments;
 
3373
                                                _tmp18__length1 = segments_length1;
 
3374
                                                _tmp19_ = seg;
 
3375
                                                _tmp20_ = segments;
 
3376
                                                _tmp20__length1 = segments_length1;
 
3377
                                                _tmp21_ = seg;
 
3378
                                                _tmp22_ = _tmp20_[_tmp21_];
 
3379
                                                _tmp23_ = string_offset (_tmp22_, (glong) 1);
 
3380
                                                _tmp24_ = g_strdup (_tmp23_);
 
3381
                                                _g_free0 (_tmp18_[_tmp19_]);
 
3382
                                                _tmp18_[_tmp19_] = _tmp24_;
 
3383
                                                _tmp25_ = _tmp18_[_tmp19_];
2365
3384
                                                dest_pos = 1;
2366
3385
                                        } else {
2367
3386
                                                dest_pos = 0;
2368
3387
                                        }
2369
3388
                                        while (TRUE) {
2370
 
                                                gchar* _tmp9_;
2371
 
                                                gchar* _tmp10_;
2372
 
                                                if (!(pos < dest_pos)) {
 
3389
                                                gint _tmp26_;
 
3390
                                                gint _tmp27_;
 
3391
                                                gchar** _tmp28_;
 
3392
                                                gint _tmp28__length1;
 
3393
                                                gint _tmp29_;
 
3394
                                                gchar* _tmp30_;
 
3395
                                                gchar* _tmp31_;
 
3396
                                                gint _tmp32_;
 
3397
                                                _tmp26_ = pos;
 
3398
                                                _tmp27_ = dest_pos;
 
3399
                                                if (!(_tmp26_ < _tmp27_)) {
2373
3400
                                                        break;
2374
3401
                                                }
2375
 
                                                _wildcard = TRUE;
2376
 
                                                _tmp9_ = g_strdup ("*");
2377
 
                                                _tmp10_ = _tmp9_;
2378
 
                                                _g_free0 (real_selector[pos]);
2379
 
                                                real_selector[pos] = _tmp10_;
2380
 
                                                pos++;
 
3402
                                                _vala_wildcard = TRUE;
 
3403
                                                _tmp28_ = real_selector;
 
3404
                                                _tmp28__length1 = real_selector_length1;
 
3405
                                                _tmp29_ = pos;
 
3406
                                                _tmp30_ = g_strdup ("*");
 
3407
                                                _g_free0 (_tmp28_[_tmp29_]);
 
3408
                                                _tmp28_[_tmp29_] = _tmp30_;
 
3409
                                                _tmp31_ = _tmp28_[_tmp29_];
 
3410
                                                _tmp32_ = pos;
 
3411
                                                pos = _tmp32_ + 1;
2381
3412
                                        }
2382
3413
                                } else {
2383
 
                                        gboolean _tmp11_ = FALSE;
2384
 
                                        if (pos == 0) {
2385
 
                                                _tmp11_ = first_char != '*';
 
3414
                                        gboolean _tmp33_ = FALSE;
 
3415
                                        gint _tmp34_;
 
3416
                                        gboolean _tmp36_;
 
3417
                                        _tmp34_ = pos;
 
3418
                                        if (_tmp34_ == 0) {
 
3419
                                                gunichar _tmp35_;
 
3420
                                                _tmp35_ = first_char;
 
3421
                                                _tmp33_ = _tmp35_ != ((gunichar) '*');
2386
3422
                                        } else {
2387
 
                                                _tmp11_ = FALSE;
 
3423
                                                _tmp33_ = FALSE;
2388
3424
                                        }
2389
 
                                        if (_tmp11_) {
2390
 
                                                gchar* _tmp12_;
2391
 
                                                gchar* _tmp13_;
2392
 
                                                gchar* _tmp14_;
2393
 
                                                gchar* _tmp15_;
2394
 
                                                _wildcard = TRUE;
2395
 
                                                _tmp12_ = g_strdup ("*");
2396
 
                                                _tmp13_ = _tmp12_;
2397
 
                                                _g_free0 (real_selector[0]);
2398
 
                                                real_selector[0] = _tmp13_;
2399
 
                                                _tmp14_ = g_strdup ("*");
2400
 
                                                _tmp15_ = _tmp14_;
2401
 
                                                _g_free0 (real_selector[1]);
2402
 
                                                real_selector[1] = _tmp15_;
 
3425
                                        _tmp36_ = _tmp33_;
 
3426
                                        if (_tmp36_) {
 
3427
                                                gchar** _tmp37_;
 
3428
                                                gint _tmp37__length1;
 
3429
                                                gchar* _tmp38_;
 
3430
                                                gchar* _tmp39_;
 
3431
                                                gchar** _tmp40_;
 
3432
                                                gint _tmp40__length1;
 
3433
                                                gchar* _tmp41_;
 
3434
                                                gchar* _tmp42_;
 
3435
                                                _vala_wildcard = TRUE;
 
3436
                                                _tmp37_ = real_selector;
 
3437
                                                _tmp37__length1 = real_selector_length1;
 
3438
                                                _tmp38_ = g_strdup ("*");
 
3439
                                                _g_free0 (_tmp37_[0]);
 
3440
                                                _tmp37_[0] = _tmp38_;
 
3441
                                                _tmp39_ = _tmp37_[0];
 
3442
                                                _tmp40_ = real_selector;
 
3443
                                                _tmp40__length1 = real_selector_length1;
 
3444
                                                _tmp41_ = g_strdup ("*");
 
3445
                                                _g_free0 (_tmp40_[1]);
 
3446
                                                _tmp40_[1] = _tmp41_;
 
3447
                                                _tmp42_ = _tmp40_[1];
2403
3448
                                                pos = 2;
2404
3449
                                        }
2405
3450
                                }
2406
 
                                if (g_strcmp0 (segments[seg], "*") == 0) {
2407
 
                                        _wildcard = TRUE;
 
3451
                                _tmp43_ = segments;
 
3452
                                _tmp43__length1 = segments_length1;
 
3453
                                _tmp44_ = seg;
 
3454
                                _tmp45_ = _tmp43_[_tmp44_];
 
3455
                                if (g_strcmp0 (_tmp45_, "*") == 0) {
 
3456
                                        _vala_wildcard = TRUE;
2408
3457
                                }
2409
 
                                if (pos > 2) {
2410
 
                                        _tmp16_ = TRUE;
 
3458
                                _tmp47_ = pos;
 
3459
                                if (_tmp47_ > 2) {
 
3460
                                        _tmp46_ = TRUE;
2411
3461
                                } else {
2412
 
                                        _tmp16_ = real_selector[pos] != NULL;
 
3462
                                        gchar** _tmp48_;
 
3463
                                        gint _tmp48__length1;
 
3464
                                        gint _tmp49_;
 
3465
                                        const gchar* _tmp50_;
 
3466
                                        _tmp48_ = real_selector;
 
3467
                                        _tmp48__length1 = real_selector_length1;
 
3468
                                        _tmp49_ = pos;
 
3469
                                        _tmp50_ = _tmp48_[_tmp49_];
 
3470
                                        _tmp46_ = _tmp50_ != NULL;
2413
3471
                                }
2414
 
                                if (_tmp16_) {
2415
 
                                        GError* _tmp17_ = NULL;
2416
 
                                        _tmp17_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_SELECTOR, "Invalid selector (%s).", selector);
2417
 
                                        _inner_error_ = _tmp17_;
 
3472
                                _tmp51_ = _tmp46_;
 
3473
                                if (_tmp51_) {
 
3474
                                        const gchar* _tmp52_;
 
3475
                                        GError* _tmp53_;
 
3476
                                        _tmp52_ = selector;
 
3477
                                        _tmp53_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_SELECTOR, "Invalid selector (%s).", _tmp52_);
 
3478
                                        _inner_error_ = _tmp53_;
2418
3479
                                        if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
2419
3480
                                                g_propagate_error (error, _inner_error_);
2420
3481
                                                segments = (_vala_array_free (segments, segments_length1, (GDestroyNotify) g_free), NULL);
2428
3489
                                                return NULL;
2429
3490
                                        }
2430
3491
                                }
2431
 
                                _tmp18_ = g_strdup (segments[seg]);
2432
 
                                _tmp19_ = _tmp18_;
2433
 
                                _g_free0 (real_selector[pos]);
2434
 
                                real_selector[pos] = _tmp19_;
2435
 
                                pos++;
 
3492
                                _tmp54_ = real_selector;
 
3493
                                _tmp54__length1 = real_selector_length1;
 
3494
                                _tmp55_ = pos;
 
3495
                                _tmp56_ = segments;
 
3496
                                _tmp56__length1 = segments_length1;
 
3497
                                _tmp57_ = seg;
 
3498
                                _tmp58_ = _tmp56_[_tmp57_];
 
3499
                                _tmp59_ = g_strdup (_tmp58_);
 
3500
                                _g_free0 (_tmp54_[_tmp55_]);
 
3501
                                _tmp54_[_tmp55_] = _tmp59_;
 
3502
                                _tmp60_ = _tmp54_[_tmp55_];
 
3503
                                _tmp61_ = pos;
 
3504
                                pos = _tmp61_ + 1;
2436
3505
                        }
2437
3506
                }
2438
3507
        }
2439
 
        _tmp20_ = g_strjoinv ("/", real_selector);
2440
 
        result = _tmp20_;
 
3508
        _tmp62_ = real_selector;
 
3509
        _tmp62__length1 = real_selector_length1;
 
3510
        _tmp63_ = g_strjoinv ("/", _tmp62_);
 
3511
        result = _tmp63_;
2441
3512
        segments = (_vala_array_free (segments, segments_length1, (GDestroyNotify) g_free), NULL);
2442
3513
        real_selector = (_vala_array_free (real_selector, real_selector_length1, (GDestroyNotify) g_free), NULL);
2443
3514
        if (wildcard) {
2444
 
                *wildcard = _wildcard;
 
3515
                *wildcard = _vala_wildcard;
2445
3516
        }
2446
3517
        return result;
2447
3518
}
2453
3524
 
2454
3525
 
2455
3526
static void sql_heavy_generator_parse_metadata (SQLHeavyGenerator* self, GError** error) {
2456
 
        GKeyFile* _tmp0_ = NULL;
 
3527
        GKeyFile* _tmp0_;
2457
3528
        GKeyFile* metadata;
2458
 
        gsize _tmp1_;
2459
 
        gchar** _tmp2_ = NULL;
 
3529
        GKeyFile* _tmp1_;
 
3530
        const gchar* _tmp2_;
 
3531
        GKeyFile* _tmp3_;
 
3532
        gsize _tmp4_;
 
3533
        gchar** _tmp5_ = NULL;
2460
3534
        GError * _inner_error_ = NULL;
2461
3535
        g_return_if_fail (self != NULL);
2462
3536
        _tmp0_ = g_key_file_new ();
2463
3537
        metadata = _tmp0_;
2464
 
        g_key_file_load_from_file (metadata, sql_heavy_generator_metadata_location, G_KEY_FILE_NONE, &_inner_error_);
 
3538
        _tmp1_ = metadata;
 
3539
        _tmp2_ = sql_heavy_generator_metadata_location;
 
3540
        g_key_file_load_from_file (_tmp1_, _tmp2_, G_KEY_FILE_NONE, &_inner_error_);
2465
3541
        if (_inner_error_ != NULL) {
2466
3542
                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == G_KEY_FILE_ERROR)) {
2467
3543
                        g_propagate_error (error, _inner_error_);
2474
3550
                        return;
2475
3551
                }
2476
3552
        }
2477
 
        _tmp2_ = g_key_file_get_groups (metadata, &_tmp1_);
 
3553
        _tmp3_ = metadata;
 
3554
        _tmp5_ = g_key_file_get_groups (_tmp3_, &_tmp4_);
2478
3555
        {
2479
 
                gchar** group_collection;
2480
 
                int group_collection_length1;
2481
 
                int group_it;
2482
 
                group_collection = _tmp2_;
2483
 
                group_collection_length1 = _tmp1_;
2484
 
                for (group_it = 0; group_it < _tmp1_; group_it = group_it + 1) {
2485
 
                        const gchar* group;
 
3556
                gchar** group_collection = NULL;
 
3557
                gint group_collection_length1 = 0;
 
3558
                gint _group_collection_size_ = 0;
 
3559
                gint group_it = 0;
 
3560
                group_collection = _tmp5_;
 
3561
                group_collection_length1 = _tmp4_;
 
3562
                for (group_it = 0; group_it < _tmp4_; group_it = group_it + 1) {
 
3563
                        const gchar* group = NULL;
2486
3564
                        group = group_collection[group_it];
2487
3565
                        {
2488
3566
                                gboolean is_wildcard = FALSE;
2489
 
                                gboolean _tmp3_;
2490
 
                                gchar* _tmp4_ = NULL;
 
3567
                                const gchar* _tmp6_;
 
3568
                                gboolean _tmp7_ = FALSE;
 
3569
                                gchar* _tmp8_ = NULL;
2491
3570
                                gchar* selector;
2492
 
                                ValaHashMap* _tmp5_ = NULL;
2493
 
                                ValaHashMap* _tmp6_;
 
3571
                                ValaHashMap* _tmp9_ = NULL;
 
3572
                                gboolean _tmp10_;
 
3573
                                ValaHashMap* _tmp13_;
 
3574
                                ValaHashMap* _tmp14_;
2494
3575
                                ValaHashMap* cache;
2495
 
                                gpointer _tmp7_ = NULL;
 
3576
                                ValaHashMap* _tmp15_;
 
3577
                                const gchar* _tmp16_;
 
3578
                                gpointer _tmp17_ = NULL;
2496
3579
                                ValaHashMap* properties;
2497
 
                                gsize _tmp9_;
2498
 
                                gchar** _tmp10_ = NULL;
2499
 
                                gchar** _tmp11_;
2500
 
                                gint _tmp11__length1;
2501
 
                                gint __tmp11__size_;
2502
 
                                _tmp4_ = sql_heavy_generator_parse_selector (group, &_tmp3_, &_inner_error_);
2503
 
                                is_wildcard = _tmp3_;
2504
 
                                selector = _tmp4_;
 
3580
                                ValaHashMap* _tmp18_;
 
3581
                                GKeyFile* _tmp26_;
 
3582
                                const gchar* _tmp27_;
 
3583
                                gsize _tmp28_;
 
3584
                                gchar** _tmp29_ = NULL;
 
3585
                                gchar** _tmp30_;
 
3586
                                gint _tmp30__length1;
 
3587
                                gint __tmp30__size_;
 
3588
                                _tmp6_ = group;
 
3589
                                _tmp8_ = sql_heavy_generator_parse_selector (_tmp6_, &_tmp7_, &_inner_error_);
 
3590
                                is_wildcard = _tmp7_;
 
3591
                                selector = _tmp8_;
2505
3592
                                if (_inner_error_ != NULL) {
2506
3593
                                        if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == G_KEY_FILE_ERROR)) {
2507
3594
                                                g_propagate_error (error, _inner_error_);
2516
3603
                                                return;
2517
3604
                                        }
2518
3605
                                }
2519
 
                                if (is_wildcard) {
2520
 
                                        _tmp5_ = self->priv->wildcard_cache;
 
3606
                                _tmp10_ = is_wildcard;
 
3607
                                if (_tmp10_) {
 
3608
                                        ValaHashMap* _tmp11_;
 
3609
                                        _tmp11_ = self->priv->wildcard_cache;
 
3610
                                        _tmp9_ = _tmp11_;
2521
3611
                                } else {
2522
 
                                        _tmp5_ = self->priv->cache;
 
3612
                                        ValaHashMap* _tmp12_;
 
3613
                                        _tmp12_ = self->priv->cache;
 
3614
                                        _tmp9_ = _tmp12_;
2523
3615
                                }
2524
 
                                _tmp6_ = _vala_map_ref0 (_tmp5_);
2525
 
                                cache = _tmp6_;
2526
 
                                _tmp7_ = vala_map_get ((ValaMap*) cache, selector);
2527
 
                                properties = (ValaHashMap*) _tmp7_;
2528
 
                                if (properties == NULL) {
2529
 
                                        ValaHashMap* _tmp8_ = NULL;
2530
 
                                        _tmp8_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_str_hash, g_str_equal, g_str_equal);
 
3616
                                _tmp13_ = _tmp9_;
 
3617
                                _tmp14_ = _vala_map_ref0 (_tmp13_);
 
3618
                                cache = _tmp14_;
 
3619
                                _tmp15_ = cache;
 
3620
                                _tmp16_ = selector;
 
3621
                                _tmp17_ = vala_map_get ((ValaMap*) _tmp15_, _tmp16_);
 
3622
                                properties = (ValaHashMap*) _tmp17_;
 
3623
                                _tmp18_ = properties;
 
3624
                                if (_tmp18_ == NULL) {
 
3625
                                        GHashFunc _tmp19_;
 
3626
                                        GEqualFunc _tmp20_;
 
3627
                                        GEqualFunc _tmp21_;
 
3628
                                        ValaHashMap* _tmp22_;
 
3629
                                        ValaHashMap* _tmp23_;
 
3630
                                        const gchar* _tmp24_;
 
3631
                                        ValaHashMap* _tmp25_;
 
3632
                                        _tmp19_ = g_str_hash;
 
3633
                                        _tmp20_ = g_str_equal;
 
3634
                                        _tmp21_ = g_str_equal;
 
3635
                                        _tmp22_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp19_, _tmp20_, _tmp21_);
2531
3636
                                        _vala_map_unref0 (properties);
2532
 
                                        properties = _tmp8_;
2533
 
                                        vala_map_set ((ValaMap*) cache, selector, properties);
 
3637
                                        properties = _tmp22_;
 
3638
                                        _tmp23_ = cache;
 
3639
                                        _tmp24_ = selector;
 
3640
                                        _tmp25_ = properties;
 
3641
                                        vala_map_set ((ValaMap*) _tmp23_, _tmp24_, _tmp25_);
2534
3642
                                }
2535
 
                                _tmp10_ = g_key_file_get_keys (metadata, group, &_tmp9_, &_inner_error_);
2536
 
                                _tmp11_ = _tmp10_;
2537
 
                                _tmp11__length1 = _tmp9_;
2538
 
                                __tmp11__size_ = _tmp9_;
 
3643
                                _tmp26_ = metadata;
 
3644
                                _tmp27_ = group;
 
3645
                                _tmp29_ = g_key_file_get_keys (_tmp26_, _tmp27_, &_tmp28_, &_inner_error_);
 
3646
                                _tmp30_ = _tmp29_;
 
3647
                                _tmp30__length1 = _tmp28_;
 
3648
                                __tmp30__size_ = _tmp30__length1;
2539
3649
                                if (_inner_error_ != NULL) {
2540
3650
                                        if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == G_KEY_FILE_ERROR)) {
2541
3651
                                                g_propagate_error (error, _inner_error_);
2557
3667
                                        }
2558
3668
                                }
2559
3669
                                {
2560
 
                                        gchar** key_collection;
2561
 
                                        int key_collection_length1;
2562
 
                                        int key_it;
2563
 
                                        key_collection = _tmp11_;
2564
 
                                        key_collection_length1 = _tmp11__length1;
2565
 
                                        for (key_it = 0; key_it < _tmp11__length1; key_it = key_it + 1) {
2566
 
                                                const gchar* key;
 
3670
                                        gchar** key_collection = NULL;
 
3671
                                        gint key_collection_length1 = 0;
 
3672
                                        gint _key_collection_size_ = 0;
 
3673
                                        gint key_it = 0;
 
3674
                                        key_collection = _tmp30_;
 
3675
                                        key_collection_length1 = _tmp30__length1;
 
3676
                                        for (key_it = 0; key_it < _tmp30__length1; key_it = key_it + 1) {
 
3677
                                                const gchar* key = NULL;
2567
3678
                                                key = key_collection[key_it];
2568
3679
                                                {
2569
 
                                                        gchar* _tmp12_ = NULL;
2570
 
                                                        gchar* _tmp13_;
2571
 
                                                        gchar* _tmp14_;
2572
 
                                                        _tmp12_ = g_key_file_get_string (metadata, group, key, &_inner_error_);
2573
 
                                                        _tmp13_ = _tmp12_;
 
3680
                                                        GKeyFile* _tmp31_;
 
3681
                                                        const gchar* _tmp32_;
 
3682
                                                        const gchar* _tmp33_;
 
3683
                                                        gchar* _tmp34_ = NULL;
 
3684
                                                        gchar* _tmp35_;
 
3685
                                                        ValaHashMap* _tmp36_;
 
3686
                                                        const gchar* _tmp37_;
 
3687
                                                        gchar* _tmp38_;
 
3688
                                                        _tmp31_ = metadata;
 
3689
                                                        _tmp32_ = group;
 
3690
                                                        _tmp33_ = key;
 
3691
                                                        _tmp34_ = g_key_file_get_string (_tmp31_, _tmp32_, _tmp33_, &_inner_error_);
 
3692
                                                        _tmp35_ = _tmp34_;
2574
3693
                                                        if (_inner_error_ != NULL) {
2575
3694
                                                                if ((_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) || (_inner_error_->domain == G_KEY_FILE_ERROR)) {
2576
3695
                                                                        g_propagate_error (error, _inner_error_);
2593
3712
                                                                        return;
2594
3713
                                                                }
2595
3714
                                                        }
2596
 
                                                        _tmp14_ = _tmp13_;
2597
 
                                                        vala_map_set ((ValaMap*) properties, key, _tmp14_);
2598
 
                                                        _g_free0 (_tmp14_);
 
3715
                                                        _tmp36_ = properties;
 
3716
                                                        _tmp37_ = key;
 
3717
                                                        _tmp38_ = _tmp35_;
 
3718
                                                        vala_map_set ((ValaMap*) _tmp36_, _tmp37_, _tmp38_);
 
3719
                                                        _g_free0 (_tmp38_);
2599
3720
                                                }
2600
3721
                                        }
2601
3722
                                        key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
2612
3733
 
2613
3734
 
2614
3735
void sql_heavy_generator_configure (SQLHeavyGenerator* self, GError** error) {
 
3736
        const gchar* _tmp0_;
 
3737
        ValaCodeContext* _tmp7_;
 
3738
        ValaCodeContext* _tmp8_;
 
3739
        ValaCodeContext* _tmp9_;
 
3740
        ValaCodeContext* _tmp10_;
 
3741
        ValaCodeContext* _tmp11_;
 
3742
        gchar* _tmp12_ = NULL;
 
3743
        gchar* _tmp13_;
 
3744
        gchar* _tmp14_ = NULL;
 
3745
        gchar* _tmp15_;
 
3746
        gchar** _tmp16_;
 
3747
        gint _tmp16__length1;
 
3748
        gchar** _tmp19_;
 
3749
        gint _tmp19__length1;
2615
3750
        GError * _inner_error_ = NULL;
2616
3751
        g_return_if_fail (self != NULL);
2617
 
        if (sql_heavy_generator_metadata_location != NULL) {
2618
 
                sql_heavy_generator_parse_metadata (self, &_inner_error_);
2619
 
                if (_inner_error_ != NULL) {
2620
 
                        if (_inner_error_->domain == G_KEY_FILE_ERROR) {
2621
 
                                goto __catch3_g_key_file_error;
2622
 
                        }
2623
 
                        if (_inner_error_->domain == G_FILE_ERROR) {
2624
 
                                goto __catch3_g_file_error;
2625
 
                        }
2626
 
                        goto __finally3;
 
3752
        _tmp0_ = sql_heavy_generator_metadata_location;
 
3753
        if (_tmp0_ != NULL) {
 
3754
                {
 
3755
                        sql_heavy_generator_parse_metadata (self, &_inner_error_);
 
3756
                        if (_inner_error_ != NULL) {
 
3757
                                if (_inner_error_->domain == G_KEY_FILE_ERROR) {
 
3758
                                        goto __catch3_g_key_file_error;
 
3759
                                }
 
3760
                                if (_inner_error_->domain == G_FILE_ERROR) {
 
3761
                                        goto __catch3_g_file_error;
 
3762
                                }
 
3763
                                goto __finally3;
 
3764
                        }
2627
3765
                }
2628
3766
                goto __finally3;
2629
3767
                __catch3_g_key_file_error:
2630
3768
                {
2631
 
                        GError * e;
2632
 
                        GError* _tmp0_ = NULL;
 
3769
                        GError* e = NULL;
 
3770
                        GError* _tmp1_;
 
3771
                        const gchar* _tmp2_;
 
3772
                        GError* _tmp3_;
2633
3773
                        e = _inner_error_;
2634
3774
                        _inner_error_ = NULL;
2635
 
                        _tmp0_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, "Unable to load metadata file: %s", e->message);
2636
 
                        _inner_error_ = _tmp0_;
 
3775
                        _tmp1_ = e;
 
3776
                        _tmp2_ = _tmp1_->message;
 
3777
                        _tmp3_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, "Unable to load metadata file: %s", _tmp2_);
 
3778
                        _inner_error_ = _tmp3_;
2637
3779
                        _g_error_free0 (e);
2638
3780
                        goto __finally3;
2639
3781
                }
2640
3782
                goto __finally3;
2641
3783
                __catch3_g_file_error:
2642
3784
                {
2643
 
                        GError * e;
2644
 
                        GError* _tmp1_ = NULL;
 
3785
                        GError* e = NULL;
 
3786
                        GError* _tmp4_;
 
3787
                        const gchar* _tmp5_;
 
3788
                        GError* _tmp6_;
2645
3789
                        e = _inner_error_;
2646
3790
                        _inner_error_ = NULL;
2647
 
                        _tmp1_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, "Unable to load metadata file: %s", e->message);
2648
 
                        _inner_error_ = _tmp1_;
 
3791
                        _tmp4_ = e;
 
3792
                        _tmp5_ = _tmp4_->message;
 
3793
                        _tmp6_ = g_error_new (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, "Unable to load metadata file: %s", _tmp5_);
 
3794
                        _inner_error_ = _tmp6_;
2649
3795
                        _g_error_free0 (e);
2650
3796
                        goto __finally3;
2651
3797
                }
2661
3807
                        }
2662
3808
                }
2663
3809
        }
2664
 
        vala_code_context_set_profile (self->priv->context, VALA_PROFILE_GOBJECT);
2665
 
        vala_code_context_push (self->priv->context);
2666
 
        vala_code_context_add_external_package (self->priv->context, "glib-2.0");
2667
 
        vala_code_context_add_external_package (self->priv->context, "gobject-2.0");
2668
 
        vala_code_context_add_external_package (self->priv->context, "sqlheavy-1.0");
 
3810
        _tmp7_ = self->priv->context;
 
3811
        vala_code_context_set_profile (_tmp7_, VALA_PROFILE_GOBJECT);
 
3812
        _tmp8_ = self->priv->context;
 
3813
        vala_code_context_push (_tmp8_);
 
3814
        _tmp9_ = self->priv->context;
 
3815
        vala_code_context_add_external_package (_tmp9_, "glib-2.0");
 
3816
        _tmp10_ = self->priv->context;
 
3817
        vala_code_context_add_external_package (_tmp10_, "gobject-2.0");
 
3818
        _tmp11_ = self->priv->context;
 
3819
        _tmp12_ = sql_heavy_version_api ();
 
3820
        _tmp13_ = _tmp12_;
 
3821
        _tmp14_ = g_strdup_printf ("sqlheavy-%s", _tmp13_);
 
3822
        _tmp15_ = _tmp14_;
 
3823
        vala_code_context_add_external_package (_tmp11_, _tmp15_);
 
3824
        _g_free0 (_tmp15_);
 
3825
        _g_free0 (_tmp13_);
 
3826
        _tmp16_ = sql_heavy_generator_packages;
 
3827
        _tmp16__length1 = _vala_array_length (sql_heavy_generator_packages);
2669
3828
        {
2670
 
                gchar** pkg_collection;
2671
 
                int pkg_collection_length1;
2672
 
                int pkg_it;
2673
 
                pkg_collection = sql_heavy_generator_packages;
2674
 
                pkg_collection_length1 = _vala_array_length (sql_heavy_generator_packages);
2675
 
                for (pkg_it = 0; pkg_it < _vala_array_length (sql_heavy_generator_packages); pkg_it = pkg_it + 1) {
2676
 
                        const gchar* pkg;
 
3829
                gchar** pkg_collection = NULL;
 
3830
                gint pkg_collection_length1 = 0;
 
3831
                gint _pkg_collection_size_ = 0;
 
3832
                gint pkg_it = 0;
 
3833
                pkg_collection = _tmp16_;
 
3834
                pkg_collection_length1 = _tmp16__length1;
 
3835
                for (pkg_it = 0; pkg_it < _tmp16__length1; pkg_it = pkg_it + 1) {
 
3836
                        const gchar* pkg = NULL;
2677
3837
                        pkg = pkg_collection[pkg_it];
2678
3838
                        {
2679
 
                                vala_code_context_add_external_package (self->priv->context, pkg);
 
3839
                                ValaCodeContext* _tmp17_;
 
3840
                                const gchar* _tmp18_;
 
3841
                                _tmp17_ = self->priv->context;
 
3842
                                _tmp18_ = pkg;
 
3843
                                vala_code_context_add_external_package (_tmp17_, _tmp18_);
2680
3844
                        }
2681
3845
                }
2682
3846
        }
 
3847
        _tmp19_ = sql_heavy_generator_sources;
 
3848
        _tmp19__length1 = _vala_array_length (sql_heavy_generator_sources);
2683
3849
        {
2684
 
                gchar** source_collection;
2685
 
                int source_collection_length1;
2686
 
                int source_it;
2687
 
                source_collection = sql_heavy_generator_sources;
2688
 
                source_collection_length1 = _vala_array_length (sql_heavy_generator_sources);
2689
 
                for (source_it = 0; source_it < _vala_array_length (sql_heavy_generator_sources); source_it = source_it + 1) {
2690
 
                        const gchar* source;
 
3850
                gchar** source_collection = NULL;
 
3851
                gint source_collection_length1 = 0;
 
3852
                gint _source_collection_size_ = 0;
 
3853
                gint source_it = 0;
 
3854
                source_collection = _tmp19_;
 
3855
                source_collection_length1 = _tmp19__length1;
 
3856
                for (source_it = 0; source_it < _tmp19__length1; source_it = source_it + 1) {
 
3857
                        const gchar* source = NULL;
2691
3858
                        source = source_collection[source_it];
2692
3859
                        {
2693
 
                                gboolean _tmp2_;
2694
 
                                _tmp2_ = g_str_has_suffix (source, ".vala");
2695
 
                                if (_tmp2_) {
2696
 
                                        gboolean _tmp3_;
2697
 
                                        _tmp3_ = g_file_test (source, G_FILE_TEST_EXISTS);
2698
 
                                        if (_tmp3_) {
2699
 
                                                ValaSourceFile* _tmp4_ = NULL;
2700
 
                                                ValaSourceFile* _tmp5_;
2701
 
                                                _tmp4_ = vala_source_file_new (self->priv->context, VALA_SOURCE_FILE_TYPE_NONE, source, NULL);
2702
 
                                                _tmp5_ = _tmp4_;
2703
 
                                                vala_code_context_add_source_file (self->priv->context, _tmp5_);
2704
 
                                                _vala_source_file_unref0 (_tmp5_);
 
3860
                                const gchar* _tmp20_;
 
3861
                                gboolean _tmp21_ = FALSE;
 
3862
                                _tmp20_ = source;
 
3863
                                _tmp21_ = g_str_has_suffix (_tmp20_, ".vala");
 
3864
                                if (_tmp21_) {
 
3865
                                        const gchar* _tmp22_;
 
3866
                                        gboolean _tmp23_ = FALSE;
 
3867
                                        _tmp22_ = source;
 
3868
                                        _tmp23_ = g_file_test (_tmp22_, G_FILE_TEST_EXISTS);
 
3869
                                        if (_tmp23_) {
 
3870
                                                ValaCodeContext* _tmp24_;
 
3871
                                                ValaCodeContext* _tmp25_;
 
3872
                                                const gchar* _tmp26_;
 
3873
                                                ValaSourceFile* _tmp27_;
 
3874
                                                ValaSourceFile* _tmp28_;
 
3875
                                                _tmp24_ = self->priv->context;
 
3876
                                                _tmp25_ = self->priv->context;
 
3877
                                                _tmp26_ = source;
 
3878
                                                _tmp27_ = vala_source_file_new (_tmp25_, VALA_SOURCE_FILE_TYPE_NONE, _tmp26_, NULL, FALSE);
 
3879
                                                _tmp28_ = _tmp27_;
 
3880
                                                vala_code_context_add_source_file (_tmp24_, _tmp28_);
 
3881
                                                _vala_source_file_unref0 (_tmp28_);
2705
3882
                                        } else {
2706
 
                                                const gchar* _tmp6_ = NULL;
2707
 
                                                gchar* _tmp7_ = NULL;
2708
 
                                                gchar* _tmp8_;
2709
 
                                                GError* _tmp9_ = NULL;
2710
 
                                                GError* _tmp10_;
2711
 
                                                _tmp6_ = string_to_string (source);
2712
 
                                                _tmp7_ = g_strconcat ("Source file '", _tmp6_, "' does not exist.", NULL);
2713
 
                                                _tmp8_ = _tmp7_;
2714
 
                                                _tmp9_ = g_error_new_literal (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, _tmp8_);
2715
 
                                                _tmp10_ = _tmp9_;
2716
 
                                                _g_free0 (_tmp8_);
2717
 
                                                _inner_error_ = _tmp10_;
 
3883
                                                const gchar* _tmp29_;
 
3884
                                                const gchar* _tmp30_ = NULL;
 
3885
                                                gchar* _tmp31_ = NULL;
 
3886
                                                gchar* _tmp32_;
 
3887
                                                GError* _tmp33_;
 
3888
                                                GError* _tmp34_;
 
3889
                                                _tmp29_ = source;
 
3890
                                                _tmp30_ = string_to_string (_tmp29_);
 
3891
                                                _tmp31_ = g_strconcat ("Source file '", _tmp30_, "' does not exist.", NULL);
 
3892
                                                _tmp32_ = _tmp31_;
 
3893
                                                _tmp33_ = g_error_new_literal (SQL_HEAVY_GENERATOR_ERROR, SQL_HEAVY_GENERATOR_ERROR_CONFIGURATION, _tmp32_);
 
3894
                                                _tmp34_ = _tmp33_;
 
3895
                                                _g_free0 (_tmp32_);
 
3896
                                                _inner_error_ = _tmp34_;
2718
3897
                                                if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
2719
3898
                                                        g_propagate_error (error, _inner_error_);
2720
3899
                                                        return;
2725
3904
                                                }
2726
3905
                                        }
2727
3906
                                } else {
2728
 
                                        gchar* _tmp11_;
2729
 
                                        _tmp11_ = g_strdup (source);
2730
 
                                        self->priv->databases = g_slist_prepend (self->priv->databases, _tmp11_);
 
3907
                                        const gchar* _tmp35_;
 
3908
                                        gchar* _tmp36_;
 
3909
                                        _tmp35_ = source;
 
3910
                                        _tmp36_ = g_strdup (_tmp35_);
 
3911
                                        self->priv->databases = g_slist_prepend (self->priv->databases, _tmp36_);
2731
3912
                                }
2732
3913
                        }
2733
3914
                }
2737
3918
 
2738
3919
static gint sql_heavy_generator_main (gchar** args, int args_length1) {
2739
3920
        gint result = 0;
2740
 
        GOptionContext* _tmp0_ = NULL;
2741
 
        GOptionContext* opt_context;
2742
 
        SQLHeavyGenerator* _tmp7_ = NULL;
 
3921
        gchar** _tmp18_;
 
3922
        gint _tmp18__length1;
 
3923
        SQLHeavyGenerator* _tmp20_;
2743
3924
        SQLHeavyGenerator* generator;
2744
3925
        GError * _inner_error_ = NULL;
2745
 
        _tmp0_ = g_option_context_new ("- SQLHeavy ORM Generator");
2746
 
        opt_context = _tmp0_;
2747
 
        g_option_context_set_help_enabled (opt_context, TRUE);
2748
 
        g_option_context_add_main_entries (opt_context, SQL_HEAVY_GENERATOR_options, NULL);
2749
 
        g_option_context_set_summary (opt_context, "This tool will generate a Vala file which provides an object for each\n" \
 
3926
        {
 
3927
                GOptionContext* _tmp0_;
 
3928
                GOptionContext* opt_context;
 
3929
                GOptionContext* _tmp1_;
 
3930
                GOptionContext* _tmp2_;
 
3931
                GOptionContext* _tmp3_;
 
3932
                GOptionContext* _tmp4_;
 
3933
                GOptionContext* _tmp5_;
 
3934
                _tmp0_ = g_option_context_new ("- SQLHeavy ORM Generator");
 
3935
                opt_context = _tmp0_;
 
3936
                _tmp1_ = opt_context;
 
3937
                g_option_context_set_help_enabled (_tmp1_, TRUE);
 
3938
                _tmp2_ = opt_context;
 
3939
                g_option_context_add_main_entries (_tmp2_, SQL_HEAVY_GENERATOR_options, NULL);
 
3940
                _tmp3_ = opt_context;
 
3941
                g_option_context_set_summary (_tmp3_, "This tool will generate a Vala file which provides an object for each\n" \
2750
3942
"table in the specified database(s), each of which extends the\n" \
2751
3943
"SQLHeavyRow class.");
2752
 
        g_option_context_set_description (opt_context, "Copyright 2010 Evan Nemerson.\n" \
 
3944
                _tmp4_ = opt_context;
 
3945
                g_option_context_set_description (_tmp4_, "Copyright 2010 Evan Nemerson.\n" \
2753
3946
"Released under versions 2.1 and 3 of the LGPL.\n" \
2754
3947
"\n" \
2755
3948
"For more information, or to report a bug, see\n" \
2756
3949
"<http://code.google.com/p/sqlheavy>");
2757
 
        g_option_context_parse (opt_context, &args_length1, &args, &_inner_error_);
2758
 
        if (_inner_error_ != NULL) {
2759
 
                _g_option_context_free0 (opt_context);
2760
 
                if (_inner_error_->domain == G_OPTION_ERROR) {
2761
 
                        goto __catch4_g_option_error;
 
3950
                _tmp5_ = opt_context;
 
3951
                g_option_context_parse (_tmp5_, &args_length1, &args, &_inner_error_);
 
3952
                if (_inner_error_ != NULL) {
 
3953
                        _g_option_context_free0 (opt_context);
 
3954
                        if (_inner_error_->domain == G_OPTION_ERROR) {
 
3955
                                goto __catch4_g_option_error;
 
3956
                        }
 
3957
                        _g_option_context_free0 (opt_context);
 
3958
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
3959
                        g_clear_error (&_inner_error_);
 
3960
                        return 0;
2762
3961
                }
2763
3962
                _g_option_context_free0 (opt_context);
2764
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2765
 
                g_clear_error (&_inner_error_);
2766
 
                return 0;
2767
3963
        }
2768
 
        _g_option_context_free0 (opt_context);
2769
3964
        goto __finally4;
2770
3965
        __catch4_g_option_error:
2771
3966
        {
2772
 
                GError * e;
2773
 
                const gchar* _tmp1_ = NULL;
2774
 
                gchar* _tmp2_ = NULL;
2775
 
                gchar* _tmp3_;
2776
 
                const gchar* _tmp4_ = NULL;
2777
 
                gchar* _tmp5_ = NULL;
2778
 
                gchar* _tmp6_;
 
3967
                GError* e = NULL;
 
3968
                FILE* _tmp6_;
 
3969
                GError* _tmp7_;
 
3970
                const gchar* _tmp8_;
 
3971
                const gchar* _tmp9_ = NULL;
 
3972
                gchar* _tmp10_ = NULL;
 
3973
                gchar* _tmp11_;
 
3974
                FILE* _tmp12_;
 
3975
                gchar** _tmp13_;
 
3976
                gint _tmp13__length1;
 
3977
                const gchar* _tmp14_;
 
3978
                const gchar* _tmp15_ = NULL;
 
3979
                gchar* _tmp16_ = NULL;
 
3980
                gchar* _tmp17_;
2779
3981
                e = _inner_error_;
2780
3982
                _inner_error_ = NULL;
2781
 
                _tmp1_ = string_to_string (e->message);
2782
 
                _tmp2_ = g_strconcat (_tmp1_, "\n", NULL);
2783
 
                _tmp3_ = _tmp2_;
2784
 
                fputs (_tmp3_, stdout);
2785
 
                _g_free0 (_tmp3_);
2786
 
                _tmp4_ = string_to_string (args[0]);
2787
 
                _tmp5_ = g_strconcat ("Run '", _tmp4_, " --help' to see a full list of available command line options.\n", NULL);
2788
 
                _tmp6_ = _tmp5_;
2789
 
                fputs (_tmp6_, stdout);
2790
 
                _g_free0 (_tmp6_);
 
3983
                _tmp6_ = stdout;
 
3984
                _tmp7_ = e;
 
3985
                _tmp8_ = _tmp7_->message;
 
3986
                _tmp9_ = string_to_string (_tmp8_);
 
3987
                _tmp10_ = g_strconcat (_tmp9_, "\n", NULL);
 
3988
                _tmp11_ = _tmp10_;
 
3989
                fputs (_tmp11_, _tmp6_);
 
3990
                _g_free0 (_tmp11_);
 
3991
                _tmp12_ = stdout;
 
3992
                _tmp13_ = args;
 
3993
                _tmp13__length1 = args_length1;
 
3994
                _tmp14_ = _tmp13_[0];
 
3995
                _tmp15_ = string_to_string (_tmp14_);
 
3996
                _tmp16_ = g_strconcat ("Run '", _tmp15_, " --help' to see a full list of available command line options.\n", NULL);
 
3997
                _tmp17_ = _tmp16_;
 
3998
                fputs (_tmp17_, _tmp12_);
 
3999
                _g_free0 (_tmp17_);
2791
4000
                result = 1;
2792
4001
                _g_error_free0 (e);
2793
4002
                return result;
2798
4007
                g_clear_error (&_inner_error_);
2799
4008
                return 0;
2800
4009
        }
2801
 
        if (sql_heavy_generator_sources == NULL) {
2802
 
                fputs ("No databases specified.\n", stderr);
 
4010
        _tmp18_ = sql_heavy_generator_sources;
 
4011
        _tmp18__length1 = _vala_array_length (sql_heavy_generator_sources);
 
4012
        if (_tmp18_ == NULL) {
 
4013
                FILE* _tmp19_;
 
4014
                _tmp19_ = stderr;
 
4015
                fputs ("No databases specified.\n", _tmp19_);
2803
4016
                result = 1;
2804
4017
                return result;
2805
4018
        }
2806
 
        _tmp7_ = sql_heavy_generator_new ();
2807
 
        generator = _tmp7_;
2808
 
        sql_heavy_generator_configure (generator, &_inner_error_);
2809
 
        if (_inner_error_ != NULL) {
2810
 
                if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
2811
 
                        goto __catch5_sql_heavy_generator_error;
2812
 
                }
2813
 
                _g_object_unref0 (generator);
2814
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2815
 
                g_clear_error (&_inner_error_);
2816
 
                return 0;
2817
 
        }
2818
 
        sql_heavy_generator_run (generator, &_inner_error_);
2819
 
        if (_inner_error_ != NULL) {
2820
 
                if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
2821
 
                        goto __catch5_sql_heavy_generator_error;
2822
 
                }
2823
 
                _g_object_unref0 (generator);
2824
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2825
 
                g_clear_error (&_inner_error_);
2826
 
                return 0;
 
4019
        _tmp20_ = sql_heavy_generator_new ();
 
4020
        generator = _tmp20_;
 
4021
        {
 
4022
                SQLHeavyGenerator* _tmp21_;
 
4023
                SQLHeavyGenerator* _tmp22_;
 
4024
                _tmp21_ = generator;
 
4025
                sql_heavy_generator_configure (_tmp21_, &_inner_error_);
 
4026
                if (_inner_error_ != NULL) {
 
4027
                        if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
 
4028
                                goto __catch5_sql_heavy_generator_error;
 
4029
                        }
 
4030
                        _g_object_unref0 (generator);
 
4031
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4032
                        g_clear_error (&_inner_error_);
 
4033
                        return 0;
 
4034
                }
 
4035
                _tmp22_ = generator;
 
4036
                sql_heavy_generator_run (_tmp22_, &_inner_error_);
 
4037
                if (_inner_error_ != NULL) {
 
4038
                        if (_inner_error_->domain == SQL_HEAVY_GENERATOR_ERROR) {
 
4039
                                goto __catch5_sql_heavy_generator_error;
 
4040
                        }
 
4041
                        _g_object_unref0 (generator);
 
4042
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4043
                        g_clear_error (&_inner_error_);
 
4044
                        return 0;
 
4045
                }
2827
4046
        }
2828
4047
        goto __finally5;
2829
4048
        __catch5_sql_heavy_generator_error:
2830
4049
        {
2831
 
                GError * e;
2832
 
                const gchar* _tmp8_ = NULL;
2833
 
                gchar* _tmp9_ = NULL;
2834
 
                gchar* _tmp10_;
2835
 
                const gchar* _tmp11_ = NULL;
2836
 
                gchar* _tmp12_ = NULL;
2837
 
                gchar* _tmp13_;
 
4050
                GError* e = NULL;
 
4051
                FILE* _tmp23_;
 
4052
                GError* _tmp24_;
 
4053
                const gchar* _tmp25_;
 
4054
                const gchar* _tmp26_ = NULL;
 
4055
                gchar* _tmp27_ = NULL;
 
4056
                gchar* _tmp28_;
 
4057
                FILE* _tmp29_;
 
4058
                gchar** _tmp30_;
 
4059
                gint _tmp30__length1;
 
4060
                const gchar* _tmp31_;
 
4061
                const gchar* _tmp32_ = NULL;
 
4062
                gchar* _tmp33_ = NULL;
 
4063
                gchar* _tmp34_;
2838
4064
                e = _inner_error_;
2839
4065
                _inner_error_ = NULL;
2840
 
                _tmp8_ = string_to_string (e->message);
2841
 
                _tmp9_ = g_strconcat ("Error: ", _tmp8_, "\n", NULL);
2842
 
                _tmp10_ = _tmp9_;
2843
 
                fputs (_tmp10_, stderr);
2844
 
                _g_free0 (_tmp10_);
2845
 
                _tmp11_ = string_to_string (args[0]);
2846
 
                _tmp12_ = g_strconcat ("Run '", _tmp11_, " --help' to see a full list of available command line options.\n", NULL);
2847
 
                _tmp13_ = _tmp12_;
2848
 
                fputs (_tmp13_, stdout);
2849
 
                _g_free0 (_tmp13_);
 
4066
                _tmp23_ = stderr;
 
4067
                _tmp24_ = e;
 
4068
                _tmp25_ = _tmp24_->message;
 
4069
                _tmp26_ = string_to_string (_tmp25_);
 
4070
                _tmp27_ = g_strconcat ("Error: ", _tmp26_, "\n", NULL);
 
4071
                _tmp28_ = _tmp27_;
 
4072
                fputs (_tmp28_, _tmp23_);
 
4073
                _g_free0 (_tmp28_);
 
4074
                _tmp29_ = stdout;
 
4075
                _tmp30_ = args;
 
4076
                _tmp30__length1 = args_length1;
 
4077
                _tmp31_ = _tmp30_[0];
 
4078
                _tmp32_ = string_to_string (_tmp31_);
 
4079
                _tmp33_ = g_strconcat ("Run '", _tmp32_, " --help' to see a full list of available command line options.\n", NULL);
 
4080
                _tmp34_ = _tmp33_;
 
4081
                fputs (_tmp34_, _tmp29_);
 
4082
                _g_free0 (_tmp34_);
2850
4083
                result = 1;
2851
4084
                _g_error_free0 (e);
2852
4085
                _g_object_unref0 (generator);
2891
4124
 
2892
4125
 
2893
4126
static void sql_heavy_generator_instance_init (SQLHeavyGenerator * self) {
2894
 
        ValaCodeContext* _tmp0_ = NULL;
2895
 
        ValaHashMap* _tmp1_ = NULL;
2896
 
        ValaHashMap* _tmp2_ = NULL;
 
4127
        ValaCodeContext* _tmp0_;
 
4128
        GHashFunc _tmp1_;
 
4129
        GEqualFunc _tmp2_;
 
4130
        GEqualFunc _tmp3_;
 
4131
        ValaHashMap* _tmp4_;
 
4132
        GHashFunc _tmp5_;
 
4133
        GEqualFunc _tmp6_;
 
4134
        GEqualFunc _tmp7_;
 
4135
        ValaHashMap* _tmp8_;
2897
4136
        self->priv = SQL_HEAVY_GENERATOR_GET_PRIVATE (self);
2898
4137
        _tmp0_ = vala_code_context_new ();
2899
4138
        self->priv->context = _tmp0_;
2900
4139
        self->priv->databases = NULL;
2901
 
        _tmp1_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, VALA_TYPE_HASH_MAP, (GBoxedCopyFunc) vala_map_ref, vala_map_unref, g_str_hash, g_str_equal, g_direct_equal);
2902
 
        self->priv->cache = _tmp1_;
2903
 
        _tmp2_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, VALA_TYPE_HASH_MAP, (GBoxedCopyFunc) vala_map_ref, vala_map_unref, g_str_hash, g_str_equal, g_direct_equal);
2904
 
        self->priv->wildcard_cache = _tmp2_;
 
4140
        _tmp1_ = g_str_hash;
 
4141
        _tmp2_ = g_str_equal;
 
4142
        _tmp3_ = g_direct_equal;
 
4143
        _tmp4_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, VALA_TYPE_HASH_MAP, (GBoxedCopyFunc) vala_map_ref, vala_map_unref, _tmp1_, _tmp2_, _tmp3_);
 
4144
        self->priv->cache = _tmp4_;
 
4145
        _tmp5_ = g_str_hash;
 
4146
        _tmp6_ = g_str_equal;
 
4147
        _tmp7_ = g_direct_equal;
 
4148
        _tmp8_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, VALA_TYPE_HASH_MAP, (GBoxedCopyFunc) vala_map_ref, vala_map_unref, _tmp5_, _tmp6_, _tmp7_);
 
4149
        self->priv->wildcard_cache = _tmp8_;
2905
4150
}
2906
4151
 
2907
4152