Class VeLaScope


public class VeLaScope extends VeLaEnvironment<Operand>
This class represents a VeLa scope assumed to exist within a stack of scopes, with a global scope at the bottom and function scopes thereafter. Symbols in each correspond to variable or function bindings.
  • Constructor Details

    • VeLaScope

      public VeLaScope()
  • Method Details

    • getFunctions

      public Map<String,List<FunctionExecutor>> getFunctions()
      Returns:
      the functions
    • isMutable

      public boolean isMutable()
      Description copied from class: VeLaEnvironment
      Is this environment mutable (can be modified)?
      Overrides:
      isMutable in class VeLaEnvironment<Operand>
      Returns:
      true if mutable, false if not
    • addFunctionExecutor

      public void addFunctionExecutor(FunctionExecutor executor)
      Add a function executor to the multi-map.
      If the new executor has the same signature as one already in existence, it will be replaced.
      Parameters:
      executor - The function executor to be added.
    • addAll

      public void addAll(VeLaScope other)
      Add all symbol bindings and functions from another scope to this one.
      Parameters:
      other - The scope to be added to this one.
    • lookupFunction

      public Optional<List<FunctionExecutor>> lookupFunction(String name)
      Lookup the named function, returning an optional list of functions.
      Parameters:
      name - The desired function name.
      Returns:
      An optional list of function executors.
    • isEmpty

      public boolean isEmpty()
      Is this scope empty?
      Overrides:
      isEmpty in class VeLaEnvironment<Operand>