00001 /***************************************************************************** 00002 * Copyright (C) 1997-2010, Mark Hummel 00003 * This file is part of Vrq. 00004 * 00005 * Vrq is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * Vrq is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301 USA 00019 ***************************************************************************** 00020 */ 00021 /****************************************************************************** 00022 * 00023 * 00024 * cvar.hpp 00025 * - class definition of variable 00026 * definition nodes 00027 * 00028 ****************************************************************************** 00029 */ 00030 00031 #ifndef CVAR_H 00032 #define CVAR_H 00033 00034 #include <stdio.h> 00035 #include "glue.h" 00036 #include "cnode.h" 00037 #include "cdecl.h" 00038 #include "cdatatype.h" 00039 00040 00041 class CNode; 00042 00043 /* 00044 * handle variable declarations 00045 */ 00046 00050 class CVar: public CDecl 00051 { 00052 private: 00053 int undefined; // TRUE if undefined in source 00054 public: 00062 CVar( CSymbol* symbol, Coord_t* aLoc, 00063 CDataType* dataType, int undefined = FALSE ); 00069 virtual CDecl* Clone( CObstack* heap ); 00074 int GetUndefined( void ) { return undefined; } 00079 void SetUndefined( int value ) { undefined = value; } 00084 virtual void Dump( FILE* f ); 00085 protected: 00086 /* 00087 * Deep Copy. 00088 */ 00089 void Copy( CObstack* heap, CVar& var ); 00090 private: 00091 /* 00092 * Disable copy constructor. 00093 */ 00094 CVar( const CVar& var ); 00095 }; 00096 00097 #endif // CVAR_H