runtime.go 742 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Public Domain Software
  3. *
  4. * I (Matthias Ladkau) am the author of the source code in this file.
  5. * I have placed the source code in this file in the public domain.
  6. *
  7. * For further information see: http://creativecommons.org/publicdomain/zero/1.0/
  8. */
  9. package parser
  10. /*
  11. RuntimeProvider provides runtime components for a parse tree.
  12. */
  13. type RuntimeProvider interface {
  14. /*
  15. Runtime returns a runtime component for a given ASTNode.
  16. */
  17. Runtime(node *ASTNode) Runtime
  18. }
  19. /*
  20. Runtime provides the runtime for an ASTNode.
  21. */
  22. type Runtime interface {
  23. /*
  24. Validate this runtime component and all its child components.
  25. */
  26. Validate() error
  27. /*
  28. Eval evaluate this runtime component.
  29. */
  30. Eval() (map[string]interface{}, error)
  31. }