java.lang.Object
java.lang.Record
org.aya.resolve.context.EmptyContext
- All Implemented Interfaces:
Context,Problematic
public record EmptyContext(@NotNull org.aya.util.reporter.Reporter reporter, @NotNull Path underlyingFile)
extends Record
implements Context
- API Note:
- in each file's dependency tree there should be one and only one EmptyContext which is also the tree root.
- Implementation Note:
- EmptyContext is the context storing the underlying file, and its Reporter in the resolving stage.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aya.resolve.context.Context
Context.ResolvingInterruptedException -
Constructor Summary
ConstructorsConstructorDescriptionEmptyContext(@NotNull org.aya.util.reporter.Reporter reporter, @NotNull Path underlyingFile) Creates an instance of aEmptyContextrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull PhysicalModuleContextderive(@NotNull org.aya.syntax.ref.ModulePath extraName) final booleanIndicates whether some other object is "equal to" this one.@Nullable ModuleExportgetModuleLocalMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName) Trying to get aModuleExportby a module inthiscontext.@Nullable org.aya.syntax.ref.AnyVargetQualifiedLocalMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos) Trying to get a symbol by qualified id{modName}::{name}inthiscontext@Nullable org.aya.syntax.ref.AnyVargetUnqualifiedLocalMaybe(@NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos) Trying to get a symbol by unqualified name inthiscontext.final inthashCode()Returns a hash code value for this object.@NotNull org.aya.syntax.ref.ModulePathThe path of this module@Nullable Contextparent()@NotNull org.aya.util.reporter.Reporterreporter()Returns the value of thereporterrecord component.final StringtoString()Returns a string representation of this record class.@NotNull PathReturns the value of theunderlyingFilerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.resolve.context.Context
bind, bind, bind, collect, derive, get, getMaybe, getModuleMaybe, getQualified, getQualifiedMaybe, getUnqualified, getUnqualifiedMaybe, iterate, reportAll, reportAllAndThrow, reportAndThrowMethods inherited from interface org.aya.tyck.tycker.Problematic
fail, fail, fail
-
Constructor Details
-
EmptyContext
public EmptyContext(@NotNull @NotNull org.aya.util.reporter.Reporter reporter, @NotNull @NotNull Path underlyingFile) Creates an instance of aEmptyContextrecord class.- Parameters:
reporter- the value for thereporterrecord componentunderlyingFile- the value for theunderlyingFilerecord component
-
-
Method Details
-
parent
-
getUnqualifiedLocalMaybe
@Nullable public @Nullable org.aya.syntax.ref.AnyVar getUnqualifiedLocalMaybe(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos) Description copied from interface:ContextTrying to get a symbol by unqualified name inthiscontext.- Specified by:
getUnqualifiedLocalMaybein interfaceContext
-
getQualifiedLocalMaybe
@Nullable public @Nullable org.aya.syntax.ref.AnyVar getQualifiedLocalMaybe(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos) Description copied from interface:ContextTrying to get a symbol by qualified id{modName}::{name}inthiscontext- Specified by:
getQualifiedLocalMaybein interfaceContext- Returns:
- a symbol in component , even it is
ModuleName.This; null if not found
-
derive
@NotNull public @NotNull PhysicalModuleContext derive(@NotNull @NotNull org.aya.syntax.ref.ModulePath extraName) -
modulePath
@NotNull public @NotNull org.aya.syntax.ref.ModulePath modulePath()Description copied from interface:ContextThe path of this module- Specified by:
modulePathin interfaceContext
-
getModuleLocalMaybe
@Nullable public @Nullable ModuleExport getModuleLocalMaybe(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified modName) Description copied from interface:ContextTrying to get aModuleExportby a module inthiscontext.- Specified by:
getModuleLocalMaybein interfaceContext- Parameters:
modName- qualified module name- Returns:
- a ModuleExport of that module; null if no such module.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
reporter
@NotNull public @NotNull org.aya.util.reporter.Reporter reporter()Returns the value of thereporterrecord component.- Specified by:
reporterin interfaceContext- Specified by:
reporterin interfaceProblematic- Returns:
- the value of the
reporterrecord component
-
underlyingFile
Returns the value of theunderlyingFilerecord component.- Specified by:
underlyingFilein interfaceContext- Returns:
- the value of the
underlyingFilerecord component
-