diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/corelib/xml/make-parser.sh | 2 | ||||
-rw-r--r-- | src/corelib/xml/qxmlstream.g | 1 | ||||
-rw-r--r-- | src/corelib/xml/qxmlstream_p.h | 30 | ||||
-rwxr-xr-x | src/script/parser/make-parser.sh | 53 | ||||
-rw-r--r-- | src/script/parser/qscript.g | 62 | ||||
-rw-r--r-- | src/script/parser/qscriptgrammar.cpp | 16 | ||||
-rw-r--r-- | src/script/parser/qscriptgrammar_p.h | 39 | ||||
-rw-r--r-- | src/script/parser/qscriptparser.cpp | 11 | ||||
-rw-r--r-- | src/script/parser/qscriptparser_p.h | 1 |
9 files changed, 143 insertions, 72 deletions
diff --git a/src/corelib/xml/make-parser.sh b/src/corelib/xml/make-parser.sh index 9866555..35289d2 100755 --- a/src/corelib/xml/make-parser.sh +++ b/src/corelib/xml/make-parser.sh @@ -42,7 +42,7 @@ me=$(dirname $0) mkdir -p $me/out -(cd $me/out && ../../../../util/qlalr/qlalr --troll --no-debug --no-lines ../qxmlstream.g) +(cd $me/out && ../../../../util/qlalr/qlalr --qt --no-debug --no-lines ../qxmlstream.g) for f in $me/out/*.h; do n=$(basename $f) diff --git a/src/corelib/xml/qxmlstream.g b/src/corelib/xml/qxmlstream.g index 6c0c0cf..22ba33d 100644 --- a/src/corelib/xml/qxmlstream.g +++ b/src/corelib/xml/qxmlstream.g @@ -158,6 +158,7 @@ public: if (tos + extraCapacity + 1 > cap) { cap = qMax(tos + extraCapacity + 1, cap << 1 ); data = reinterpret_cast<T *>(qRealloc(data, cap * sizeof(T))); + Q_CHECK_PTR(data); } } diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index eee3a13..253f8bd 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -1,4 +1,3 @@ -// This file was generated by qlalr - DO NOT EDIT! /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). @@ -51,6 +50,7 @@ // We mean it. // +// This file was generated by qlalr - DO NOT EDIT! #ifndef QXMLSTREAM_P_H #define QXMLSTREAM_P_H @@ -132,13 +132,13 @@ public: }; static const char *const spell []; - static const qint16 lhs []; - static const qint16 rhs []; - static const qint16 goto_default []; - static const qint16 action_default []; - static const qint16 action_index []; - static const qint16 action_info []; - static const qint16 action_check []; + static const short lhs []; + static const short rhs []; + static const short goto_default []; + static const short action_default []; + static const short action_index []; + static const short action_info []; + static const short action_check []; static inline int nt_action (int state, int nt) { @@ -169,7 +169,7 @@ const char *const QXmlStreamReader_Table::spell [] = { "EMPTY", "ANY", "PCDATA", 0, 0, 0, 0, "CDATA", "ID", "IDREF", "IDREFS", "ENTITIES", "NMTOKEN", "NMTOKENS", "<?xml", "version", 0}; -const qint16 QXmlStreamReader_Table::lhs [] = { +const short QXmlStreamReader_Table::lhs [] = { 57, 57, 59, 59, 59, 59, 59, 59, 59, 59, 67, 68, 64, 72, 72, 72, 75, 66, 66, 66, 66, 79, 78, 80, 80, 80, 80, 80, 80, 81, @@ -198,7 +198,7 @@ const qint16 QXmlStreamReader_Table::lhs [] = { 58, 58, 58, 58, 58, 58, 58, 58, 74, 69, 69, 77, 111, 102, 102, 102, 102, 102, 140}; -const qint16 QXmlStreamReader_Table:: rhs[] = { +const short QXmlStreamReader_Table::rhs [] = { 2, 1, 4, 2, 2, 2, 2, 2, 2, 0, 1, 1, 9, 2, 4, 0, 4, 4, 6, 6, 4, 1, 3, 1, 1, 1, 2, 2, 2, 1, @@ -227,7 +227,7 @@ const qint16 QXmlStreamReader_Table:: rhs[] = { 2, 2, 2, 2, 2, 2, 2, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2}; -const qint16 QXmlStreamReader_Table::action_default [] = { +const short QXmlStreamReader_Table::action_default [] = { 10, 258, 0, 2, 1, 0, 124, 116, 118, 119, 126, 128, 122, 11, 113, 107, 0, 108, 127, 110, 114, 112, 120, 123, 125, 106, 109, 111, 117, 115, @@ -272,7 +272,7 @@ const qint16 QXmlStreamReader_Table::action_default [] = { 260, 0, 230, 0, 0, 13, 269, 9, 5, 8, 4, 0, 7, 258, 6, 0, 3}; -const qint16 QXmlStreamReader_Table::goto_default [] = { +const short QXmlStreamReader_Table::goto_default [] = { 2, 4, 3, 49, 388, 43, 37, 52, 47, 41, 249, 53, 127, 84, 393, 81, 85, 126, 42, 46, 169, 130, 131, 146, 145, 149, 138, 136, 140, 147, @@ -283,7 +283,7 @@ const qint16 QXmlStreamReader_Table::goto_default [] = { 264, 252, 251, 250, 339, 326, 325, 329, 398, 399, 50, 51, 59, 0}; -const qint16 QXmlStreamReader_Table::action_index [] = { +const short QXmlStreamReader_Table::action_index [] = { -21, -57, 33, 119, 960, 70, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, 105, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, @@ -372,7 +372,7 @@ const qint16 QXmlStreamReader_Table::action_index [] = { 28, 15, 82, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, 3, -84, 98, -84}; -const qint16 QXmlStreamReader_Table::action_info [] = { +const short QXmlStreamReader_Table::action_info [] = { 65, 332, 65, 405, 392, 385, 377, 65, 414, 410, 415, 55, 397, 374, 373, 217, 206, 408, 65, 65, 207, 211, 216, 1, 55, 199, 182, 192, 70, 70, @@ -506,7 +506,7 @@ const qint16 QXmlStreamReader_Table::action_info [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -const qint16 QXmlStreamReader_Table::action_check [] = { +const short QXmlStreamReader_Table::action_check [] = { 26, 18, 26, 14, 4, 4, 4, 26, 24, 14, 4, 26, 4, 4, 4, 4, 22, 55, 26, 26, 42, 4, 4, 44, 26, 22, 19, 12, 2, 2, diff --git a/src/script/parser/make-parser.sh b/src/script/parser/make-parser.sh new file mode 100755 index 0000000..d0c71fb --- /dev/null +++ b/src/script/parser/make-parser.sh @@ -0,0 +1,53 @@ +#!/bin/sh +############################################################################# +## +## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is the build configuration utility of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## GNU Lesser General Public License Usage +## Alternatively, 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. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# + +me=$(dirname $0) +mkdir -p $me/out +(cd $me/out && ../../../../util/qlalr/qlalr --qt --no-lines ../qscript.g) + +for f in $me/out/*.h $me/out/*.cpp; do + n=$(basename $f) + cp $f $n +done + +git diff . + diff --git a/src/script/parser/qscript.g b/src/script/parser/qscript.g index b0b0cdf..7e5568a 100644 --- a/src/script/parser/qscript.g +++ b/src/script/parser/qscript.g @@ -78,8 +78,7 @@ %start Program -/. -/**************************************************************************** +/./**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -87,12 +86,24 @@ ** ** This file is part of the QtScript module of the Qt Toolkit. ** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -108,20 +119,13 @@ ** ****************************************************************************/ +// This file was generated by qlalr - DO NOT EDIT! + + #include <QtCore/QtDebug> #include <string.h> -#include "qscriptengine.h" -#include "qscriptengine_p.h" -#include "qscriptvalueimpl_p.h" -#include "qscriptcontext_p.h" -#include "qscriptmember_p.h" -#include "qscriptobject_p.h" -#include "qscriptlexer_p.h" -#include "qscriptast_p.h" -#include "qscriptnodepool_p.h" - #define Q_SCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \ node->startLine = startloc.startLine; \ node->startColumn = startloc.startColumn; \ @@ -131,8 +135,7 @@ ./ -/: -/**************************************************************************** +/:/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -140,10 +143,25 @@ ** ** This file is part of the QtScript module of the Qt Toolkit. ** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** @@ -153,10 +171,14 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ +// This file was generated by qlalr - DO NOT EDIT! + + // // W A R N I N G // ------------- diff --git a/src/script/parser/qscriptgrammar.cpp b/src/script/parser/qscriptgrammar.cpp index cbb1ab8..c7f661b 100644 --- a/src/script/parser/qscriptgrammar.cpp +++ b/src/script/parser/qscriptgrammar.cpp @@ -1,4 +1,3 @@ -// This file was generated by qlalr - DO NOT EDIT! /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). @@ -40,6 +39,7 @@ ** ****************************************************************************/ +// This file was generated by qlalr - DO NOT EDIT! #include "qscriptgrammar_p.h" QT_BEGIN_NAMESPACE @@ -68,7 +68,7 @@ const char *const QScriptGrammar::spell [] = { #endif // QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO }; -const int QScriptGrammar::lhs [] = { +const short QScriptGrammar::lhs [] = { 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 87, 87, 92, 92, 86, 86, 89, 89, 93, 93, 93, 93, 94, 94, 94, @@ -97,7 +97,7 @@ const int QScriptGrammar::lhs [] = { 163, 97, 167, 167, 164, 164, 165, 165, 168, 84, 169, 169, 170, 170, 166, 166, 88, 88, 171}; -const int QScriptGrammar:: rhs[] = { +const short QScriptGrammar::rhs [] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, 3, 4, 3, 2, 4, 1, 2, 0, 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, @@ -429,7 +429,7 @@ const int QScriptGrammar::rule_index [] = { 803, 805, 808, 810, 812, 813, 815, 816, 818}; #endif // QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO -const int QScriptGrammar::action_default [] = { +const short QScriptGrammar::action_default [] = { 0, 98, 165, 129, 137, 133, 173, 180, 77, 149, 179, 187, 175, 125, 0, 176, 264, 62, 177, 178, 183, 78, 141, 145, 66, 95, 76, 81, 61, 0, @@ -478,7 +478,7 @@ const int QScriptGrammar::action_default [] = { 15, 88, 86, 90, 87, 85, 89, 204, 197, 0, 205, 201, 0, 203, 193, 0, 194, 198}; -const int QScriptGrammar::goto_default [] = { +const short QScriptGrammar::goto_default [] = { 29, 28, 439, 437, 113, 112, 14, 2, 438, 111, 114, 194, 24, 17, 190, 26, 8, 201, 21, 27, 77, 25, 1, 32, 30, 270, 13, 264, 3, 260, @@ -489,7 +489,7 @@ const int QScriptGrammar::goto_default [] = { 460, 324, 395, 399, 402, 398, 397, 417, 418, 16, 100, 107, 96, 99, 106, 108, 33, 0}; -const int QScriptGrammar::action_index [] = { +const short QScriptGrammar::action_index [] = { 1318, 79, -84, 56, 39, -17, -84, -84, 169, -84, -84, -84, -84, 216, 149, -84, -84, -84, -84, -84, -84, 475, 68, 100, 180, 184, -84, -84, -84, 99, @@ -586,7 +586,7 @@ const int QScriptGrammar::action_index [] = { -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 5, -88, -88, -56, -88, -88}; -const int QScriptGrammar::action_info [] = { +const short QScriptGrammar::action_info [] = { 305, 307, 109, 400, 400, 400, 273, 105, 416, 302, 297, 295, 293, 423, 273, 151, 313, 321, 406, 407, 424, 295, 422, 198, 420, 149, 313, 353, -47, 396, @@ -777,7 +777,7 @@ const int QScriptGrammar::action_info [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -const int QScriptGrammar::action_check [] = { +const short QScriptGrammar::action_check [] = { 61, 60, 55, 5, 5, 5, 1, 33, 33, 61, 8, 76, 48, 29, 1, 8, 2, 29, 55, 7, 60, 76, 36, 8, 20, 7, 2, 16, 7, 33, diff --git a/src/script/parser/qscriptgrammar_p.h b/src/script/parser/qscriptgrammar_p.h index 9e0f4f8..0cb6d22 100644 --- a/src/script/parser/qscriptgrammar_p.h +++ b/src/script/parser/qscriptgrammar_p.h @@ -39,11 +39,6 @@ ** ****************************************************************************/ -// This file was generated by qlalr - DO NOT EDIT! - -#ifndef QSCRIPTGRAMMAR_P_H -#define QSCRIPTGRAMMAR_P_H - // // W A R N I N G // ------------- @@ -55,6 +50,10 @@ // We mean it. // +// This file was generated by qlalr - DO NOT EDIT! +#ifndef QSCRIPTGRAMMAR_P_H +#define QSCRIPTGRAMMAR_P_H + #include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE @@ -159,33 +158,28 @@ public: GOTO_CHECK_OFFSET = 1562 }; - static const char *const spell []; - static const int lhs []; - static const int rhs []; + static const char *const spell []; + static const short lhs []; + static const short rhs []; #ifndef QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO static const int rule_index []; static const int rule_info []; #endif // QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO - static const int goto_default []; - static const int action_default []; - static const int action_index []; - static const int action_info []; - static const int action_check []; + static const short goto_default []; + static const short action_default []; + static const short action_index []; + static const short action_info []; + static const short action_check []; static inline int nt_action (int state, int nt) { - const int *const goto_index = &action_index [GOTO_INDEX_OFFSET]; - const int *const goto_check = &action_check [GOTO_CHECK_OFFSET]; - - const int yyn = goto_index [state] + nt; - - if (yyn < 0 || goto_check [yyn] != nt) + const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; + if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) return goto_default [nt]; - const int *const goto_info = &action_info [GOTO_INFO_OFFSET]; - return goto_info [yyn]; + return action_info [GOTO_INFO_OFFSET + yyn]; } static inline int t_action (int state, int token) @@ -199,6 +193,7 @@ public: } }; -QT_END_NAMESPACE +QT_END_NAMESPACE #endif // QSCRIPTGRAMMAR_P_H + diff --git a/src/script/parser/qscriptparser.cpp b/src/script/parser/qscriptparser.cpp index 197a486..5ea6c17 100644 --- a/src/script/parser/qscriptparser.cpp +++ b/src/script/parser/qscriptparser.cpp @@ -1,5 +1,3 @@ -// This file was generated by qlalr - DO NOT EDIT! - /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). @@ -41,12 +39,13 @@ ** ****************************************************************************/ +// This file was generated by qlalr - DO NOT EDIT! + + #include <QtCore/QtDebug> #include <string.h> -#include "qscriptast_p.h" - #define Q_SCRIPT_UPDATE_POSITION(node, startloc, endloc) do { \ node->startLine = startloc.startLine; \ node->startColumn = startloc.startColumn; \ @@ -1136,9 +1135,9 @@ case 266: { error_message += QLatin1String (", "); first = false; - error_message += QLatin1Char('`'); + error_message += QLatin1String("`"); error_message += QLatin1String (spell [expected_tokens [s]]); - error_message += QLatin1Char('\''); + error_message += QLatin1String("'"); } } diff --git a/src/script/parser/qscriptparser_p.h b/src/script/parser/qscriptparser_p.h index 5f62db7..c940e1e 100644 --- a/src/script/parser/qscriptparser_p.h +++ b/src/script/parser/qscriptparser_p.h @@ -41,6 +41,7 @@ // This file was generated by qlalr - DO NOT EDIT! + // // W A R N I N G // ------------- |