Logo Search packages:      
Sourcecode: vala-0.12 version File versions  Download package

valacompiler.c

/* valacompiler.c generated by valac, the Vala compiler
 * generated from valacompiler.vala, do not modify */

/* valacompiler.vala
 *
 * Copyright (C) 2006-2010  Jürg Billeter
 * Copyright (C) 1996-2002, 2004, 2005, 2006 Free Software Foundation, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 *    Jürg Billeter <j@bitron.ch>
 */

#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <valacodegen.h>
#include <glib/gstdio.h>
#include <unistd.h>
#include <locale.h>
#include <config.h>
#include <version.h>
#include <gobject/gvaluecollector.h>


#define VALA_TYPE_COMPILER (vala_compiler_get_type ())
#define VALA_COMPILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_COMPILER, ValaCompiler))
#define VALA_COMPILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_COMPILER, ValaCompilerClass))
#define VALA_IS_COMPILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_COMPILER))
#define VALA_IS_COMPILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_COMPILER))
#define VALA_COMPILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_COMPILER, ValaCompilerClass))

typedef struct _ValaCompiler ValaCompiler;
typedef struct _ValaCompilerClass ValaCompilerClass;
typedef struct _ValaCompilerPrivate ValaCompilerPrivate;
#define _vala_code_context_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_context_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_source_file_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_file_unref (var), NULL)))
#define _vala_code_visitor_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_visitor_unref (var), NULL)))
#define _vala_ccode_compiler_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_compiler_unref (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_compiler_unref0(var) ((var == NULL) ? NULL : (var = (vala_compiler_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
typedef struct _ValaParamSpecCompiler ValaParamSpecCompiler;

00064 struct _ValaCompiler {
      GTypeInstance parent_instance;
      volatile int ref_count;
      ValaCompilerPrivate * priv;
};

00070 struct _ValaCompilerClass {
      GTypeClass parent_class;
      void (*finalize) (ValaCompiler *self);
};

00075 struct _ValaCompilerPrivate {
      ValaCodeContext* context;
};

00079 struct _Block1Data {
      int _ref_count_;
      GMainLoop* loop;
      gint child_status;
};

00085 struct _ValaParamSpecCompiler {
      GParamSpec parent_instance;
};


static gpointer vala_compiler_parent_class = NULL;
static gchar* vala_compiler_basedir;
static gchar* vala_compiler_basedir = NULL;
static gchar* vala_compiler_directory;
static gchar* vala_compiler_directory = NULL;
static gboolean vala_compiler_version;
static gboolean vala_compiler_version = FALSE;
static gchar** vala_compiler_sources;
static gchar** vala_compiler_sources = NULL;
static gchar** vala_compiler_vapi_directories;
static gchar** vala_compiler_vapi_directories = NULL;
static gchar** vala_compiler_gir_directories;
static gchar** vala_compiler_gir_directories = NULL;
static gchar* vala_compiler_vapi_filename;
static gchar* vala_compiler_vapi_filename = NULL;
static gchar* vala_compiler_library;
static gchar* vala_compiler_library = NULL;
static gchar* vala_compiler_gir;
static gchar* vala_compiler_gir = NULL;
static gchar** vala_compiler_packages;
static gchar** vala_compiler_packages = NULL;
static gchar** vala_compiler_fast_vapis;
static gchar** vala_compiler_fast_vapis = NULL;
static gchar* vala_compiler_target_glib;
static gchar* vala_compiler_target_glib = NULL;
static gboolean vala_compiler_ccode_only;
static gboolean vala_compiler_ccode_only = FALSE;
static gchar* vala_compiler_header_filename;
static gchar* vala_compiler_header_filename = NULL;
static gboolean vala_compiler_use_header;
static gboolean vala_compiler_use_header = FALSE;
static gchar* vala_compiler_internal_header_filename;
static gchar* vala_compiler_internal_header_filename = NULL;
static gchar* vala_compiler_internal_vapi_filename;
static gchar* vala_compiler_internal_vapi_filename = NULL;
static gchar* vala_compiler_fast_vapi_filename;
static gchar* vala_compiler_fast_vapi_filename = NULL;
static gchar* vala_compiler_symbols_filename;
static gchar* vala_compiler_symbols_filename = NULL;
static gchar* vala_compiler_includedir;
static gchar* vala_compiler_includedir = NULL;
static gboolean vala_compiler_compile_only;
static gboolean vala_compiler_compile_only = FALSE;
static gchar* vala_compiler_output;
static gchar* vala_compiler_output = NULL;
static gboolean vala_compiler_debug;
static gboolean vala_compiler_debug = FALSE;
static gboolean vala_compiler_thread;
static gboolean vala_compiler_thread = FALSE;
static gboolean vala_compiler_mem_profiler;
static gboolean vala_compiler_mem_profiler = FALSE;
static gboolean vala_compiler_disable_assert;
static gboolean vala_compiler_disable_assert = FALSE;
static gboolean vala_compiler_enable_checking;
static gboolean vala_compiler_enable_checking = FALSE;
static gboolean vala_compiler_deprecated;
static gboolean vala_compiler_deprecated = FALSE;
static gboolean vala_compiler_experimental;
static gboolean vala_compiler_experimental = FALSE;
static gboolean vala_compiler_experimental_non_null;
static gboolean vala_compiler_experimental_non_null = FALSE;
static gboolean vala_compiler_disable_dbus_transformation;
static gboolean vala_compiler_disable_dbus_transformation = FALSE;
static gboolean vala_compiler_disable_warnings;
static gboolean vala_compiler_disable_warnings = FALSE;
static gchar* vala_compiler_cc_command;
static gchar* vala_compiler_cc_command = NULL;
static gchar** vala_compiler_cc_options;
static gchar** vala_compiler_cc_options = NULL;
static gchar* vala_compiler_dump_tree;
static gchar* vala_compiler_dump_tree = NULL;
static gboolean vala_compiler_save_temps;
static gboolean vala_compiler_save_temps = FALSE;
static gchar** vala_compiler_defines;
static gchar** vala_compiler_defines = NULL;
static gboolean vala_compiler_quiet_mode;
static gboolean vala_compiler_quiet_mode = FALSE;
static gboolean vala_compiler_verbose_mode;
static gboolean vala_compiler_verbose_mode = FALSE;
static gchar* vala_compiler_profile;
static gchar* vala_compiler_profile = NULL;
static gboolean vala_compiler_nostdpkg;
static gboolean vala_compiler_nostdpkg = FALSE;
static gboolean vala_compiler_enable_version_header;
static gboolean vala_compiler_enable_version_header = FALSE;
static gboolean vala_compiler_disable_version_header;
static gboolean vala_compiler_disable_version_header = FALSE;
static gboolean vala_compiler_fatal_warnings;
static gboolean vala_compiler_fatal_warnings = FALSE;
static gchar* vala_compiler_dependencies;
static gchar* vala_compiler_dependencies = NULL;
static gchar* vala_compiler_entry_point;
static gchar* vala_compiler_entry_point = NULL;
static gboolean vala_compiler_run_output;
static gboolean vala_compiler_run_output = FALSE;

