class

Bindgen::Graph::Builder

Inherits Reference < Object

Builds a graph out of Parser::* structures. Can be used to build a whole namespace out of a Parser::Document, or just for smaller things.

The resulting graph mirrors the structure of the target language.

Constructors

new(db : TypeDatabase)
Source

Instance methods

build_class(klass : Parser::Class, name : String, root : Graph::Container) : Graph::Class

Copies klass at path name into the root.

Source
build_document(document : Parser::Document, ns : Namespace, except = Set(String).new) : Namespace

Copies document into the ns. The classes named in except are left out, like container instantiations Processor::InstantiateContainers builds.

Source
build_enum(enumeration : Parser::Enum, name : String, root : Graph::Container) : Graph::Enum

Copies enumeration at path name into the root.

Source
build_method(method : Parser::Method, parent : Graph::Node | Nil) : Graph::Method

Copies method into parent.

Source
get_or_create_path(root : Graph::Container, path : Path) : Graph::Node

Iterates over the path, descending from root onwards. If a part of the path does not exist yet, it'll be created as Namespace.

Source
get_or_create_path_parent(root : Graph::Container, path : Path) : Graph::Container

Gets the parent of path, starting at root. Makes sure it is a Graph::Container. Also see #get_or_create_path

Source
parent_and_local_name(root : Graph::Container, path_name : String)

Splits the qualified path, and returns the parent of the target and the name of the path local to the parent.

Source
parent_and_local_name(root : Graph::Container, path : Path)

Splits the qualified path, and returns the parent of the target and the name of the path local to the parent.

Source