Interface CBBinderContextType
- All Superinterfaces:
AutoCloseable
The contextual information used during binding analysis.
-
Method Summary
Modifier and TypeMethodDescriptionbindField(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Bind the field.bindProtocol(Optional<UUID> specSection, CBASTProtocolDeclaration proto) Bind the protocol declaration.bindProtocolVersion(Optional<UUID> specSection, BigInteger version, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Bind the protocol version.bindType(Optional<UUID> specSection, CBASTTypeDeclarationType type) Bind the type declaration.bindTypeParameter(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Bind the type parameter.bindVariantCase(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Bind the variant case.checkCaseBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Check that a variant case exists.checkFieldBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Check that a field exists.checkPackageBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Check that a package exists.checkTypeBinding(Optional<UUID> specSection, String text, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Check that a type exists.checkTypeOrProtocolBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Check that a type or protocol exists.checkTypeParameterOrCaseBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Check that a variant case or type parameter exists.checkTypeParameterOrFieldBinding(Optional<UUID> specSection, String target, com.io7m.jlexing.core.LexicalPosition<URI> lexical) Check that a field or type parameter exists.voidclose()failed(Optional<UUID> specSection, com.io7m.jlexing.core.LexicalPosition<URI> lexical, String errorCode, Object... arguments) Something failed.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.loader()Open a new binding scope.voidregisterPackage(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
- Specified by:
closein interfaceAutoCloseable- 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 sectionlexical- The lexical informationtext- The short package namepackageV- 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 sectionlexical- The lexical informationerrorCode- The error codearguments- 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 sectionlexical- The lexical informationlexicalOther- The other lexical informationerrorCode- The error codearguments- 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 sectiontype- 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 sectionproto- 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 sectionlexical- The lexical information for the identifiertext- 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 sectionlexical- The lexical information for the identifiertext- 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 sectiontext- The type namelexical- 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 sectiontext- The field namelexical- 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 sectionlexical- The lexical information for the identifiertext- 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 sectiontext- The package namelexical- 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 sectionlexical- The lexical information for the identifierversion- 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 sectiontarget- The type or protocol namelexical- 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 sectiontarget- The case namelexical- 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 sectiontarget- The case namelexical- 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 sectiontarget- The case namelexical- The lexical information for the identifier- Returns:
- The binding
- Throws:
CBBindFailedException- On errors
-