class Bindgen::Processor::SanityCheck
- Bindgen::Processor::SanityCheck
- Bindgen::Processor::Base
- Reference
- Object
Overview
Does sanity-checks on the graph.  If any check fails, a message written to
STDERR and the process is exited.
Checks are as follows:
- Name of enums, libs, structures, classes, modules and aliases are valid
- Name of methods are valid
- Enumerations have at least one constant
- Enumeration constants are correctly named
- Flag-enumerations don't have AllnorNoneconstants
- Crystal method overloads are unambiguous
- Method arguments and result types are reachable
- Variadic methods are directly bound
- Alias targets are reachable
- Class base-classes are reachable
Defined in:
bindgen/processor/sanity_check.crConstant Summary
- 
        CAMEL_CASE_RX = /^[A-Z_][A-Za-z0-9_]*$/
- 
        Regular expression for a camel-cased symbol 
- 
        CONSTANT_RX = /^[A-Z_][A-Z0-9_]*$/
- 
        Regular expression for a CONSTANT 
- 
        ENUM_FLAG_ALL = "All"
- 
        The all-flags constant in a flag-enum 
- 
        ENUM_FLAG_NONE = "None"
- 
        The no-flags constant in a flag-enum 
- 
        ENUMERABLE_RX = /^Enumerable(?:\([A-Za-z0-9_():*]*\))?$/
- 
        Regular expression for a Crystal EnumerabletypenameTODO support other Crystal stdlib types (which might not correspond to any C++ type at all) 
- 
        METHOD_NAME_RX = /^[a-z_][A-Za-z0-9_]*[?!=]?$/
- 
        Regular expression describing a method name 
- 
        OPERATOR_METHOD_NAME_RX = /^([\+\-\*\/\%\&\|\^\>\<\~]|\<\<|\>\>|[\!\=\<\>]=|=[\<\>]|\[\])$/
- 
        Regular expression describing a operator method name 
Constructors
Class Method Summary
- 
        .logger
        
          Does sanity-checks on the graph. 
Instance Method Summary
- 
        #logger
        
          Does sanity-checks on the graph. 
- #process(*_args)
- 
        #visit_class(klass)
        
          Check for ambiguous Crystal overloads 
- 
        #visit_enum(enumeration)
        
          Check enumeration constants 
- 
        #visit_library(library)
        
          Temporarily switch the platform. 
- 
        #visit_node(node)
        
          Check for correct naming of nodes. 
- 
        #visit_platform_specific(specific)
        
          Only visit non-C++ specifics 
Instance methods inherited from class Bindgen::Processor::Base
  
  
    
      process(graph : Graph::Container, doc : Parser::Document)
    process
    
  
    
  Constructor methods inherited from class Bindgen::Processor::Base
  
  
    
      new(config : Configuration, db : TypeDatabase)
    new
    
  
    
  
    
  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
Class Method Detail
Does sanity-checks on the graph.  If any check fails, a message written to
STDERR and the process is exited.
Checks are as follows:
- Name of enums, libs, structures, classes, modules and aliases are valid
- Name of methods are valid
- Enumerations have at least one constant
- Enumeration constants are correctly named
- Flag-enumerations don't have AllnorNoneconstants
- Crystal method overloads are unambiguous
- Method arguments and result types are reachable
- Variadic methods are directly bound
- Alias targets are reachable
- Class base-classes are reachable
Instance Method Detail
Does sanity-checks on the graph.  If any check fails, a message written to
STDERR and the process is exited.
Checks are as follows:
- Name of enums, libs, structures, classes, modules and aliases are valid
- Name of methods are valid
- Enumerations have at least one constant
- Enumeration constants are correctly named
- Flag-enumerations don't have AllnorNoneconstants
- Crystal method overloads are unambiguous
- Method arguments and result types are reachable
- Variadic methods are directly bound
- Alias targets are reachable
- Class base-classes are reachable