TExpression =
class
private
protected
function GetAsString: String; virtual;
function GetAsFloat: Double; virtual;
function GetAsInteger: Integer; virtual;
function GetAsBoolean: Boolean; virtual;
function GetExprType: TExprType; virtual; abstract;
public
property AsString: String read GetAsString;//属性咋用C++BULIDER表示
property AsFloat: Double read GetAsFloat;
property AsInteger: Integer read GetAsInteger;
property AsBoolean: Boolean read GetAsBoolean;
property ExprType: TExprType read GetExprType;
function CanReadAs(aExprType: TExprType): Boolean;
{means 'can be interpreted as'. Sort of}
constructor Create;
destructor Destroy; override;
end;//以下代码啥意识
TIdentifierFunction = function( const Identifier: String;
ParameterList: TParameterList): TExpression of Object;function CreateExpression( const S: String;
IdentifierFunction: TIdentifierFunction): TExpression;
class
private
protected
function GetAsString: String; virtual;
function GetAsFloat: Double; virtual;
function GetAsInteger: Integer; virtual;
function GetAsBoolean: Boolean; virtual;
function GetExprType: TExprType; virtual; abstract;
public
property AsString: String read GetAsString;//属性咋用C++BULIDER表示
property AsFloat: Double read GetAsFloat;
property AsInteger: Integer read GetAsInteger;
property AsBoolean: Boolean read GetAsBoolean;
property ExprType: TExprType read GetExprType;
function CanReadAs(aExprType: TExprType): Boolean;
{means 'can be interpreted as'. Sort of}
constructor Create;
destructor Destroy; override;
end;//以下代码啥意识
TIdentifierFunction = function( const Identifier: String;
ParameterList: TParameterList): TExpression of Object;function CreateExpression( const S: String;
IdentifierFunction: TIdentifierFunction): TExpression;
解决方案 »
- dbgrideh的OnDrawColumnCell
- 我想把DLL打包进EXE.请问有什么好方法?
- DBGrid里面查询出来的内容怎么导出到文本文件????????????
- 怎样将十六进制的串转换成字符串,然后进行传输?
- DBgrid的数据更新,统计问题
- 多线程问题
- 怎样写软件的测试报告?能否给一个范例!
- 早上给我发短信的朋友,我回答你的问题的时候csdn出了问题,我现在进来找不到你的帖子了,你的问题是一个函数指针的问题。里面是解答
- 帮我找本书
- 软件做完了,怎么作成安装程序,要注意什么?
- 有人给我推荐用友华表的cell组件处理报表及打印的问题,哪位老兄用过?给点建议
- 在delphi中如何声明和调用含有传址参数的DLL函数?
定义一个函数指针的类型。函数指针来的。
TIdentifierFunction = function( const Identifier: String;
ParameterList: TParameterList): TExpression of Object;==>
TExpression* (__closure *TIdentifierFunction)(const String Identifier,
TParameterList *ParameterList);
{
protected
virtual AnsiString __fastcall GetAsString;
...
//函数的建立可以利用BCB中ClassExplorer中的new Method的创建,创建格式可以参考。
virtual TExprType __fastcall GetExprType = 0
public
//属性的定义木石三已讲
__fastcall TExpression(); //constructor
__fastcall ~TExpression(); //destructor
end;
};TIdentifierFunction 参考木石三所讲。
使用范例:
function Exam( const S: String; P: TParameterList): TExpression
....
procedure .............................
var
aaaa :TIdentifierFunction ;
bbbb : P: TParameterList;
begin
aaaa := Exam;
aaaa('exam',bbbb );
end;