vrq
cmacro.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  * cmacro.hpp
25  * - class definition for macro
26  *
27  *
28  ******************************************************************************
29  */
30 
31 #ifndef CMACRO_HPP
32 #define CMACRO_HPP
33 
34 #include "glue.h"
35 #include "cdecl.h"
36 
37 
38 
39 class CSymbol;
40 
44 class CMacro : public CDecl
45 {
46 private:
47  char* body;
48  char** argList;
49  int complex:1;
50  int defined:1;
51  int zone;
52 public:
59  static CMacro* LookupMacro( const char* aName );
60 
66  CMacro( CSymbol* aSymbol, Coord_t* aLoc );
72  virtual CDecl* Clone( CObstack* heap );
77  char* GetBody( void );
82  void SetBody( char* aBody );
88  int GetZone( void ) { return zone; }
93  void SetZone( int aZone ) { zone = aZone; }
98  void SetComplex( int aComplex );
103  int IsComplex( void );
108  char** GetArgList( void );
114  void SetArgList( char** argList );
119  virtual void Dump( FILE* f );
124  int IsDefined( void );
129  void SetDefined( int aDefined );
130 protected:
136  void Copy( CObstack* heap, CMacro& d );
137 private:
138  /*
139  * disable copy constructor
140  */
141  CMacro( const CMacro& );
142 };
143 
144 #endif // CMACRO_HPP
char * GetBody(void)
Get body of macro.
void SetArgList(char **argList)
Set macro arguments.
char ** GetArgList(void)
Get macro arguments.
void SetBody(char *aBody)
Set body of macro.
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
static CMacro * LookupMacro(const char *aName)
Find macro definition.
Declaration object for preprocessor macros.
Definition: cmacro.h:44
int GetZone(void)
Get preprocessor zone number for last macro definition.
Definition: cmacro.h:88
void SetDefined(int aDefined)
Set defined flag.
void SetZone(int aZone)
Set preprocessor zone number.
Definition: cmacro.h:93
Base class for describing declaration objects.
Definition: cdecl.h:164
int IsComplex(void)
Get complex flag.
virtual void Dump(FILE *f)
Dump macro info to file descriptor.
virtual CDecl * Clone(CObstack *heap)
Create a clone of this declaration.
void Copy(CObstack *heap, CMacro &d)
Deep copy of declaration.
int IsDefined(void)
Get defined flag.
CMacro(CSymbol *aSymbol, Coord_t *aLoc)
Create a macro declaration object.
void SetComplex(int aComplex)
Set complex flag.