Listing 2: Class Base_Expression points to root of

expression tree


class  Base_Expression  :  Exp_Obj
    {
    protected:
        Exp_Obj  *exp;
        ExpStack  exp_stack,  op_stack;
        //  more  protected  elements  ...
    public:
        Base_Expression(  void  )  {  exp=NULL;  }
        ~Base_Expression(  void  )  {  delete  exp;  }
        virtual  void  GetToken(char  *str,int  &pos,char  *buffer,
                                int  &type,  int  &error)=0;
        virtual  int  GetType(  void  )  {  return  EXPRESSION_TYPE;  }
        virtual  float  GetValue(  Symbol_Table  &sym  )  
            { return  exp->GetValue(sym);}
        virtual  float  GetValue(void)  {Symbol_Table  sym;
            return  exp->GetValue(sym);}
        virtual  void  Push_Tree(Exp_Obj  *obj);
        virtual  void  Build(  Exp_Obj  *obj  );
        virtual  Exp_Obj  *Build_Expression(  char  *str  );
        //  more  member  functions  ...
        };
/* End of File */