+2008-10-24 Jürg Billeter <j@bitron.ch>
+
+ * gobject/Makefile.am:
+ * gobject/valaccodebasemodule.vala:
+ * gobject/valaccodegenerator.vala:
+ * gobject/valaccodemodule.vala:
+
+ Add CCodeModule and CCodeBaseModule classes as preparation to
+ make the backend more modular
+
2008-10-24 Jürg Billeter <j@bitron.ch>
* gobject/valaccodeinvocationexpressionbinding.vala:
libvala_la_VALASOURCES = \
valaccodearraycreationexpressionbinding.vala \
valaccodeassignmentbinding.vala \
+ valaccodebasemodule.vala \
valaccodebinding.vala \
valaccodeclassbinding.vala \
valaccodecompiler.vala \
valaccodeinvocationexpressionbinding.vala \
valaccodememberaccessbinding.vala \
valaccodemethodbinding.vala \
+ valaccodemodule.vala \
valaccodeobjecttypesymbolbinding.vala \
valaccodetypesymbolbinding.vala \
valaclassregisterfunction.vala \
--- /dev/null
+/* valaccodebasemodule.vala
+ *
+ * Copyright (C) 2008 Jürg Billeter
+ *
+ * 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>
+ */
+
+/**
+ * Code visitor generating C Code.
+ */
+public class Vala.CCodeBaseModule : CCodeModule {
+ public CCodeBaseModule (CCodeModule? next) {
+ base (next);
+ }
+}
* Code visitor generating C Code.
*/
public class Vala.CCodeGenerator : CodeGenerator {
+ CCodeModule head;
+
public CodeContext context;
public Symbol root_symbol;
private Set<string> wrappers;
public CCodeGenerator () {
+ this.head = new CCodeBaseModule (null);
+
predefined_marshal_set = new HashSet<string> (str_hash, str_equal);
predefined_marshal_set.add ("VOID:VOID");
predefined_marshal_set.add ("VOID:BOOLEAN");
}
public override void emit (CodeContext context) {
+ this.head.emit (context);
+
this.context = context;
context.find_header_cycles ();
--- /dev/null
+/* valaccodemodule.vala
+ *
+ * Copyright (C) 2008 Jürg Billeter
+ *
+ * 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>
+ */
+
+using Gee;
+
+/**
+ * Code visitor generating C Code.
+ */
+public abstract class Vala.CCodeModule {
+ public weak CCodeModule head { get; private set; }
+
+ public CCodeModule? next { get; private set; }
+
+ public CCodeModule (CCodeModule? next) {
+ this.next = next;
+ }
+
+ public virtual void emit (CodeContext context) {
+ if (next != null) {
+ next.emit (context);
+ }
+ }
+}