gpointer vala_compiler_ref (gpointer instance);
void vala_compiler_unref (gpointer instance);
GParamSpec* vala_param_spec_compiler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_value_set_compiler (GValue* value, gpointer v_object);
void vala_value_take_compiler (GValue* value, gpointer v_object);
gpointer vala_value_get_compiler (const GValue* value);
GType vala_compiler_get_type (void) G_GNUC_CONST;
#define VALA_COMPILER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_COMPILER, ValaCompilerPrivate))
enum  {
      VALA_COMPILER_DUMMY_PROPERTY
};
static gint vala_compiler_quit (ValaCompiler* self);
static gint vala_compiler_run (ValaCompiler* self);
static gchar** _vala_array_dup1 (gchar** self, int length);
static gchar** _vala_array_dup2 (gchar** self, int length);
static gint vala_compiler_run_source (gchar** args, int args_length1);
ValaCompiler* vala_compiler_new (void);
ValaCompiler* vala_compiler_construct (GType object_type);
static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void _lambda0_ (GPid pid, gint status, Block1Data* _data1_);
static void __lambda0__gchild_watch_func (GPid pid, gint status, gpointer self);
static gint vala_compiler_main (gchar** args, int args_length1);
static void vala_compiler_finalize (ValaCompiler* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

static const GOptionEntry VALA_COMPILER_options[47] = {{"girdir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_gir_directories, "Look for .gir files in DIRECTORY", "DIRECTORY..."}, {"vapidir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..."}, {"pkg", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_packages, "Include binding for PACKAGE", "PACKAGE..."}, {"vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_vapi_filename, "Output VAPI file name", "FILE"}, {"library", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_library, "Library name", "NAME"}, {"gir", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_gir, "GObject-Introspection repository file name", "NAME-VERSION.gir"}, {"basedir", 'b', 0, G_OPTION_ARG_FILENAME, &vala_compiler_basedir, "Base source directory", "DIRECTORY"}, {"directory", 'd', 0, G_OPTION_ARG_FILENAME, &vala_compiler_directory, "Output directory", "DIRECTORY"}, {"version", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_version, "Display version number", NULL}, {"ccode", 'C', 0, G_OPTION_ARG_NONE, &vala_compiler_ccode_only, "Output C code", NULL}, {"header", 'H', 0, G_OPTION_ARG_FILENAME, &vala_compiler_header_filename, "Output C header file", "FILE"}, {"use-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_use_header, "Use C header file", NULL}, {"includedir", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_includedir, "Directory used to include the C header file", "DIRECTORY"}, {"internal-header", 'h', 0, G_OPTION_ARG_FILENAME, &vala_compiler_internal_header_filename, "Output internal C header file", "FILE"}, {"internal-vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_internal_vapi_filename, "Output vapi with internal api", "FILE"}, {"fast-vapi", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_fast_vapi_filename, "Output vapi without performing symbol resolution", NULL}, {"use-fast-vapi", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_fast_vapis, "Use --fast-vapi output during this compile", NULL}, {"deps", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_dependencies, "Write make-style dependency information to this file", NULL}, {"symbols", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_symbols_filename, "Output symbols file", "FILE"}, {"compile", 'c', 0, G_OPTION_ARG_NONE, &vala_compiler_compile_only, "Compile but do not link", NULL}, {"output", 'o', 0, G_OPTION_ARG_FILENAME, &vala_compiler_output, "Place output in file FILE", "FILE"}, {"debug", 'g', 0, G_OPTION_ARG_NONE, &vala_compiler_debug, "Produce debug information", NULL}, {"thread", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_thread, "Enable multithreading support", NULL}, {"enable-mem-profiler", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_mem_profiler, "Enable GLib memory profiler", NULL}, {"define", 'D', 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_defines, "Define SYMBOL", "SYMBOL..."}, {"main", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_entry_point, "Use SYMBOL as entry point", "SYMBOL..."}, {"nostdpkg", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_nostdpkg, "Do not include standard packages", NULL}, {"disable-assert", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_assert, "Disable assertions", NULL}, {"enable-checking", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_enable_checking, "Enable additional run-time checks", NULL}, {"enable-deprecated", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_deprecated, "Enable deprecated features", NULL}, {"enable-experimental", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_experimental, "Enable experimental features", NULL}, {"disable-warnings", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_warnings, "Disable warnings", NULL}, {"fatal-warnings", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_fatal_warnings, "Treat warnings as fatal", NULL}, {"enable-experimental-non-null", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_experimental_non_null, "Enable experimental enhancements for non-null types", NULL}, {"disable-dbus-transformation", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_dbus_transformation, "Disable transformation of D-Bus member names", NULL}, {"cc", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_cc_command, "Use COMMAND as C compiler command", "COMMAND"}, {"Xcc", 'X', 0, G_OPTION_ARG_STRING_ARRAY, &vala_compiler_cc_options, "Pass OPTION to the C compiler", "OPTION..."}, {"dump-tree", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &vala_compiler_dump_tree, "Write code tree to FILE", "FILE"}, {"save-temps", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_save_temps, "Keep temporary files", NULL}, {"profile", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_profile, "Use the given profile instead of the default", "PROFILE"}, {"quiet", 'q', 0, G_OPTION_ARG_NONE, &vala_compiler_quiet_mode, "Do not print messages to the console", NULL}, {"verbose", 'v', 0, G_OPTION_ARG_NONE, &vala_compiler_verbose_mode, "Print additional messages to the console", NULL}, {"target-glib", (gchar) 0, 0, G_OPTION_ARG_STRING, &vala_compiler_target_glib, "Target version of glib for code generation", "MAJOR.MINOR"}, {"enable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_enable_version_header, "Write vala build version in generated files", NULL}, {"disable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &vala_compiler_disable_version_header, "Do not write vala build version in generated files", NULL}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vala_compiler_sources, NULL, "FILE..."}, {NULL}};

static gint vala_compiler_quit (ValaCompiler* self) {
      gint result = 0;
      gboolean _tmp0_ = FALSE;
      ValaReport* _tmp1_ = NULL;
      gint _tmp2_;
      gboolean _tmp5_ = FALSE;
      ValaReport* _tmp6_ = NULL;
      gint _tmp7_;
      g_return_val_if_fail (self != NULL, 0);
      _tmp1_ = vala_code_context_get_report (self->priv->context);
      _tmp2_ = vala_report_get_errors (_tmp1_);
      if (_tmp2_ == 0) {
            ValaReport* _tmp3_ = NULL;
            gint _tmp4_;
            _tmp3_ = vala_code_context_get_report (self->priv->context);
            _tmp4_ = vala_report_get_warnings (_tmp3_);
            _tmp0_ = _tmp4_ == 0;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            result = 0;
            return result;
      }
      _tmp6_ = vala_code_context_get_report (self->priv->context);
      _tmp7_ = vala_report_get_errors (_tmp6_);
      if (_tmp7_ == 0) {
            gboolean _tmp8_ = FALSE;
            if (!vala_compiler_fatal_warnings) {
                  _tmp8_ = TRUE;
            } else {
                  ValaReport* _tmp9_ = NULL;
                  gint _tmp10_;
                  _tmp9_ = vala_code_context_get_report (self->priv->context);
                  _tmp10_ = vala_report_get_warnings (_tmp9_);
                  _tmp8_ = _tmp10_ == 0;
            }
            _tmp5_ = _tmp8_;
      } else {
            _tmp5_ = FALSE;
      }
      if (_tmp5_) {
            if (!vala_compiler_quiet_mode) {
                  ValaReport* _tmp11_ = NULL;
                  gint _tmp12_;
                  _tmp11_ = vala_code_context_get_report (self->priv->context);
                  _tmp12_ = vala_report_get_warnings (_tmp11_);
                  fprintf (stdout, "Compilation succeeded - %d warning(s)\n", _tmp12_);
            }
            result = 0;
            return result;
      } else {
            if (!vala_compiler_quiet_mode) {
                  ValaReport* _tmp13_ = NULL;
                  gint _tmp14_;
                  ValaReport* _tmp15_ = NULL;
                  gint _tmp16_;
                  _tmp13_ = vala_code_context_get_report (self->priv->context);
                  _tmp14_ = vala_report_get_errors (_tmp13_);
                  _tmp15_ = vala_code_context_get_report (self->priv->context);
                  _tmp16_ = vala_report_get_warnings (_tmp15_);
                  fprintf (stdout, "Compilation failed: %d error(s), %d warning(s)\n", _tmp14_, _tmp16_);
            }
            result = 1;
            return result;
      }
}


static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) {
      gint result = 0;
      gchar* _tmp0_ = NULL;
      gchar* _result_;
      g_return_val_if_fail (self != NULL, 0);
      _tmp0_ = g_utf8_strrchr (((gchar*) self) + start_index, (gssize) (-1), c);
      _result_ = _tmp0_;
      if (_result_ != NULL) {
            result = (gint) (_result_ - ((gchar*) self));
            return result;
      } else {
            result = -1;
            return result;
      }
}


static glong string_strnlen (gchar* str, glong maxlen) {
      glong result = 0L;
      gchar* _tmp0_ = NULL;
      gchar* end;
      _tmp0_ = memchr (str, 0, (gsize) maxlen);
      end = _tmp0_;
      if (end == NULL) {
            result = maxlen;
            return result;
      } else {
            result = (glong) (end - str);
            return result;
      }
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
      gchar* result = NULL;
      glong string_length = 0L;
      gboolean _tmp0_ = FALSE;
      gchar* _tmp3_ = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      if (offset >= 0) {
            _tmp0_ = len >= 0;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            glong _tmp1_;
            _tmp1_ = string_strnlen ((gchar*) self, offset + len);
            string_length = _tmp1_;
      } else {
            gint _tmp2_;
            _tmp2_ = strlen (self);
            string_length = (glong) _tmp2_;
      }
      if (offset < 0) {
            offset = string_length + offset;
            g_return_val_if_fail (offset >= 0, NULL);
      } else {
            g_return_val_if_fail (offset <= string_length, NULL);
      }
      if (len < 0) {
            len = string_length - offset;
      }
      g_return_val_if_fail ((offset + len) <= string_length, NULL);
      _tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
      result = _tmp3_;
      return result;
}


static gchar** _vala_array_dup1 (gchar** self, int length) {
      gchar** result;
      int i;
      result = g_new0 (gchar*, length + 1);
      for (i = 0; i < length; i++) {
            result[i] = g_strdup (self[i]);
      }
      return result;
}


static gchar** _vala_array_dup2 (gchar** self, int length) {
      gchar** result;
      int i;
      result = g_new0 (gchar*, length + 1);
      for (i = 0; i < length; i++) {
            result[i] = g_strdup (self[i]);
      }
      return result;
}


static gchar string_get (const gchar* self, glong index) {
      gchar result = '\0';
      g_return_val_if_fail (self != NULL, '\0');
      result = ((gchar*) self)[index];
      return result;
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
      gboolean result = FALSE;
      gchar* _tmp0_ = NULL;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (needle != NULL, FALSE);
      _tmp0_ = strstr ((gchar*) self, (gchar*) needle);
      result = _tmp0_ != NULL;
      return result;
}


