Interface CBBinderContextType

All Superinterfaces:
AutoCloseable

public interface CBBinderContextType extends AutoCloseable
The contextual information used during binding analysis.
  • 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

      Bind the type declaration.
      Parameters:
      specSection - The quoted spec section
      type - The type
      Returns:
      A local binding
      Throws:
      CBBindFailedException - On errors
    • bindProtocol

      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