abstract class Bindgen::Processor::Base

Overview

Base-class for all processors.

The processor Runner will instantiate all processors first, then call #process in order as configured.

All processors are automatically made available as their String#underscored name through in the processors configuration.

If your processor only requires to act on specific graph nodes, you can simply override the corresponding #visit_X method. See FilterMethods for an example of this.

Included Modules

Direct Known Subclasses

Defined in:

bindgen/processor/base.cr

Constructors

Instance Method Summary

Instance methods inherited from module Bindgen::Graph::Visitor

visit_alias(alias_name) visit_alias, visit_children(container : Container) visit_children, visit_class(klass) visit_class, visit_constant(constant) visit_constant, visit_enum(enumeration) visit_enum, visit_library(library) visit_library, visit_method(method) visit_method, visit_namespace(ns) visit_namespace, visit_node(node : Node) visit_node, visit_node?(node : Node) visit_node?, visit_platform_specific(specific) visit_platform_specific, visit_struct(structure) visit_struct, visit_union(structure) visit_union

Constructor Detail

def self.new(config : Configuration, db : TypeDatabase) #

[View source]

Instance Method Detail

def inherited_rules(class_name : String, & : TypeDatabase::TypeConfig -> TypeDatabase::KeepAlive) : TypeDatabase::KeepAlive #

Returns the keep_alive: or depends_on: rules, selected from the type configuration by the block, applying to the methods of class_name: its own, and those of its base classes. A method a subclass re-declares, like an override of a setter, keeps what the method of the base class keeps, so the rule of the base class covers it.


[View source]
def process(graph : Graph::Container, doc : Parser::Document) #

Runs the processor. You may change graph as you see fit.


[View source]
def unmatched_patterns(klass : Graph::Class, rules : TypeDatabase::KeepAlive) : Array(Regex) #

Returns the patterns of rules, the keep_alive: or depends_on: configuration of klass, matching the name of none of its methods, so a typo, or a pattern for an ignored method, isn't silent. Only the methods the class declares count, those bound from a superclass follow the rules of the superclass.


[View source]