#include <Cell.hpp>
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). | |
| Cell * | get_car () const |
| Accessor (error if this is not a cons cell). | |
| Cell * | get_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 |
| Cell::Cell | ( | const int | i | ) |
| Cell::Cell | ( | const double | d | ) |
| Cell::Cell | ( | const char *const | s | ) |
| Cell* Cell::get_car | ( | ) | const |
| Cell* Cell::get_cdr | ( | ) | const |
| double Cell::get_double | ( | ) | const |
Accessor (error if this is not a double cell).
Referenced by get_double().
| int Cell::get_int | ( | ) | const |
Accessor (error if this is not an int cell).
Referenced by get_int().
| string Cell::get_symbol | ( | ) | const |
Accessor (error if this is not a symbol cell).
Referenced by get_symbol().
| bool Cell::is_cons | ( | ) | const |
| bool Cell::is_double | ( | ) | const |
| bool Cell::is_int | ( | ) | const |
| bool Cell::is_symbol | ( | ) | const |
| void Cell::print | ( | ostream & | os = cout |
) | const |
Print the subtree rooted at this cell, in s-expression notation.
| os | The output stream to print to. |
References sexpr_m.
Referenced by Cell(), and operator<<().
string Cell::sexpr_m [private] |
1.5.8