1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
// Copyright (c) 1996 David Engberg All rights reserved
// $Id: IntermediateClass.C,v 1.7 1997/11/10 00:48:06 geppetto Exp $
#pragma implementation
#include "IntermediateClass.h"
#include "IntermediateFunction.h"
#include "LocalVariableRecord.h"
#include "Statement.h"
#include "Expression.h"
//
// Method name : CIntermediateClass
// Description : Constructs a class.
//
CIntermediateClass::CIntermediateClass(const string& sourceFileName,
const unicode_string& className,
const unicode_string& shortName,
CJavaAccessFlags* adoptModifiers,
unicode_string* adoptExtends,
deque<unicode_string>* adoptInterfaces,
bool deprecated)
: fSourceFileName(sourceFileName),
fName(className),
fShortName(shortName),
fExtends(adoptExtends),
fStaticLocalVariables(0),
fAnyConstructors(false),
fStaticInitializer(0),
fRealClass(0),
fDeprecated(deprecated),
fInsideClass(0),
fIsInner(false),
fIsAnonymous(false),
fSyntheticInnerCount(0),
fCurrentFunction(0),
fCurrentLocalVariable(0)
{
if (adoptModifiers != 0) {
fAccessFlags = *adoptModifiers;
delete adoptModifiers;
}
if (adoptInterfaces != 0) {
fInterfaces = *adoptInterfaces;
delete adoptInterfaces;
}
}
//
// Method name : ~CIntermediateClass
// Description : Destructor
//
CIntermediateClass::~CIntermediateClass()
{
delete fExtends;
for (deque<CIntermediateFunction*>::iterator i = fFunctions.begin();
i != fFunctions.end(); i++) {
delete *i;
}
delete fStaticInitializer;
for (StatementList::iterator i = fStaticDeclarations.begin();
!(i == fStaticDeclarations.end()); ++i) {
delete *i;
}
for (StatementList::iterator i = fNonStaticDeclarations.begin();
!(i == fNonStaticDeclarations.end()); ++i) {
delete *i;
}
for (list<COuterLocalExpression*>::iterator i = fSyntheticLocals.begin();
!(i == fSyntheticLocals.end()); ++i) {
delete *i;
}
delete fRealClass;
}
//
// Method name : GetShortName
// Description : This method is used to get the part of the class name after
// the last package delimiter. For example, if this class name is
// java.foo.Blah, then this will return "Blah". If this class name is
// just "Blah", then it will return "Blah".
//
unicode_string
CIntermediateClass::GetShortName() const
{
return fShortName;
}
|