static gint vala_compiler_run (ValaCompiler* self) {
      gint result = 0;
      ValaCodeContext* _tmp0_ = NULL;
      gboolean _tmp1_ = FALSE;
      gboolean _tmp2_ = FALSE;
      ValaReport* _tmp8_ = NULL;
      ValaReport* _tmp9_ = NULL;
      gboolean _tmp10_ = FALSE;
      gchar** _tmp18_;
      gchar** _tmp19_;
      gchar** _tmp20_;
      gchar** _tmp21_;
      ValaProfile _tmp30_;
      gboolean _tmp45_ = FALSE;
      ValaReport* _tmp46_ = NULL;
      gint _tmp47_;
      ValaProfile _tmp52_;
      gboolean has_c_files;
      gboolean _tmp67_ = FALSE;
      ValaReport* _tmp68_ = NULL;
      gint _tmp69_;
      ValaParser* _tmp74_ = NULL;
      ValaParser* parser;
      ValaGenieParser* _tmp75_ = NULL;
      ValaGenieParser* genie_parser;
      ValaGirParser* _tmp76_ = NULL;
      ValaGirParser* gir_parser;
      gboolean _tmp77_ = FALSE;
      ValaReport* _tmp78_ = NULL;
      gint _tmp79_;
      gboolean _tmp86_ = FALSE;
      ValaReport* _tmp87_ = NULL;
      gint _tmp88_;
      gboolean _tmp93_ = FALSE;
      gboolean _tmp94_ = FALSE;
      gboolean _tmp98_ = FALSE;
      ValaReport* _tmp99_ = NULL;
      gint _tmp100_;
      ValaCodeGenerator* _tmp105_ = NULL;
      gboolean _tmp106_ = FALSE;
      ValaReport* _tmp107_ = NULL;
      gint _tmp108_;
      gboolean _tmp113_ = FALSE;
      gint _tmp156_;
      g_return_val_if_fail (self != NULL, 0);
      _tmp0_ = vala_code_context_new ();
      _vala_code_context_unref0 (self->priv->context);
      self->priv->context = _tmp0_;
      vala_code_context_push (self->priv->context);
      if (!vala_compiler_ccode_only) {
            _tmp2_ = !vala_compiler_compile_only;
      } else {
            _tmp2_ = FALSE;
      }
      if (_tmp2_) {
            _tmp1_ = vala_compiler_output == NULL;
      } else {
            _tmp1_ = FALSE;
      }
      if (_tmp1_) {
            gint _tmp3_;
            _tmp3_ = string_last_index_of_char (vala_compiler_sources[0], (gunichar) '.', 0);
            if (_tmp3_ != (-1)) {
                  gint _tmp4_;
                  gint dot;
                  gchar* _tmp5_ = NULL;
                  gchar* _tmp6_;
                  gchar* _tmp7_ = NULL;
                  _tmp4_ = string_last_index_of_char (vala_compiler_sources[0], (gunichar) '.', 0);
                  dot = _tmp4_;
                  _tmp5_ = string_substring (vala_compiler_sources[0], (glong) 0, (glong) dot);
                  _tmp6_ = _tmp5_;
                  _tmp7_ = g_path_get_basename (_tmp6_);
                  _g_free0 (vala_compiler_output);
                  vala_compiler_output = _tmp7_;
                  _g_free0 (_tmp6_);
            }
      }
      vala_code_context_set_assert (self->priv->context, !vala_compiler_disable_assert);
      vala_code_context_set_checking (self->priv->context, vala_compiler_enable_checking);
      vala_code_context_set_deprecated (self->priv->context, vala_compiler_deprecated);
      vala_code_context_set_experimental (self->priv->context, vala_compiler_experimental);
      vala_code_context_set_experimental_non_null (self->priv->context, vala_compiler_experimental_non_null);
      vala_code_context_set_dbus_transformation (self->priv->context, !vala_compiler_disable_dbus_transformation);
      _tmp8_ = vala_code_context_get_report (self->priv->context);
      vala_report_set_enable_warnings (_tmp8_, !vala_compiler_disable_warnings);
      _tmp9_ = vala_code_context_get_report (self->priv->context);
      vala_report_set_verbose_errors (_tmp9_, !vala_compiler_quiet_mode);
      vala_code_context_set_verbose_mode (self->priv->context, vala_compiler_verbose_mode);
      vala_code_context_set_version_header (self->priv->context, !vala_compiler_disable_version_header);
      vala_code_context_set_ccode_only (self->priv->context, vala_compiler_ccode_only);
      vala_code_context_set_compile_only (self->priv->context, vala_compiler_compile_only);
      vala_code_context_set_header_filename (self->priv->context, vala_compiler_header_filename);
      if (vala_compiler_header_filename == NULL) {
            _tmp10_ = vala_compiler_use_header;
      } else {
            _tmp10_ = FALSE;
      }
      if (_tmp10_) {
            vala_report_error (NULL, "--use-header may only be used in combination with --header");
      }
      vala_code_context_set_use_header (self->priv->context, vala_compiler_use_header);
      vala_code_context_set_internal_header_filename (self->priv->context, vala_compiler_internal_header_filename);
      vala_code_context_set_symbols_filename (self->priv->context, vala_compiler_symbols_filename);
      vala_code_context_set_includedir (self->priv->context, vala_compiler_includedir);
      vala_code_context_set_output (self->priv->context, vala_compiler_output);
      if (vala_compiler_basedir == NULL) {
            gchar* _tmp11_ = NULL;
            gchar* _tmp12_;
            _tmp11_ = vala_code_context_realpath (".");
            _tmp12_ = _tmp11_;
            vala_code_context_set_basedir (self->priv->context, _tmp12_);
            _g_free0 (_tmp12_);
      } else {
            gchar* _tmp13_ = NULL;
            gchar* _tmp14_;
            _tmp13_ = vala_code_context_realpath (vala_compiler_basedir);
            _tmp14_ = _tmp13_;
            vala_code_context_set_basedir (self->priv->context, _tmp14_);
            _g_free0 (_tmp14_);
      }
      if (vala_compiler_directory != NULL) {
            gchar* _tmp15_ = NULL;
            gchar* _tmp16_;
            _tmp15_ = vala_code_context_realpath (vala_compiler_directory);
            _tmp16_ = _tmp15_;
            vala_code_context_set_directory (self->priv->context, _tmp16_);
            _g_free0 (_tmp16_);
      } else {
            const gchar* _tmp17_ = NULL;
            _tmp17_ = vala_code_context_get_basedir (self->priv->context);
            vala_code_context_set_directory (self->priv->context, _tmp17_);
      }
      _tmp18_ = (_tmp19_ = vala_compiler_vapi_directories, (_tmp19_ == NULL) ? ((gpointer) _tmp19_) : _vala_array_dup1 (_tmp19_, _vala_array_length (vala_compiler_vapi_directories)));
      self->priv->context->vapi_directories = (_vala_array_free (self->priv->context->vapi_directories, self->priv->context->vapi_directories_length1, (GDestroyNotify) g_free), NULL);
      self->priv->context->vapi_directories = _tmp18_;
      self->priv->context->vapi_directories_length1 = _vala_array_length (vala_compiler_vapi_directories);
      _tmp20_ = (_tmp21_ = vala_compiler_gir_directories, (_tmp21_ == NULL) ? ((gpointer) _tmp21_) : _vala_array_dup2 (_tmp21_, _vala_array_length (vala_compiler_gir_directories)));
      self->priv->context->gir_directories = (_vala_array_free (self->priv->context->gir_directories, self->priv->context->gir_directories_length1, (GDestroyNotify) g_free), NULL);
      self->priv->context->gir_directories = _tmp20_;
      self->priv->context->gir_directories_length1 = _vala_array_length (vala_compiler_gir_directories);
      vala_code_context_set_debug (self->priv->context, vala_compiler_debug);
      vala_code_context_set_thread (self->priv->context, vala_compiler_thread);
      vala_code_context_set_mem_profiler (self->priv->context, vala_compiler_mem_profiler);
      vala_code_context_set_save_temps (self->priv->context, vala_compiler_save_temps);
      if (g_strcmp0 (vala_compiler_profile, "posix") == 0) {
            vala_code_context_set_profile (self->priv->context, VALA_PROFILE_POSIX);
            vala_code_context_add_define (self->priv->context, "POSIX");
      } else {
            gboolean _tmp22_ = FALSE;
            gboolean _tmp23_ = FALSE;
            if (g_strcmp0 (vala_compiler_profile, "gobject-2.0") == 0) {
                  _tmp23_ = TRUE;
            } else {
                  _tmp23_ = g_strcmp0 (vala_compiler_profile, "gobject") == 0;
            }
            if (_tmp23_) {
                  _tmp22_ = TRUE;
            } else {
                  _tmp22_ = vala_compiler_profile == NULL;
            }
            if (_tmp22_) {
                  vala_code_context_set_profile (self->priv->context, VALA_PROFILE_GOBJECT);
                  vala_code_context_add_define (self->priv->context, "GOBJECT");
            } else {
                  if (g_strcmp0 (vala_compiler_profile, "dova") == 0) {
                        vala_code_context_set_profile (self->priv->context, VALA_PROFILE_DOVA);
                        vala_code_context_add_define (self->priv->context, "DOVA");
                  } else {
                        gchar* _tmp24_ = NULL;
                        gchar* _tmp25_;
                        _tmp24_ = g_strdup_printf ("Unknown profile %s", vala_compiler_profile);
                        _tmp25_ = _tmp24_;
                        vala_report_error (NULL, _tmp25_);
                        _g_free0 (_tmp25_);
                  }
            }
      }
      vala_compiler_nostdpkg = vala_compiler_nostdpkg | (vala_compiler_fast_vapi_filename != NULL);
      vala_code_context_set_nostdpkg (self->priv->context, vala_compiler_nostdpkg);
      vala_code_context_set_entry_point_name (self->priv->context, vala_compiler_entry_point);
      vala_code_context_set_run_output (self->priv->context, vala_compiler_run_output);
      if (vala_compiler_defines != NULL) {
            {
                  gchar** define_collection;
                  int define_collection_length1;
                  int define_it;
                  define_collection = vala_compiler_defines;
                  define_collection_length1 = _vala_array_length (vala_compiler_defines);
                  for (define_it = 0; define_it < _vala_array_length (vala_compiler_defines); define_it = define_it + 1) {
                        gchar* _tmp26_;
                        gchar* define;
                        _tmp26_ = g_strdup (define_collection[define_it]);
                        define = _tmp26_;
                        {
                              vala_code_context_add_define (self->priv->context, define);
                              _g_free0 (define);
                        }
                  }
            }
      }
      {
            gint i;
            i = 2;
            {
                  gboolean _tmp27_;
                  _tmp27_ = TRUE;
                  while (TRUE) {
                        gchar* _tmp28_ = NULL;
                        gchar* _tmp29_;
                        if (!_tmp27_) {
                              i = i + 2;
                        }
                        _tmp27_ = FALSE;
                        if (!(i <= 12)) {
                              break;
                        }
                        _tmp28_ = g_strdup_printf ("VALA_0_%d", i);
                        _tmp29_ = _tmp28_;
                        vala_code_context_add_define (self->priv->context, _tmp29_);
                        _g_free0 (_tmp29_);
                  }
            }
      }
      _tmp30_ = vala_code_context_get_profile (self->priv->context);
      if (_tmp30_ == VALA_PROFILE_POSIX) {
            if (!vala_compiler_nostdpkg) {
                  vala_code_context_add_external_package (self->priv->context, "posix");
            }
      } else {
            ValaProfile _tmp31_;
            _tmp31_ = vala_code_context_get_profile (self->priv->context);
            if (_tmp31_ == VALA_PROFILE_GOBJECT) {
                  gint glib_major;
                  gint glib_minor;
                  gboolean _tmp32_ = FALSE;
                  gint _tmp34_;
                  glib_major = 2;
                  glib_minor = 16;
                  if (vala_compiler_target_glib != NULL) {
                        gint _tmp33_;
                        _tmp33_ = sscanf (vala_compiler_target_glib, "%d.%d", &glib_major, &glib_minor);
                        _tmp32_ = _tmp33_ != 2;
                  } else {
                        _tmp32_ = FALSE;
                  }
                  if (_tmp32_) {
                        vala_report_error (NULL, "Invalid format for --target-glib");
                  }
                  vala_code_context_set_target_glib_major (self->priv->context, glib_major);
                  vala_code_context_set_target_glib_minor (self->priv->context, glib_minor);
                  _tmp34_ = vala_code_context_get_target_glib_major (self->priv->context);
                  if (_tmp34_ != 2) {
                        vala_report_error (NULL, "This version of valac only supports GLib 2");
                  }
                  {
                        gint i;
                        i = 16;
                        {
                              gboolean _tmp35_;
                              _tmp35_ = TRUE;
                              while (TRUE) {
                                    gchar* _tmp36_ = NULL;
                                    gchar* _tmp37_;
                                    if (!_tmp35_) {
                                          i = i + 2;
                                    }
                                    _tmp35_ = FALSE;
                                    if (!(i <= glib_minor)) {
                                          break;
                                    }
                                    _tmp36_ = g_strdup_printf ("GLIB_2_%d", i);
                                    _tmp37_ = _tmp36_;
                                    vala_code_context_add_define (self->priv->context, _tmp37_);
                                    _g_free0 (_tmp37_);
                              }
                        }
                  }
                  if (!vala_compiler_nostdpkg) {
                        vala_code_context_add_external_package (self->priv->context, "glib-2.0");
                        vala_code_context_add_external_package (self->priv->context, "gobject-2.0");
                  }
            } else {
                  ValaProfile _tmp38_;
                  _tmp38_ = vala_code_context_get_profile (self->priv->context);
                  if (_tmp38_ == VALA_PROFILE_DOVA) {
                        if (!vala_compiler_nostdpkg) {
                              vala_code_context_add_external_package (self->priv->context, "dova-core-0.1");
                        }
                  }
            }
      }
      if (vala_compiler_packages != NULL) {
            {
                  gchar** package_collection;
                  int package_collection_length1;
                  int package_it;
                  package_collection = vala_compiler_packages;
                  package_collection_length1 = _vala_array_length (vala_compiler_packages);
                  for (package_it = 0; package_it < _vala_array_length (vala_compiler_packages); package_it = package_it + 1) {
                        gchar* _tmp39_;
                        gchar* package;
                        _tmp39_ = g_strdup (package_collection[package_it]);
                        package = _tmp39_;
                        {
                              gboolean _tmp40_ = FALSE;
                              ValaProfile _tmp41_;
                              vala_code_context_add_external_package (self->priv->context, package);
                              _tmp41_ = vala_code_context_get_profile (self->priv->context);
                              if (_tmp41_ == VALA_PROFILE_GOBJECT) {
                                    _tmp40_ = g_strcmp0 (package, "dbus-glib-1") == 0;
                              } else {
                                    _tmp40_ = FALSE;
                              }
                              if (_tmp40_) {
                                    vala_code_context_add_define (self->priv->context, "DBUS_GLIB");
                              }
                              _g_free0 (package);
                        }
                  }
            }
            vala_compiler_packages = (_vala_array_free (vala_compiler_packages, _vala_array_length (vala_compiler_packages), (GDestroyNotify) g_free), NULL);
            vala_compiler_packages = NULL;
      }
      if (vala_compiler_fast_vapis != NULL) {
            {
                  gchar** vapi_collection;
                  int vapi_collection_length1;
                  int vapi_it;
                  vapi_collection = vala_compiler_fast_vapis;
                  vapi_collection_length1 = _vala_array_length (vala_compiler_fast_vapis);
                  for (vapi_it = 0; vapi_it < _vala_array_length (vala_compiler_fast_vapis); vapi_it = vapi_it + 1) {
                        gchar* _tmp42_;
                        gchar* vapi;
                        _tmp42_ = g_strdup (vapi_collection[vapi_it]);
                        vapi = _tmp42_;
                        {
                              gchar* _tmp43_ = NULL;
                              gchar* rpath;
                              ValaSourceFile* _tmp44_ = NULL;
                              ValaSourceFile* source_file;
                              _tmp43_ = vala_code_context_realpath (vapi);
                              rpath = _tmp43_;
                              _tmp44_ = vala_source_file_new (self->priv->context, VALA_SOURCE_FILE_TYPE_FAST, rpath, NULL);
                              source_file = _tmp44_;
                              vala_code_context_add_source_file (self->priv->context, source_file);
                              _vala_source_file_unref0 (source_file);
                              _g_free0 (rpath);
                              _g_free0 (vapi);
                        }
                  }
            }
      }
      _tmp46_ = vala_code_context_get_report (self->priv->context);
      _tmp47_ = vala_report_get_errors (_tmp46_);
      if (_tmp47_ > 0) {
            _tmp45_ = TRUE;
      } else {
            gboolean _tmp48_ = FALSE;
            if (vala_compiler_fatal_warnings) {
                  ValaReport* _tmp49_ = NULL;
                  gint _tmp50_;
                  _tmp49_ = vala_code_context_get_report (self->priv->context);
                  _tmp50_ = vala_report_get_warnings (_tmp49_);
                  _tmp48_ = _tmp50_ > 0;
            } else {
                  _tmp48_ = FALSE;
            }
            _tmp45_ = _tmp48_;
      }
      if (_tmp45_) {
            gint _tmp51_;
            _tmp51_ = vala_compiler_quit (self);
            result = _tmp51_;
            return result;
      }
      _tmp52_ = vala_code_context_get_profile (self->priv->context);
      if (_tmp52_ == VALA_PROFILE_GOBJECT) {
            gboolean _tmp53_;
            _tmp53_ = vala_code_context_has_package (self->priv->context, "dbus-glib-1");
            if (_tmp53_) {
                  gboolean _tmp54_;
                  ValaDBusServerModule* _tmp55_ = NULL;
                  ValaDBusServerModule* _tmp56_;
                  _tmp54_ = vala_code_context_get_deprecated (self->priv->context);
                  if (!_tmp54_) {
                        vala_report_warning (NULL, "D-Bus GLib is deprecated, use GDBus");
                  }
                  _tmp55_ = vala_dbus_server_module_new ();
                  _tmp56_ = _tmp55_;
                  vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) _tmp56_);
                  _vala_code_visitor_unref0 (_tmp56_);
            } else {
                  ValaGDBusServerModule* _tmp57_ = NULL;
                  ValaGDBusServerModule* _tmp58_;
                  _tmp57_ = vala_gd_bus_server_module_new ();
                  _tmp58_ = _tmp57_;
                  vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) _tmp58_);
                  _vala_code_visitor_unref0 (_tmp58_);
            }
      } else {
            ValaProfile _tmp59_;
            _tmp59_ = vala_code_context_get_profile (self->priv->context);
            if (_tmp59_ == VALA_PROFILE_DOVA) {
                  ValaDovaErrorModule* _tmp60_ = NULL;
                  ValaDovaErrorModule* _tmp61_;
                  _tmp60_ = vala_dova_error_module_new ();
                  _tmp61_ = _tmp60_;
                  vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) _tmp61_);
                  _vala_code_visitor_unref0 (_tmp61_);
            } else {
                  ValaCCodeDelegateModule* _tmp62_ = NULL;
                  ValaCCodeDelegateModule* _tmp63_;
                  _tmp62_ = vala_ccode_delegate_module_new ();
                  _tmp63_ = _tmp62_;
                  vala_code_context_set_codegen (self->priv->context, (ValaCodeGenerator*) _tmp63_);
                  _vala_code_visitor_unref0 (_tmp63_);
            }
      }
      has_c_files = FALSE;
      {
            gchar** source_collection;
            int source_collection_length1;
            int source_it;
            source_collection = vala_compiler_sources;
            source_collection_length1 = _vala_array_length (vala_compiler_sources);
            for (source_it = 0; source_it < _vala_array_length (vala_compiler_sources); source_it = source_it + 1) {
                  gchar* _tmp64_;
                  gchar* source;
                  _tmp64_ = g_strdup (source_collection[source_it]);
                  source = _tmp64_;
                  {
                        gboolean _tmp65_;
                        _tmp65_ = vala_code_context_add_source_filename (self->priv->context, source, vala_compiler_run_output);
                        if (_tmp65_) {
                              gboolean _tmp66_;
                              _tmp66_ = g_str_has_suffix (source, ".c");
                              if (_tmp66_) {
                                    has_c_files = TRUE;
                              }
                        }
                        _g_free0 (source);
                  }
            }
      }
      vala_compiler_sources = (_vala_array_free (vala_compiler_sources, _vala_array_length (vala_compiler_sources), (GDestroyNotify) g_free), NULL);
      vala_compiler_sources = NULL;
      _tmp68_ = vala_code_context_get_report (self->priv->context);
      _tmp69_ = vala_report_get_errors (_tmp68_);
      if (_tmp69_ > 0) {
            _tmp67_ = TRUE;
      } else {
            gboolean _tmp70_ = FALSE;
            if (vala_compiler_fatal_warnings) {
                  ValaReport* _tmp71_ = NULL;
                  gint _tmp72_;
                  _tmp71_ = vala_code_context_get_report (self->priv->context);
                  _tmp72_ = vala_report_get_warnings (_tmp71_);
                  _tmp70_ = _tmp72_ > 0;
            } else {
                  _tmp70_ = FALSE;
            }
            _tmp67_ = _tmp70_;
      }
      if (_tmp67_) {
            gint _tmp73_;
            _tmp73_ = vala_compiler_quit (self);
            result = _tmp73_;
            return result;
      }
      _tmp74_ = vala_parser_new ();
      parser = _tmp74_;
      vala_parser_parse (parser, self->priv->context);
      _tmp75_ = vala_genie_parser_new ();
      genie_parser = _tmp75_;
      vala_genie_parser_parse (genie_parser, self->priv->context);
      _tmp76_ = vala_gir_parser_new ();
      gir_parser = _tmp76_;
      vala_gir_parser_parse (gir_parser, self->priv->context);
      _tmp78_ = vala_code_context_get_report (self->priv->context);
      _tmp79_ = vala_report_get_errors (_tmp78_);
      if (_tmp79_ > 0) {
            _tmp77_ = TRUE;
      } else {
            gboolean _tmp80_ = FALSE;
            if (vala_compiler_fatal_warnings) {
                  ValaReport* _tmp81_ = NULL;
                  gint _tmp82_;
                  _tmp81_ = vala_code_context_get_report (self->priv->context);
                  _tmp82_ = vala_report_get_warnings (_tmp81_);
                  _tmp80_ = _tmp82_ > 0;
            } else {
                  _tmp80_ = FALSE;
            }
            _tmp77_ = _tmp80_;
      }
      if (_tmp77_) {
            gint _tmp83_;
            _tmp83_ = vala_compiler_quit (self);
            result = _tmp83_;
            _vala_code_visitor_unref0 (gir_parser);
            _vala_code_visitor_unref0 (genie_parser);
            _vala_code_visitor_unref0 (parser);
            return result;
      }
      if (vala_compiler_fast_vapi_filename != NULL) {
            ValaCodeWriter* _tmp84_ = NULL;
            ValaCodeWriter* interface_writer;
            gint _tmp85_;
            _tmp84_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_FAST);
            interface_writer = _tmp84_;
            vala_code_writer_write_file (interface_writer, self->priv->context, vala_compiler_fast_vapi_filename);
            _tmp85_ = vala_compiler_quit (self);
            result = _tmp85_;
            _vala_code_visitor_unref0 (interface_writer);
            _vala_code_visitor_unref0 (gir_parser);
            _vala_code_visitor_unref0 (genie_parser);
            _vala_code_visitor_unref0 (parser);
            return result;
      }
      vala_code_context_check (self->priv->context);
      _tmp87_ = vala_code_context_get_report (self->priv->context);
      _tmp88_ = vala_report_get_errors (_tmp87_);
      if (_tmp88_ > 0) {
            _tmp86_ = TRUE;
      } else {
            gboolean _tmp89_ = FALSE;
            if (vala_compiler_fatal_warnings) {
                  ValaReport* _tmp90_ = NULL;
                  gint _tmp91_;
                  _tmp90_ = vala_code_context_get_report (self->priv->context);
                  _tmp91_ = vala_report_get_warnings (_tmp90_);
                  _tmp89_ = _tmp91_ > 0;
            } else {
                  _tmp89_ = FALSE;
            }
            _tmp86_ = _tmp89_;
      }
      if (_tmp86_) {
            gint _tmp92_;
            _tmp92_ = vala_compiler_quit (self);
            result = _tmp92_;
            _vala_code_visitor_unref0 (gir_parser);
            _vala_code_visitor_unref0 (genie_parser);
            _vala_code_visitor_unref0 (parser);
            return result;
      }
      if (!vala_compiler_ccode_only) {
            _tmp94_ = !vala_compiler_compile_only;
      } else {
            _tmp94_ = FALSE;
      }
      if (_tmp94_) {
            _tmp93_ = vala_compiler_library == NULL;
      } else {
            _tmp93_ = FALSE;
      }
      if (_tmp93_) {
            gboolean _tmp95_ = FALSE;
            if (!has_c_files) {
                  ValaMethod* _tmp96_ = NULL;
                  _tmp96_ = vala_code_context_get_entry_point (self->priv->context);
                  _tmp95_ = _tmp96_ == NULL;
            } else {
                  _tmp95_ = FALSE;
            }
            if (_tmp95_) {
                  vala_report_error (NULL, "program does not contain a static `main' method");
            }
      }
      if (vala_compiler_dump_tree != NULL) {
            ValaCodeWriter* _tmp97_ = NULL;
            ValaCodeWriter* code_writer;
            _tmp97_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_DUMP);
            code_writer = _tmp97_;
            vala_code_writer_write_file (code_writer, self->priv->context, vala_compiler_dump_tree);
            _vala_code_visitor_unref0 (code_writer);
      }
      _tmp99_ = vala_code_context_get_report (self->priv->context);
      _tmp100_ = vala_report_get_errors (_tmp99_);
      if (_tmp100_ > 0) {
            _tmp98_ = TRUE;
      } else {
            gboolean _tmp101_ = FALSE;
            if (vala_compiler_fatal_warnings) {
                  ValaReport* _tmp102_ = NULL;
                  gint _tmp103_;
                  _tmp102_ = vala_code_context_get_report (self->priv->context);
                  _tmp103_ = vala_report_get_warnings (_tmp102_);
                  _tmp101_ = _tmp103_ > 0;
            } else {
                  _tmp101_ = FALSE;
            }
            _tmp98_ = _tmp101_;
      }
      if (_tmp98_) {
            gint _tmp104_;
            _tmp104_ = vala_compiler_quit (self);
            result = _tmp104_;
            _vala_code_visitor_unref0 (gir_parser);
            _vala_code_visitor_unref0 (genie_parser);
            _vala_code_visitor_unref0 (parser);
            return result;
      }
      _tmp105_ = vala_code_context_get_codegen (self->priv->context);
      vala_code_generator_emit (_tmp105_, self->priv->context);
      _tmp107_ = vala_code_context_get_report (self->priv->context);
      _tmp108_ = vala_report_get_errors (_tmp107_);
      if (_tmp108_ > 0) {
            _tmp106_ = TRUE;
      } else {
            gboolean _tmp109_ = FALSE;
            if (vala_compiler_fatal_warnings) {
                  ValaReport* _tmp110_ = NULL;
                  gint _tmp111_;
                  _tmp110_ = vala_code_context_get_report (self->priv->context);
                  _tmp111_ = vala_report_get_warnings (_tmp110_);
                  _tmp109_ = _tmp111_ > 0;
            } else {
                  _tmp109_ = FALSE;
            }
            _tmp106_ = _tmp109_;
      }
      if (_tmp106_) {
            gint _tmp112_;
            _tmp112_ = vala_compiler_quit (self);
            result = _tmp112_;
            _vala_code_visitor_unref0 (gir_parser);
            _vala_code_visitor_unref0 (genie_parser);
            _vala_code_visitor_unref0 (parser);
            return result;
      }
      if (vala_compiler_vapi_filename == NULL) {
            _tmp113_ = vala_compiler_library != NULL;
      } else {
            _tmp113_ = FALSE;
      }
      if (_tmp113_) {
            gchar* _tmp114_ = NULL;
            _tmp114_ = g_strdup_printf ("%s.vapi", vala_compiler_library);
            _g_free0 (vala_compiler_vapi_filename);
            vala_compiler_vapi_filename = _tmp114_;
      }
      if (vala_compiler_library != NULL) {
            if (vala_compiler_gir != NULL) {
                  ValaProfile _tmp115_;
                  _tmp115_ = vala_code_context_get_profile (self->priv->context);
                  if (_tmp115_ == VALA_PROFILE_GOBJECT) {
                        gint _tmp116_;
                        glong gir_len;
                        gint _tmp117_;
                        gint last_hyphen;
                        gboolean _tmp118_ = FALSE;
                        _tmp116_ = strlen (vala_compiler_gir);
                        gir_len = (glong) _tmp116_;
                        _tmp117_ = string_last_index_of_char (vala_compiler_gir, (gunichar) '-', 0);
                        last_hyphen = _tmp117_;
                        if (last_hyphen == (-1)) {
                              _tmp118_ = TRUE;
                        } else {
                              gboolean _tmp119_;
                              _tmp119_ = g_str_has_suffix (vala_compiler_gir, ".gir");
                              _tmp118_ = !_tmp119_;
                        }
                        if (_tmp118_) {
                              gchar* _tmp120_ = NULL;
                              gchar* _tmp121_;
                              _tmp120_ = g_strdup_printf ("GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", vala_compiler_gir);
                              _tmp121_ = _tmp120_;
                              vala_report_error (NULL, _tmp121_);
                              _g_free0 (_tmp121_);
                        } else {
                              gchar* _tmp122_ = NULL;
                              gchar* gir_namespace;
                              gchar* _tmp123_ = NULL;
                              gchar* gir_version;
                              gboolean _tmp124_ = FALSE;
                              gboolean _tmp125_ = FALSE;
                              gboolean _tmp126_ = FALSE;
                              _tmp122_ = string_substring (vala_compiler_gir, (glong) 0, (glong) last_hyphen);
                              gir_namespace = _tmp122_;
                              _tmp123_ = string_substring (vala_compiler_gir, (glong) (last_hyphen + 1), (gir_len - last_hyphen) - 5);
                              gir_version = _tmp123_;
                              g_strcanon (gir_version, "0123456789.", '?');
                              if (g_strcmp0 (gir_namespace, "") == 0) {
                                    _tmp126_ = TRUE;
                              } else {
                                    _tmp126_ = g_strcmp0 (gir_version, "") == 0;
                              }
                              if (_tmp126_) {
                                    _tmp125_ = TRUE;
                              } else {
                                    gchar _tmp127_;
                                    gboolean _tmp128_;
                                    _tmp127_ = string_get (gir_version, (glong) 0);
                                    _tmp128_ = g_ascii_isdigit (_tmp127_);
                                    _tmp125_ = !_tmp128_;
                              }
                              if (_tmp125_) {
                                    _tmp124_ = TRUE;
                              } else {
                                    gboolean _tmp129_;
                                    _tmp129_ = string_contains (gir_version, "?");
                                    _tmp124_ = _tmp129_;
                              }
                              if (_tmp124_) {
                                    gchar* _tmp130_ = NULL;
                                    gchar* _tmp131_;
                                    _tmp130_ = g_strdup_printf ("GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", vala_compiler_gir);
                                    _tmp131_ = _tmp130_;
                                    vala_report_error (NULL, _tmp131_);
                                    _g_free0 (_tmp131_);
                              } else {
                                    ValaGIRWriter* _tmp132_ = NULL;
                                    ValaGIRWriter* gir_writer;
                                    gchar* _tmp133_;
                                    gchar* gir_directory;
                                    _tmp132_ = vala_gir_writer_new ();
                                    gir_writer = _tmp132_;
                                    _tmp133_ = g_strdup (".");
                                    gir_directory = _tmp133_;
                                    if (vala_compiler_directory != NULL) {
                                          const gchar* _tmp134_ = NULL;
                                          gchar* _tmp135_;
                                          _tmp134_ = vala_code_context_get_directory (self->priv->context);
                                          _tmp135_ = g_strdup (_tmp134_);
                                          _g_free0 (gir_directory);
                                          gir_directory = _tmp135_;
                                    }
                                    vala_gir_writer_write_file (gir_writer, self->priv->context, gir_directory, gir_namespace, gir_version, vala_compiler_library);
                                    _g_free0 (gir_directory);
                                    _vala_code_visitor_unref0 (gir_writer);
                              }
                              _g_free0 (gir_version);
                              _g_free0 (gir_namespace);
                        }
                  }
                  _g_free0 (vala_compiler_gir);
                  vala_compiler_gir = NULL;
            }
            _g_free0 (vala_compiler_library);
            vala_compiler_library = NULL;
      }
      if (vala_compiler_vapi_filename != NULL) {
            ValaCodeWriter* _tmp136_ = NULL;
            ValaCodeWriter* interface_writer;
            gboolean _tmp137_ = FALSE;
            _tmp136_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_EXTERNAL);
            interface_writer = _tmp136_;
            if (vala_compiler_directory != NULL) {
                  gboolean _tmp138_;
                  _tmp138_ = g_path_is_absolute (vala_compiler_vapi_filename);
                  _tmp137_ = !_tmp138_;
            } else {
                  _tmp137_ = FALSE;
            }
            if (_tmp137_) {
                  const gchar* _tmp139_ = NULL;
                  gchar* _tmp140_ = NULL;
                  _tmp139_ = vala_code_context_get_directory (self->priv->context);
                  _tmp140_ = g_strdup_printf ("%s%c%s", _tmp139_, (gint) G_DIR_SEPARATOR, vala_compiler_vapi_filename);
                  _g_free0 (vala_compiler_vapi_filename);
                  vala_compiler_vapi_filename = _tmp140_;
            }
            vala_code_writer_write_file (interface_writer, self->priv->context, vala_compiler_vapi_filename);
            _vala_code_visitor_unref0 (interface_writer);
      }
      if (vala_compiler_internal_vapi_filename != NULL) {
            gboolean _tmp141_ = FALSE;
            ValaCodeWriter* _tmp143_ = NULL;
            ValaCodeWriter* interface_writer;
            gchar* _tmp144_;
            gchar* vapi_filename;
            gboolean _tmp145_ = FALSE;
            if (vala_compiler_internal_header_filename == NULL) {
                  _tmp141_ = TRUE;
            } else {
                  _tmp141_ = vala_compiler_header_filename == NULL;
            }
            if (_tmp141_) {
                  gint _tmp142_;
                  vala_report_error (NULL, "--internal-vapi may only be used in combination with --header and --in" \
"ternal-header");
                  _tmp142_ = vala_compiler_quit (self);
                  result = _tmp142_;
                  _vala_code_visitor_unref0 (gir_parser);
                  _vala_code_visitor_unref0 (genie_parser);
                  _vala_code_visitor_unref0 (parser);
                  return result;
            }
            _tmp143_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_INTERNAL);
            interface_writer = _tmp143_;
            vala_code_writer_set_cheader_override (interface_writer, vala_compiler_header_filename, vala_compiler_internal_header_filename);
            _tmp144_ = g_strdup (vala_compiler_internal_vapi_filename);
            vapi_filename = _tmp144_;
            if (vala_compiler_directory != NULL) {
                  gboolean _tmp146_;
                  _tmp146_ = g_path_is_absolute (vapi_filename);
                  _tmp145_ = !_tmp146_;
            } else {
                  _tmp145_ = FALSE;
            }
            if (_tmp145_) {
                  const gchar* _tmp147_ = NULL;
                  gchar* _tmp148_ = NULL;
                  _tmp147_ = vala_code_context_get_directory (self->priv->context);
                  _tmp148_ = g_strdup_printf ("%s%c%s", _tmp147_, (gint) G_DIR_SEPARATOR, vapi_filename);
                  _g_free0 (vapi_filename);
                  vapi_filename = _tmp148_;
            }
            vala_code_writer_write_file (interface_writer, self->priv->context, vapi_filename);
            _g_free0 (vala_compiler_internal_vapi_filename);
            vala_compiler_internal_vapi_filename = NULL;
            _g_free0 (vapi_filename);
            _vala_code_visitor_unref0 (interface_writer);
      }
      if (vala_compiler_dependencies != NULL) {
            vala_code_context_write_dependencies (self->priv->context, vala_compiler_dependencies);
      }
      if (!vala_compiler_ccode_only) {
            ValaCCodeCompiler* _tmp149_ = NULL;
            ValaCCodeCompiler* ccompiler;
            gboolean _tmp150_ = FALSE;
            _tmp149_ = vala_ccode_compiler_new ();
            ccompiler = _tmp149_;
            if (vala_compiler_cc_command == NULL) {
                  const gchar* _tmp151_ = NULL;
                  _tmp151_ = g_getenv ("CC");
                  _tmp150_ = _tmp151_ != NULL;
            } else {
                  _tmp150_ = FALSE;
            }
            if (_tmp150_) {
                  const gchar* _tmp152_ = NULL;
                  gchar* _tmp153_;
                  _tmp152_ = g_getenv ("CC");
                  _tmp153_ = g_strdup (_tmp152_);
                  _g_free0 (vala_compiler_cc_command);
                  vala_compiler_cc_command = _tmp153_;
            }
            if (vala_compiler_cc_options == NULL) {
                  gchar** _tmp154_ = NULL;
                  gchar** _tmp155_;
                  gint _tmp155__length1;
                  _tmp154_ = g_new0 (gchar*, 0 + 1);
                  _tmp155_ = _tmp154_;
                  _tmp155__length1 = 0;
                  vala_ccode_compiler_compile (ccompiler, self->priv->context, vala_compiler_cc_command, _tmp155_, 0);
                  _tmp155_ = (_vala_array_free (_tmp155_, _tmp155__length1, (GDestroyNotify) g_free), NULL);
            } else {
                  vala_ccode_compiler_compile (ccompiler, self->priv->context, vala_compiler_cc_command, vala_compiler_cc_options, _vala_array_length (vala_compiler_cc_options));
            }
            _vala_ccode_compiler_unref0 (ccompiler);
      }
      _tmp156_ = vala_compiler_quit (self);
      result = _tmp156_;
      _vala_code_visitor_unref0 (gir_parser);
      _vala_code_visitor_unref0 (genie_parser);
      _vala_code_visitor_unref0 (parser);
      return result;
}


