#include "Node.hpp"
#include "Cell.hpp"
#include <string>
#include <iostream>
Go to the source code of this file.
Functions | |
Cell * | make_int (int i) |
Make an int cell. | |
Cell * | make_double (double d) |
Make a double cell. | |
Cell * | make_symbol (const char *s) |
Make a symbol cell. | |
Node * | make_node (Cell *my_elem, Node *my_next) |
Make a linked list node. | |
bool | intp (const Cell *c) |
Check if d points to an int node. | |
bool | doublep (const Cell *c) |
Check if d points to a double node. | |
bool | symbolp (const Cell *c) |
Check if d points to a symbol node. | |
int | get_int (const Cell *c) |
Accessor (error if d is not an int node). | |
double | get_double (const Cell *c) |
Accessor (error if d is not a double node). | |
char * | get_symbol (const Cell *c) |
Retrieve the symbol name as a string (error if d is not a symbol node). | |
Cell * | get_elem (const Node *n) |
Accessor. | |
Node * | get_next (const Node *n) |
Accessor. | |
std::ostream & | operator<< (std::ostream &os, const Node &n) |
Print the linked list rooted at n in parentheses. |
bool doublep | ( | const Cell * | c | ) | [inline] |
Check if d points to a double node.
double get_double | ( | const Cell * | c | ) | [inline] |
Accessor (error if d is not a double node).
Accessor.
int get_int | ( | const Cell * | c | ) | [inline] |
Accessor (error if d is not an int node).
Accessor.
char* get_symbol | ( | const Cell * | c | ) | [inline] |
Retrieve the symbol name as a string (error if d is not a symbol node).
bool intp | ( | const Cell * | c | ) | [inline] |
Check if d points to an int node.
Cell* make_double | ( | double | d | ) | [inline] |
Make a double cell.
d | The initial double value to be stored in the new cell. |
Cell* make_int | ( | int | i | ) | [inline] |
Make an int cell.
i | The initial int value to be stored in the new cell. |
Referenced by main().
Make a linked list node.
my_elem | Pointer to the element to be held by this node. | |
my_next | Pointer to the next node. |
Referenced by main().
Cell* make_symbol | ( | const char * | s | ) | [inline] |
Make a symbol cell.
s | The initial symbol name to be stored in the new cell. |
std::ostream& operator<< | ( | std::ostream & | os, | |
const Node & | n | |||
) | [inline] |
Print the linked list rooted at n in parentheses.
os | The output stream to print to. | |
n | The root node of the linked list to be printed. |
bool symbolp | ( | const Cell * | c | ) | [inline] |
Check if d points to a symbol node.