diff options
author | Jürg Billeter <j@bitron.ch> | 2008-10-24 09:47:32 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-10-24 09:47:32 +0000 |
commit | 3339ed6b51f3207ca2026fc05f3fcc1c34bb4d32 (patch) | |
tree | 9aa846e047ea99fff892e63a43efa0b20dbf6b53 /gobject/valaccodemodule.vala | |
parent | a65ea415b55eedc136e466dc400dc71b1d476c1e (diff) | |
download | vala-3339ed6b51f3207ca2026fc05f3fcc1c34bb4d32.tar.gz |
Allow access to head and codegen from CCode modules
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
svn path=/trunk/; revision=1884
Diffstat (limited to 'gobject/valaccodemodule.vala')
-rw-r--r-- | gobject/valaccodemodule.vala | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gobject/valaccodemodule.vala b/gobject/valaccodemodule.vala index d78de0a9d..847c5fe43 100644 --- a/gobject/valaccodemodule.vala +++ b/gobject/valaccodemodule.vala @@ -26,12 +26,26 @@ using Gee; * 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) { |