proj home

Files   Classes   Functions   Hierarchy  

Public Member Functions | Public Attributes | List of all members
rpnstring Class Reference

#include <rpn.h>

Inheritance diagram for rpnstring:
Inheritance graph
Collaboration diagram for rpnstring:
Collaboration graph

Public Member Functions

 rpnstring ()
 rpnstring (deque< rpnbase * > &ds, string const &s)
 ~rpnstring ()
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
void eval (deque< rpnbase * > &ds)
bool const isstring () const
 rpnstring ()
 rpnstring (deque< rpnbase * > &ds, string const &s)
 ~rpnstring ()
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
void eval (deque< rpnbase * > &ds)
bool const isstring () const
- Public Member Functions inherited from rpnbase
virtual void inc ()
void dec ()
 rpnbase ()
virtual ~rpnbase ()=0
virtual string const name () const
virtual bool const isinteger () const
virtual bool const isreal () const
virtual bool const iscomplex () const
virtual bool const isprogram () const
virtual bool const isvariable () const
virtual bool const isvector () const
bool const isnumber () const
virtual void inc ()
void dec ()
 rpnbase ()
virtual ~rpnbase ()=0
virtual string const name () const
virtual bool const isinteger () const
virtual bool const isreal () const
virtual bool const isprogram () const
virtual bool const isvariable () const
virtual bool const isvector () const
bool const isnumber () const

Public Attributes

string str
- Public Attributes inherited from rpnbase
unsigned int counter

Detailed Description

Definition at line 183 of file rpn.h.

Constructor & Destructor Documentation

rpnstring::rpnstring ( )
inline

Definition at line 189 of file rpn.h.

Referenced by copy().

{}
rpnstring::rpnstring ( deque< rpnbase * > &  ds,
string const &  s 
)

Definition at line 171 of file rpn.cpp.

References eval().

:str(s)
{
eval(ds);
}
rpnstring::~rpnstring ( )
inline

Definition at line 191 of file rpn.h.

{}
rpnstring::rpnstring ( )
inline

Definition at line 155 of file rpn2.h.

{}
rpnstring::rpnstring ( deque< rpnbase * > &  ds,
string const &  s 
)
rpnstring::~rpnstring ( )
inline

Definition at line 157 of file rpn2.h.

{}

Member Function Documentation

void rpnstring::accept ( deque< rpnbase * > &  ds,
rpnfunction f 
)
inlinevirtual

Reimplemented from rpnbase.

Definition at line 160 of file rpn2.h.

References rpnfunction::visit().

{ f.visit(ds,*this); }
void rpnstring::accept ( deque< rpnbase * > &  ds,
rpnfunction f 
)
inlinevirtual

Reimplemented from rpnbase.

Definition at line 194 of file rpn.h.

References rpnfunction::visit().

{ f.visit(ds,*this); }
rpnbase* rpnstring::copy ( ) const
virtual

Implements rpnbase.

rpnbase * rpnstring::copy ( ) const
virtual

Implements rpnbase.

Definition at line 196 of file rpn.cpp.

References rpnstring(), and str.

{
rpnstring* s = new rpnstring();
s->str = str;
return s;
}
void rpnstring::eval ( deque< rpnbase * > &  ds)
virtual

Reimplemented from rpnbase.

void rpnstring::eval ( deque< rpnbase * > &  ds)
inlinevirtual

Reimplemented from rpnbase.

Definition at line 203 of file rpn.cpp.

Referenced by rpnstring().

{
ds.push_front(this);
}
bool const rpnstring::isstring ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 167 of file rpn2.h.

{ return true; }
bool const rpnstring::isstring ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 201 of file rpn.h.

{ return true; }
ostream& rpnstring::print ( ostream os) const
virtual

Reimplemented from rpnbase.

ostream & rpnstring::print ( ostream os) const
virtual

Reimplemented from rpnbase.

Definition at line 177 of file rpn.cpp.

References str.

{
if (str=="/")
return os << "\"/\"";
if (str.find(' ')!=string::npos)
return os << '"' << str << '"';
return os << str;
/*
if (str != "/")
return os << str;
// To distinguish between division and root node.
return os << string("\"/");
*/
}

Member Data Documentation

string rpnstring::str

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