static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) {
      if ((*length) == (*size)) {
            *size = (*size) ? (2 * (*size)) : 4;
            *array = g_renew (gchar*, *array, (*size) + 1);
      }
      (*array)[(*length)++] = value;
      (*array)[*length] = NULL;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
      g_atomic_int_inc (&_data1_->_ref_count_);
      return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
      if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
            _g_main_loop_unref0 (_data1_->loop);
            g_slice_free (Block1Data, _data1_);
      }
}


static void _lambda0_ (GPid pid, gint status, Block1Data* _data1_) {
      _data1_->child_status = (status & 0xff00) >> 8;
      g_main_loop_quit (_data1_->loop);
}


static void __lambda0__gchild_watch_func (GPid pid, gint status, gpointer self) {
      _lambda0_ (pid, status, self);
}


static gint vala_compiler_run_source (gchar** args, int args_length1) {
      gint result = 0;
      gint i;
      gboolean _tmp0_ = FALSE;
      gchar* _tmp7_;
      gchar** _tmp8_ = NULL;
      const gchar* _tmp9_ = NULL;
      gchar* _tmp10_ = NULL;
      gchar* _tmp11_;
      gchar* _tmp12_ = NULL;
      gint _tmp13_;
      gint outputfd;
      ValaCompiler* _tmp14_ = NULL;
      ValaCompiler* compiler;
      gint _tmp15_;
      gint ret;
      gint _tmp16_;
      gchar* _tmp17_;
      gchar** _tmp18_ = NULL;
      gchar** target_args;
      gint target_args_length1;
      gint _target_args_size_;
      Block1Data* _data1_;
      GPid pid = 0;
      GMainLoop* _tmp20_ = NULL;
      GPid _tmp21_;
      GError * _inner_error_ = NULL;
      i = 1;
      if (args[i] != NULL) {
            gboolean _tmp1_;
            _tmp1_ = g_str_has_prefix (args[i], "-");
            _tmp0_ = _tmp1_;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            gchar** compile_args = NULL;
            gint compile_args_length1 = 0;
            gint _compile_args_size_ = 0;
            gchar* _tmp2_;
            gchar* _tmp3_;
            gchar** _tmp4_ = NULL;
            gint _tmp5_;
            GOptionContext* _tmp6_ = NULL;
            GOptionContext* opt_context;
            gchar** temp_args;
            gint temp_args_length1;
            gint _temp_args_size_;
            _tmp2_ = g_strconcat ("valac ", args[1], NULL);
            _tmp3_ = _tmp2_;
            g_shell_parse_argv (_tmp3_, &_tmp5_, &_tmp4_, &_inner_error_);
            compile_args = (_vala_array_free (compile_args, compile_args_length1, (GDestroyNotify) g_free), NULL);
            compile_args = _tmp4_;
            compile_args_length1 = _tmp5_;
            _g_free0 (_tmp3_);
            if (_inner_error_ != NULL) {
                  compile_args = (_vala_array_free (compile_args, compile_args_length1, (GDestroyNotify) g_free), NULL);
                  if (_inner_error_->domain == G_SHELL_ERROR) {
                        goto __catch0_g_shell_error;
                  }
                  if (_inner_error_->domain == G_OPTION_ERROR) {
                        goto __catch0_g_option_error;
                  }
                  compile_args = (_vala_array_free (compile_args, compile_args_length1, (GDestroyNotify) g_free), NULL);
                  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);
                  g_clear_error (&_inner_error_);
                  return 0;
            }
            _tmp6_ = g_option_context_new ("- Vala");
            opt_context = _tmp6_;
            g_option_context_set_help_enabled (opt_context, TRUE);
            g_option_context_add_main_entries (opt_context, VALA_COMPILER_options, NULL);
            temp_args = compile_args;
            temp_args_length1 = compile_args_length1;
            _temp_args_size_ = compile_args_length1;
            g_option_context_parse (opt_context, &temp_args_length1, &temp_args, &_inner_error_);
            if (_inner_error_ != NULL) {
                  _g_option_context_free0 (opt_context);
                  compile_args = (_vala_array_free (compile_args, compile_args_length1, (GDestroyNotify) g_free), NULL);
                  if (_inner_error_->domain == G_SHELL_ERROR) {
                        goto __catch0_g_shell_error;
                  }
                  if (_inner_error_->domain == G_OPTION_ERROR) {
                        goto __catch0_g_option_error;
                  }
                  _g_option_context_free0 (opt_context);
                  compile_args = (_vala_array_free (compile_args, compile_args_length1, (GDestroyNotify) g_free), NULL);
                  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);
                  g_clear_error (&_inner_error_);
                  return 0;
            }
            _g_option_context_free0 (opt_context);
            compile_args = (_vala_array_free (compile_args, compile_args_length1, (GDestroyNotify) g_free), NULL);
            goto __finally0;
            __catch0_g_shell_error:
            {
                  GError * e;
                  e = _inner_error_;
                  _inner_error_ = NULL;
                  fprintf (stdout, "%s\n", e->message);
                  result = 1;
                  _g_error_free0 (e);
                  return result;
            }
            goto __finally0;
            __catch0_g_option_error:
            {
                  GError * e;
                  e = _inner_error_;
                  _inner_error_ = NULL;
                  fprintf (stdout, "%s\n", e->message);
                  fprintf (stdout, "Run '%s --help' to see a full list of available command line options.\n", args[0]);
                  result = 1;
                  _g_error_free0 (e);
                  return result;
            }
            __finally0:
            if (_inner_error_ != NULL) {
                  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);
                  g_clear_error (&_inner_error_);
                  return 0;
            }
            i++;
      }
      if (args[i] == NULL) {
            fprintf (stderr, "No source file specified.\n");
            result = 1;
            return result;
      }
      _tmp7_ = g_strdup (args[i]);
      _tmp8_ = g_new0 (gchar*, 1 + 1);
      _tmp8_[0] = _tmp7_;
      vala_compiler_sources = (_vala_array_free (vala_compiler_sources, _vala_array_length (vala_compiler_sources), (GDestroyNotify) g_free), NULL);
      vala_compiler_sources = _tmp8_;
      _tmp9_ = g_get_tmp_dir ();
      _tmp10_ = g_path_get_basename (args[i]);
      _tmp11_ = _tmp10_;
      _tmp12_ = g_strdup_printf ("%s/%s.XXXXXX", _tmp9_, _tmp11_);
      _g_free0 (vala_compiler_output);
      vala_compiler_output = _tmp12_;
      _g_free0 (_tmp11_);
      _tmp13_ = g_mkstemp (vala_compiler_output);
      outputfd = _tmp13_;
      if (outputfd < 0) {
            result = 1;
            return result;
      }
      vala_compiler_run_output = TRUE;
      vala_compiler_disable_warnings = TRUE;
      vala_compiler_quiet_mode = TRUE;
      _tmp14_ = vala_compiler_new ();
      compiler = _tmp14_;
      _tmp15_ = vala_compiler_run (compiler);
      ret = _tmp15_;
      if (ret != 0) {
            result = ret;
            _vala_compiler_unref0 (compiler);
            return result;
      }
      close (outputfd);
      _tmp16_ = g_chmod (vala_compiler_output, 0700);
      if (_tmp16_ != 0) {
            g_unlink (vala_compiler_output);
            result = 1;
            _vala_compiler_unref0 (compiler);
            return result;
      }
      _tmp17_ = g_strdup (vala_compiler_output);
      _tmp18_ = g_new0 (gchar*, 1 + 1);
      _tmp18_[0] = _tmp17_;
      target_args = _tmp18_;
      target_args_length1 = 1;
      _target_args_size_ = 1;
      while (TRUE) {
            gchar* _tmp19_;
            if (!(i < args_length1)) {
                  break;
            }
            _tmp19_ = g_strdup (args[i]);
            _vala_array_add1 (&target_args, &target_args_length1, &_target_args_size_, _tmp19_);
            i++;
      }
      _data1_ = g_slice_new0 (Block1Data);
      _data1_->_ref_count_ = 1;
      _tmp20_ = g_main_loop_new (NULL, FALSE);
      _data1_->loop = _tmp20_;
      _data1_->child_status = 0;
      g_spawn_async (NULL, target_args, NULL, (G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_DO_NOT_REAP_CHILD) | G_SPAWN_FILE_AND_ARGV_ZERO, NULL, NULL, &_tmp21_, &_inner_error_);
      pid = _tmp21_;
      if (_inner_error_ != NULL) {
            block1_data_unref (_data1_);
            _data1_ = NULL;
            if (_inner_error_->domain == G_SPAWN_ERROR) {
                  goto __catch1_g_spawn_error;
            }
            block1_data_unref (_data1_);
            _data1_ = NULL;
            target_args = (_vala_array_free (target_args, target_args_length1, (GDestroyNotify) g_free), NULL);
            _vala_compiler_unref0 (compiler);
            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);
            g_clear_error (&_inner_error_);
            return 0;
      }
      g_unlink (vala_compiler_output);
      g_child_watch_add_full (G_PRIORITY_DEFAULT_IDLE, pid, __lambda0__gchild_watch_func, block1_data_ref (_data1_), block1_data_unref);
      g_main_loop_run (_data1_->loop);
      result = _data1_->child_status;
      block1_data_unref (_data1_);
      _data1_ = NULL;
      target_args = (_vala_array_free (target_args, target_args_length1, (GDestroyNotify) g_free), NULL);
      _vala_compiler_unref0 (compiler);
      return result;
      block1_data_unref (_data1_);
      _data1_ = NULL;
      goto __finally1;
      __catch1_g_spawn_error:
      {
            GError * e;
            e = _inner_error_;
            _inner_error_ = NULL;
            fprintf (stdout, "%s\n", e->message);
            result = 1;
            _g_error_free0 (e);
            target_args = (_vala_array_free (target_args, target_args_length1, (GDestroyNotify) g_free), NULL);
            _vala_compiler_unref0 (compiler);
            return result;
      }
      __finally1:
      target_args = (_vala_array_free (target_args, target_args_length1, (GDestroyNotify) g_free), NULL);
      _vala_compiler_unref0 (compiler);
      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);
      g_clear_error (&_inner_error_);
      return 0;
}


