void FunctionType::accept0 (TypeVisitor *v) const { TYPE_D(FunctionType); if (v->visit (this)) { acceptType (d->m_returnType.abstractType(), v); for (unsigned int i = 0; i < d->m_argumentsSize (); ++i) acceptType (d->m_arguments()[i].abstractType(), v); } v->endVisit (this); }
QString FunctionType::partToString( SignaturePart sigPart ) const { QString args; TYPE_D(FunctionType); if( sigPart == SignatureArguments || sigPart == SignatureWhole ) { args += '('; bool first = true; FOREACH_FUNCTION(const IndexedType& type, d->m_arguments) { if (first) first = false; else args.append(", "); args.append(type ? type.abstractType()->toString() : QString("<notype>")); } args += ')'; }
QString IntegralType::toString() const { TYPE_D(IntegralType); QString name; switch (d->m_dataType) { case TypeChar: name = QStringLiteral("char"); break; case TypeChar16_t: name = QStringLiteral("char16_t"); break; case TypeChar32_t: name = QStringLiteral("char32_t"); break; case TypeWchar_t: name = QStringLiteral("wchar_t"); break; case TypeBoolean: name = QStringLiteral("bool"); break; case TypeInt: name = QStringLiteral("int"); break; case TypeFloat: name = QStringLiteral("float"); break; case TypeDouble: name = QStringLiteral("double"); break; case TypeVoid: name = QStringLiteral("void"); break; case TypeMixed: name = QStringLiteral("mixed"); break; case TypeString: name = QStringLiteral("string"); break; case TypeArray: name = QStringLiteral("array"); break; case TypeNull: name = QStringLiteral("null"); break; default: name = QStringLiteral("<unknown>"); break; } if (modifiers() & UnsignedModifier) name.prepend("unsigned "); else if (modifiers() & SignedModifier) name.prepend("signed "); if (modifiers() & ShortModifier) name.prepend("short "); else if (modifiers() & LongLongModifier) name.prepend("long long "); else if (modifiers() & LongModifier) name.prepend("long "); return AbstractType::toString() + name; }
QString GoIntegralType::toString() const { TYPE_D(GoIntegralType); QString name; switch (d->m_dataType) { case TypeUint8: name="uint8"; break; case TypeUint16: name="uint16"; break; case TypeUint32: name="uint32"; break; case TypeUint64: name="uint64"; break; case TypeInt8: name="int8"; break; case TypeInt16: name="int16"; break; case TypeInt32: name="int32"; break; case TypeInt64: name="int64"; break; case TypeFloat32: name="float32"; break; case TypeFloat64: name="float64"; break; case TypeComplex64: name="complex64"; break; case TypeComplex128: name="complex128"; break; case TypeRune: name="rune"; break; case TypeUint: name="uint"; break; case TypeInt: name="int"; break; case TypeUintptr: name="uintptr"; break; case TypeString: name="string"; break; case TypeBool: name="bool"; break; case TypeByte: name="byte"; break; } return /*AbstractType::toString() + */name; }