using Valadoc.Content;
public class Valadoc.Api.Constant : Member {
- private Vala.Constant vconst;
-
- public TypeReference? type_reference {
- protected set;
- get;
- }
-
- public bool is_vconstant (Vala.Constant vconst) {
- return (this.vconst == vconst);
- }
+ public TypeReference type_reference { private set; get; }
public Constant (Vala.Constant symbol, Node parent) {
base (symbol, parent);
- this.vconst = symbol;
-
type_reference = new TypeReference (symbol.type_reference, this);
}
public string get_cname () {
- return this.vconst.get_cname ();
+ return ((Vala.Constant) symbol).get_cname ();
}
protected override void resolve_type_references (Tree root) {
using Valadoc.Content;
public class Valadoc.Api.Delegate : TypeSymbol {
- private Vala.Delegate vdelegate;
-
public Delegate (Vala.Delegate symbol, Node parent) {
base (symbol, parent);
-
- this.vdelegate = symbol;
-
- type_reference = new TypeReference (symbol.return_type, this);
+ return_type = new TypeReference (symbol.return_type, this);
}
public string? get_cname () {
- return this.vdelegate.get_cname ();
+ return ((Vala.Delegate) symbol).get_cname ();
}
- public TypeReference? type_reference {
- protected set;
- get;
- }
+ public TypeReference? return_type { private set; get; }
public override NodeType node_type { get { return NodeType.DELEGATE; } }
public bool is_static {
get {
- return this.vdelegate.has_target;
+ return ((Vala.Delegate) symbol).has_target;
}
}
protected override void resolve_type_references (Tree root) {
- type_reference.resolve_type_references (root);
+ return_type.resolve_type_references (root);
base.resolve_type_references (root);
}
signature.append_keyword ("static");
}
- signature.append_content (type_reference.signature);
+ signature.append_content (return_type.signature);
signature.append_symbol (this);
var type_parameters = get_children_by_type (NodeType.TYPE_PARAMETER);
public class Valadoc.Api.Enum : TypeSymbol {
public Enum (Vala.Enum symbol, Node parent) {
base (symbol, parent);
- this.venum = symbol;
}
public string? get_cname () {
- return this.venum.get_cname();
+ return ((Vala.Enum) symbol).get_cname ();
}
public override NodeType node_type { get { return NodeType.ENUM; } }
visitor.visit_enum (this);
}
- private Vala.Enum venum;
-
protected override Inline build_signature () {
return new SignatureBuilder ()
.append_keyword (get_accessibility_modifier ())
using Valadoc.Content;
public class Valadoc.Api.EnumValue: Symbol {
- private Vala.EnumValue venval;
-
public EnumValue (Vala.EnumValue symbol, Node parent) {
base (symbol, parent);
- this.venval = symbol;
}
protected override void process_comments (Settings settings, DocumentationParser parser) {
}
public string get_cname () {
- return this.venval.get_cname ();
- }
-
- public bool is_venumvalue (Vala.EnumValue venval) {
- return this.venval == venval;
+ return ((Vala.EnumValue) symbol).get_cname ();
}
public override NodeType node_type { get { return NodeType.ENUM_VALUE; } }
return new SignatureBuilder ()
.append_symbol (this)
.append ("=")
- .append (this.venval.value.to_string ())
+ .append (((Vala.EnumValue) symbol).value.to_string ())
.get ();
}
}
+
using Valadoc.Content;
public class Valadoc.Api.ErrorCode : TypeSymbol {
- private Vala.ErrorCode verrcode;
-
public ErrorCode (Vala.ErrorCode symbol, Node parent) {
base (symbol, parent);
- this.verrcode = symbol;
}
public string get_cname () {
- return this.verrcode.get_cname ();
- }
-
- public bool is_verrorcode (Vala.ErrorCode verrcode) {
- return this.verrcode == verrcode;
+ return ((Vala.ErrorCode) symbol).get_cname ();
}
public override NodeType node_type { get { return NodeType.ERROR_CODE; } }
.get ();
}
}
+
public class Valadoc.Api.ErrorDomain : TypeSymbol {
- private Vala.ErrorDomain verrdom;
-
public ErrorDomain (Vala.ErrorDomain symbol, Node parent) {
base (symbol, parent);
- this.verrdom = symbol;
}
public string? get_cname () {
- return this.verrdom.get_cname();
+ return ((Vala.ErrorDomain) symbol).get_cname();
}
public override NodeType node_type { get { return NodeType.ERROR_DOMAIN; } }
using Valadoc.Content;
public class Valadoc.Api.Field : Member {
- private Vala.Field vfield;
-
public Field (Vala.Field symbol, Node parent) {
base (symbol, parent);
- this.vfield = symbol;
-
- type_reference = new TypeReference (symbol.field_type, this);
+ field_type = new TypeReference (symbol.field_type, this);
}
public string? get_cname () {
- return this.vfield.get_cname();
+ return ((Vala.Field) symbol).get_cname();
}
- public TypeReference? type_reference {
- protected set;
- get;
- }
+ public TypeReference? field_type { private set; get; }
public bool is_static {
get {
return false;
}
- return this.vfield.binding == MemberBinding.STATIC;
+ return ((Vala.Field) symbol).binding == MemberBinding.STATIC;
}
}
public bool is_volatile {
get {
- return this.vfield.is_volatile;
+ return ((Vala.Field) symbol).is_volatile;
}
}
protected override void resolve_type_references (Tree root) {
- type_reference.resolve_type_references (root);
+ field_type.resolve_type_references (root);
base.resolve_type_references (root);
}
signature.append_keyword ("volatile");
}
- signature.append_content (type_reference.signature);
+ signature.append_content (field_type.signature);
signature.append_symbol (this);
return signature.get ();
}
using Valadoc.Content;
public class Valadoc.Api.FormalParameter : Symbol {
- private Vala.FormalParameter vformalparam;
-
public FormalParameter (Vala.FormalParameter symbol, Node parent) {
base (symbol, parent);
- this.vformalparam = symbol;
-
- type_reference = new TypeReference (symbol.parameter_type, this);
+ parameter_type = new TypeReference (symbol.parameter_type, this);
}
public bool is_out {
get {
- return this.vformalparam.direction == Vala.ParameterDirection.OUT;
+ return ((Vala.FormalParameter) symbol).direction == Vala.ParameterDirection.OUT;
}
}
public bool is_ref {
get {
- return this.vformalparam.direction == Vala.ParameterDirection.REF;
+ return ((Vala.FormalParameter) symbol).direction == Vala.ParameterDirection.REF;
}
}
public bool has_default_value {
get {
- return this.vformalparam.default_expression != null;
+ return ((Vala.FormalParameter) symbol).default_expression != null;
}
}
- public TypeReference? type_reference {
- protected set;
- get;
- }
+ public TypeReference? parameter_type { private set; get; }
public bool ellipsis {
get {
- return this.vformalparam.ellipsis;
+ return ((Vala.FormalParameter) symbol).ellipsis;
}
}
}
protected override void resolve_type_references (Tree root) {
- if (this.vformalparam.ellipsis) {
+ if (ellipsis) {
return;
}
- type_reference.resolve_type_references (root);
+ parameter_type.resolve_type_references (root);
base.resolve_type_references (root);
}
signature.append_keyword ("ref");
}
- signature.append_content (type_reference.signature);
+ signature.append_content (parameter_type.signature);
signature.append (name);
if (has_default_value) {
signature.append ("=");
- signature.append (this.vformalparam.default_expression.to_string ());
+ signature.append (((Vala.FormalParameter) symbol).default_expression.to_string ());
}
}
public class Valadoc.Api.Interface : TypeSymbol {
public Interface (Vala.Interface symbol, Node parent) {
base (symbol, parent);
- this.vinterface = symbol;
}
private ArrayList<TypeReference> interfaces = new ArrayList<TypeReference> ();
}
public string? get_cname () {
- return this.vinterface.get_cname ();
+ return ((Vala.Interface) symbol).get_cname ();
}
- protected TypeReference? base_type {
- private set;
- get;
- }
-
- private Vala.Interface vinterface;
+ protected TypeReference? base_type { private set; get; }
public override NodeType node_type { get { return NodeType.INTERFACE; } }
}
protected override void resolve_type_references (Tree root) {
- var lst = this.vinterface.get_prerequisites ();
- this.set_prerequisites (root, lst);
+ var prerequisites = ((Vala.Interface) symbol).get_prerequisites ();
+ this.set_prerequisites (root, prerequisites);
base.resolve_type_references (root);
}
public abstract class Valadoc.Api.Item : Object {
private Inline _signature;
- public Item parent {
- protected set;
- get;
- }
+ public Item parent { protected set; get; }
protected virtual void resolve_type_references (Tree root) {
}
protected abstract Inline build_signature ();
}
+
using Valadoc.Content;
public class Valadoc.Api.Method : Member {
- private Vala.Method vmethod;
-
public Method (Vala.Method symbol, Node parent) {
base (symbol, parent);
- this.vmethod = symbol;
-
- type_reference = new TypeReference (symbol.return_type, this);
+ return_type = new TypeReference (symbol.return_type, this);
}
public string? get_cname () {
- return this.vmethod.get_cname ();
+ return ((Vala.Method) symbol).get_cname ();
}
- public Method? base_method {
- private set;
- get;
- }
+ public Method? base_method { private set; get; }
- public TypeReference? type_reference {
- protected set;
- get;
- }
+ public TypeReference? return_type { private set; get; }
public bool is_yields {
get {
- return this.vmethod.coroutine;
+ return ((Vala.Method) symbol).coroutine;
}
}
public bool is_abstract {
get {
- return this.vmethod.is_abstract;
+ return ((Vala.Method) symbol).is_abstract;
}
}
public bool is_virtual {
get {
- return this.vmethod.is_virtual;
+ return ((Vala.Method) symbol).is_virtual;
}
}
public bool is_override {
get {
- return this.vmethod.overrides;
+ return ((Vala.Method) symbol).overrides;
}
}
public bool is_static {
get {
- if (this.parent is Namespace || this.is_constructor) {
+ if (this.parent is Namespace || is_constructor) {
return false;
}
- return this.vmethod.binding == MemberBinding.STATIC;
+ return ((Vala.Method) symbol).binding == MemberBinding.STATIC;
}
}
public bool is_constructor {
get {
- return ( this.vmethod is Vala.CreationMethod );
+ return symbol is Vala.CreationMethod;
}
}
public bool is_inline {
get {
- return this.vmethod.is_inline;
+ return ((Vala.Method) symbol).is_inline;
}
}
public override string? name {
owned get {
if (this.is_constructor) {
- if (this.vmethod.name == ".new") {
- return ((Node)this.parent).name;
+ if (symbol.name == ".new") {
+ return ((Node) parent).name;
} else {
- return ((Node)this.parent).name + "." + this.vmethod.name;
+ return ((Node) parent).name + "." + symbol.name;
}
}
else {
- return this.vmethod.name;
+ return symbol.name;
}
}
}
protected override void resolve_type_references (Tree root) {
- Vala.Method? vm = null;
- if (vmethod.base_method != null) {
- vm = vmethod.base_method;
- } else if (vmethod.base_interface_method != null) {
- vm = vmethod.base_interface_method;
+ Vala.Method vala_method = symbol as Vala.Method;
+ Vala.Method? base_vala_method = null;
+ if (vala_method.base_method != null) {
+ base_vala_method = vala_method.base_method;
+ } else if (vala_method.base_interface_method != null) {
+ base_vala_method = vala_method.base_interface_method;
}
- if (vm == vmethod && vmethod.base_interface_method != null) {
- vm = vmethod.base_interface_method;
+ if (base_vala_method == vala_method
+ && vala_method.base_interface_method != null) {
+ base_vala_method = vala_method.base_interface_method;
}
- if (vm != null) {
- this.base_method = (Method?) root.search_vala_symbol (vm);
+ if (base_vala_method != null) {
+ this.base_method = (Method?) root.search_vala_symbol (base_vala_method);
}
- type_reference.resolve_type_references (root);
+ return_type.resolve_type_references (root);
base.resolve_type_references (root);
}
signature.append_keyword ("async");
}
- signature.append_content (type_reference.signature);
+ signature.append_content (return_type.signature);
signature.append_symbol (this);
var type_parameters = get_children_by_type (NodeType.TYPE_PARAMETER, false);
public Namespace (Vala.Namespace symbol, Api.Node parent) {
base (symbol, parent);
- this.vnspace = symbol;
-
- if (vnspace.source_reference != null) {
- foreach (Vala.Comment c in vnspace.get_comments()) {
- if (this.package.is_vpackage (c.source_reference.file)) {
- this.source_comment = c;
+ if (symbol.source_reference != null) {
+ foreach (Vala.Comment c in symbol.get_comments()) {
+ if (package.is_package_for_file (c.source_reference.file)) {
+ source_comment = c;
break;
}
}
public override void accept (Visitor visitor) {
visitor.visit_namespace (this);
}
-
- public Vala.Namespace vnspace {
- private get;
- set;
- }
}
private Namespace? _nspace = null;
private Package? _package = null;
private string _full_name = null;
- private int _line = -1;
public Namespace? nspace {
get {
}
}
- internal bool is_vpackage (Vala.SourceFile vfile) {
- return this.vfiles.contains (vfile);
- }
-
internal bool is_package_for_file (Vala.SourceFile source_file) {
return this.vfiles.contains (source_file);
}
using Valadoc.Content;
public class Valadoc.Api.Property : Member {
- private Vala.Property vproperty;
-
public Property (Vala.Property symbol, Node parent) {
base (symbol, parent);
- this.vproperty = symbol;
-
- type_reference = new TypeReference (symbol.property_type, this);
+ property_type = new TypeReference (symbol.property_type, this);
- if (this.vproperty.get_accessor != null) {
- this.getter = new PropertyAccessor (this.vproperty.get_accessor, this);
+ if (symbol.get_accessor != null) {
+ this.getter = new PropertyAccessor (symbol.get_accessor, this);
}
- if (this.vproperty.set_accessor != null) {
- this.setter = new PropertyAccessor (this.vproperty.set_accessor, this);
+ if (symbol.set_accessor != null) {
+ this.setter = new PropertyAccessor (symbol.set_accessor, this);
}
}
- public bool is_vproperty (Vala.Property vprop) {
- return (this.vproperty == vprop);
- }
-
public string? get_cname () {
- return this.vproperty.nick;
- }
-
- public bool equals (Property p) {
- return this.vproperty.equals (p.vproperty);
+ return ((Vala.Property) symbol).nick;
}
- public TypeReference? type_reference {
- protected set;
- get;
- }
+ public TypeReference? property_type { private set; get;}
public bool is_virtual {
get {
- return this.vproperty.is_virtual;
+ return ((Vala.Property) symbol).is_virtual;
}
}
public bool is_abstract {
get {
- return this.vproperty.is_abstract;
+ return ((Vala.Property) symbol).is_abstract;
}
}
public bool is_override {
get {
- return this.vproperty.overrides;
+ return ((Vala.Property) symbol).overrides;
}
}
- public PropertyAccessor setter {
- private set;
- get;
- }
+ public PropertyAccessor setter { private set; get; }
- public PropertyAccessor getter {
- private set;
- get;
- }
+ public PropertyAccessor getter { private set; get; }
- public Property base_property {
- private set;
- get;
- }
+ public Property base_property { private set; get; }
protected override void resolve_type_references (Tree root) {
- Vala.Property? vp = null;
- if (vproperty.base_property != null) {
- vp = vproperty.base_property;
- } else if (vproperty.base_interface_property != null) {
- vp = vproperty.base_interface_property;
+ Vala.Property vala_property = symbol as Vala.Property;
+ Vala.Property? base_vala_property = null;
+ if (vala_property.base_property != null) {
+ base_vala_property = vala_property.base_property;
+ } else if (vala_property.base_interface_property != null) {
+ base_vala_property = vala_property.base_interface_property;
}
- if (vp == vproperty && vproperty.base_interface_property != null) {
- vp = vproperty.base_interface_property;
+ if (base_vala_property == vala_property
+ && vala_property.base_interface_property != null) {
+ base_vala_property = vala_property.base_interface_property;
}
- if (vp != null) {
- this.base_property = (Property?) root.search_vala_symbol (vp);
+ if (base_vala_property != null) {
+ base_property = (Property?) root.search_vala_symbol (base_vala_property);
}
- type_reference.resolve_type_references (root);
+ property_type.resolve_type_references (root);
}
protected override Inline build_signature () {
signature.append_keyword ("virtual");
}
- signature.append_content (type_reference.signature);
+ signature.append_content (property_type.signature);
signature.append_symbol (this);
signature.append ("{");
using Valadoc.Content;
public class Valadoc.Api.Signal : Member {
- private Vala.Signal vsignal;
-
public Signal (Vala.Signal symbol, Node parent) {
base (symbol, parent);
-
- this.vsignal = symbol;
-
- type_reference = new TypeReference (symbol.return_type, this);
+ return_type = new TypeReference (symbol.return_type, this);
}
public string? get_cname () {
- return this.vsignal.get_cname();
+ return ((Vala.Signal) symbol).get_cname();
}
- public TypeReference? type_reference {
- protected set;
- get;
- }
+ public TypeReference? return_type { protected set; get; }
protected override void resolve_type_references (Tree root) {
- type_reference.resolve_type_references (root);
+ return_type.resolve_type_references (root);
base.resolve_type_references (root);
}
public bool is_virtual {
get {
- return this.vsignal.is_virtual;
+ return ((Vala.Signal) symbol).is_virtual;
}
}
signature.append_keyword ("virtual");
}
- signature.append_content (type_reference.signature);
+ signature.append_content (return_type.signature);
signature.append_symbol (this);
signature.append ("(");
using Valadoc.Content;
public class Valadoc.Api.Struct : TypeSymbol {
- private Vala.Struct vstruct;
-
public Struct (Vala.Struct symbol, Node parent) {
base (symbol, parent);
- this.vstruct = symbol;
}
- protected TypeReference? base_type {
- protected set;
- get;
- }
+ protected TypeReference? base_type { private set; get; }
public string? get_cname () {
- return this.vstruct.get_cname();
+ return ((Vala.Struct) symbol).get_cname();
}
public override NodeType node_type { get { return NodeType.STRUCT; } }
}
private void set_parent_references (Tree root) {
- Vala.ValueType? basetype = this.vstruct.base_type as Vala.ValueType;
+ Vala.ValueType? basetype = ((Vala.Struct) symbol).base_type as Vala.ValueType;
if (basetype == null) {
return ;
}
public abstract class Valadoc.Api.Symbol : Node, SymbolAccessibility {
protected Vala.Symbol symbol { private set; get; }
- // TODO Drop DocumentedElement
- /* protected Vala.Comment vcomment { private set; get; } */
public override string? name {
owned get {
using Gee;
-
public interface Valadoc.Api.SymbolAccessibility {
public abstract bool is_public { get; }
}
/* default packages */
- if (!this.add_package ("glib-2.0")) {
+ if (!this.add_package ("glib-2.0")) { //
Vala.Report.error (null, "glib-2.0 not found in specified Vala API directories");
}
- if (!this.add_package ("gobject-2.0")) {
+ if (!this.add_package ("gobject-2.0")) { //
Vala.Report.error (null, "gobject-2.0 not found in specified Vala API directories");
}
}
return true;
}
- internal Package? find_file (Vala.SourceFile vfile) {
+ private Package? find_package_for_file (Vala.SourceFile vfile) {
foreach (Package pkg in this.packages) {
- if (pkg.is_vpackage(vfile))
+ if (pkg.is_package_for_file (vfile))
return pkg;
}
return null;
internal Symbol? search_vala_symbol (Vala.Symbol symbol) {
Vala.SourceFile source_file = symbol.source_reference.file;
- Package package = this.find_file (source_file);
+ Package package = find_package_for_file (source_file);
return search_vala_symbol_in (symbol, package);
}
}
return (Symbol) node;
}
-
- private Package? get_external_package_by_name (string name) {
- foreach (Package pkg in this.packages) {
- if (name == pkg.name) {
- return pkg;
- }
- }
- return null;
- }
}