Cell.hpp

Go to the documentation of this file.
00001 
00794 #ifndef CELL_HPP
00795 #define CELL_HPP
00796 
00797 #include <cstddef>
00798 #include <cstdlib>
00799 #include <iostream>
00800 #include <fstream>
00801 #include <sstream>
00802 #include <string>
00803 #include <stack>
00804 
00805 using namespace std;
00806 
00811 class Cell {
00812 public:
00813 
00817   Cell(const int i);
00818 
00822   Cell(const double d);
00823 
00827   Cell(const char* const s);
00828 
00832   Cell(Cell* const my_car, Cell* const my_cdr);
00833 
00838   bool is_int() const;
00839 
00844   bool is_double() const;
00845 
00850   bool is_symbol() const;
00851 
00856   bool is_cons() const;
00857 
00862   int get_int() const;
00863 
00868   double get_double() const;
00869 
00874   string get_symbol() const;
00875 
00880   Cell* get_car() const;
00881 
00886   Cell* get_cdr() const;
00887 
00892   void print(ostream& os = cout) const;
00893 
00894 private:
00895 
00896   string sexpr_m;
00897 
00898 };
00899 
00900 // Reminder: cons.hpp expects nil to be defined somewhere (for this
00901 // implementation, Cell.cpp is the logical place to define it).
00902 // Here we promise this again, just to be safe.
00903 extern Cell* const nil;
00904 
00905 #endif // CELL_HPP

Generated on Mon Mar 10 09:45:35 2008 for a1 by  doxygen 1.5.3