9 #import <Foundation/Foundation.h>
54 -(double)run: (NSArray *)parameters;
88 -(double) getVariableValue:(NSString *) varName;
96 NSString * m_InvalidPortion;
98 -(id)initWithMessage:(NSString *) message andInvalidPortion:(NSString *) invalid;
100 -(NSString *) getInvalidPortionOfExpression;
115 -(BOOL) isVariableUsed:(NSString *)name;
118 -(BOOL) isFunctionUsed:(NSString *)name;
163 BOOL m_LocaleSpecificDecimals;
166 NSObject<VariableDelegate> *m_VariableDelegate;
169 char m_DecimalSeperatorChar;
170 NSString *m_DecimalSeparatorStr;
171 char m_FunctionParamSeparatorChar;
172 NSString *m_FunctionParamSeparatorStr;
261 @property (nonatomic) NSString *expression;
264 @property (nonatomic, readonly)
double value;
267 @property (nonatomic) BOOL precedingZerosAllowed;
270 @property (nonatomic) NSLocale *locale;
273 @property (nonatomic) BOOL localeSpecificDecimals;
285 @property (nonatomic) NSObject<VariableDelegate> *variableDelegate;
333 @property (nonatomic) NSDictionary * translationStrings;
337 @property (nonatomic) BOOL optimizationOn;
364 -(BOOL) isVariableUsed: (NSString *) varName;
368 -(BOOL) isFunctionUsed: (NSString *)funcName;
373 -(BOOL) isVariable:(NSString *) varName;
376 -(BOOL) isConstant:(NSString *) constName;
380 -(BOOL) isFunction:(NSString *) funcName;
390 -(void) setVariable: (NSString *) varName withNewValue: (
double) newVal maybeConstant: (
bool) isConst;
396 -(void) setVariable: (NSString *)varName withNewValue:(
double) newVal;
402 -(void) createConstant:(NSString *)varName withValue:(
double)newVal;
423 -(void) createFunc: (NSString *)newFuncName withImpl: (NSObject<
Function> *) funcAddr;
495 -(void) createDefaultFuncs;
504 -(void) deleteVar: (NSString *) varName;
513 -(void) deleteFunc: (NSString *) funcName;
523 -(void) deleteAllVars;
532 -(void) deleteAllFuncs;
549 -(NSArray *) getVariables;
553 -(NSArray *) getFunctions;
559 -(NSArray *) getVariablesUsed;
565 -(void) FreeParseTree;
void optimize()
Optimize Evaluates constant values at compile time (When Parse() is called).
Internal support protocol that represents parsed expression tree.
Definition: MathParser.h:110
int getNumberOfParameters()
Return the number of parameters that this function accepts.
MathParser class provides the capability to parse and evaluate math expressions given as strings at r...
Definition: MathParser.h:135
NSMutableDictionary * m_Functions
internal list of functions that take more than 2 parameters that are available for use in an expressi...
Definition: MathParser.h:157
double getValue()
Returns the value as NSObject which can be one of NSNumber of NSString.
BOOL m_Dirty
non-public flag that shows if parsing is needed or not.
Definition: MathParser.h:142
NSObject< Node > * m_Node
Starting node for the internal compiled representation of the expression in parsed form...
Definition: MathParser.h:151
NSString * m_Expression
protected variable that holds the expression to parse.
Definition: MathParser.h:138
Parameter protocol represents a parameter that is passed into a user defined function.
Definition: MathParser.h:69
double getValue()
Return the value for the parameter.
BOOL m_OptimizationOn
when optimization on, after the parse tree is compiled, it will be further optimized by removing sub ...
Definition: MathParser.h:147
Exception thrown by the parser when the expression has a problem.
Definition: MathParser.h:94
VariableDelegate returns the current value of a variable whose name is given.
Definition: MathParser.h:83
NSMutableDictionary * m_Variables
internal list of variables that are available for use in an expression.
Definition: MathParser.h:154
Function defines the interface that describes a function that can be used as a user defined function ...
Definition: MathParser.h:48