vala r1884 - in trunk: . gobject



Author: juergbi
Date: Fri Oct 24 09:47:32 2008
New Revision: 1884
URL: http://svn.gnome.org/viewvc/vala?rev=1884&view=rev

Log:
2008-10-24  JÃrg Billeter  <j bitron ch>

	* gobject/valaccodebasemodule.vala:
	* gobject/valaccodegenerator.vala:
	* gobject/valaccodemodule.vala:

	Allow access to head and codegen from CCode modules


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodebasemodule.vala
   trunk/gobject/valaccodegenerator.vala
   trunk/gobject/valaccodemodule.vala

Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala	(original)
+++ trunk/gobject/valaccodebasemodule.vala	Fri Oct 24 09:47:32 2008
@@ -24,7 +24,7 @@
  * Code visitor generating C Code.
  */
 public class Vala.CCodeBaseModule : CCodeModule {
-	public CCodeBaseModule (CCodeModule? next) {
-		base (next);
+	public CCodeBaseModule (CCodeGenerator codegen, CCodeModule? next) {
+		base (codegen, next);
 	}
 }

Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala	(original)
+++ trunk/gobject/valaccodegenerator.vala	Fri Oct 24 09:47:32 2008
@@ -141,7 +141,7 @@
 	private Set<string> wrappers;
 
 	public CCodeGenerator () {
-		this.head = new CCodeBaseModule (null);
+		this.head = new CCodeBaseModule (this, null);
 
 		predefined_marshal_set = new HashSet<string> (str_hash, str_equal);
 		predefined_marshal_set.add ("VOID:VOID");

Modified: trunk/gobject/valaccodemodule.vala
==============================================================================
--- trunk/gobject/valaccodemodule.vala	(original)
+++ trunk/gobject/valaccodemodule.vala	Fri Oct 24 09:47:32 2008
@@ -26,12 +26,26 @@
  * Code visitor generating C Code.
  */
 public abstract class Vala.CCodeModule {
-	public weak CCodeModule head { get; private set; }
+	public weak CCodeGenerator codegen { get; private set; }
 
-	public CCodeModule? next { get; private set; }
+	public CCodeModule head {
+		get { return _head; }
+		private set {
+			_head = value;
+			// propagate head property to all modules
+			if (next != null) {
+				next.head = value;
+			}
+		}
+	}
+
+	weak CCodeModule _head;
+	CCodeModule? next;
 
-	public CCodeModule (CCodeModule? next) {
+	public CCodeModule (CCodeGenerator codegen, CCodeModule? next) {
+		this.codegen = codegen;
 		this.next = next;
+		this.head = this;
 	}
 
 	public virtual void emit (CodeContext context) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]