00001 /* 00002 * Copyright (C) 2001, The University of Queensland 00003 * 00004 * See the file "LICENSE.TERMS" for information on usage and 00005 * redistribution of this file, and for a DISCLAIMER OF ALL 00006 * WARRANTIES. 00007 * 00008 */ 00009 00010 /*============================================================================== 00011 * FILE: table.h 00012 * OVERVIEW: Provides the definition of class Table and children used by 00013 * the SSL parser 00014 *============================================================================*/ 00015 00016 /* 00017 * 25 Feb 01 - Simon: updated post creation 00018 * 10 May 02 - Mike: Mods for boomerang 00019 */ 00020 00021 #ifndef TABLE_H 00022 #define TABLE_H 00023 00024 #include <string> 00025 #include <deque> 00026 00027 // Kinds of SSL specification tables 00028 enum TABLE_TYPE { 00029 NAMETABLE, 00030 OPTABLE, 00031 EXPRTABLE 00032 }; 00033 00034 class Table { 00035 public: 00036 Table(std::deque<std::string>& recs, TABLE_TYPE t = NAMETABLE); 00037 Table(TABLE_TYPE t); 00038 TABLE_TYPE getType() const; 00039 std::deque<std::string> records; 00040 00041 private: 00042 TABLE_TYPE type; 00043 }; 00044 00045 class OpTable : public Table { 00046 public: 00047 OpTable(std::deque<std::string>& ops); 00048 }; 00049 00050 class Exp; 00051 00052 class ExprTable : public Table { 00053 public: 00054 ExprTable(std::deque<Exp*>& exprs); 00055 ~ExprTable(void); 00056 std::deque<Exp*> expressions; 00057 }; 00058 00059 #endif