StackFrame.cs 662 B

12345678910111213141516171819202122232425262728293031323334
  1. using NTERA.Engine.Compiler;
  2. namespace NTERA.Engine.Runtime
  3. {
  4. public class StackFrame
  5. {
  6. public VariableDictionary LocalVariables { get; set; }
  7. public VariableDictionary GlobalVariables { get; set; }
  8. public FunctionDefinition SelfDefinition { get; set; }
  9. }
  10. public enum ExecutionResultType
  11. {
  12. None,
  13. FunctionReturn
  14. }
  15. public class ExecutionResult
  16. {
  17. public static ExecutionResult None { get; } = new ExecutionResult(ExecutionResultType.None);
  18. public ExecutionResultType Type { get; }
  19. public Value? Result { get; }
  20. public ExecutionResult(ExecutionResultType type, Value? value = null)
  21. {
  22. Type = type;
  23. Result = value;
  24. }
  25. }
  26. }