runtime.go 754 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * EliasDB
  3. *
  4. * Copyright 2016 Matthias Ladkau. All rights reserved.
  5. *
  6. * This Source Code Form is subject to the terms of the Mozilla Public
  7. * License, v. 2.0. If a copy of the MPL was not distributed with this
  8. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. */
  10. package parser
  11. /*
  12. RuntimeProvider provides runtime components for a parse tree.
  13. */
  14. type RuntimeProvider interface {
  15. /*
  16. Runtime returns a runtime component for a given ASTNode.
  17. */
  18. Runtime(node *ASTNode) Runtime
  19. }
  20. /*
  21. Runtime provides the runtime for an ASTNode.
  22. */
  23. type Runtime interface {
  24. /*
  25. Validate this runtime component and all its child components.
  26. */
  27. Validate() error
  28. /*
  29. Eval evaluate this runtime component.
  30. */
  31. Eval() (interface{}, error)
  32. }