![]() |
![]() |
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 * csimpletype.h 00025 * - abstract class for simple built in data types 00026 * 00027 * 00028 ****************************************************************************** 00029 */ 00030 00031 #ifndef CSIMPLETYPE_H 00032 #define CSIMPLETYPE_H 00033 00034 #include "cobject.h" 00035 #include "cdatatype.h" 00036 00037 00041 class CSimpleType : public CDataType 00042 { 00043 public: 00044 private: 00045 int signedAttr; 00046 int unsignedAttr; 00047 CNode* range; 00048 public: 00052 CSimpleType( VarDataType_t vt, CNode* aRange ); 00057 virtual CDataType* Clone( CObstack* heap ); 00062 virtual int GetSignedAttr() const { return signedAttr; } 00067 virtual int GetUnsignedAttr() const { return unsignedAttr; } 00072 virtual void SetSignedAttr( int v ) { signedAttr = v; } 00077 virtual void SetUnsignedAttr( int v ) { unsignedAttr = v; } 00082 virtual int GetSigned() const; 00087 virtual int GetTwoState() const; 00092 virtual NodeType_t GetNodeType( void ) const; 00097 virtual void SetPackedRange( CNode* r ) { range = r; } 00102 virtual int IsPacked() const { return TRUE; } 00107 virtual CNode* GetPackedRange() const { return range; } 00112 virtual void Dump( FILE* f ) const; 00120 virtual void PreVisit1( int (*callback)(CNode*,void*), void* data ); 00127 virtual void PostVisit1( void (*callback)(CNode*,void*), void* data ); 00136 virtual void PostSubVisit1( CNode* (*callback)(CNode*, void*), void* data ); 00137 protected: 00144 void Copy( CObstack* heap, const CSimpleType& o ); 00145 private: 00146 /* 00147 * disable copy constructor 00148 */ 00149 CSimpleType( const CSimpleType& o ); 00150 00151 }; 00152 00153 #endif // CSIMPLETYPE_H 00154