2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-03 11:37:35 +01:00
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-03 11:37:35 +01:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2008-12-03 11:37:35 +01:00
|
|
|
**
|
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-03 11:37:35 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-03 11:37:35 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
**
|
2008-12-03 11:37:35 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-03 11:34:46 +01:00
|
|
|
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <AST.h>
|
2009-01-02 16:10:28 +01:00
|
|
|
#include <ASTVisitor.h>
|
2009-11-16 14:46:07 +01:00
|
|
|
#include <ASTPatternBuilder.h>
|
2009-11-13 12:13:49 +01:00
|
|
|
#include <ASTMatcher.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <Control.h>
|
|
|
|
#include <Scope.h>
|
|
|
|
#include <TranslationUnit.h>
|
2009-06-05 13:16:36 +02:00
|
|
|
#include <Literals.h>
|
|
|
|
#include <Symbols.h>
|
|
|
|
#include <Names.h>
|
|
|
|
#include <CoreTypes.h>
|
2009-11-13 12:36:51 +01:00
|
|
|
#include <CppDocument.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
|
2009-01-06 15:15:13 +01:00
|
|
|
#include <QFile>
|
|
|
|
#include <QList>
|
|
|
|
#include <QCoreApplication>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QFileInfo>
|
2009-06-05 13:16:36 +02:00
|
|
|
#include <QTime>
|
2009-01-02 16:10:28 +01:00
|
|
|
#include <QtDebug>
|
2008-12-03 11:34:46 +01:00
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
2009-01-06 15:15:13 +01:00
|
|
|
#include <iostream>
|
2008-12-03 11:34:46 +01:00
|
|
|
|
2009-10-21 14:56:42 +02:00
|
|
|
using namespace CPlusPlus;
|
2009-01-02 16:10:28 +01:00
|
|
|
|
2009-11-13 12:36:51 +01:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QCoreApplication app(argc, argv);
|
|
|
|
|
|
|
|
QStringList files = app.arguments();
|
|
|
|
files.removeFirst();
|
|
|
|
|
|
|
|
foreach (const QString &fileName, files) {
|
|
|
|
QFile file(fileName);
|
|
|
|
if (! file.open(QFile::ReadOnly))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
const QByteArray source = file.readAll();
|
|
|
|
file.close();
|
|
|
|
|
|
|
|
Document::Ptr doc = Document::create(fileName);
|
|
|
|
doc->control()->setDiagnosticClient(0);
|
2012-02-09 13:17:13 +01:00
|
|
|
doc->setUtf8Source(source);
|
2009-11-13 12:36:51 +01:00
|
|
|
doc->parse();
|
2008-12-03 11:34:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|