00001 /* 00002 * Copyright (C) 2001, The University of Queensland 00003 * Copyright (C) 2002, Trent Waddington 00004 * 00005 * See the file "LICENSE.TERMS" for information on usage and 00006 * redistribution of this file, and for a DISCLAIMER OF ALL 00007 * WARRANTIES. 00008 * 00009 */ 00010 00011 /*============================================================================== 00012 * FILE: table.cc 00013 * OVERVIEW: Provides the implementation of classes Table, OpTable, and 00014 * ExprTable 00015 *============================================================================*/ 00016 00017 /* 00018 * 25 Feb 01 - Simon: sorted out dependancies 00019 * 01 May 02 - Mike: mods for boomerang 00020 */ 00021 00022 00023 #include <assert.h> 00024 #if defined(_MSC_VER) && _MSC_VER <= 1200 00025 #pragma warning(disable:4786) 00026 #endif 00027 00028 #include "types.h" 00029 #include "table.h" 00030 #include "statement.h" 00031 #include "exp.h" 00032 00033 Table::Table(TABLE_TYPE t) : 00034 type(t) 00035 { 00036 } 00037 00038 Table::Table(std::deque<std::string>& recs, TABLE_TYPE t /* = NAMETABLE */) : 00039 records(recs),type(t) 00040 { 00041 } 00042 00043 TABLE_TYPE Table::getType() const { return type; } 00044 00045 OpTable::OpTable(std::deque<std::string>& ops) : 00046 Table(ops, OPTABLE) 00047 { 00048 } 00049 00050 ExprTable::ExprTable(std::deque<Exp*>& exprs) : 00051 Table(EXPRTABLE),expressions(exprs) 00052 { 00053 } 00054 00055 ExprTable::~ExprTable(void) 00056 { 00057 std::deque<Exp*>::iterator loc; 00058 for (loc = expressions.begin(); loc != expressions.end(); loc++) 00059 delete (*loc); 00060 }