Package com.io7m.cedarbridge.schema.binder.internal

# Interface CBBinderContextType

All Superinterfaces:
  `AutoCloseable`

public interface CBBinderContextType extends AutoCloseable
The contextual information used during binding analysis.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CBBindingLocalType`
  `bindField(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Bind the field.
  `CBBindingLocalType`
  `bindProtocol(Optional<UUID> specSection, CBASTProtocolDeclaration proto)`
  Bind the protocol declaration.
  `CBBindingLocalType`
  `bindProtocolVersion(Optional<UUID> specSection, BigInteger version, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Bind the protocol version.
  `CBBindingLocalType`
  `bindType(Optional<UUID> specSection, CBASTTypeDeclarationType type)`
  Bind the type declaration.
  `CBBindingLocalType`
  `bindTypeParameter(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Bind the type parameter.
  `CBBindingLocalType`
  `bindVariantCase(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Bind the variant case.
  `CBBindingLocalType`
  `checkCaseBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Check that a variant case exists.
  `CBBindingLocalType`
  `checkFieldBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Check that a field exists.
  `CBPackageType`
  `checkPackageBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Check that a package exists.
  `CBBindingLocalType`
  `checkTypeBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Check that a type exists.
  `CBBindingLocalType`
  `checkTypeOrProtocolBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Check that a type or protocol exists.
  `CBBindingType`
  `checkTypeParameterOrCaseBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Check that a variant case or type parameter exists.
  `CBBindingType`
  `checkTypeParameterOrFieldBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical)`
  Check that a field or type parameter exists.
  `void`
  `close()`
  `String`
  `currentPackage()`
  `CBBindFailedException`
  `failed(Optional<UUID> specSection, com.io7m.jlexing.core.LexicalPosition<URI> lexical, String errorCode, Object... arguments)`
  Something failed.
  `CBBindFailedException`
  `failedWithOther(Optional<UUID> specSection, com.io7m.jlexing.core.LexicalPosition<URI> lexical, com.io7m.jlexing.core.LexicalPosition<URI> lexicalOther, String errorCode, Object... arguments)`
  Something failed and referred to an object at a different lexical position.
  `CBLoaderType`
  `loader()`
  `CBBinderContextType`
  `openBindingScope()`
  Open a new binding scope.
  `void`
  `registerPackage(Optional<UUID> specSection, com.io7m.jlexing.core.LexicalPosition<URI> lexical, String text, CBPackageType packageV)`
  Register a package, making it available for subsequent analysis operations.

- ## Method Details

  - ### loader

    CBLoaderType loader()
    Returns:
      The package loader

  - ### openBindingScope

    CBBinderContextType openBindingScope()
    Open a new binding scope. This is typically called upon encountering a declaration that generates a new name.
    Returns:
      The scope

  - ### close

    void close() throws CBBindFailedException
    Specified by:
      `close` in interface `AutoCloseable`
    Throws:
      `CBBindFailedException`

  - ### registerPackage

    void registerPackage(Optional<UUID> specSection, com.io7m.jlexing.core.LexicalPosition<URI> lexical, String text, CBPackageType packageV) throws CBBindFailedException
    Register a package, making it available for subsequent analysis operations.
    Parameters:
      `specSection` - The quoted spec section
      `lexical` - The lexical information
      `text` - The short package name
      `packageV` - The package
    Throws:
      `CBBindFailedException` - On errors

  - ### failed

    CBBindFailedException failed(Optional<UUID> specSection, com.io7m.jlexing.core.LexicalPosition<URI> lexical, String errorCode, Object... arguments)
    Something failed.
    Parameters:
      `specSection` - The quoted spec section
      `lexical` - The lexical information
      `errorCode` - The error code
      `arguments` - The error arguments
    Returns:
      A failure exception

  - ### failedWithOther

    CBBindFailedException failedWithOther(Optional<UUID> specSection, com.io7m.jlexing.core.LexicalPosition<URI> lexical, com.io7m.jlexing.core.LexicalPosition<URI> lexicalOther, String errorCode, Object... arguments)
    Something failed and referred to an object at a different lexical position.
    Parameters:
      `specSection` - The quoted spec section
      `lexical` - The lexical information
      `lexicalOther` - The other lexical information
      `errorCode` - The error code
      `arguments` - The error arguments
    Returns:
      A failure exception

  - ### bindType

    CBBindingLocalType bindType(Optional<UUID> specSection, CBASTTypeDeclarationType type) throws CBBindFailedException
    Bind the type declaration.
    Parameters:
      `specSection` - The quoted spec section
      `type` - The type
    Returns:
      A local binding
    Throws:
      `CBBindFailedException` - On errors

  - ### bindProtocol

    CBBindingLocalType bindProtocol(Optional<UUID> specSection, CBASTProtocolDeclaration proto) throws CBBindFailedException
    Bind the protocol declaration.
    Parameters:
      `specSection` - The quoted spec section
      `proto` - The protocol declaration
    Returns:
      A local binding
    Throws:
      `CBBindFailedException` - On errors

  - ### bindTypeParameter

    CBBindingLocalType bindTypeParameter(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Bind the type parameter.
    Parameters:
      `specSection` - The quoted spec section
      `lexical` - The lexical information for the identifier
      `text` - The type parameter
    Returns:
      A local binding
    Throws:
      `CBBindFailedException` - On errors

  - ### bindField

    CBBindingLocalType bindField(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Bind the field.
    Parameters:
      `specSection` - The quoted spec section
      `lexical` - The lexical information for the identifier
      `text` - The field
    Returns:
      A local binding
    Throws:
      `CBBindFailedException` - On errors

  - ### checkTypeBinding

    CBBindingLocalType checkTypeBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Check that a type exists.
    Parameters:
      `specSection` - The quoted spec section
      `text` - The type name
      `lexical` - The lexical information for the identifier
    Returns:
      The binding
    Throws:
      `CBBindFailedException` - On errors

  - ### checkFieldBinding

    CBBindingLocalType checkFieldBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Check that a field exists.
    Parameters:
      `specSection` - The quoted spec section
      `text` - The field name
      `lexical` - The lexical information for the identifier
    Returns:
      The binding
    Throws:
      `CBBindFailedException` - On errors

  - ### bindVariantCase

    CBBindingLocalType bindVariantCase(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Bind the variant case.
    Parameters:
      `specSection` - The quoted spec section
      `lexical` - The lexical information for the identifier
      `text` - The variant case
    Returns:
      A local binding
    Throws:
      `CBBindFailedException` - On errors

  - ### checkPackageBinding

    CBPackageType checkPackageBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Check that a package exists.
    Parameters:
      `specSection` - The quoted spec section
      `text` - The package name
      `lexical` - The lexical information for the identifier
    Returns:
      The binding
    Throws:
      `CBBindFailedException` - On errors

  - ### currentPackage

    String currentPackage()
    Returns:
      The name of the current package

  - ### bindProtocolVersion

    CBBindingLocalType bindProtocolVersion(Optional<UUID> specSection, BigInteger version, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Bind the protocol version.
    Parameters:
      `specSection` - The quoted spec section
      `lexical` - The lexical information for the identifier
      `version` - The version
    Returns:
      A local binding
    Throws:
      `CBBindFailedException` - On errors

  - ### checkTypeOrProtocolBinding

    CBBindingLocalType checkTypeOrProtocolBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Check that a type or protocol exists.
    Parameters:
      `specSection` - The quoted spec section
      `target` - The type or protocol name
      `lexical` - The lexical information for the identifier
    Returns:
      The binding
    Throws:
      `CBBindFailedException` - On errors

  - ### checkCaseBinding

    CBBindingLocalType checkCaseBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Check that a variant case exists.
    Parameters:
      `specSection` - The quoted spec section
      `target` - The case name
      `lexical` - The lexical information for the identifier
    Returns:
      The binding
    Throws:
      `CBBindFailedException` - On errors

  - ### checkTypeParameterOrFieldBinding

    CBBindingType checkTypeParameterOrFieldBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Check that a field or type parameter exists.
    Parameters:
      `specSection` - The quoted spec section
      `target` - The case name
      `lexical` - The lexical information for the identifier
    Returns:
      The binding
    Throws:
      `CBBindFailedException` - On errors

  - ### checkTypeParameterOrCaseBinding

    CBBindingType checkTypeParameterOrCaseBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) throws CBBindFailedException
    Check that a variant case or type parameter exists.
    Parameters:
      `specSection` - The quoted spec section
      `target` - The case name
      `lexical` - The lexical information for the identifier
    Returns:
      The binding
    Throws:
      `CBBindFailedException` - On errors