static gint vala_compiler_main (gchar** args, int args_length1) {
      gint result = 0;
      gboolean _tmp0_ = FALSE;
      gchar* _tmp1_ = NULL;
      gchar* _tmp2_;
      gboolean _tmp3_;
      GOptionContext* _tmp7_ = NULL;
      GOptionContext* opt_context;
      gboolean _tmp8_ = FALSE;
      ValaCompiler* _tmp9_ = NULL;
      ValaCompiler* compiler;
      gint _tmp10_;
      GError * _inner_error_ = NULL;
      setlocale (LC_ALL, "");
      _tmp1_ = g_path_get_basename (args[0]);
      _tmp2_ = _tmp1_;
      _tmp3_ = g_strcmp0 (_tmp2_, "vala") == 0;
      _g_free0 (_tmp2_);
      if (_tmp3_) {
            _tmp0_ = TRUE;
      } else {
            gchar* _tmp4_ = NULL;
            gchar* _tmp5_;
            _tmp4_ = g_path_get_basename (args[0]);
            _tmp5_ = _tmp4_;
            _tmp0_ = g_strcmp0 (_tmp5_, "vala" PACKAGE_SUFFIX) == 0;
            _g_free0 (_tmp5_);
      }
      if (_tmp0_) {
            gint _tmp6_;
            _tmp6_ = vala_compiler_run_source (args, args_length1);
            result = _tmp6_;
            return result;
      }
      _tmp7_ = g_option_context_new ("- Vala Compiler");
      opt_context = _tmp7_;
      g_option_context_set_help_enabled (opt_context, TRUE);
      g_option_context_add_main_entries (opt_context, VALA_COMPILER_options, NULL);
      g_option_context_parse (opt_context, &args_length1, &args, &_inner_error_);
      if (_inner_error_ != NULL) {
            _g_option_context_free0 (opt_context);
            if (_inner_error_->domain == G_OPTION_ERROR) {
                  goto __catch2_g_option_error;
            }
            _g_option_context_free0 (opt_context);
            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);
            g_clear_error (&_inner_error_);
            return 0;
      }
      _g_option_context_free0 (opt_context);
      goto __finally2;
      __catch2_g_option_error:
      {
            GError * e;
            e = _inner_error_;
            _inner_error_ = NULL;
            fprintf (stdout, "%s\n", e->message);
            fprintf (stdout, "Run '%s --help' to see a full list of available command line options.\n", args[0]);
            result = 1;
            _g_error_free0 (e);
            return result;
      }
      __finally2:
      if (_inner_error_ != NULL) {
            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);
            g_clear_error (&_inner_error_);
            return 0;
      }
      if (vala_compiler_version) {
            fprintf (stdout, "Vala %s\n", BUILD_VERSION);
            result = 0;
            return result;
      }
      if (vala_compiler_sources == NULL) {
            _tmp8_ = vala_compiler_fast_vapis == NULL;
      } else {
            _tmp8_ = FALSE;
      }
      if (_tmp8_) {
            fprintf (stderr, "No source file specified.\n");
            result = 1;
            return result;
      }
      _tmp9_ = vala_compiler_new ();
      compiler = _tmp9_;
      _tmp10_ = vala_compiler_run (compiler);
      result = _tmp10_;
      _vala_compiler_unref0 (compiler);
      return result;
}


