]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Api: Remove references to the tree root in nodes
authorDidier 'Ptitjes <ptitjes@free.fr>
Wed, 14 Oct 2009 13:39:43 +0000 (15:39 +0200)
committerDidier 'Ptitjes <ptitjes@free.fr>
Wed, 14 Oct 2009 14:38:44 +0000 (16:38 +0200)
32 files changed:
src/libvaladoc/apitree/apiitem.vala
src/libvaladoc/apitree/apimembernode.vala
src/libvaladoc/apitree/apinode.vala
src/libvaladoc/apitree/apinodebuilder.vala
src/libvaladoc/apitree/apisymbolnode.vala
src/libvaladoc/apitree/apitree.vala
src/libvaladoc/apitree/apitypesymbolnode.vala
src/libvaladoc/apitree/array.vala
src/libvaladoc/apitree/class.vala
src/libvaladoc/apitree/constant.vala
src/libvaladoc/apitree/delegate.vala
src/libvaladoc/apitree/enum.vala
src/libvaladoc/apitree/enumhandler.vala
src/libvaladoc/apitree/enumvalue.vala
src/libvaladoc/apitree/errorcode.vala
src/libvaladoc/apitree/errordomain.vala
src/libvaladoc/apitree/exceptionlisthandler.vala
src/libvaladoc/apitree/field.vala
src/libvaladoc/apitree/formalparameter.vala
src/libvaladoc/apitree/interface.vala
src/libvaladoc/apitree/method.vala
src/libvaladoc/apitree/namespace.vala
src/libvaladoc/apitree/namespacehandler.vala
src/libvaladoc/apitree/package.vala
src/libvaladoc/apitree/pointer.vala
src/libvaladoc/apitree/property.vala
src/libvaladoc/apitree/propertyaccessor.vala
src/libvaladoc/apitree/returntypehandler.vala
src/libvaladoc/apitree/signal.vala
src/libvaladoc/apitree/struct.vala
src/libvaladoc/apitree/typeparameter.vala
src/libvaladoc/apitree/typereference.vala

index 31210193797d2c558b93c3e1b745c106ba4db2e5..27a4890c1b7090372f2062156eeae083a8d31d93 100644 (file)
@@ -34,13 +34,7 @@ public abstract class Valadoc.Api.Item : Object {
                get;
        }
 
