proj home

Files   Classes   Functions   Hierarchy  

isrpnstring Class Reference

#include <rpnfunc.h>

Inheritance diagram for isrpnstring:
Collaboration diagram for isrpnstring:

List of all members.

Public Member Functions

 isrpnstring ()
 isrpnstring (deque< rpnbase * > &ds, bool const evaluate=true)
 ~isrpnstring ()
rpnbasecopy () const
string const name () const
void eval (deque< rpnbase * > &ds)


Detailed Description

Definition at line 931 of file rpnfunc.h.


Constructor & Destructor Documentation

isrpnstring::isrpnstring (  )  [inline]

Definition at line 935 of file rpnfunc.h.

Referenced by copy().

00935 {}

isrpnstring::isrpnstring ( deque< rpnbase * > &  ds,
bool const   evaluate = true 
)

Definition at line 2914 of file rpnfunc.cpp.

References eval().

02915 {
02916   if (evaluate)
02917     eval(ds);
02918   else
02919     ds.push_front(this);
02920 }

isrpnstring::~isrpnstring (  )  [inline]

Definition at line 937 of file rpnfunc.h.

00937 {}


Member Function Documentation

rpnbase * isrpnstring::copy (  )  const [virtual]

Reimplemented from rpnfunction.

Definition at line 2922 of file rpnfunc.cpp.

References isrpnstring().

02923 {
02924   return new isrpnstring();
02925 }

void isrpnstring::eval ( deque< rpnbase * > &  ds  )  [virtual]

Reimplemented from rpnfunction.

Definition at line 2927 of file rpnfunc.cpp.

References rpnbase::dec(), rpnbase::isstring(), and rpninteger::num.

Referenced by isrpnstring().

02928 {
02929   if(ds.empty())
02930     return;
02931 
02932   ds[0]->accept(ds,*this);
02933 
02934   rpninteger* res = new rpninteger();
02935   res->num = 0;
02936 
02937   if( ds[0]->isstring() )
02938     res->num = 1;
02939 
02940   ds.push_front(res);
02941 
02942   dec();
02943 }

string const isrpnstring::name (  )  const [inline, virtual]

Reimplemented from rpnfunction.

Definition at line 940 of file rpnfunc.h.

00940 { return string("isstring"); }


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:04 2011 for Chelton Evans Source by  doxygen 1.5.8