// Class Name: tree_content // // Purpose: // // Defines an object that is held in the abstract syntax tree generated // from the program being parsed. #ifndef TREE_CONTENT_CLASS #define TREE_CONTENT_CLASS #include "strings.h" class tree_content { public: tree_content(int token, const string &token_text, int line, int position); // constructs a tree node with the language-defined token number of "token" // and with the actual text found in "token_text". The line number and // character position are also included so that the original location in // the source text is retained. ~tree_content(); // pack: returns a packed form of this tree_content. // virtual byte *pack(int &size) const; // this constructor reconstitutes a tree_content from a packed form. // friend packable *tree_content_unpack(byte *packed_form, int size); int token() const; string token_text() const; int line_number() const; int position() const; private: int my_line_number; int my_position; int my_token; string my_token_text; }; #endif