本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例6: accept
void accept(const FullySpecifiedType &ty)
{
TypeVisitor::accept(ty.type());
unsigned flags = ty.flags();
flags |= temps.back().flags();
temps.back().setFlags(flags);
}
示例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(" "));
}
示例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());
}
示例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));
}
}
示例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");
}
示例11: prependCv
void TypePrettyPrinter::prependCv(const FullySpecifiedType &ty)
{
if (ty.isVolatile()) {
prependWordSeparatorSpace();
_text.prepend("volatile");
}
if (ty.isConst()) {
prependWordSeparatorSpace();
_text.prepend("const");
}
}
示例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;
}
示例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();
}
示例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;
}
示例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_;
}