public class Scope<T> extends Object
Constructor and Description |
---|
Scope() |
Modifier and Type | Method and Description |
---|---|
Optional<T> |
eval(Expr expr)
Search the fact stack for an explicitly calculated value for [expr]
|
T |
expectValue(Identifier name) |
Optional<T> |
getValue(Identifier name) |
<U> U |
inScope(Supplier<U> func) |
void |
insert(Identifier name,
T value) |
void |
insert(String name,
T value) |
void |
insertFact(Expr name,
T value) |
void |
pop() |
void |
push() |
String |
toString() |
public void push()
public void pop()
public void insert(Identifier name, T value)
public <U> U inScope(Supplier<U> func)
public Optional<T> eval(Expr expr)
Currently, this is only impacted by the `isSet` function which will record `T`, rather than Option<T>
for
its arguments
expr
- The expression to evaluatepublic T expectValue(Identifier name)
public Optional<T> getValue(Identifier name)
Copyright © 2023. All rights reserved.