vrq
cvar.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (C) 1997-2010, 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  * cvar.hpp
25  * - class definition of variable
26  * definition nodes
27  *
28  ******************************************************************************
29  */
30 
31 #ifndef CVAR_H
32 #define CVAR_H
33 
34 #include <stdio.h>
35 #include "glue.h"
36 #include "cnode.h"
37 #include "cdecl.h"
38 #include "cdatatype.h"
39 
40 
41 class CNode;
42 
43 /*
44  * handle variable declarations
45  */
46 
50 class CVar: public CDecl
51 {
52 private:
53  int undefined; // TRUE if undefined in source
54 public:
62  CVar( CSymbol* symbol, Coord_t* aLoc,
63  CDataType* dataType, int undefined = FALSE );
69  virtual CDecl* Clone( CObstack* heap );
74  int GetUndefined( void ) { return undefined; }
79  void SetUndefined( int value ) { undefined = value; }
84  virtual void Dump( FILE* f );
85 protected:
86  /*
87  * Deep Copy.
88  */
89  void Copy( CObstack* heap, CVar& var );
90 private:
91  /*
92  * Disable copy constructor.
93  */
94  CVar( const CVar& var );
95 };
96 
97 #endif // CVAR_H
Base class for describing data types.
Definition: cdatatype.h:110
int GetUndefined(void)
Get undefined attribute.
Definition: cvar.h:74
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
Primary data structure representing parse tree nodes.
Definition: cnode.h:188
void Copy(CObstack *heap, CVar &var)
Base class for describing declaration objects.
Definition: cdecl.h:164
Declaration object for variables.
Definition: cvar.h:50
virtual void Dump(FILE *f)
Dump register info to file.
virtual CDecl * Clone(CObstack *heap)
Create a clone of this declaration.
void SetUndefined(int value)
Set undefined attribute.
Definition: cvar.h:79
CVar(CSymbol *symbol, Coord_t *aLoc, CDataType *dataType, int undefined=FALSE)
Create a register declaration.