int main (int argc, char ** argv) {
      g_type_init ();
      return vala_compiler_main (argv, argc);
}


ValaCompiler* vala_compiler_construct (GType object_type) {
      ValaCompiler* self = NULL;
      self = (ValaCompiler*) g_type_create_instance (object_type);
      return self;
}


ValaCompiler* vala_compiler_new (void) {
      return vala_compiler_construct (VALA_TYPE_COMPILER);
}


static void vala_value_compiler_init (GValue* value) {
      value->data[0].v_pointer = NULL;
}


static void vala_value_compiler_free_value (GValue* value) {
      if (value->data[0].v_pointer) {
            vala_compiler_unref (value->data[0].v_pointer);
      }
}


static void vala_value_compiler_copy_value (const GValue* src_value, GValue* dest_value) {
      if (src_value->data[0].v_pointer) {
            dest_value->data[0].v_pointer = vala_compiler_ref (src_value->data[0].v_pointer);
      } else {
            dest_value->data[0].v_pointer = NULL;
      }
}


static gpointer vala_value_compiler_peek_pointer (const GValue* value) {
      return value->data[0].v_pointer;
}


static gchar* vala_value_compiler_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      if (collect_values[0].v_pointer) {
            ValaCompiler* object;
            object = collect_values[0].v_pointer;
            if (object->parent_instance.g_class == NULL) {
                  return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
                  return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            }
            value->data[0].v_pointer = vala_compiler_ref (object);
      } else {
            value->data[0].v_pointer = NULL;
      }
      return NULL;
}


