vrq
cportdir.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  * cportdir.hpp
25  * - class definition of port direction
26  * definition nodes
27  *
28  ******************************************************************************
29  */
30 
31 #ifndef CPORTDIR_HPP
32 #define CPORTDIR_HPP
33 
34 #include <stdio.h>
35 #include "glue.h"
36 #include "cnode.h"
37 #include "cdecl.h"
38 
39 
40 class CNode;
41 
45 class CPortDir : public CDecl
46 {
47 private:
48  CDecl* decl;
49 public:
57  CPortDir( CSymbol* symbol, Coord_t* aLoc,
58  Decl_t type, CDataType* dataType );
64  virtual CDecl* Clone( CObstack* heap );
69  virtual void Dump( FILE* f );
74  CDecl* GetDecl( void ) { return decl; }
79  void SetDecl( CDecl* d ) { decl = d; }
80 protected:
86  void Copy( CObstack* heap, CPortDir& d );
87 private:
88  /*
89  * Disable copy constructor.
90  */
91  CPortDir( const CPortDir& );
92 public:
93  virtual void PreVisit1( int (*func)(CNode*,void*), void* data );
94  virtual void PostVisit1( void (*func)(CNode*, void*), void* data );
95  virtual void PostSubVisit1( CNode* (*func)(CNode*, void*), void* data );
96 };
97 
98 #endif // CPORT_HPP
Decl_t
Declaration types.
Definition: cdecl.h:74
Base class for describing data types.
Definition: cdatatype.h:108
CPortDir(CSymbol *symbol, Coord_t *aLoc, Decl_t type, CDataType *dataType)
Create a port direction declaration.
Structure to hold file coordinates.
Definition: cdecl.h:47
Holder for character strings.
Definition: csymbol.h:44
Bulk object allocation object.
Definition: cobstack.h:46
void Copy(CObstack *heap, CPortDir &d)
Deep copy of declaration.
Primary data structure representing parse tree nodes.
Definition: cnode.h:188
void SetDecl(CDecl *d)
Set association to variable declaration.
Definition: cportdir.h:79
CDecl * GetDecl(void)
Get variable declaration associated with this.
Definition: cportdir.h:74
Base class for describing declaration objects.
Definition: cdecl.h:164
Declaration object for input/output/inout statements.
Definition: cportdir.h:45
virtual void Dump(FILE *f)
Dump declaration to file descriptor.
virtual void PostVisit1(void(*func)(CNode *, void *), void *data)
virtual CDecl * Clone(CObstack *heap)
Create a clone of this declaration.
virtual void PostSubVisit1(CNode *(*func)(CNode *, void *), void *data)
virtual void PreVisit1(int(*func)(CNode *, void *), void *data)