Cell Class Reference

Class Cell. More...

#include <Cell.hpp>

List of all members.

Public Member Functions

 Cell (const int i)
 Constructor to make int cell.
 Cell (const double d)
 Constructor to make double cell.
 Cell (const char *const s)
 Constructor to make symbol cell.
 Cell (Cell *const my_car, Cell *const my_cdr)
 Constructor to make cons cell.
bool is_int () const
 Check if this is an int cell.
bool is_double () const
 Check if this is a double cell.
bool is_symbol () const
 Check if this is a symbol cell.
bool is_cons () const
 Check if this is a cons cell.
int get_int () const
 Accessor (error if this is not an int cell).
double get_double () const
 Accessor (error if this is not a double cell).
string get_symbol () const
 Accessor (error if this is not a symbol cell).
Cellget_car () const
 Accessor (error if this is not a cons cell).
Cellget_cdr () const
 Accessor (error if this is not a cons cell).
void print (ostream &os=cout) const
 Print the subtree rooted at this cell, in s-expression notation.

Private Attributes

string sexpr_m


Detailed Description

Class Cell.

Constructor & Destructor Documentation

Cell::Cell ( const int  i  ) 

Constructor to make int cell.

Cell::Cell ( const double  d  ) 

Constructor to make double cell.

Cell::Cell ( const char *const   s  ) 

Constructor to make symbol cell.

Cell::Cell ( Cell *const   my_car,
Cell *const   my_cdr 
)

Constructor to make cons cell.


Member Function Documentation

bool Cell::is_int (  )  const

Check if this is an int cell.

Returns:
True iff this is an int cell.

bool Cell::is_double (  )  const

Check if this is a double cell.

Returns:
True iff this is a double cell.

bool Cell::is_symbol (  )  const

Check if this is a symbol cell.

Returns:
True iff this is a symbol cell.

bool Cell::is_cons (  )  const

Check if this is a cons cell.

Returns:
True iff this is a cons cell.

int Cell::get_int (  )  const

Accessor (error if this is not an int cell).

Returns:
The value in this int cell.

double Cell::get_double (  )  const

Accessor (error if this is not a double cell).

Returns:
The value in this double cell.

string Cell::get_symbol (  )  const

Accessor (error if this is not a symbol cell).

Returns:
The symbol name in this symbol cell.

Cell* Cell::get_car (  )  const

Accessor (error if this is not a cons cell).

Returns:
First child cell.

Cell* Cell::get_cdr (  )  const

Accessor (error if this is not a cons cell).

Returns:
Rest child cell.

void Cell::print ( ostream &  os = cout  )  const

Print the subtree rooted at this cell, in s-expression notation.

Parameters:
os The output stream to print to.


Member Data Documentation

string Cell::sexpr_m [private]


The documentation for this class was generated from the following files:
Generated on Mon Mar 10 09:45:35 2008 for a1 by  doxygen 1.5.3