vala r1893 - in trunk: . gobject vala



Author: juergbi
Date: Fri Oct 24 13:27:26 2008
New Revision: 1893
URL: http://svn.gnome.org/viewvc/vala?rev=1893&view=rev

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

	* vala/valacodegenerator.vala:
	* vala/valaelementaccess.vala:
	* gobject/Makefile.am:
	* gobject/valaccodebinding.vala:
	* gobject/valaccodeelementaccessmodule.vala:
	* gobject/valaccodegenerator.vala:
	* gobject/valaccodemodule.vala:

	Add CCodeElementAccessModule


Added:
   trunk/gobject/valaccodeelementaccessmodule.vala   (contents, props changed)
      - copied, changed from r1889, /trunk/gobject/valaccodeelementaccessbinding.vala
Removed:
   trunk/gobject/valaccodeelementaccessbinding.vala
Modified:
   trunk/ChangeLog
   trunk/gobject/Makefile.am
   trunk/gobject/valaccodebinding.vala
   trunk/gobject/valaccodegenerator.vala
   trunk/gobject/valaccodemodule.vala
   trunk/vala/valacodegenerator.vala
   trunk/vala/valaelementaccess.vala

Modified: trunk/gobject/Makefile.am
==============================================================================
--- trunk/gobject/Makefile.am	(original)
+++ trunk/gobject/Makefile.am	Fri Oct 24 13:27:26 2008
@@ -19,7 +19,7 @@
 	valaccodecompiler.vala \
 	valaccodedynamicpropertybinding.vala \
 	valaccodedynamicsignalbinding.vala \
-	valaccodeelementaccessbinding.vala \
+	valaccodeelementaccessmodule.vala \
 	valaccodegenerator.vala \
 	valaccodegeneratorsignal.vala \
 	valaccodegeneratorsourcefile.vala \

Modified: trunk/gobject/valaccodebinding.vala
==============================================================================
--- trunk/gobject/valaccodebinding.vala	(original)
+++ trunk/gobject/valaccodebinding.vala	Fri Oct 24 13:27:26 2008
@@ -45,10 +45,6 @@
 		return (CCodeBinding) node.get_code_binding (codegen);
 	}
 
-	public CCodeElementAccessBinding element_access_binding (ElementAccess node) {
-		return (CCodeElementAccessBinding) node.get_code_binding (codegen);
-	}
-
 	public CCodeAssignmentBinding assignment_binding (Assignment node) {
 		return (CCodeAssignmentBinding) node.get_code_binding (codegen);
 	}

Copied: trunk/gobject/valaccodeelementaccessmodule.vala (from r1889, /trunk/gobject/valaccodeelementaccessbinding.vala)
==============================================================================
--- /trunk/gobject/valaccodeelementaccessbinding.vala	(original)
+++ trunk/gobject/valaccodeelementaccessmodule.vala	Fri Oct 24 13:27:26 2008
@@ -1,4 +1,4 @@
-/* valaccodeelementaccessbinding.vala
+/* valaccodeelementaccessmodule.vala
  *
  * Copyright (C) 2006-2008  JÃrg Billeter, Raffaele Sandrini
  *
@@ -27,16 +27,13 @@
 /**
  * The link between an element access and generated code.
  */
-public class Vala.CCodeElementAccessBinding : CCodeBinding {
-	public ElementAccess element_access { get; set; }
-
-	public CCodeElementAccessBinding (CCodeGenerator codegen, ElementAccess element_access) {
-		this.element_access = element_access;
-		this.codegen = codegen;
+public class Vala.CCodeElementAccessModule : CCodeModule {
+	public CCodeElementAccessModule (CCodeGenerator codegen, CCodeModule? next) {
+		base (codegen, next);
 	}
 
-	public override void emit () {
-		var expr = element_access;
+	public override void visit_element_access (ElementAccess expr) {
+		expr.accept_children (codegen);
 
 		Gee.List<Expression> indices = expr.get_indices ();
 		int rank = indices.size;

Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala	(original)
+++ trunk/gobject/valaccodegenerator.vala	Fri Oct 24 13:27:26 2008
@@ -144,6 +144,7 @@
 		head = new CCodeBaseModule (this, head);
 		head = new CCodeMethodModule (this, head);
 		head = new CCodeMemberAccessModule (this, head);
+		head = new CCodeElementAccessModule (this, head);
 		head = new CCodeInvocationExpressionModule (this, head);
 		head = new CCodeArrayModule (this, head);
 		head = new GObjectModule (this, head);
@@ -3061,9 +3062,7 @@
 	}
 
 	public override void visit_element_access (ElementAccess expr) {
-		expr.accept_children (this);
-
-		code_binding (expr).emit ();
+		head.visit_element_access (expr);
 	}
 
 	public override void visit_base_access (BaseAccess expr) {
@@ -4375,10 +4374,6 @@
 		return new CCodeDynamicSignalBinding (this, node);
 	}
 
-	public override CodeBinding? create_element_access_binding (ElementAccess node) {
-		return new CCodeElementAccessBinding (this, node);
-	}
-
 	public override CodeBinding? create_assignment_binding (Assignment node) {
 		return new CCodeAssignmentBinding (this, node);
 	}
@@ -4395,10 +4390,6 @@
 		return (CCodeDynamicSignalBinding) node.get_code_binding (this);
 	}
 
-	public CCodeElementAccessBinding element_access_binding (ElementAccess node) {
-		return (CCodeElementAccessBinding) node.get_code_binding (this);
-	}
-
 	public CCodeAssignmentBinding assignment_binding (Assignment node) {
 		return (CCodeAssignmentBinding) node.get_code_binding (this);
 	}

Modified: trunk/gobject/valaccodemodule.vala
==============================================================================
--- trunk/gobject/valaccodemodule.vala	(original)
+++ trunk/gobject/valaccodemodule.vala	Fri Oct 24 13:27:26 2008
@@ -72,6 +72,10 @@
 		next.visit_member_access (expr);
 	}
 
+	public virtual void visit_element_access (ElementAccess expr) {
+		next.visit_element_access (expr);
+	}
+
 	public virtual void visit_invocation_expression (InvocationExpression expr) {
 		next.visit_invocation_expression (expr);
 	}

Modified: trunk/vala/valacodegenerator.vala
==============================================================================
--- trunk/vala/valacodegenerator.vala	(original)
+++ trunk/vala/valacodegenerator.vala	Fri Oct 24 13:27:26 2008
@@ -42,10 +42,6 @@
 		return null;
 	}
 
-	public virtual CodeBinding? create_element_access_binding (ElementAccess node) {
-		return null;
-	}
-
 	public virtual CodeBinding? create_assignment_binding (Assignment node) {
 		return null;
 	}

Modified: trunk/vala/valaelementaccess.vala
==============================================================================
--- trunk/vala/valaelementaccess.vala	(original)
+++ trunk/vala/valaelementaccess.vala	Fri Oct 24 13:27:26 2008
@@ -85,8 +85,4 @@
 		}
 		return container.is_pure ();
 	}
-
-	public override CodeBinding? create_code_binding (CodeGenerator codegen) {
-		return codegen.create_element_access_binding (this);
-	}
 }



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