class

Bindgen::Graph::Node

Inherits Reference < Object

A node in the method graph. Base class of all elements in the graph.

To add a Node into a Container pass the container instance as parent to #initialize. This lets you quickly build hierarchies.

Constructors

new(name : String, parent : Container | Nil = nil)
Source

Instance methods

constant?

Is this node kind a constant in Crystal?

Source
crystal_prefix

Node-kind prefix for a nicely readable path, according to Crystal.

Source
diagnostics_path

Gives a humanly-readable path string, formatted for Crystal.

Source
find_root

Finds the root of this node. The root node is the one with a #parent of nil.

Source
full_path

Gives a list of nodes, going from the root node all the way to this node. This node will be the last item in the result, and the root will be the first.

The result list does not contain any PlatformSpecific nodes, even if one was encountered while traversing.

Source
kind_name

The kind name of this node for diagnostic purposes.

Source
name

Name of this node.

Source
parent

Parent node, or nil if it's tKeyErrorhis node has no parent.

Source
parent=(parent : Container | Nil)

Parent node, or nil if it's tKeyErrorhis node has no parent.

Source
path_name

Returns the qualified path name to this node, starting in the global scope. PlatformSpecifics are omitted.

See also #full_path and #diagnostics_path.

Source
set_tag(name : String, value : String = "")

Sets the value of tag name to value. Raises if a tag of the same name is already set.

Source
tag(name : String)

Returns the value of tag name.

Source
tag?(name : String)

Returns the value of tag name, if any.

Source
tags

Tags. Can be used to store flag-like data, as signal between processors. Also see the x_TAG constants in sub-classes of Node.

Before you use tags, check if you can get the information you require on some other way, e.g. infer through other existing properties.

Source
unspecific_parent

Finds the parent node which is not a PlatformSpecific.

Source