Updated the QML/JS front-end.

This commit is contained in:
Roberto Raggi
2010-03-03 11:38:33 +01:00
parent 08b9323f0c
commit 26e4672bc6
18 changed files with 1187 additions and 1099 deletions

View File

@@ -0,0 +1,4 @@
s/qdeclarativejs/qmljs/g
s/QDECLARATIVEJS/QMLJS/g
s/QDeclarativeJS/QmlJS/g
s/QDeclarativeParser/QmlParser/g

View File

@@ -0,0 +1,9 @@
#!/bin/sh
me=$(dirname $0)
for i in $QTDIR/src/declarative/qml/parser/*.{h,cpp,pri}; do
sed -f $me/cmd.sed $i > $me/$(echo $(basename $i) | sed s/qdeclarativejs/qmljs/)
done

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **
@@ -2599,11 +2599,17 @@ public:
UiObjectInitializer *initializer) UiObjectInitializer *initializer)
: qualifiedId(qualifiedId), : qualifiedId(qualifiedId),
qualifiedTypeNameId(qualifiedTypeNameId), qualifiedTypeNameId(qualifiedTypeNameId),
initializer(initializer) initializer(initializer),
hasOnToken(false)
{ kind = K; } { kind = K; }
virtual SourceLocation firstSourceLocation() const virtual SourceLocation firstSourceLocation() const
{ return qualifiedId->identifierToken; } {
if (hasOnToken && qualifiedTypeNameId)
return qualifiedTypeNameId->identifierToken;
return qualifiedId->identifierToken;
}
virtual SourceLocation lastSourceLocation() const virtual SourceLocation lastSourceLocation() const
{ return initializer->rbraceToken; } { return initializer->rbraceToken; }
@@ -2615,6 +2621,7 @@ public:
UiQualifiedId *qualifiedTypeNameId; UiQualifiedId *qualifiedTypeNameId;
UiObjectInitializer *initializer; UiObjectInitializer *initializer;
SourceLocation colonToken; SourceLocation colonToken;
bool hasOnToken;
}; };
class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **
@@ -61,10 +61,10 @@ QT_BEGIN_NAMESPACE
class QmlJSGrammar class QmlJSGrammar
{ {
public: public:
enum VariousConstants { enum {
EOF_SYMBOL = 0, EOF_SYMBOL = 0,
REDUCE_HERE = 99, REDUCE_HERE = 100,
SHIFT_THERE = 98, SHIFT_THERE = 99,
T_AND = 1, T_AND = 1,
T_AND_AND = 2, T_AND_AND = 2,
T_AND_EQ = 3, T_AND_EQ = 3,
@@ -90,12 +90,12 @@ public:
T_EQ_EQ = 18, T_EQ_EQ = 18,
T_EQ_EQ_EQ = 19, T_EQ_EQ_EQ = 19,
T_FALSE = 83, T_FALSE = 83,
T_FEED_JS_EXPRESSION = 95, T_FEED_JS_EXPRESSION = 96,
T_FEED_JS_PROGRAM = 97, T_FEED_JS_PROGRAM = 98,
T_FEED_JS_SOURCE_ELEMENT = 96, T_FEED_JS_SOURCE_ELEMENT = 97,
T_FEED_JS_STATEMENT = 94, T_FEED_JS_STATEMENT = 95,
T_FEED_UI_OBJECT_MEMBER = 93, T_FEED_UI_OBJECT_MEMBER = 94,
T_FEED_UI_PROGRAM = 92, T_FEED_UI_PROGRAM = 93,
T_FINALLY = 20, T_FINALLY = 20,
T_FOR = 21, T_FOR = 21,
T_FUNCTION = 22, T_FUNCTION = 22,
@@ -127,6 +127,7 @@ public:
T_NOT_EQ_EQ = 46, T_NOT_EQ_EQ = 46,
T_NULL = 81, T_NULL = 81,
T_NUMERIC_LITERAL = 47, T_NUMERIC_LITERAL = 47,
T_ON = 92,
T_OR = 48, T_OR = 48,
T_OR_EQ = 49, T_OR_EQ = 49,
T_OR_OR = 50, T_OR_OR = 50,
@@ -163,15 +164,15 @@ public:
T_XOR = 79, T_XOR = 79,
T_XOR_EQ = 80, T_XOR_EQ = 80,
ACCEPT_STATE = 635, ACCEPT_STATE = 639,
RULE_COUNT = 343, RULE_COUNT = 345,
STATE_COUNT = 636, STATE_COUNT = 640,
TERMINAL_COUNT = 100, TERMINAL_COUNT = 101,
NON_TERMINAL_COUNT = 106, NON_TERMINAL_COUNT = 106,
GOTO_INDEX_OFFSET = 636, GOTO_INDEX_OFFSET = 640,
GOTO_INFO_OFFSET = 2520, GOTO_INFO_OFFSET = 2699,
GOTO_CHECK_OFFSET = 2520 GOTO_CHECK_OFFSET = 2699
}; };
static const char *const spell []; static const char *const spell [];

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **
@@ -56,12 +56,10 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
QT_BEGIN_NAMESPACE
extern double qstrtod(const char *s00, char const **se, bool *ok);
QT_END_NAMESPACE
QT_QML_BEGIN_NAMESPACE QT_QML_BEGIN_NAMESPACE
extern double qstrtod(const char *s00, char const **se, bool *ok);
#define shiftWindowsLineBreak() \ #define shiftWindowsLineBreak() \
do { \ do { \
if (((current == '\r') && (next1 == '\n')) \ if (((current == '\r') && (next1 == '\n')) \
@@ -168,6 +166,8 @@ int Lexer::findReservedWord(const QChar *c, int size) const
return QmlJSGrammar::T_IN; return QmlJSGrammar::T_IN;
else if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('s')) else if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('s'))
return QmlJSGrammar::T_AS; return QmlJSGrammar::T_AS;
else if (c[0] == QLatin1Char('o') && c[1] == QLatin1Char('n'))
return QmlJSGrammar::T_ON;
} break; } break;
case 3: { case 3: {

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved. ** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com) ** Contact: Nokia Corporation (qt-info@nokia.com)
** **

File diff suppressed because it is too large Load Diff

View File

@@ -235,9 +235,9 @@ protected:
#define J_SCRIPT_REGEXPLITERAL_RULE1 74 #define J_SCRIPT_REGEXPLITERAL_RULE1 76
#define J_SCRIPT_REGEXPLITERAL_RULE2 75 #define J_SCRIPT_REGEXPLITERAL_RULE2 77
QT_QML_END_NAMESPACE QT_QML_END_NAMESPACE