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
00802 class Cell {
00803 public:
00804
00808 Cell(int i);
00809
00813 Cell(double d);
00814
00818 Cell(const char* s);
00819
00823 Cell(const Cell* my_car, const Cell* my_cdr);
00824
00829 bool is_int() const;
00830
00835 bool is_double() const;
00836
00841 bool is_symbol() const;
00842
00847 bool is_cons() const;
00848
00853 int get_int() const;
00854
00859 double get_double() const;
00860
00865 std::string get_symbol() const;
00866
00871 Cell* get_car() const;
00872
00877 Cell* get_cdr() const;
00878
00883 void print(std::ostream& os = std::cout) const;
00884
00885 private:
00886
00887 std::string sexpr_m;
00888
00889 };
00890
00891
00892
00893
00894 extern const Cell* nil;
00895
00896 #endif // CELL_HPP