Implemented Evaluation
This commit is contained in:
@@ -8,23 +8,25 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPExpression.h"
|
||||
#import "MPElementParser.h"
|
||||
|
||||
@class MPExpressionEvaluator, MPExpression, MPParsedElement;
|
||||
|
||||
@interface MPExpressionEvaluator : NSObject
|
||||
|
||||
// Do not instanciate yourself, use evaluator property of MPExpression instead
|
||||
- (instancetype)initWithExpression:(MPExpression *)expression;
|
||||
|
||||
@property (readonly, nonatomic, strong) MPExpression *expression;
|
||||
|
||||
#pragma mark Lexing
|
||||
- (MPParsedElement *)structuredRepresentationOfElementAtIndex:(NSUInteger)index;
|
||||
@property (readonly, nonatomic, weak) MPExpression *expression;
|
||||
|
||||
#pragma mark Evaluating Expressions
|
||||
@property (readonly, nonatomic, strong) NSDictionary *variableBindings;
|
||||
|
||||
- (void)bindValue:(double)value toVariableName:(NSString *)name;
|
||||
- (void)bindValue:(NSDecimalNumber *)value toVariableName:(NSString *)name;
|
||||
- (void)unbindVariableName:(NSString *)name;
|
||||
|
||||
- (double)evaluateWithError:(NSError *__autoreleasing *)error;
|
||||
- (NSDecimalNumber *)evaluateWithError:(MPParseError *__autoreleasing *)error;
|
||||
- (NSDecimalNumber *)evaluateVariableDefinition:(BOOL)flag error:(MPParseError *__autoreleasing *)error;
|
||||
@property (readonly, nonatomic, strong) NSString *definedVariable;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user