StackFrame.cs 716 B

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