Package net.hydromatic.morel.compile
Class Environments.EmptyEnvironment
java.lang.Object
net.hydromatic.morel.compile.Environment
net.hydromatic.morel.compile.Environments.EmptyEnvironment
- Enclosing class:
Environments
Empty environment.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intdistance(int soFar, Core.NamedPat id) @Nullable BindingReturns the binding ofnameif bound, null if not.@Nullable BindinggetOpt(Core.NamedPat id) Returns the binding ofidif bound, null if not.(package private) EnvironmentIf this environment only defines bindings in the given set, returns its parent.(package private) voidVisits every variable binding in this environment.Methods inherited from class net.hydromatic.morel.compile.Environment
asString, bind, bind, bindAll, forEachType, forEachValue, getValueMap, plus
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EmptyEnvironment
private EmptyEnvironment()
-
-
Method Details
-
visit
Description copied from class:EnvironmentVisits every variable binding in this environment.Bindings that are obscured by more recent bindings of the same name are visited, but after the more obscuring bindings.
- Specified by:
visitin classEnvironment
-
getOpt
Description copied from class:EnvironmentReturns the binding ofnameif bound, null if not.- Specified by:
getOptin classEnvironment
-
getOpt
Description copied from class:EnvironmentReturns the binding ofidif bound, null if not.- Specified by:
getOptin classEnvironment
-
nearestAncestorNotObscuredBy
Description copied from class:EnvironmentIf this environment only defines bindings in the given set, returns its parent. Never returns null. The empty environment returns itself.- Specified by:
nearestAncestorNotObscuredByin classEnvironment
-
distance
- Specified by:
distancein classEnvironment
-