2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2010-12-15 15:11:59 +01:00
|
|
|
|
|
|
|
|
#include "SymbolNameVisitor.h"
|
2013-03-27 18:54:03 +01:00
|
|
|
|
|
|
|
|
#include <cplusplus/Symbols.h>
|
|
|
|
|
#include <cplusplus/Names.h>
|
2010-12-15 15:11:59 +01:00
|
|
|
|
|
|
|
|
using namespace CPlusPlus;
|
|
|
|
|
|
|
|
|
|
SymbolNameVisitor::SymbolNameVisitor()
|
2019-07-31 17:21:41 +02:00
|
|
|
: _symbol(nullptr)
|
2010-12-15 15:11:59 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SymbolNameVisitor::accept(Symbol *symbol)
|
|
|
|
|
{
|
|
|
|
|
if (symbol) {
|
|
|
|
|
if (Scope *scope = symbol->enclosingScope())
|
|
|
|
|
accept(scope);
|
|
|
|
|
|
2022-06-23 16:56:36 +02:00
|
|
|
if (! symbol->asTemplate()) {
|
2010-12-15 15:11:59 +01:00
|
|
|
if (const Name *name = symbol->name()) {
|
|
|
|
|
std::swap(_symbol, symbol);
|
|
|
|
|
accept(name);
|
|
|
|
|
std::swap(_symbol, symbol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|