cfront::ArrayType Class Reference

#include <ArrayType.hpp>

Inheritance diagram for cfront::ArrayType:

Inheritance graph
[legend]
Collaboration diagram for cfront::ArrayType:

Collaboration graph
[legend]

Public Types

enum  LengthSpec {
  NOT_SPECIFIED, FIXED, VARIABLE, VARIABLE_NOT_SPECIFIED,
  INCOMPLETE
}

Public Member Functions

 ArrayType (const Type *baseType, QualFlags qualFlags, LengthSpec lengthSpec)
 ArrayType (const Type *baseType, ConstantValue &lengthValue, QualFlags qualFlags)
 ArrayType (const ArrayType &other)
virtual ~ArrayType ()
virtual ArrayTypeclone () const
virtual bool isCompatibleType (const Type *other) const
virtual size_t getSize (const TargetInfo &targetInfo) const
virtual size_t getAlign (const TargetInfo &targetInfo) const
const TypegetBaseType () const
const ConstantValuegetLengthValue () const
QualFlags getQualFlags () const
LengthSpec getLengthSpec () const
void setBaseType (const Type *t)
void setLengthValue (const ConstantValue lengthValue)

Protected Attributes

const TypebaseType_
ConstantValue lengthValue_
QualFlags qualFlags_
LengthSpec lengthSpec_

Detailed Description

This class represents the array type.

Definition at line 42 of file ArrayType.hpp.


Member Enumeration Documentation

Constants represents the types of the length of the array.

Enumerator:
NOT_SPECIFIED 
FIXED  Fixed integer value. e.g. a[10]
VARIABLE  C99 variable length array. e.g. a[x]
VARIABLE_NOT_SPECIFIED  C99 variable length array (declaration). e.g. a[*]
INCOMPLETE  Length is not specified. e.g. a[]

Definition at line 48 of file ArrayType.hpp.


Constructor & Destructor Documentation

cfront::ArrayType::ArrayType ( const Type baseType,
QualFlags  qualFlags,
LengthSpec  lengthSpec 
) [inline]

Definition at line 57 of file ArrayType.hpp.

Referenced by clone().

cfront::ArrayType::ArrayType ( const Type baseType,
ConstantValue lengthValue,
QualFlags  qualFlags 
) [inline]

Definition at line 60 of file ArrayType.hpp.

cfront::ArrayType::ArrayType ( const ArrayType other  )  [inline]

Definition at line 64 of file ArrayType.hpp.

virtual cfront::ArrayType::~ArrayType (  )  [inline, virtual]

Definition at line 69 of file ArrayType.hpp.


Member Function Documentation

virtual ArrayType* cfront::ArrayType::clone (  )  const [inline, virtual]

Return the copy of self.

Implements cfront::Type.

Definition at line 71 of file ArrayType.hpp.

References ArrayType().

virtual bool cfront::ArrayType::isCompatibleType ( const Type other  )  const [inline, virtual]

Tests whether this type is compatible to the given one.

Implements cfront::Type.

Definition at line 76 of file ArrayType.hpp.

References baseType_, and cfront::Type::isCompatibleType().

virtual size_t cfront::ArrayType::getSize ( const TargetInfo targetInfo  )  const [inline, virtual]

Implements cfront::Type.

Definition at line 83 of file ArrayType.hpp.

References getBaseType(), getLengthValue(), and cfront::Type::getSize().

virtual size_t cfront::ArrayType::getAlign ( const TargetInfo targetInfo  )  const [inline, virtual]

Implements cfront::Type.

Definition at line 89 of file ArrayType.hpp.

References cfront::Type::getAlign(), and getBaseType().

const Type* cfront::ArrayType::getBaseType (  )  const [inline]

const ConstantValue& cfront::ArrayType::getLengthValue (  )  const [inline]

Definition at line 99 of file ArrayType.hpp.

References lengthValue_.

Referenced by cfront::CAnalyzer::checkArrayInitializer(), and getSize().

QualFlags cfront::ArrayType::getQualFlags (  )  const [inline]

Definition at line 104 of file ArrayType.hpp.

References qualFlags_.

Referenced by cfront::CAnalyzer::convertUnaryExprType().

LengthSpec cfront::ArrayType::getLengthSpec (  )  const [inline]

Definition at line 109 of file ArrayType.hpp.

References lengthSpec_.

Referenced by cfront::CAnalyzer::checkArrayInitializer().

void cfront::ArrayType::setBaseType ( const Type t  )  [inline]

void cfront::ArrayType::setLengthValue ( const ConstantValue  lengthValue  )  [inline]

Definition at line 119 of file ArrayType.hpp.

References lengthValue_.

Referenced by cfront::CAnalyzer::checkArrayInitializer().


Field Documentation

const Type* cfront::ArrayType::baseType_ [protected]

Definition at line 135 of file ArrayType.hpp.

Referenced by getBaseType(), isCompatibleType(), and setBaseType().

Definition at line 136 of file ArrayType.hpp.

Referenced by getLengthValue(), and setLengthValue().

Definition at line 137 of file ArrayType.hpp.

Referenced by getQualFlags().

Definition at line 138 of file ArrayType.hpp.

Referenced by getLengthSpec().


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

Generated on Tue Mar 31 20:19:53 2009 for ctrump by  doxygen 1.5.6