31 lines
797 B
Objective-C
31 lines
797 B
Objective-C
//
|
|
// MPExpressionEvaluator.h
|
|
// MathPad
|
|
//
|
|
// Created by Kim Wittenburg on 31.08.14.
|
|
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import "MPExpression.h"
|
|
|
|
@class MPExpressionEvaluator, MPExpression, MPParsedElement;
|
|
|
|
@interface MPExpressionEvaluator : NSObject
|
|
|
|
- (instancetype)initWithExpression:(MPExpression *)expression;
|
|
|
|
@property (readonly, nonatomic, strong) MPExpression *expression;
|
|
|
|
#pragma mark Lexing
|
|
- (MPParsedElement *)structuredRepresentationOfElementAtIndex:(NSUInteger)index;
|
|
|
|
#pragma mark Evaluating Expressions
|
|
@property (readonly, nonatomic, strong) NSDictionary *variableBindings;
|
|
|
|
- (void)bindValue:(double)value toVariableName:(NSString *)name;
|
|
|
|
- (double)evaluateWithError:(NSError *__autoreleasing *)error;
|
|
|
|
@end
|