-       // TODO rename root
-       public Tree head {
-               protected set;
-               get;
-       }
-
-       protected virtual void resolve_type_references () {
+       protected virtual void resolve_type_references (Tree root) {
        }
 
        protected virtual void parse_comments (DocumentationParser parser) {
index 4b8aa645d284c17b2621aae1f994e2c8c38b8a73..ea5b201b74633c68499ffb03014b08f668c87f0f 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 
 public abstract class Valadoc.Api.MemberNode : Api.SymbolNode {
 
-       public MemberNode (Settings settings, Vala.Member symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public MemberNode (Settings settings, Vala.Member symbol, Api.Node parent) {
+               base (settings, symbol, parent);
        }
 
        protected override void parse_comments (DocumentationParser parser) {
index 825d43a1723bef37d9fdb99b32459e11c5373cef..94af777bcc0d624f6cf45b458b1f9830aedf9650 100644 (file)
@@ -58,10 +58,9 @@ public abstract class Valadoc.Api.Node : /*Api.Item*/DocumentedElement, Visitabl
        private Map<Symbol,Node> per_symbol_children;
        private Map<NodeType?,Gee.List<Node>> per_type_children;
 
-       public Node (Settings settings, Api.Node? parent, Tree root) {
+       public Node (Settings settings, Api.Node? parent) {
                this.settings = settings;
                this.parent = parent;
-               this.head = root;
 
                per_name_children = new HashMap<string,Node> ();
                per_symbol_children = new HashMap<Symbol,Node> ();
@@ -97,9 +96,9 @@ public abstract class Valadoc.Api.Node : /*Api.Item*/DocumentedElement, Visitabl
                children.add (child);
        }
 
-       protected override void resolve_type_references () {
+       protected override void resolve_type_references (Tree root) {
                foreach (Node node in per_name_children.values) {
-                       node.resolve_type_references ();
+                       node.resolve_type_references (root);
                }
        }
 
index 5355fa1cab76df4b60c66106505264863f1f3901..75e979123a57944c27d9c93a2dd2deb4bbe17d6c 100644 (file)
@@ -70,7 +70,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_class (Vala.Class element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Class (settings, element, parent, root);
+               SymbolNode node = new Class (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -79,7 +79,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_interface (Vala.Interface element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Interface (settings, element, parent, root);
+               SymbolNode node = new Interface (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -88,7 +88,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_struct (Vala.Struct element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Struct (settings, element, parent, root);
+               SymbolNode node = new Struct (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -97,7 +97,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_field (Vala.Field element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Field (settings, element, parent, root);
+               SymbolNode node = new Field (settings, element, parent);
                parent.add_child (node);
 
                // Process field type
@@ -108,7 +108,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_property (Vala.Property element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Property (settings, element, parent, root);
+               SymbolNode node = new Property (settings, element, parent);
                parent.add_child (node);
 
                // Process property type
@@ -119,7 +119,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_method (Vala.Method element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Method (settings, element, parent, root);
+               SymbolNode node = new Method (settings, element, parent);
                parent.add_child (node);
 
                // Process error types
@@ -131,7 +131,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_signal (Vala.Signal element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Signal (settings, element, parent, root);
+               SymbolNode node = new Signal (settings, element, parent);
                parent.add_child (node);
 
                // Process return type
@@ -142,7 +142,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_delegate (Vala.Delegate element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Delegate (settings, element, parent, root);
+               SymbolNode node = new Delegate (settings, element, parent);
                parent.add_child (node);
 
                // Process error types
@@ -154,7 +154,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_enum (Vala.Enum element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Enum (settings, element, parent, root);
+               SymbolNode node = new Enum (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -163,7 +163,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_enum_value (Vala.EnumValue element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new EnumValue (settings, element, parent, root);
+               SymbolNode node = new EnumValue (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -172,7 +172,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_constant (Vala.Constant element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Constant (settings, element, parent, root);
+               SymbolNode node = new Constant (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -181,7 +181,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_error_domain (Vala.ErrorDomain element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new ErrorDomain (settings, element, parent, root);
+               SymbolNode node = new ErrorDomain (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -190,7 +190,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_error_code (Vala.ErrorCode element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new ErrorCode (settings, element, parent, root);
+               SymbolNode node = new ErrorCode (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -199,7 +199,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_type_parameter (Vala.TypeParameter element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new TypeParameter (settings, element, parent, root);
+               SymbolNode node = new TypeParameter (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -208,7 +208,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_formal_parameter (Vala.FormalParameter element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new FormalParameter (settings, element, parent, root);
+               SymbolNode node = new FormalParameter (settings, element, parent);
                parent.add_child (node);
 
                process_children (node, element);
index f6d7061f7548b281be84be1cb3e499b10315ca85..d46aa55c173c6729c08e0d6794c778620df007de 100644 (file)
@@ -36,8 +36,8 @@ public abstract class Valadoc.Api.SymbolNode : Api.Node, SymbolAccessibility {
                }
        }
 
-       public SymbolNode (Settings settings, Vala.Symbol symbol, Api.Node parent, Tree root) {
-               base (settings, parent, root);
+       public SymbolNode (Settings settings, Vala.Symbol symbol, Api.Node parent) {
+               base (settings, parent);
                this.symbol = symbol;
        }
 
index bf349a684cba6ab55198659a8bb245112502b21e..ed7fe4d7a6be926a84bea84cbe39381866250062 100644 (file)
@@ -186,7 +186,7 @@ public class Valadoc.Tree {
                var vfile = new SourceFile (context, package_path, true);
                context.add_source_file (vfile);
 
-               Package vdpkg = new Package (this.settings, vfile, this, true);
+               Package vdpkg = new Package (this.settings, vfile, true);
                this.packages.add (vdpkg);
 
                var deps_filename = Path.build_filename (Path.get_dirname (package_path), "%s.deps".printf (pkg));
@@ -233,7 +233,7 @@ public class Valadoc.Tree {
 
 
                                        if (this.sourcefiles == null) {
-                                               this.sourcefiles = new Package (this.settings, source_file, this, false);
+                                               this.sourcefiles = new Package (this.settings, source_file, false);
                                                this.packages.add (this.sourcefiles);
                                        }
                                        else {
@@ -255,7 +255,7 @@ public class Valadoc.Tree {
                                        context.add_source_file (source_file);
                                } else if (source.has_suffix (".vapi")) {
                                        var vfile = new SourceFile (context, rpath, true);
-                                       Package vdpkg = new Package (this.settings, vfile, this); 
+                                       Package vdpkg = new Package (this.settings, vfile); 
                                        context.add_source_file (vfile);
                                        this.packages.add (vdpkg);
                                } else if (source.has_suffix (".c")) {
@@ -314,7 +314,7 @@ public class Valadoc.Tree {
 
        private void resolve_type_references () {
                foreach (Package pkg in this.packages) {
-                       pkg.resolve_type_references();
+                       pkg.resolve_type_references (this);
                }
        }
 
index 149f1736352fc6ee61a69a6132c473463de7fc62..cfb74c7da03ac14d0d6b25f4ff74a02945464744 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 
 public abstract class Valadoc.Api.TypeSymbolNode : Api.SymbolNode {
 
-       public TypeSymbolNode (Settings settings, Vala.TypeSymbol symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public TypeSymbolNode (Settings settings, Vala.TypeSymbol symbol, Api.Node parent) {
+               base (settings, symbol, parent);
        }
 
        protected override void parse_comments (DocumentationParser parser) {
index fdc1c605448c63042f6e574815cd1896ac7c33e6..1ef8ba590b559b9170dc17f9e562ff081b561d7f 100644 (file)
@@ -31,32 +31,31 @@ public class Valadoc.Array : Basic {
                get;
        }
 
-       public Array (Valadoc.Settings settings, Vala.ArrayType vtyperef, Basic parent, Tree head) {
+       public Array (Valadoc.Settings settings, Vala.ArrayType vtyperef, Basic parent) {
                this.settings = settings;
                this.vtype = vtyperef;
                this.parent = parent;
-               this.head = head;
 
                Vala.DataType vntype = vtyperef.element_type;
                if ( vntype is Vala.ArrayType )
-                       this.data_type = new Array (settings, (Vala.ArrayType)vntype, this, head);
+                       this.data_type = new Array (settings, (Vala.ArrayType)vntype, this);
                else
-                       this.data_type = new TypeReference (settings, vntype, this, head);
+                       this.data_type = new TypeReference (settings, vntype, this);
        }
 
        public void write (Langlet langlet, void* ptr, DocumentedElement parent) {
                langlet.write_array (this, ptr, parent);
        }
 
-       public void set_type_references () {
+       protected override void resolve_type_references (Tree root) {
                if ( this.data_type == null )
                        /*TODO:possible?*/;
                else if ( this.data_type is Array )
-                       ((Array)this.data_type).resolve_type_references ();
+                       ((Array)this.data_type).resolve_type_references (root);
                else if ( this.data_type is Pointer )
-                       ((Pointer)this.data_type).resolve_type_references ();
+                       ((Pointer)this.data_type).resolve_type_references (root);
                else
-                       ((TypeReference)this.data_type).resolve_type_references ();
+                       ((TypeReference)this.data_type).resolve_type_references (root);
        }
 }
 
index 5119c6cded7f2e377d69c26593568d87d0a769a7..62dd708435163ab28839615c3057c6fe6283a1f5 100644 (file)
@@ -27,8 +27,8 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
        private Gee.ArrayList<Interface> interfaces;
        private Vala.Class vclass;
 
-       public Class (Valadoc.Settings settings, Vala.Class symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Class (Valadoc.Settings settings, Vala.Class symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.interfaces = new Gee.ArrayList<Interface>();
 
                this.vclass = symbol;
@@ -80,12 +80,12 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
                visit (doclet);
        }
 
-       private void set_parent_type_references ( Gee.Collection<Vala.DataType> lst ) {
+       private void set_parent_type_references (Tree root, Gee.Collection<Vala.DataType> lst) {
                if (this.interfaces.size != 0)
                        return ;
 
                foreach ( Vala.DataType vtyperef in lst ) {
-                       Basic? element = this.head.search_vala_symbol ( vtyperef.data_type );
+                       Basic? element = root.search_vala_symbol ( vtyperef.data_type );
                        if ( element is Class ) {
                                this.base_type = (Class)element;
                        }
@@ -95,11 +95,11 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
                }
        }
 
-       protected override void resolve_type_references () {
+       protected override void resolve_type_references (Tree root) {
                var lst = this.vclass.get_base_types ();
-               this.set_parent_type_references ( lst );
+               this.set_parent_type_references (root, lst);
 
-               base.resolve_type_references ( );
+               base.resolve_type_references (root);
        }
 }
 
index cf6f873e3306d8faa00a3538183d74f324dbdbd3..90e0b33a9fc25cfcf8d58cfd4f1018f9af360710 100644 (file)
@@ -35,8 +35,8 @@ public class Valadoc.Constant : Api.MemberNode, ReturnTypeHandler {
                return ( this.vconst == vconst );
        }
 
-       public Constant (Valadoc.Settings settings, Vala.Constant symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Constant (Valadoc.Settings settings, Vala.Constant symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.vconst = symbol;
 
                var vret = this.vconst.type_reference;
@@ -47,8 +47,8 @@ public class Valadoc.Constant : Api.MemberNode, ReturnTypeHandler {
                return this.vconst.get_cname ();
        }
 
-       protected override void resolve_type_references () {
-               this.set_return_type_references ( );
+       protected override void resolve_type_references (Tree root) {
+               this.set_return_type_references (root);
        }
 
        public void visit ( Doclet doclet, ConstantHandler? parent ) {
index 445d526ec6b03a9ffb3d55b393c0b8c1c35dfb38..a1fdd4b0042052cbd25b6485a38a15e0148eee91 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Delegate : Api.TypeSymbolNode, ParameterListHandler, ReturnTypeHandler, TemplateParameterListHandler, ExceptionHandler {
        private Vala.Delegate vdelegate;
 
-       public Delegate (Valadoc.Settings settings, Vala.Delegate symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Delegate (Valadoc.Settings settings, Vala.Delegate symbol, Api.Node parent) {
+               base (settings, symbol, parent);
 
                this.vdelegate = symbol;
 
@@ -63,11 +63,11 @@ public class Valadoc.Delegate : Api.TypeSymbolNode, ParameterListHandler, Return
                }
        }
 
-       protected override void resolve_type_references () {
-               this.set_return_type_references ( );
+       protected override void resolve_type_references (Tree root) {
+               this.set_return_type_references (root);
 
                var vexceptionlst = this.vdelegate.get_error_types ();
-               this.add_exception_list ( vexceptionlst );
+               this.add_exception_list (root, vexceptionlst);
        }
 
        public void write (Langlet langlet, void* ptr) {
index 2d669b74de18cd5b91362d0b5f69c7b547becfe2..33ef0533e18e03f7b0192cd61fdeb9fc912b2850 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 
 
 public class Valadoc.Enum : Api.TypeSymbolNode, MethodHandler {
-       public Enum (Valadoc.Settings settings, Vala.Enum symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Enum (Valadoc.Settings settings, Vala.Enum symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.venum = symbol;
        }
 
index 89bd17e40bc0cc2731e30b2ce1b4b96e0ba95375..48f95019c2a3aee6574fc83928148e0395837916 100644 (file)
@@ -37,7 +37,7 @@ public interface Valadoc.EnumHandler : Api.Node {
        }
 
        public void add_enum ( Vala.Enum venum ) {
-               Enum tmp = new Enum ( this.settings, venum, this, this.head );
+               Enum tmp = new Enum (this.settings, venum, this);
                add_child (tmp);
        }
 }
index ff226344705b2fa662b1a605e612ccfedc9a8412..3a440ee605f51699256d4f021a524975d46b0b8b 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.EnumValue: Api.SymbolNode {
        private Vala.EnumValue venval;
 
-       public EnumValue (Valadoc.Settings settings, Vala.EnumValue symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public EnumValue (Valadoc.Settings settings, Vala.EnumValue symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.venval = symbol;
        }
 
index d0fa8a0b5a0d389688b774c2b80cdd3a172e3bab..a493cf62bbaa37e24414743278215aa607e35a3b 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.ErrorCode : Api.TypeSymbolNode {
        private Vala.ErrorCode verrcode;
 
-       public ErrorCode (Valadoc.Settings settings, Vala.ErrorCode symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public ErrorCode (Valadoc.Settings settings, Vala.ErrorCode symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.verrcode = symbol;
        }
 
index af4fc5b6a701845d3d47514146e2ca4595836db0..920a793fb79464bd7e2cc330e62730a272517a08 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 public class Valadoc.ErrorDomain : Api.TypeSymbolNode, MethodHandler {
        private Vala.ErrorDomain verrdom;
 
-       public ErrorDomain (Valadoc.Settings settings, Vala.ErrorDomain symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public ErrorDomain (Valadoc.Settings settings, Vala.ErrorDomain symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.verrdom = symbol;
        }
 
index 71736d45190173763e15099ebb200f4fb0f5308d..936278bd420ff58e64791d7c7b80bb21cf7eb5a6 100644 (file)
@@ -28,12 +28,12 @@ public interface Valadoc.ExceptionHandler : Api.Node {
                return get_children_by_type (Api.NodeType.ERROR_DOMAIN);
        }
 
-       public void add_exception_list (Gee.Collection<Vala.DataType> vexceptions) {
+       public void add_exception_list (Tree root, Gee.Collection<Vala.DataType> vexceptions) {
                foreach (Vala.DataType vtype in vexceptions) {
                        if (((Vala.ErrorType) vtype).error_domain == null) {
                                add_child ( glib_error );
                        } else {
-                               ErrorDomain type = (ErrorDomain) this.head.search_vala_symbol (((Vala.ErrorType) vtype).error_domain);
+                               ErrorDomain type = (ErrorDomain) root.search_vala_symbol (((Vala.ErrorType) vtype).error_domain);
                                add_child (type);
                        }
                }
index cdfaf29614d3cd0bb0d8397d4c71f154b9cb754a..df97a5094b15b0e63326ce6aa26c6e95e3d25e50 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Field : Api.MemberNode, ReturnTypeHandler {
        private Vala.Field vfield;
 
-       public Field (Valadoc.Settings settings, Vala.Field symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Field (Valadoc.Settings settings, Vala.Field symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.vfield = symbol;
 
                var vret = this.vfield.field_type;
@@ -58,10 +58,10 @@ public class Valadoc.Field : Api.MemberNode, ReturnTypeHandler {
                }
        }
 
-       protected override void resolve_type_references () {
-               this.set_return_type_references ();
+       protected override void resolve_type_references (Tree root) {
+               this.set_return_type_references (root);
 
-               base.resolve_type_references ();
+               base.resolve_type_references (root);
        }
 
        public void visit ( Doclet doclet, FieldHandler? parent ) {
index 4ac9d8371a47e53b05761109fa000fd0a91f9237..3239e45c2f0028864fee168904e08530ffa113c5 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 public class Valadoc.FormalParameter : Api.SymbolNode, ReturnTypeHandler {
        private Vala.FormalParameter vformalparam;
 
-       public FormalParameter (Valadoc.Settings settings, Vala.FormalParameter symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public FormalParameter (Valadoc.Settings settings, Vala.FormalParameter symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.vformalparam = symbol;
 
                var vformparam = this.vformalparam.parameter_type;
@@ -66,13 +66,13 @@ public class Valadoc.FormalParameter : Api.SymbolNode, ReturnTypeHandler {
        public override void accept (Doclet doclet) {
        }
 
-       protected override void resolve_type_references () {
+       protected override void resolve_type_references (Tree root) {
                if (this.vformalparam.ellipsis)
                        return ;
 
-               this.set_return_type_references ();
+               this.set_return_type_references (root);
 
-               base.resolve_type_references ();
+               base.resolve_type_references (root);
        }
 
        public void write ( Langlet langlet, void* ptr ) {
index 43f90a8ea8f0e22c8ccece565bd07e8c82b7e039..2ad85cadb9171fcb6f9450f43fa327f1e47f502f 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 
 
 public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler, MethodHandler, DelegateHandler, EnumHandler, StructHandler, ClassHandler {
-       public Interface (Valadoc.Settings settings, Vala.Interface symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Interface (Valadoc.Settings settings, Vala.Interface symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.vinterface = symbol;
        }
 
@@ -63,12 +63,12 @@ public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHand
                langlet.write_interface ( this, ptr );
        }
 
-       private void set_prerequisites ( Gee.Collection<Vala.DataType> lst ) {
+       private void set_prerequisites (Tree root, Gee.Collection<Vala.DataType> lst) {
                if ( ((Gee.Collection)this.interfaces).size != 0 )
                        return ;
 
                foreach ( Vala.DataType vtyperef in lst ) {
-                       Basic? element = this.head.search_vala_symbol ( vtyperef.data_type );
+                       Basic? element = root.search_vala_symbol ( vtyperef.data_type );
                        if ( element is Class )
                                this.base_type = (Class)element;
                        else
@@ -76,11 +76,11 @@ public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHand
                }
        }
 
-       protected override void resolve_type_references () {
-               var lst = this.vinterface.get_prerequisites ( );
-               this.set_prerequisites ( lst );
+       protected override void resolve_type_references (Tree root) {
+               var lst = this.vinterface.get_prerequisites ();
+               this.set_prerequisites (root, lst);
 
-               base.resolve_type_references ();
+               base.resolve_type_references (root);
        }
 }
 
index 2845c042d65f4bcdda67646b7fca958cd6f71507..9b511de3410c0ff2ccf13158dc4825bb87e8d611 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHandler, TemplateParameterListHandler, ReturnTypeHandler {
        private Vala.Method vmethod;
 
-       public Method (Valadoc.Settings settings, Vala.Method symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Method (Valadoc.Settings settings, Vala.Method symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.vmethod = symbol;
 
                var vret = this.vmethod.return_type;
@@ -107,7 +107,7 @@ public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHan
                }
        }
 
-       protected override void resolve_type_references () {
+       protected override void resolve_type_references (Tree root) {
                Vala.Method? vm = null;
                if (vmethod.base_method != null) {
                        vm = vmethod.base_method;
@@ -118,15 +118,15 @@ public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHan
                        vm = vmethod.base_interface_method;
                }
                if (vm != null) {
-                       this.base_method = (Method?) this.head.search_vala_symbol (vm);
+                       this.base_method = (Method?) root.search_vala_symbol (vm);
                }
 
                var vexceptionlst = this.vmethod.get_error_types ();
-               this.add_exception_list ( vexceptionlst );
+               this.add_exception_list (root, vexceptionlst);
 
-               this.set_return_type_references ();
+               this.set_return_type_references (root);
 
-               base.resolve_type_references ( );
+               base.resolve_type_references (root);
        }
 
        public void visit ( Doclet doclet, Valadoc.MethodHandler in_type ) {
index 67f777f688f291ca32454f299737376167ed4e8f..8546da25fe2b97c0048aa122d801d048b07250f7 100644 (file)
@@ -29,8 +29,8 @@ public class Valadoc.Namespace : Api.SymbolNode, MethodHandler, FieldHandler, Na
 {
        private Comment source_comment;
 
-       public Namespace (Valadoc.Settings settings, Vala.Namespace symbol, NamespaceHandler parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Namespace (Valadoc.Settings settings, Vala.Namespace symbol, NamespaceHandler parent) {
+               base (settings, symbol, parent);
 
                this.vnspace = symbol;
 
index d08b4e474eb4ff2fa7f5b01d994f40ec298bc1ae..8f8ba69c79ea530696f33bfb0ba65dc25b7f37d6 100644 (file)
@@ -47,7 +47,7 @@ public interface Valadoc.NamespaceHandler : Api.Node {
 
                Namespace ns = this.find_namespace_without_childs ( vns );
                if ( ns == null ) {
-                       ns = new Namespace( this.settings, vns, this, this.head );
+                       ns = new Namespace (this.settings, vns, this);
                        add_child ( ns );
                }
 
@@ -74,7 +74,7 @@ public interface Valadoc.NamespaceHandler : Api.Node {
                        return this.get_namespace_helper ( node, vnspaces, 1 );
                }
                else {
-                       var ns = new Namespace( this.settings, vnspace, this, this.head );
+                       var ns = new Namespace (this.settings, vnspace, this);
                        add_child ( ns );
                        return ns;
                }
index 088ebcec5eb39c581ba40d681750467a5ba4d03d..0b99a3cef6656a2f9daa0a380627c93ed44bd809 100644 (file)
@@ -85,8 +85,8 @@ public class Valadoc.Package : Api.Node, NamespaceHandler {
                }
        }
 
-       public Package.with_name (Valadoc.Settings settings, Vala.SourceFile vfile, string name, Tree root, bool is_package = false) {
-               base (settings, null, root);
+       public Package.with_name (Valadoc.Settings settings, Vala.SourceFile vfile, string name, bool is_package = false) {
+               base (settings, null);
                this.is_package = is_package;
 
                this.package_name = name;
@@ -95,8 +95,8 @@ public class Valadoc.Package : Api.Node, NamespaceHandler {
                this.parent = null;
        }
 
-       public Package (Valadoc.Settings settings, Vala.SourceFile vfile, Tree head, bool is_package = false) {
-               this.with_name (settings, vfile, this.extract_package_name (settings, vfile), head, is_package);
+       public Package (Valadoc.Settings settings, Vala.SourceFile vfile, bool is_package = false) {
+               this.with_name (settings, vfile, this.extract_package_name (settings, vfile), is_package);
        }
 
        private string package_name;
index 8358d34a22221e0879411fce13f1acf9e67c5c10..be693b7c093fc8c1fa3d7ebdc8f577a19bb11af9 100644 (file)
@@ -32,35 +32,34 @@ public class Valadoc.Pointer : Basic {
                get;
        }
 
-       public Pointer (Valadoc.Settings settings, Vala.PointerType vtyperef, Basic parent, Tree head) {
+       public Pointer (Valadoc.Settings settings, Vala.PointerType vtyperef, Basic parent) {
                this.settings = settings;
                this.vtype = vtyperef;
                this.parent = parent;
-               this.head = head;
 
                Vala.DataType vntype = vtype.base_type;
                if (vntype is Vala.PointerType)
-                       this.data_type = new Pointer (settings, (Vala.PointerType)vntype, this, head);
+                       this.data_type = new Pointer (settings, (Vala.PointerType) vntype, this);
                else if (vntype is Vala.ArrayType)
-                       this.data_type = new Array (settings, (Vala.ArrayType)vntype, this, head);
+                       this.data_type = new Array (settings, (Vala.ArrayType) vntype, this);
                else
-                       this.data_type = new TypeReference (settings, vntype, this, head);
+                       this.data_type = new TypeReference (settings, vntype, this);
        }
 
        public void write (Langlet langlet, void* ptr, DocumentedElement parent) {
                langlet.write_pointer (this, ptr, parent);
        }
 
-       protected override void resolve_type_references () {
+       protected override void resolve_type_references (Tree root) {
                Basic type = this.data_type;
                if ( type == null )
                        ;
                else if ( type is Array )
-                       ((Array)type).resolve_type_references ();
+                       ((Array) type).resolve_type_references (root);
                else if ( type is Pointer )
-                       ((Pointer)type ).resolve_type_references ();
+                       ((Pointer) type ).resolve_type_references (root);
                else
-                       ((TypeReference)type).resolve_type_references ();
+                       ((TypeReference) type).resolve_type_references (root);
        }
 }
 
index 01eacc685df1c55d32e0db2713edae4e71f72bea..8ba2768efebdc34568fcc184ac3e1490d70a64a6 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
        private Vala.Property vproperty;
 
-       public Property (Valadoc.Settings settings, Vala.Property symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Property (Valadoc.Settings settings, Vala.Property symbol, Api.Node parent) {
+               base (settings, symbol, parent);
 
                this.vproperty = symbol;
 
@@ -35,11 +35,11 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
                this.set_ret_type (ret);
 
                if (this.vproperty.get_accessor != null) {
-                       this.getter = new PropertyAccessor (this.settings, this.vproperty.get_accessor, this, this.head);
+                       this.getter = new PropertyAccessor (this.settings, this.vproperty.get_accessor, this);
                }
 
                if (this.vproperty.set_accessor != null) {
-                       this.setter = new PropertyAccessor (this.settings, this.vproperty.set_accessor, this, this.head);
+                       this.setter = new PropertyAccessor (this.settings, this.vproperty.set_accessor, this);
                }
        }
 
@@ -94,7 +94,7 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
        }
 
 
-       protected override void resolve_type_references () {
+       protected override void resolve_type_references (Tree root) {
                Vala.Property? vp = null;
                if (vproperty.base_property != null) {
                        vp = vproperty.base_property;
@@ -105,9 +105,9 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
                        vp = vproperty.base_interface_property;
                }
                if (vp != null) {
-                       this.base_property = (Property?) this.head.search_vala_symbol (vp);
+                       this.base_property = (Property?) root.search_vala_symbol (vp);
                }
-               this.set_return_type_references ( );
+               this.set_return_type_references (root);
        }
 
        public void visit (Doclet doclet) {
index 02d0f3016adabcace2d3df47001b0be66f979a69..49b23b6524441e715ac99aa3500f977402ec07ad 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.PropertyAccessor : Api.SymbolNode {
        private Vala.PropertyAccessor vpropacc;
 
-       public PropertyAccessor (Valadoc.Settings settings, Vala.PropertyAccessor symbol, Property parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public PropertyAccessor (Valadoc.Settings settings, Vala.PropertyAccessor symbol, Property parent) {
+               base (settings, symbol, parent);
                this.vpropacc = symbol;
        }
 
index bc3b5b2f6f6919af292ede06be0ad73fe58cfddd..5f157234459fa5c919320605b1b432c93e521e0e 100644 (file)
@@ -27,16 +27,16 @@ public interface Valadoc.ReturnTypeHandler : Basic {
                get;
        }
 
-       internal void set_return_type_references () {
+       internal void set_return_type_references (Tree root) {
                if ( this.type_reference == null )
                        return ;
 
-               this.type_reference.resolve_type_references ();
+               this.type_reference.resolve_type_references (root);
        }
 
        // rename
        internal void set_ret_type ( Vala.DataType? vtref ) {
-               var tmp = new TypeReference ( this.settings, vtref, this, this.head );
+               var tmp = new TypeReference (this.settings, vtref, this);
                this.type_reference = tmp;
        }
 }
index c59d8c1c9c8508bf4b3505b563e390b440ab8c98..ba3b73b8f1abe9a94be46471b78a5a0aa1c59303 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Signal : Api.MemberNode, ParameterListHandler, ReturnTypeHandler {
        private Vala.Signal vsignal;
 
-       public Signal (Valadoc.Settings settings, Vala.Signal symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Signal (Valadoc.Settings settings, Vala.Signal symbol, Api.Node parent) {
+               base (settings, symbol, parent);
 
                this.vsignal = symbol;
 
@@ -44,10 +44,10 @@ public class Valadoc.Signal : Api.MemberNode, ParameterListHandler, ReturnTypeHa
                get;
        }
 
-       protected override void resolve_type_references () {
-               this.set_return_type_references ( );
+       protected override void resolve_type_references (Tree root) {
+               this.set_return_type_references (root);
 
-               base.resolve_type_references ( );
+               base.resolve_type_references (root);
        }
 
        public bool is_virtual {
index f5c4b7511308b2d321dd8b1d7d14453120a9e89c..786460cd134ba41cca4969b76133303ad1a0002f 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMethodHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler {
        private Vala.Struct vstruct;
 
-       public Struct (Valadoc.Settings settings, Vala.Struct symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public Struct (Valadoc.Settings settings, Vala.Struct symbol, Api.Node parent) {
+               base (settings, symbol, parent);
                this.vstruct = symbol;
        }
 
@@ -57,18 +57,18 @@ public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMet
                langlet.write_struct (this, ptr);
        }
 
-       private void set_parent_references ( ) {
-               Vala.ValueType? basetype = (Vala.ValueType?)this.vstruct.base_type;
+       private void set_parent_references (Tree root) {
+               Vala.ValueType? basetype = this.vstruct.base_type as Vala.ValueType;
                if (basetype == null)
                        return ;
 
-               this.base_type = (Struct?)this.head.search_vala_symbol ( (Vala.Struct)basetype.type_symbol );
+               this.base_type = (Struct?) root.search_vala_symbol ((Vala.Struct) basetype.type_symbol);
        }
 
-       protected override void resolve_type_references () {
-               this.set_parent_references ( );
+       protected override void resolve_type_references (Tree root) {
+               this.set_parent_references (root);
 
-               base.resolve_type_references ( );
+               base.resolve_type_references (root);
        }
 }
 
index 67116c6154b256f137397bbb60b95f1501cce83d..607a38431290b8eeea8e4fa0415dd1608473387e 100644 (file)
@@ -25,8 +25,8 @@ using Gee;
 
 public class Valadoc.TypeParameter : Api.SymbolNode, ReturnTypeHandler {
 
-       public TypeParameter (Valadoc.Settings settings, Vala.TypeParameter symbol, Api.Node parent, Tree root) {
-               base (settings, symbol, parent, root);
+       public TypeParameter (Valadoc.Settings settings, Vala.TypeParameter symbol, Api.Node parent) {
+               base (settings, symbol, parent);
        }
 
        public TypeReference? type_reference {
index c17a6b72ee7f85daa6b089332624d05dff597d58..86e1a9860d56c8f7f626463d80148a8fa9568c29 100644 (file)
@@ -27,21 +27,20 @@ public class Valadoc.TypeReference : Basic {
        private Gee.ArrayList<TypeReference> type_arguments = new Gee.ArrayList<TypeReference> ();
        private Vala.DataType? vtyperef;
 
-       public TypeReference ( Valadoc.Settings settings, Vala.DataType? vtyperef, Basic parent, Tree head ) {
+       public TypeReference (Valadoc.Settings settings, Vala.DataType? vtyperef, Basic parent) {
                this.settings = settings;
                this.vtyperef = vtyperef;
                this.parent = parent;
-               this.head = head;
        }
 
        public Gee.Collection<TypeReference> get_type_arguments ( ) {
                return this.type_arguments.read_only_view;
        }
 
-       private void set_template_argument_list ( Gee.Collection<Vala.DataType> varguments ) {
+       private void set_template_argument_list (Tree root, Gee.Collection<Vala.DataType> varguments) {
                foreach ( Vala.DataType vdtype in varguments ) {
-                       var dtype = new TypeReference ( this.settings, vdtype, this, this.head );
-                       dtype.resolve_type_references ( );
+                       var dtype = new TypeReference (this.settings, vdtype, this);
+                       dtype.resolve_type_references (root);
                        this.type_arguments.add ( dtype );
                }
        }
@@ -185,41 +184,41 @@ public class Valadoc.TypeReference : Basic {
                }
        }
 
-       protected override void resolve_type_references () {
+       protected override void resolve_type_references (Tree root) {
                if ( this.vtyperef != null ) {
                        if ( this.vtyperef is PointerType )
-                               this.data_type = new Pointer ( settings, (Vala.PointerType)this.vtyperef, this, head );
+                               this.data_type = new Pointer (settings, (Vala.PointerType) this.vtyperef, this);
                        else if ( vtyperef is ArrayType )
-                               this.data_type = new Array ( settings, (Vala.ArrayType)this.vtyperef, this, head );
+                               this.data_type = new Array (settings, (Vala.ArrayType) this.vtyperef, this);
                        else if ( vtyperef is GenericType )
-                                this.data_type = (TypeParameter) this.head.search_vala_symbol (((Vala.ArrayType) this.vtyperef).type_parameter);
+                                this.data_type = (TypeParameter) root.search_vala_symbol (((Vala.GenericType) this.vtyperef).type_parameter);
                }
 
 
                if ( this.data_type == null ) {
                        Vala.DataType vtype = this.vtyperef;
-                       this.set_template_argument_list ( vtype.get_type_arguments ()  );
+                       this.set_template_argument_list (root, vtype.get_type_arguments ());
                        // still necessary?
                        if ( vtype is Vala.ErrorType ) {
                                Vala.ErrorDomain verrdom = ((Vala.ErrorType)vtype).error_domain;
                                if ( verrdom != null )
-                                       this.data_type = this.head.search_vala_symbol ( verrdom );
+                                       this.data_type = root.search_vala_symbol ( verrdom );
                                else
                                        this.data_type = glib_error;
                        }
                        // necessary?
                        else if (vtype is Vala.DelegateType ) {
-                               this.data_type = this.head.search_vala_symbol ( ((Vala.DelegateType)vtype).delegate_symbol );
+                               this.data_type = root.search_vala_symbol ( ((Vala.DelegateType)vtype).delegate_symbol );
                        }
                        else {
-                               this.data_type = this.head.search_vala_symbol ( vtype.data_type );
+                               this.data_type = root.search_vala_symbol ( vtype.data_type );
                        }
                }
                else if ( this.data_type is Pointer ) {
-                       ((Pointer)this.data_type).resolve_type_references ();
+                       ((Pointer)this.data_type).resolve_type_references (root);
                }
                else if ( this.data_type is Array ) {
-                       ((Array)this.data_type).resolve_type_references ();
+                       ((Array)this.data_type).resolve_type_references (root);
                }
        }