Archived
1

Started to Implement Evaluation

Corrected Some Errors
Cleaned Code
This commit is contained in:
Kim Wittenburg
2014-09-06 01:53:22 +02:00
parent 4a3ea0cede
commit a69b5273ee
13 changed files with 112 additions and 107 deletions

View File

@@ -9,7 +9,7 @@
@import Foundation;
#import "NSString+MPExpressionElement.h"
@class MPExpression, MPFunction, MPRangePath;
@class MPExpression, MPFunction, MPRangePath, MPExpressionEvaluator;
@protocol MPExpressionElement;
/*!
@@ -269,8 +269,26 @@
- (void)replaceSymbolsInRange:(NSRange)range
withElements:(NSArray *)elements;
#warning Evaluating must possibly return error
- (double)doubleValue; // Evaluates Expression
/*!
@method elements
@brief Returns an array of all elements in the receiver.
@discussion The elements in the returned array are not copied before they are
returned.
@return An array of all elements from the receiver.
*/
- (NSArray *)elements;
#pragma mark Evaluating Expressions
- (double)evaluateExpression:(NSError *__autoreleasing *)error;
// TODO: Private?
@property (readonly, nonatomic, strong) MPExpressionEvaluator *evaluator;
#pragma mark Notifications
// All notification methods should create a new rangePath with the receiver's index added to the beginning of the path and then ascend the message to it's parent
@@ -312,7 +330,7 @@
@return @c YES if @c anExpression is equal to the receiver, @c NO
otherwise.
*/
- (BOOL)isEqualToExpression:(MPExpression *)anExpression;
// - (BOOL)isEqualToExpression:(MPExpression *)anExpression;
- (NSString *)description;
- (NSUInteger)hash;
@@ -534,21 +552,6 @@
- (void)deleteElementsInRange:(NSRange)range;
#pragma mark Querying Expressions
/*!
@method elements
@brief Returns an array of all elements in the receiver.
@discussion The elements in the returned array are not copied before they are
returned.
@return An array of all elements from the receiver.
*/
- (NSArray *)elements;
/*!
@method mutableElements
@brief Returns a proxy mutable array object that responds to all methods
@@ -564,3 +567,4 @@
// - (NSMutableArray *)mutableElements;
@end