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;

解决方案 »

  1.   

    property AsString: String read GetAsString;__property AnsiString AsString = { read = GetAsString }//以下代码啥意识
    定义一个函数指针的类型。函数指针来的。
     TIdentifierFunction = function( const Identifier: String;
                                      ParameterList: TParameterList): TExpression of Object;==>
    TExpression* (__closure *TIdentifierFunction)(const String Identifier,
      TParameterList *ParameterList);
      

  2.   

    可以结贴了。copy_paste(木石三)兄已经说得很清楚了!
      

  3.   

    补充一下:class TExpression 
    {
     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;