KWLetNode.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Licensed under the terms in License.txt
  3. //
  4. // Copyright 2010 Allen Ding. All rights reserved.
  5. //
  6. #import "KiwiConfiguration.h"
  7. #import "KWExampleNode.h"
  8. @interface KWLetNode : NSObject<KWExampleNode>
  9. - (instancetype)initWithSymbolName:(NSString *)aSymbolName objectRef:(id *)anObjectRef block:(id (^)(void))block;
  10. + (instancetype)letNodeWithSymbolName:(NSString *)aSymbolName objectRef:(id *)anObjectRef block:(id (^)(void))block;
  11. @property (nonatomic, copy) NSString *symbolName;
  12. @property (nonatomic, copy) id (^block)(void);
  13. @property (nonatomic, readonly) __autoreleasing id *objectRef;
  14. - (id)evaluate;
  15. - (void)evaluateTree;
  16. - (void)addLetNode:(KWLetNode *)aNode;
  17. - (void)unlink;
  18. // The parent/child relationship describes let nodes declared in nested
  19. // contexts -- evaluating a node returns the value of the deepest
  20. // evaluated child.
  21. @property (nonatomic, readonly, weak) KWLetNode *parent;
  22. @property (nonatomic, readonly, strong) KWLetNode *child;
  23. // The next/previous relationship describes the order in which nodes
  24. // of different symbols were declared.
  25. @property (nonatomic, readonly, strong) KWLetNode *next;
  26. @property (nonatomic, readonly, weak) KWLetNode *previous;
  27. @end