vrq
/usr/src/RPM/BUILD/vrq-1.0.96/src/cinstance.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  *         cinstance.hpp
00025  *              - class definition an instance
00026  *                of module, macromodules, and primitive 
00027  *                definition nodes
00028  *
00029  ******************************************************************************
00030  */
00031 
00032 #ifndef CINSTANCE_HPP
00033 #define CINSTANCE_HPP
00034 
00035 #include <vector>
00036 #include "glue.h"
00037 #include "cdecl.h"
00038 
00039 
00040 class CModule;
00041 
00045 class CInstance: public CDecl
00046 {
00047 private:
00048         CModule*        definition;     
00049         CNode*          parameters;     
00050         CNode*          arguments;      
00051         int             isGate;         
00052         vector<CNode*>  argumentVector; 
00053         unsigned long long timestamp;   
00054 
00055         unsigned long long cachedTimestamp; 
00056 
00057 public:
00066         CInstance( CSymbol* aSymbol, CModule* definition, 
00067                            CNode* parameters, CNode* arguments, Coord_t* aLoc );
00073         virtual CDecl* Clone( CObstack* heap );
00078         CModule* GetDefinition( void );
00083         CNode*   GetParameters( void );
00088         void     SetParameters( CNode* param );
00093         CNode*   GetArguments( void );
00098         void     SetArguments( CNode* n );
00103         vector<CNode*>* GetArgumentVector( void );
00108         int      IsGate() { return isGate; }
00113         virtual void Dump( FILE* f );
00118         void    PreVisit1( int (*func)(CNode*,void*), void* data );
00119         void    PostVisit1( void (*func)(CNode*, void*), void* data );
00120         void    PostSubVisit1( CNode* (*func)(CNode*, void*), void* data );
00121 private:
00122         void    PushArgs( CNode* n, int level );
00123         CInstance( const CInstance& );
00127 };
00128 
00129 #endif // CINSTANCE_HPP