Cell.hpp

Go to the documentation of this file.
00001 
00786 #ifndef CELL_HPP
00787 #define CELL_HPP
00788 
00789 #include <cstddef>
00790 #include <cstdlib>
00791 #include <iostream>
00792 #include <fstream>
00793 #include <sstream>
00794 #include <string>
00795 #include <stack>
00796 
00797 using namespace std;
00798 
00803 class Cell {
00804 public:
00805 
00809   Cell(const int i);
00810 
00814   Cell(const double d);
00815 
00819   Cell(const char* const s);
00820 
00824   Cell(Cell* const my_car, Cell* const my_cdr);
00825 
00830   bool is_int() const;
00831 
00836   bool is_double() const;
00837 
00842   bool is_symbol() const;
00843 
00848   bool is_cons() const;
00849 
00854   int get_int() const;
00855 
00860   double get_double() const;
00861 
00866   string get_symbol() const;
00867 
00872   Cell* get_car() const;
00873 
00878   Cell* get_cdr() const;
00879 
00884   void print(ostream& os = cout) const;
00885 
00886 private:
00887 
00888   string sexpr_m;
00889 
00890 };
00891 
00892 // Reminder: cons.hpp expects nil to be defined somewhere (for this
00893 // implementation, Cell.cpp is the logical place to define it).
00894 // Here we promise this again, just to be safe.
00895 extern Cell* const nil;
00896 
00897 #endif // CELL_HPP

Generated on Thu Mar 8 12:59:26 2007 for a1 by  doxygen 1.4.6