microScheme
|
Go to the source code of this file.
Functions | |
Cell * | make_int (const int i) |
Make an int cell. More... | |
Cell * | make_double (const double d) |
Make a double cell. More... | |
Cell * | make_symbol (const char *const s) |
Make a symbol cell. More... | |
Cell * | cons (Cell *const my_car, Cell *const my_cdr) |
Make a conspair cell. More... | |
bool | nullp (Cell *const c) |
Check if c points to an empty list, i.e., is a null pointer. More... | |
bool | listp (Cell *const c) |
Check if c points to a list (i.e., nil or a cons cell). More... | |
bool | intp (Cell *const c) |
Check if c points to an int cell. More... | |
bool | doublep (Cell *const c) |
Check if c points to a double cell. More... | |
bool | symbolp (Cell *const c) |
Check if c points to a symbol cell. More... | |
int | get_int (Cell *const c) |
Accessor (error if c is not an int cell). More... | |
double | get_double (Cell *const c) |
Accessor (error if c is not a double cell). More... | |
string | get_symbol (Cell *const c) |
Retrieve the symbol name as a string (error if c is not a symbol cell). More... | |
Cell * | car (Cell *const c) |
Accessor (error if c is not a cons cell). More... | |
Cell * | cdr (Cell *const c) |
Accessor (error if c is not a string cell). More... | |
ostream & | operator<< (ostream &os, const Cell &c) |
Print the subtree rooted at c, in s-expression notation. More... | |
Variables | |
Cell *const | nil |
The null pointer value. More... | |
Encapsulates an abstract interface layer for a cons list ADT, without using member functions. Makes no assumptions about what kind of concrete type Cell will be defined to be.
|
inline |
Accessor (error if c is not a cons cell).
Referenced by separate_parse().
|
inline |
Accessor (error if c is not a string cell).
Referenced by separate_parse().
|
inline |
Make a conspair cell.
my_car | The initial car pointer to be stored in the new cell. |
my_cdr | The initial cdr pointer to be stored in the new cell. |
Referenced by separate_parse().
|
inline |
|
inline |
Accessor (error if c is not a double cell).
|
inline |
Accessor (error if c is not an int cell).
|
inline |
Retrieve the symbol name as a string (error if c is not a symbol cell).
|
inline |
|
inline |
Check if c points to a list (i.e., nil or a cons cell).
References nullp().
|
inline |
Make a double cell.
d | The initial double value to be stored in the new cell. |
Referenced by makecell().
|
inline |
Make an int cell.
i | The initial int value to be stored in the new cell. |
Referenced by makecell().
|
inline |
Make a symbol cell.
s | The initial symbol name to be stored in the new cell. |
Referenced by makecell().
|
inline |
|
inline |
Print the subtree rooted at c, in s-expression notation.
os | The output stream to print to. |
c | The root cell of the subtree to be printed. |
|
inline |
Cell* const nil |
The null pointer value.
Referenced by nullp().