Class TParser (unit Parser9) |
Inherits from
TComponent
far;
constructor Create(AParent: TComponent);
- functions with TWO arguments, e.
procedure AddFunctionOneParam(const AFunctionName: string; Func: TFuncPrototype);
procedure AddFunctionTwoParam(const AFunctionName: string; Func: TFuncPrototype);
destructor Destroy;
procedure FreeExpression;
function GetVariable(const VarName: string): Float;
check whether the variable contains any of the operators (DIV and MOD)
this would confuse the parser.
function ParseExpression(const AnExpression: string): boolean;
TParser
class function RemoveBlanks(const s: string): string;
returns the string with the blanks inside removed
function SetVariable(VarName: string; Value: Float): PFloat;
The PFloat returned points to the place in memory where the variable
actually sits; to speed up assignment you can use
PFloat is declared P9UILD.
function CalcValue: Float;
this implies FExpression := AnExpression
procedure SetExpression(const AnExpression: string);
procedure SetVar(const VarName: string; Value: Float);
deletes all blanks in s
property A : Float
predefined variables - could be left out
property B : Float
property C : Float
property D : Float
property E : Float
property Expression : string
setting Expression automatically parses it - warning: exceptions may be raised
property T : Float
property Value : Float
property X : Float
property Y : Float
property LinkedOperationList : POperation
property ParserError : boolean
property Variable : Float
event OnParserError : TParserExceptionEvent
FunctionOne : TStringList;
lists of available functions, see .
FunctionTwo : TStringList;
functions with ONE argument, e.
FA : Float;
FB : Float;
FC : Float;
FD : Float;
FE : Float;
FExpression : string;
FNumberOperators : integer;
FOnParserError : TParserExceptionEvent;
FParserError : boolean;
FStartOperationList : POperation;
FT : Float;
FVariables : TStringList;
FX : Float;
FY : Float;
constructor Create(AParent: TComponent);
functions with TWO arguments, e.g. max(,)
while OperationLoop<>nil
procedure AddFunctionOneParam(const AFunctionName: string; Func: TFuncPrototype);
procedure AddFunctionTwoParam(const AFunctionName: string; Func: TFuncPrototype);
destructor Destroy;
procedure FreeExpression;
function GetVariable(const VarName: string): Float;
check whether the variable contains any of the operators (DIV and MOD)
this would confuse the parser...
function ParseExpression(const AnExpression: string): boolean;
TParser
class function RemoveBlanks(const s: string): string;
returns the string with the blanks inside removed
function SetVariable(VarName: string; Value: Float): PFloat;
The PFloat returned points to the place in memory where the variable
actually sits; to speed up assignment you can use
PFloat is declared P9UILD.PAS
function CalcValue: Float;
this implies FExpression := AnExpression
procedure SetExpression(const AnExpression: string);
procedure SetVar(const VarName: string; Value: Float);
deletes all blanks in s
property A : Float
predefined variables - could be left out
property B : Float
property C : Float
property D : Float
property E : Float
property Expression : string
setting Expression automatically parses it - warning: exceptions may be raised
property T : Float
property Value : Float
property X : Float
property Y : Float
property LinkedOperationList : POperation
property ParserError : boolean
property Variable : Float
event OnParserError : TParserExceptionEvent
FunctionOne : TStringList;
lists of available functions, see .Create for example use
FunctionTwo : TStringList;
functions with ONE argument, e.g. exp()
FA : Float;
FB : Float;
FC : Float;
FD : Float;
FE : Float;
FExpression : string;
FNumberOperators : integer;
FOnParserError : TParserExceptionEvent;
FParserError : boolean;
FStartOperationList : POperation;
FT : Float;
FVariables : TStringList;
FX : Float;
FY : Float;