vrq
/usr/src/RPM/BUILD/vrq-1.0.96/src/cparam.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (C) 1997-2007, 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  *         cparam.hpp
00025  *              - class definition of parameter 
00026  *                definition nodes
00027  *
00028  ******************************************************************************
00029  */
00030 
00031 #ifndef CPARAM_HPP
00032 #define CPARAM_HPP
00033 
00034 #include <stdio.h>
00035 #include "glue.h"
00036 #include "cnode.h"
00037 #include "cdecl.h"
00038 
00039 
00040 class CNode;
00041 
00042 
00046 class CParam: public CDecl
00047 {
00048 private:
00049         CNode*  expression;  
00050         int     specify;     
00051         int     inlined;     
00052 
00053 public:
00061         CParam( CSymbol* symbol, Coord_t* aLoc, 
00062                 Decl_t type, CDataType* dataType );
00068         virtual CDecl* Clone( CObstack* heap );
00073         void    Specify( int v ) { specify = v; }
00078         int     Specify( void ) { return specify; }
00083         void    SetExpression( CNode* aExp );
00088         CNode*  GetExpression( void );
00093         virtual NodeType_t GetNodeType( void );
00099         virtual int  IsWidthConstant( void );
00105         virtual int  IsWidthVolatile( void );
00110         virtual int  IsWidthEvaluateable( void );
00115         virtual INT32 GetWidth( void );
00120         virtual CNode* GetWidthExp( void );
00125         virtual CNode* GetMsb();
00130         virtual CNode* GetLsb();
00135         virtual void Dump( FILE* f );
00141         void    SetInlined( int v ) { inlined = v; }
00147         int     GetInlined() { return inlined; }
00152         void    PreVisit1( int (*func)(CNode*,void*), void* data );
00153         void    PostVisit1( void (*func)(CNode*, void*), void* data );
00154         void    PostSubVisit1( CNode* (*func)(CNode*, void*), void* data );
00155 protected:
00159         void    Copy( CObstack* heap, CParam& param );
00160 private:
00161         /*
00162          * Disable copy constructor.
00163          */
00164         CParam( const CParam& param );
00168 };
00169 
00170 #endif // CPARAM_HPP