예제 #1
0
GeneratorType::GeneratorType(Generator &generator, const Type &type)
    : typedefEmittedM(false), typeM(type)
{
    generator.RegisterGeneratorType(&type, this);

    u32 count = type.GetArrayOrPointerCount();
    if (count) {
        vArrayOrPointersM.resize(count);
        for (u32 i = 0; i < count; i++) {
            const ArrayOrPointer &arrayOrPointer = type.GetArrayOrPointer(i);
            if (arrayOrPointer.GetType() == ArrayOrPointer::Type_Array) {
                vArrayOrPointersM[i] = new GeneratorArray
                    ((const Array &) arrayOrPointer);
            }
            else {
                vArrayOrPointersM[i] = new GeneratorPointer
                    ((const Pointer &) arrayOrPointer);
            }
        }
    }
}