当前位置: 首页>>代码示例>>C++>>正文


C++ FullySpecifiedType类代码示例

本文整理汇总了C++中FullySpecifiedType的典型用法代码示例。如果您正苦于以下问题:C++ FullySpecifiedType类的具体用法?C++ FullySpecifiedType怎么用?C++ FullySpecifiedType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FullySpecifiedType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: locationOfDeclaratorId

bool CheckDeclaration::visit(ParameterDeclarationAST *ast)
{
    unsigned sourceLocation = locationOfDeclaratorId(ast->declarator);
    if (! sourceLocation) {
        if (ast->declarator)
            sourceLocation = ast->declarator->firstToken();
        else
            sourceLocation = ast->firstToken();
    }

    const Name *argName = 0;
    FullySpecifiedType ty = semantic()->check(ast->type_specifier_list, _scope);
    FullySpecifiedType argTy = semantic()->check(ast->declarator, ty.qualifiedType(),
                                                 _scope, &argName);
    FullySpecifiedType exprTy = semantic()->check(ast->expression, _scope);
    Argument *arg = control()->newArgument(sourceLocation, argName);
    ast->symbol = arg;
    if (ast->expression) {
        unsigned startOfExpression = ast->expression->firstToken();
        unsigned endOfExpression = ast->expression->lastToken();
        std::string buffer;
        for (unsigned index = startOfExpression; index != endOfExpression; ++index) {
            const Token &tk = tokenAt(index);
            if (tk.whitespace() || tk.newline())
                buffer += ' ';
            buffer += tk.spell();
        }
        const StringLiteral *initializer = control()->findOrInsertStringLiteral(buffer.c_str(), buffer.size());
        arg->setInitializer(initializer);
    }
    arg->setType(argTy);
    _scope->enterSymbol(arg);
    return false;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: semantic

bool CheckExpression::visit(TypeIdAST *ast)
{
    FullySpecifiedType typeSpecTy = semantic()->check(ast->type_specifier_list, _scope);
    FullySpecifiedType declTy = semantic()->check(ast->declarator, typeSpecTy.qualifiedType(), _scope);
    _fullySpecifiedType = declTy;
    return false;
}
开发者ID:ionionica,项目名称:qt-mobility,代码行数:7,代码来源:CheckExpression.cpp

示例3: semantic

bool CheckDeclaration::visit(ExceptionDeclarationAST *ast)
{
    FullySpecifiedType ty = semantic()->check(ast->type_specifier, _scope);
    FullySpecifiedType qualTy = ty.qualifiedType();

    Name *name = 0;
    FullySpecifiedType declTy = semantic()->check(ast->declarator, qualTy,
                                                  _scope, &name);

    unsigned location = locationOfDeclaratorId(ast->declarator);
    if (! location) {
        if (ast->declarator)
            location = ast->declarator->firstToken();
        else
            location = ast->firstToken();
    }

    Declaration *symbol = control()->newDeclaration(location, name);
    symbol->setStartOffset(tokenAt(ast->firstToken()).offset);
    symbol->setEndOffset(tokenAt(ast->lastToken()).offset);
    symbol->setType(declTy);
    _scope->enterSymbol(symbol);

    return false;
}
开发者ID:halsten,项目名称:beaverdbg,代码行数:25,代码来源:CheckDeclaration.cpp

示例4: collectFieldNames

static QStringList collectFieldNames(ClassSpecifierAST *classAST, bool onlyTokensAndASTNodes)
{
    QStringList fields;
    Overview oo;
    Class *clazz = classAST->symbol;
    for (unsigned i = 0; i < clazz->memberCount(); ++i) {
        Symbol *s = clazz->memberAt(i);
        if (Declaration *decl = s->asDeclaration()) {
            const QString declName = oo(decl->name());
            const FullySpecifiedType ty = decl->type();
            if (const PointerType *ptrTy = ty->asPointerType()) {
                if (onlyTokensAndASTNodes) {
                    if (const NamedType *namedTy = ptrTy->elementType()->asNamedType()) {
                        if (oo(namedTy->name()).endsWith(QLatin1String("AST")))
                            fields.append(declName);
                    }
                } else {
                    fields.append(declName);
                }
            } else if (ty.isUnsigned()) {
                fields.append(declName);
            }
        }
    }
    return fields;
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例5: control

bool CheckStatement::visit(QtMemberDeclarationAST *ast)
{
    const Name *name = 0;

    if (tokenKind(ast->q_token) == T_Q_D)
        name = control()->nameId(control()->findOrInsertIdentifier("d"));
    else
        name = control()->nameId(control()->findOrInsertIdentifier("q"));

    FullySpecifiedType declTy = semantic()->check(ast->type_id, _scope);

    if (tokenKind(ast->q_token) == T_Q_D) {
        if (NamedType *namedTy = declTy->asNamedType()) {
            if (const NameId *nameId = namedTy->name()->asNameId()) {
                std::string privateClass;
                privateClass += nameId->identifier()->chars();
                privateClass += "Private";

                const Name *privName = control()->nameId(control()->findOrInsertIdentifier(privateClass.c_str(),
                                                                                           privateClass.size()));
                declTy.setType(control()->namedType(privName));
            }
        }
    }

    Declaration *symbol = control()->newDeclaration(/*generated*/ 0, name);
    symbol->setType(control()->pointerType(declTy));

    _scope->enterSymbol(symbol);

    return false;
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:32,代码来源:CheckStatement.cpp

示例6: accept

 void accept(const FullySpecifiedType &ty)
 {
     TypeVisitor::accept(ty.type());
     unsigned flags = ty.flags();
     flags |= temps.back().flags();
     temps.back().setFlags(flags);
 }
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:7,代码来源:CppRewriter.cpp

示例7: prependSpaceBeforeIndirection

void TypePrettyPrinter::prependSpaceBeforeIndirection(const FullySpecifiedType &type)
{
    const bool elementTypeIsPointerOrReference = type.type()->isPointerType()
        || type.type()->isReferenceType();
    const bool elementIsConstPointerOrReference = elementTypeIsPointerOrReference && type.isConst();
    const bool shouldBindToLeftSpecifier = _overview->starBindFlags & Overview::BindToLeftSpecifier;
    if (elementIsConstPointerOrReference && ! shouldBindToLeftSpecifier)
        _text.prepend(QLatin1String(" "));
}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:9,代码来源:TypePrettyPrinter.cpp

示例8: visit

void CloneType::visit(NamedType *type)
{
    const Name *name = _clone->name(type->name(), _subst);
    FullySpecifiedType ty;
    if (_subst)
        ty = _subst->apply(name);
    if (! ty.isValid())
        ty = _control->namedType(name);
    _type.setType(ty.type());
}
开发者ID:Andersbakken,项目名称:rparser,代码行数:10,代码来源:Templates.cpp

示例9: visit

 virtual void visit(NamedType *type)
 {
     FullySpecifiedType ty = rewrite->env->apply(type->name(), rewrite);
     if (! ty->isUndefinedType()) {
         temps.append(ty);
     } else {
         const Name *name = rewrite->rewriteName(type->name());
         temps.append(control()->namedType(name));
     }
 }
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:10,代码来源:CppRewriter.cpp

示例10: outCV

void TypePrettyPrinter::outCV(const FullySpecifiedType &ty)
{
    if (ty.isConst() && ty.isVolatile())
        _text += QLatin1String("const volatile");

    else if (ty.isConst())
        _text += QLatin1String("const");

    else if (ty.isVolatile())
        _text += QLatin1String("volatile");
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例11: prependCv

void TypePrettyPrinter::prependCv(const FullySpecifiedType &ty)
{
    if (ty.isVolatile()) {
        prependWordSeparatorSpace();
        _text.prepend("volatile");
    }

    if (ty.isConst()) {
        prependWordSeparatorSpace();
        _text.prepend("const");
    }
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:12,代码来源:TypePrettyPrinter.cpp

示例12: QLatin1String

void TypePrettyPrinter::acceptType(const FullySpecifiedType &ty)
{
    if (ty.isSigned())
        _text += QLatin1String("signed ");

    else if (ty.isUnsigned())
        _text += QLatin1String("unsigned ");

    const FullySpecifiedType previousFullySpecifiedType = _fullySpecifiedType;
    _fullySpecifiedType = ty;
    accept(ty.type());
    _fullySpecifiedType = previousFullySpecifiedType;
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例13: FullySpecifiedType

FullySpecifiedType SubstitutionEnvironment::apply(const Name *name, Rewrite *rewrite) const
{
    if (name) {
        for (int index = _substs.size() - 1; index != -1; --index) {
            const Substitution *subst = _substs.at(index);

            FullySpecifiedType ty = subst->apply(name, rewrite);
            if (! ty->isUndefinedType())
                return ty;
        }
    }

    return FullySpecifiedType();
}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:14,代码来源:CppRewriter.cpp

示例14: qualifiedType

FullySpecifiedType FullySpecifiedType::qualifiedType() const
{
    FullySpecifiedType ty = *this;
    ty.setFriend(false);
    ty.setRegister(false);
    ty.setStatic(false);
    ty.setExtern(false);
    ty.setMutable(false);
    ty.setTypedef(false);

    ty.setInline(false);
    ty.setVirtual(false);
    ty.setExplicit(false);
    return ty;
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:15,代码来源:FullySpecifiedType.cpp

示例15: spellTypeName

std::string TypeNameSpeller::spellTypeName(const FullySpecifiedType& fullType,
                                           const CPlusPlus::Scope* scope,
                                           std::string* alpha)
{
    spelling_.clear();
    alpha_ = alpha;

    if (fullType.isUnsigned())
        spelling_.append("unsigned ");

    scope_ = scope;
    accept(fullType.type());

    return spelling_;
}
开发者ID:maroar,项目名称:demon,代码行数:15,代码来源:TypeNameSpeller.cpp


注:本文中的FullySpecifiedType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。