| Class TCustomFormula (unit FC) |
TComponent
TCustomFormula - predecessor of TFormulaCompiler components } { It provides all common properties and methods
| Constructors |
constructor Create(AOwner: TComponent);| Functions |
destructor Destroy;
function NewFunction(const S: String): Integer;FLD1 (D9E8); FWAIT (9B); RET (C3);
procedure Recompile;recompile Source
procedure Loaded;
procedure Notification(AComponent: TComponent; Operation: TOperation);
function Compile(S: String;
var Code: PChar; var CodeSize: Integer;
var Cnst: PChar; var ConstSize: Integer;
NameList: TStringList): Integer;Main method - compilation of expression
function GetArgs: Integer;
function OnFuncCall(Index: Integer; ParamCount: Integer; Offs: Integer): Extended;
function OnVarCall(Index: Integer): Extended;
procedure SetSource(NewValue: String);
procedure SetUnknownNames(NewValue: Boolean);| Properties |
property Args : Integer
property Lib : TFormulaLib
property Source : String
property UnknownNames : Boolean| Events |
event OnFunction : TFunctionEvent
event OnVariable : TVariableEvent| Variables |
FCode : PChar;
FCodeSize : Integer;
FConst : PChar;
FConstSize : Integer;
FLib : TFormulaLib;
FNameList : TStringList;
FOnFunction : TFunctionEvent;
FOnVariable : TVariableEvent;
FOptions : Integer;
FSource : String;
FUnknownNames : Boolean;| Constructors |
constructor Create(AOwner: TComponent);TCustomFormula methods
| Functions |
destructor Destroy;prepare to call event
function NewFunction(const S: String): Integer;sets new formula - returns error code
FLD1 (D9E8); FWAIT (9B); RET (C3);
procedure Recompile;recompile Source
recompile Source
procedure Loaded;
procedure Notification(AComponent: TComponent; Operation: TOperation);
function Compile(S: String;
var Code: PChar; var CodeSize: Integer;
var Cnst: PChar; var ConstSize: Integer;
NameList: TStringList): Integer;Compile S into machine code } { Code - pointer to copiled code, CodeSize - size of code } { Cnst - pointer to array of constants, ConstSize - size of Cnst } { NameList - list of unknown names (aliases which are not defined in FLib)
Main method - compilation of expression
function GetArgs: Integer;get number of arguments in Source
function OnFuncCall(Index: Integer; ParamCount: Integer; Offs: Integer): Extended;OnFuncCall is called from the compiled code
function OnVarCall(Index: Integer): Extended;OnVarCall is called from the compiled code
procedure SetSource(NewValue: String);
procedure SetUnknownNames(NewValue: Boolean);| Properties |
property Args : IntegerRuntime only and read only . Number of arguments
property Lib : TFormulaLibassigned user library
property Source : Stringformula
property UnknownNames : Boolean| Events |
event OnFunction : TFunctionEvent
event OnVariable : TVariableEvent| Variables |
FCode : PChar;
FCodeSize : Integer;compiled code of Source
FConst : PChar;code size
FConstSize : Integer;array of used constants
FLib : TFormulaLib;
FNameList : TStringList;
FOnFunction : TFunctionEvent;
FOnVariable : TVariableEvent;
FOptions : Integer;size of FConst
FSource : String;
FUnknownNames : Boolean;TFormulaLib - assigned user library