static gchar* vala_value_compiler_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      ValaCompiler** object_p;
      object_p = collect_values[0].v_pointer;
      if (!object_p) {
            return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
      }
      if (!value->data[0].v_pointer) {
            *object_p = NULL;
      } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
            *object_p = value->data[0].v_pointer;
      } else {
            *object_p = vala_compiler_ref (value->data[0].v_pointer);
      }
      return NULL;
}


GParamSpec* vala_param_spec_compiler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
      ValaParamSpecCompiler* spec;
      g_return_val_if_fail (g_type_is_a (object_type, VALA_TYPE_COMPILER), NULL);
      spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
      G_PARAM_SPEC (spec)->value_type = object_type;
      return G_PARAM_SPEC (spec);
}


gpointer vala_value_get_compiler (const GValue* value) {
      g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALA_TYPE_COMPILER), NULL);
      return value->data[0].v_pointer;
}


void vala_value_set_compiler (GValue* value, gpointer v_object) {
      ValaCompiler* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALA_TYPE_COMPILER));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALA_TYPE_COMPILER));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
            vala_compiler_ref (value->data[0].v_pointer);
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            vala_compiler_unref (old);
      }
}


void vala_value_take_compiler (GValue* value, gpointer v_object) {
      ValaCompiler* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALA_TYPE_COMPILER));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALA_TYPE_COMPILER));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            vala_compiler_unref (old);
      }
}


