/* An simple symbol table written using Pascal/C style */ /* based on a translation of pages 93 to 98 into C++ */ /* WARNING: this has not been checked and needs fixing. */ #include // OR #include #include #include using namespace std; const int ERROR=0; class node; typedef node* ptr; class node{ public: ptr right; char id; int val; }; ptr p; int obtain(char ch) { //cerr <<"debug obtain "<id == ch) { //cerr <<"debug obtained "<val<val; } else { q=q->right; } } // else if not found cout <<"variable "<id=ch; p->val=i; p->right=q; } void remove(char ch) { //cerr <<"debug remove "<id<<" "<< q->val<right; } } int main() { initialize(); add('a', 10); add('b', 25); add('c', 5); cout<< "Test add"<