Package net.hydromatic.morel.compile
Class Environments.SubEnvironment
java.lang.Object
net.hydromatic.morel.compile.Environment
net.hydromatic.morel.compile.Environments.SubEnvironment
- Enclosing class:
Environments
Environment that inherits from a parent environment and adds one
binding.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Environment(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.toString()(package private) voidVisits every variable binding in this environment.Methods inherited from class net.hydromatic.morel.compile.Environment
asString, bind, bindAll, forEachType, forEachValue, getValueMap, plus
-
Field Details
-
parent
-
binding
-
-
Constructor Details
-
SubEnvironment
SubEnvironment(Environment parent, Binding binding)
-
-
Method Details
-
toString
-
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
-
bind
- Overrides:
bindin classEnvironment
-
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
-
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
-