diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-08-12 02:40:14 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-08-12 02:40:14 (GMT) |
commit | 265cb525256be8e6d39058b6427f46e1ae381907 (patch) | |
tree | 589c78b77f3b9241a15d1c0ada282d755a2e01c9 /util/qlalr | |
parent | 39accaec06629da15c073859660fd94c78f1b261 (diff) | |
download | Qt-265cb525256be8e6d39058b6427f46e1ae381907.zip Qt-265cb525256be8e6d39058b6427f46e1ae381907.tar.gz Qt-265cb525256be8e6d39058b6427f46e1ae381907.tar.bz2 |
Update embedded copyright headers.
Reviewed-by: Trust Me
Diffstat (limited to 'util/qlalr')
-rw-r--r-- | util/qlalr/cppgenerator.cpp | 57 | ||||
-rw-r--r-- | util/qlalr/cppgenerator.h | 11 | ||||
-rw-r--r-- | util/qlalr/main.cpp | 10 |
3 files changed, 52 insertions, 26 deletions
diff --git a/util/qlalr/cppgenerator.cpp b/util/qlalr/cppgenerator.cpp index 6bb0e4c..222aaa4 100644 --- a/util/qlalr/cppgenerator.cpp +++ b/util/qlalr/cppgenerator.cpp @@ -39,32 +39,59 @@ ** ****************************************************************************/ - #include <QtCore/QtCore> #include "cppgenerator.h" #include "lalr.h" #include "recognizer.h" -QString CppGenerator::trollCopyrightHeader() const +QString CppGenerator::copyrightHeader() const { return QLatin1String( "/****************************************************************************\n" "**\n" "** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\n" + "** Contact: Nokia Corporation (qt-info@nokia.com)\n" + "**\n" + "** This file is part of the QtGui module of the Qt Toolkit.\n" + "**\n" + "** $QT_BEGIN_LICENSE:LGPL$\n" + "** No Commercial Usage\n" + "** This file contains pre-release code and may not be distributed.\n" + "** You may use this file in accordance with the terms and conditions\n" + "** contained in the either Technology Preview License Agreement or the\n" + "** Beta Release License Agreement.\n" + "**\n" + "** GNU Lesser General Public License Usage\n" + "** Alternatively, this file may be used under the terms of the GNU Lesser\n" + "** General Public License version 2.1 as published by the Free Software\n" + "** Foundation and appearing in the file LICENSE.LGPL included in the\n" + "** packaging of this file. Please review the following information to\n" + "** ensure the GNU Lesser General Public License version 2.1 requirements\n" + "** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n" "**\n" - "** This file is part of the $MODULE$ of the Qt Toolkit.\n" + "** In addition, as a special exception, Nokia gives you certain\n" + "** additional rights. These rights are described in the Nokia Qt LGPL\n" + "** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this\n" + "** package.\n" "**\n" - "** $TROLLTECH_DUAL_LICENSE$\n" + "** GNU General Public License Usage\n" + "** Alternatively, this file may be used under the terms of the GNU\n" + "** General Public License version 3.0 as published by the Free Software\n" + "** Foundation and appearing in the file LICENSE.GPL included in the\n" + "** packaging of this file. Please review the following information to\n" + "** ensure the GNU General Public License version 3.0 requirements will be\n" + "** met: http://www.gnu.org/copyleft/gpl.html.\n" "**\n" - "** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE\n" - "** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n" + "** If you are unsure which license is appropriate for your use, please\n" + "** contact the sales department at http://qt.nokia.com/contact.\n" + "** $QT_END_LICENSE$\n" "**\n" "****************************************************************************/\n" "\n"); } -QString CppGenerator::trollPrivateCopyrightHeader() const +QString CppGenerator::privateCopyrightHeader() const { return QLatin1String( "//\n" @@ -315,10 +342,10 @@ void CppGenerator::operator () () QTextStream out (&f); out << "// This file was generated by qlalr - DO NOT EDIT!\n"; - if (troll_copyright) + if (copyright) { - out << trollCopyrightHeader() - << trollPrivateCopyrightHeader() + out << copyrightHeader() + << privateCopyrightHeader() << endl; } @@ -347,10 +374,10 @@ void CppGenerator::operator () () QString prot = declFileName.toUpper ().replace (QLatin1Char ('.'), QLatin1Char ('_')); - if (troll_copyright) + if (copyright) { - out << trollCopyrightHeader() - << trollPrivateCopyrightHeader() + out << copyrightHeader() + << privateCopyrightHeader() << endl; } @@ -369,8 +396,8 @@ void CppGenerator::operator () () QTextStream out (&f); out << "// This file was generated by qlalr - DO NOT EDIT!\n"; - if (troll_copyright) - out << trollCopyrightHeader(); + if (copyright) + out << copyrightHeader(); out << "#include \"" << declFileName << "\"" << endl << endl; generateImpl(out); diff --git a/util/qlalr/cppgenerator.h b/util/qlalr/cppgenerator.h index ce81a73..4531b8d 100644 --- a/util/qlalr/cppgenerator.h +++ b/util/qlalr/cppgenerator.h @@ -58,23 +58,22 @@ public: aut (aut), verbose (verbose), debug_info (false), - troll_copyright (false) {} + copyright (false) {} void operator () (); bool debugInfo () const { return debug_info; } void setDebugInfo (bool d) { debug_info = d; } - bool trollCopyright () const { return troll_copyright; } - void setTrollCopyright (bool t) { troll_copyright = t; } + void setCopyright (bool t) { copyright = t; } private: void generateDecl (QTextStream &out); void generateImpl (QTextStream &out); QString debugInfoProt() const; - QString trollCopyrightHeader() const; - QString trollPrivateCopyrightHeader() const; + QString copyrightHeader() const; + QString privateCopyrightHeader() const; private: static QString startIncludeGuard(const QString &fileName); @@ -89,7 +88,7 @@ private: int terminal_count; int non_terminal_count; bool debug_info; - bool troll_copyright; + bool copyright; Compress compressed_action; Compress compressed_goto; QVector<int> count; diff --git a/util/qlalr/main.cpp b/util/qlalr/main.cpp index d3a9c7f..7c1607e 100644 --- a/util/qlalr/main.cpp +++ b/util/qlalr/main.cpp @@ -64,7 +64,7 @@ static void help_me () << " --no-debug\t\tno debug information" << endl << " --no-lines\t\tno #line directives" << endl << " --dot\t\t\tgenerate a graph" << endl - << " --troll\t\tadd the Trolltech copyright header" << endl + << " --copyright\t\tadd the Qt copyright header" << endl << endl; exit (0); } @@ -77,7 +77,7 @@ int main (int argc, char *argv[]) bool generate_report = false; bool no_lines = false; bool debug_info = true; - bool troll_copyright = false; + bool copyright = false; QString file_name = 0; QStringList args = app.arguments (); @@ -100,8 +100,8 @@ int main (int argc, char *argv[]) else if (arg == QLatin1String ("--no-debug")) debug_info = false; - else if (arg == QLatin1String ("--troll")) - troll_copyright = true; + else if (arg == QLatin1String ("--copyright") || arg == QLatin1String ("--troll")) + copyright = true; else if (file_name.isEmpty ()) file_name = arg; @@ -142,7 +142,7 @@ int main (int argc, char *argv[]) CppGenerator gen (p, grammar, aut, generate_report); gen.setDebugInfo (debug_info); - gen.setTrollCopyright (troll_copyright); + gen.setCopyright (copyright); gen (); if (generate_dot) |