vrq
Public Member Functions | Static Public Member Functions | Protected Member Functions
CMacro Class Reference

Declaration object for preprocessor macros. More...

#include <cmacro.h>

Inheritance diagram for CMacro:
CDecl CObject

List of all members.

Public Member Functions

 CMacro (CSymbol *aSymbol, Coord_t *aLoc)
 Create a macro declaration object.
virtual CDeclClone (CObstack *heap)
 Create a clone of this declaration.
char * GetBody (void)
 Get body of macro.
void SetBody (char *aBody)
 Set body of macro.
int GetZone (void)
 Get preprocessor zone number for last macro definition.
void SetZone (int aZone)
 Set preprocessor zone number.
void SetComplex (int aComplex)
 Set complex flag.
int IsComplex (void)
 Get complex flag.
char ** GetArgList (void)
 Get macro arguments.
void SetArgList (char **argList)
 Set macro arguments.
virtual void Dump (FILE *f)
 Dump macro info to file descriptor.
int IsDefined (void)
 Get defined flag.
void SetDefined (int aDefined)
 Set defined flag.

Static Public Member Functions

static CMacroLookupMacro (const char *aName)
 Find macro definition.

Protected Member Functions

void Copy (CObstack *heap, CMacro &d)
 Deep copy of declaration.

Detailed Description

Declaration object for preprocessor macros.


Constructor & Destructor Documentation

CMacro::CMacro ( CSymbol aSymbol,
Coord_t aLoc 
)

Create a macro declaration object.

Parameters:
aSymbolname of macro.
aLocfile coordinate of definition.

Member Function Documentation

virtual CDecl* CMacro::Clone ( CObstack heap) [virtual]

Create a clone of this declaration.

Parameters:
heapheap to use for allocation.
Returns:
new declaration.

Implements CDecl.

void CMacro::Copy ( CObstack heap,
CMacro d 
) [protected]

Deep copy of declaration.

Parameters:
heapheap to use for allocation.
ddeclaration to copy.
virtual void CMacro::Dump ( FILE *  f) [virtual]

Dump macro info to file descriptor.

Parameters:
ffile descriptor.

Reimplemented from CDecl.

char** CMacro::GetArgList ( void  )

Get macro arguments.

Returns:
pointer to array of macro arguments.
char* CMacro::GetBody ( void  )

Get body of macro.

Returns:
macro body.
int CMacro::GetZone ( void  ) [inline]

Get preprocessor zone number for last macro definition.

Returns:
preprocessor zone number.
int CMacro::IsComplex ( void  )

Get complex flag.

Returns:
non-zero if macro has arguments.
int CMacro::IsDefined ( void  )

Get defined flag.

Returns:
non-zero if macro has been defined.
static CMacro* CMacro::LookupMacro ( const char *  aName) [static]

Find macro definition.

Create an undefined entry if it doesn't exist.

Parameters:
aNamechar pointer to macro name.
Returns:
macro object.
void CMacro::SetArgList ( char **  argList)

Set macro arguments.

Parameters:
argListpointer to array of macro arguments. Array is not copied.
void CMacro::SetBody ( char *  aBody)

Set body of macro.

Parameters:
aBodybody of macro.
void CMacro::SetComplex ( int  aComplex)

Set complex flag.

Parameters:
aComplexnon-zero if macro has arguments.
void CMacro::SetDefined ( int  aDefined)

Set defined flag.

Parameters:
aDefinednon-zero if macro has been defined.
void CMacro::SetZone ( int  aZone) [inline]

Set preprocessor zone number.

Parameters:
aZonepreprocessor zone number.

The documentation for this class was generated from the following file: