Skip to content
Newer
Older
100644 47 lines (35 sloc) 1.59 KB
6fa4925 @davedelong initial commit
authored
1 //
2 // DDMathEvaluator.h
3 // DDMathParser
4 //
5 // Created by Dave DeLong on 11/17/10.
6 // Copyright 2010 Home. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import "DDTypes.h"
11
12 @class DDMathEvaluator;
13 @class DDExpression;
14
b132b37 @davedelong Added ability to resolve functions lazily
authored
15 typedef DDMathFunction (^DDFunctionResolver)(NSString *);
29073d7 @davedelong DDMathEvaluator.angleMeasurementMode. Fixes issue #29.
authored
16 typedef NSNumber* (^DDVariableResolver)(NSString *);
b132b37 @davedelong Added ability to resolve functions lazily
authored
17
5e0fa67 @davedelong Updated README, removed llvm3 dependency.
authored
18 @interface DDMathEvaluator : NSObject {
19 NSMutableArray *functions;
20 NSMutableDictionary * functionMap;
f583e6f @davedelong Add API to DDMathEvaluator for rewriting expressions
authored
21 NSMutableArray *rewriteRules;
b132b37 @davedelong Added ability to resolve functions lazily
authored
22 DDFunctionResolver functionResolver;
29073d7 @davedelong DDMathEvaluator.angleMeasurementMode. Fixes issue #29.
authored
23 DDVariableResolver variableResolver;
24 DDAngleMeasurementMode angleMeasurementMode;
5e0fa67 @davedelong Updated README, removed llvm3 dependency.
authored
25 }
6fa4925 @davedelong initial commit
authored
26
29073d7 @davedelong DDMathEvaluator.angleMeasurementMode. Fixes issue #29.
authored
27 @property (nonatomic) DDAngleMeasurementMode angleMeasurementMode; // default is Radians
b132b37 @davedelong Added ability to resolve functions lazily
authored
28 @property (nonatomic, copy) DDFunctionResolver functionResolver;
29073d7 @davedelong DDMathEvaluator.angleMeasurementMode. Fixes issue #29.
authored
29 @property (nonatomic, copy) DDVariableResolver variableResolver;
b132b37 @davedelong Added ability to resolve functions lazily
authored
30
6fa4925 @davedelong initial commit
authored
31 + (id) sharedMathEvaluator;
32
900bc2d @davedelong beginning attempt to transition to NSDecimal
authored
33 - (BOOL) registerFunction:(DDMathFunction)function forName:(NSString *)functionName;
6fa4925 @davedelong initial commit
authored
34 - (void) unregisterFunctionWithName:(NSString *)functionName;
35 - (NSArray *) registeredFunctions;
36
37 - (NSNumber *) evaluateString:(NSString *)expressionString withSubstitutions:(NSDictionary *)substitutions;
4d16dc9 @davedelong Fixed some parsing and tokenization errors. Exceptions are no longer …
authored
38 - (NSNumber *) evaluateString:(NSString *)expressionString withSubstitutions:(NSDictionary *)substitutions error:(NSError **)error;
6fa4925 @davedelong initial commit
authored
39
2f8adf2 @davedelong correct bug with n-argument function evaluation. added function alias…
authored
40 - (BOOL) addAlias:(NSString *)alias forFunctionName:(NSString *)functionName;
41 - (void) removeAlias:(NSString *)alias;
42
77c91a4 @davedelong adding conditions to rewrite rules
authored
43 - (void)addRewriteRule:(NSString *)rule forExpressionsMatchingTemplate:(NSString *)template condition:(NSString *)condition;
f583e6f @davedelong Add API to DDMathEvaluator for rewriting expressions
authored
44 - (DDExpression *)expressionByRewritingExpression:(DDExpression *)expression;
45
6fa4925 @davedelong initial commit
authored
46 @end
Something went wrong with that request. Please try again.