static void vala_compiler_class_init (ValaCompilerClass * klass) {
      vala_compiler_parent_class = g_type_class_peek_parent (klass);
      VALA_COMPILER_CLASS (klass)->finalize = vala_compiler_finalize;
      g_type_class_add_private (klass, sizeof (ValaCompilerPrivate));
}


static void vala_compiler_instance_init (ValaCompiler * self) {
      self->priv = VALA_COMPILER_GET_PRIVATE (self);
      self->ref_count = 1;
}


static void vala_compiler_finalize (ValaCompiler* obj) {
      ValaCompiler * self;
      self = VALA_COMPILER (obj);
      _vala_code_context_unref0 (self->priv->context);
}


GType vala_compiler_get_type (void) {
      static volatile gsize vala_compiler_type_id__volatile = 0;
      if (g_once_init_enter (&vala_compiler_type_id__volatile)) {
            static const GTypeValueTable g_define_type_value_table = { vala_value_compiler_init, vala_value_compiler_free_value, vala_value_compiler_copy_value, vala_value_compiler_peek_pointer, "p", vala_value_compiler_collect_value, "p", vala_value_compiler_lcopy_value };
            static const GTypeInfo g_define_type_info = { sizeof (ValaCompilerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_compiler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaCompiler), 0, (GInstanceInitFunc) vala_compiler_instance_init, &g_define_type_value_table };
            static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
            GType vala_compiler_type_id;
            vala_compiler_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ValaCompiler", &g_define_type_info, &g_define_type_fundamental_info, 0);
            g_once_init_leave (&vala_compiler_type_id__volatile, vala_compiler_type_id);
      }
      return vala_compiler_type_id__volatile;
}


gpointer vala_compiler_ref (gpointer instance) {
      ValaCompiler* self;
      self = instance;
      g_atomic_int_inc (&self->ref_count);
      return instance;
}


void vala_compiler_unref (gpointer instance) {
      ValaCompiler* self;
      self = instance;
      if (g_atomic_int_dec_and_test (&self->ref_count)) {
            VALA_COMPILER_GET_CLASS (self)->finalize (self);
            g_type_free_instance ((GTypeInstance *) self);
      }
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      if ((array != NULL) && (destroy_func != NULL)) {
            int i;
            for (i = 0; i < array_length; i = i + 1) {
                  if (((gpointer*) array)[i] != NULL) {
                        destroy_func (((gpointer*) array)[i]);
                  }
            }
      }
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      _vala_array_destroy (array, array_length, destroy_func);
      g_free (array);
}


static gint _vala_array_length (gpointer array) {
      int length;
      length = 0;
      if (array) {
            while (((gpointer*) array)[length]) {
                  length++;
            }
      }
      return length;
}




Generated by  Doxygen 1.6.0   Back to index