vrq
cgate.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (C) 1997-2007, Mark Hummel
3  * This file is part of Vrq.
4  *
5  * Vrq is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * Vrq is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301 USA
19  *****************************************************************************
20  */
21 /******************************************************************************
22  *
23  *
24  * cgate.hpp
25  * - class definition a gate instance
26  *
27  ******************************************************************************
28  */
29 
30 #ifndef CGATE_HPP
31 #define CGATE_HPP
32 
33 #include "glue.h"
34 #include "cdecl.h"
35 #include "cnode.h"
36 
37 
38 
42 class CGate: public CDecl
43 {
44 private:
45  CSymbol* type;
46  CNode* delayControl;
47  CNode* arguments;
48  Strength_t strength0;
49  Strength_t strength1;
50 public:
61  CGate( CSymbol* aSymbol, CSymbol* type,
62  Strength_t s0, Strength_t s1,
63  CNode* delayControl, CNode* arguments, Coord_t* aLoc );
69  virtual CDecl* Clone( CObstack* heap );
74  CSymbol* GetType( void );
79  CNode* GetDelayControl( void );
84  CNode* GetArguments( void );
89  void SetArguments( CNode* n ) { arguments = n; }
94  virtual void Dump( FILE* f );
99  Strength_t Strength0() { return strength0; }
104  void Strength0( Strength_t pair ) { strength0 = pair; }
109  Strength_t Strength1() { return strength1; }
114  void Strength1( Strength_t pair ) { strength1 = pair; }
119  virtual void PreVisit1( int (*func)(CNode*,void*), void* data );
120  virtual void PostVisit1( void (*func)(CNode*, void*), void* data );
121  virtual void PostSubVisit1( CNode* (*func)(CNode*, void*), void* data );
122 protected:
128  void Copy( CObstack* heap, CGate& d );
129 private:
130  /*
131  * disable copy constructor
132  */
133  CGate( const CGate& );
137 };
138 
139 #endif // CGATE_HPP
Gate declaration object.
Definition: cgate.h:42
virtual void PreVisit1(int(*func)(CNode *, void *), void *data)
void Strength0(Strength_t pair)
Set 0 drive strength.
Definition: cgate.h:104
CNode * GetDelayControl(void)
Get gate's delay control.
Structure to hold file coordinates.
Definition: cdecl.h:47
Holder for character strings.
Definition: csymbol.h:44
void Copy(CObstack *heap, const CDecl &o)
Perform deep copy of given object to this one This should never be call directly, only by subclasses...
virtual CDecl * Clone(CObstack *heap)
Create a clone of this declaration.
Bulk object allocation object.
Definition: cobstack.h:46
Strength_t
Strength values.
Definition: cnode.h:93
void Strength1(Strength_t pair)
Set 1 drive strength.
Definition: cgate.h:114
Primary data structure representing parse tree nodes.
Definition: cnode.h:188
Strength_t Strength0()
Get 0 drive stength.
Definition: cgate.h:99
CSymbol * GetType(void)
Get gate's type.
virtual void PostSubVisit1(CNode *(*func)(CNode *, void *), void *data)
Base class for describing declaration objects.
Definition: cdecl.h:164
virtual void PostVisit1(void(*func)(CNode *, void *), void *data)
virtual void Dump(FILE *f)
Dump gate info to file descriptor.
void SetArguments(CNode *n)
Set gate's arguments.
Definition: cgate.h:89
CNode * GetArguments(void)
Get gate's arguments.
Strength_t Strength1()
Get 1 drive stength.
Definition: cgate.h:109
CGate(CSymbol *aSymbol, CSymbol *type, Strength_t s0, Strength_t s1, CNode *delayControl, CNode *arguments, Coord_t *aLoc)
Create a gate declaration.