Class Scope<T>


  • public class Scope<T>
    extends Object
    • Constructor Detail

      • Scope

        public Scope()
    • Method Detail

      • push

        public void push()
      • pop

        public void pop()
      • insert

        public void insert​(String name,
                           T value)
      • insert

        public void insert​(Identifier name,
                           T value)
      • insertFact

        public void insertFact​(Expr name,
                               T value)
      • inScope

        public <U> U inScope​(Supplier<U> func)
      • eval

        public Optional<T> eval​(Expr expr)
        Search the fact stack for an explicitly calculated value for [expr]

        Currently, this is only impacted by the `isSet` function which will record `T`, rather than Option<T> for its arguments

        Parameters:
        expr - The expression to evaluate
        Returns:
        The value from the scope
      • expectValue

        public T expectValue​(Identifier name)