diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-06-11 08:46:43 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-06-11 09:02:53 (GMT) |
commit | 7d7c1da715474cefa5404df684d680c36e4b6b20 (patch) | |
tree | 9a47bae6183401f0d846a2723a7f43fafcab77ef /src | |
parent | f88167c39259967912540cf50d3f9df9524da4b3 (diff) | |
download | Qt-7d7c1da715474cefa5404df684d680c36e4b6b20.zip Qt-7d7c1da715474cefa5404df684d680c36e4b6b20.tar.gz Qt-7d7c1da715474cefa5404df684d680c36e4b6b20.tar.bz2 |
Renamed the QML front-end.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/parser/parser.pri | 34 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljs.g (renamed from src/declarative/qml/parser/javascript.g) | 47 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsast.cpp (renamed from src/declarative/qml/parser/javascriptast.cpp) | 8 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsast_p.h (renamed from src/declarative/qml/parser/javascriptast_p.h) | 190 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsastfwd_p.h (renamed from src/declarative/qml/parser/javascriptastfwd_p.h) | 6 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsastvisitor.cpp (renamed from src/declarative/qml/parser/javascriptastvisitor.cpp) | 6 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsastvisitor_p.h (renamed from src/declarative/qml/parser/javascriptastvisitor_p.h) | 12 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsengine_p.cpp (renamed from src/declarative/qml/parser/javascriptengine_p.cpp) | 10 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsengine_p.h (renamed from src/declarative/qml/parser/javascriptengine_p.h) | 22 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsgrammar.cpp (renamed from src/declarative/qml/parser/javascriptgrammar.cpp) | 18 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsgrammar_p.h (renamed from src/declarative/qml/parser/javascriptgrammar_p.h) | 8 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljslexer.cpp (renamed from src/declarative/qml/parser/javascriptlexer.cpp) | 264 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljslexer_p.h (renamed from src/declarative/qml/parser/javascriptlexer_p.h) | 8 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsmemorypool_p.h (renamed from src/declarative/qml/parser/javascriptmemorypool_p.h) | 8 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsnodepool_p.h (renamed from src/declarative/qml/parser/javascriptnodepool_p.h) | 10 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsparser.cpp (renamed from src/declarative/qml/parser/javascriptparser.cpp) | 20 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsparser_p.h (renamed from src/declarative/qml/parser/javascriptparser_p.h) | 20 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsprettypretty.cpp (renamed from src/declarative/qml/parser/javascriptprettypretty.cpp) | 14 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsprettypretty_p.h (renamed from src/declarative/qml/parser/javascriptprettypretty_p.h) | 10 | ||||
-rw-r--r-- | src/declarative/qml/qmlbasicscript.cpp | 36 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 12 | ||||
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlparser.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlparser_p.h | 8 | ||||
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 16 | ||||
-rw-r--r-- | src/declarative/qml/rewriter/rewriter.cpp | 8 | ||||
-rw-r--r-- | src/declarative/qml/rewriter/rewriter_p.h | 6 | ||||
-rw-r--r-- | src/declarative/qml/rewriter/textwriter.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/rewriter/textwriter_p.h | 4 |
29 files changed, 407 insertions, 406 deletions
diff --git a/src/declarative/qml/parser/parser.pri b/src/declarative/qml/parser/parser.pri index 72bd46c..610b2aa 100644 --- a/src/declarative/qml/parser/parser.pri +++ b/src/declarative/qml/parser/parser.pri @@ -1,22 +1,22 @@ INCLUDEPATH += $$PWD -HEADERS += $$PWD/javascriptast_p.h \ - $$PWD/javascriptastfwd_p.h \ - $$PWD/javascriptastvisitor_p.h \ - $$PWD/javascriptengine_p.h \ - $$PWD/javascriptgrammar_p.h \ - $$PWD/javascriptlexer_p.h \ - $$PWD/javascriptmemorypool_p.h \ - $$PWD/javascriptnodepool_p.h \ - $$PWD/javascriptparser_p.h \ - $$PWD/javascriptprettypretty_p.h +HEADERS += $$PWD/qmljsast_p.h \ + $$PWD/qmljsastfwd_p.h \ + $$PWD/qmljsastvisitor_p.h \ + $$PWD/qmljsengine_p.h \ + $$PWD/qmljsgrammar_p.h \ + $$PWD/qmljslexer_p.h \ + $$PWD/qmljsmemorypool_p.h \ + $$PWD/qmljsnodepool_p.h \ + $$PWD/qmljsparser_p.h \ + $$PWD/qmljsprettypretty_p.h -SOURCES += $$PWD/javascriptast.cpp \ - $$PWD/javascriptastvisitor.cpp \ - $$PWD/javascriptengine_p.cpp \ - $$PWD/javascriptgrammar.cpp \ - $$PWD/javascriptlexer.cpp \ - $$PWD/javascriptprettypretty.cpp \ - $$PWD/javascriptparser.cpp +SOURCES += $$PWD/qmljsast.cpp \ + $$PWD/qmljsastvisitor.cpp \ + $$PWD/qmljsengine_p.cpp \ + $$PWD/qmljsgrammar.cpp \ + $$PWD/qmljslexer.cpp \ + $$PWD/qmljsprettypretty.cpp \ + $$PWD/qmljsparser.cpp diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/qmljs.g index 884d814..907ca52 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/qmljs.g @@ -42,11 +42,11 @@ -- ---------------------------------------------------------------------------- -%parser JavaScriptGrammar -%decl javascriptparser_p.h -%impl javascriptparser.cpp +%parser QmlJSGrammar +%decl qmljsparser_p.h +%impl qmljsparser.cpp %expect 2 -%expect-rr 2 +%expect-rr 3 %token T_AND "&" T_AND_AND "&&" T_AND_EQ "&=" %token T_BREAK "break" T_CASE "case" T_CATCH "catch" @@ -137,10 +137,10 @@ #include <string.h> -#include "javascriptengine_p.h" -#include "javascriptlexer_p.h" -#include "javascriptast_p.h" -#include "javascriptnodepool_p.h" +#include "qmljsengine_p.h" +#include "qmljslexer_p.h" +#include "qmljsast_p.h" +#include "qmljsnodepool_p.h" ./ @@ -198,16 +198,16 @@ // // -// This file is automatically generated from javascript.g. +// This file is automatically generated from qmljs.g. // Changes will be lost. // -#ifndef JAVASCRIPTPARSER_P_H -#define JAVASCRIPTPARSER_P_H +#ifndef QMLJSPARSER_P_H +#define QMLJSPARSER_P_H -#include "javascriptgrammar_p.h" -#include "javascriptast_p.h" -#include "javascriptengine_p.h" +#include "qmljsgrammar_p.h" +#include "qmljsast_p.h" +#include "qmljsengine_p.h" #include <QtCore/QList> @@ -215,7 +215,7 @@ QT_BEGIN_NAMESPACE class QString; -namespace JavaScript { +namespace QmlJS { class Engine; class NameId; @@ -262,6 +262,7 @@ public: AST::UiArrayBinding *UiArrayBinding; AST::UiObjectMember *UiObjectMember; AST::UiObjectMemberList *UiObjectMemberList; + AST::UiArrayMemberList *UiArrayMemberList; AST::UiQualifiedId *UiQualifiedId; }; @@ -337,7 +338,7 @@ protected: QList<DiagnosticMessage> diagnostic_messages; }; -} // end of namespace JavaScript +} // end of namespace QmlJS :/ @@ -345,15 +346,15 @@ protected: /. -#include "javascriptparser_p.h" +#include "qmljsparser_p.h" #include <QVarLengthArray> // -// This file is automatically generated from javascript.g. +// This file is automatically generated from qmljs.g. // Changes will be lost. // -using namespace JavaScript; +using namespace QmlJS; QT_BEGIN_NAMESPACE @@ -809,7 +810,7 @@ JsIdentifier: T_IDENTIFIER; JsIdentifier: T_PROPERTY ; /. case $rule_number: { - QString s = QLatin1String(JavaScriptGrammar::spell[T_PROPERTY]); + QString s = QLatin1String(QmlJSGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } @@ -818,7 +819,7 @@ case $rule_number: { JsIdentifier: T_SIGNAL ; /. case $rule_number: { - QString s = QLatin1String(JavaScriptGrammar::spell[T_SIGNAL]); + QString s = QLatin1String(QmlJSGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } @@ -2697,7 +2698,7 @@ case $rule_number: { } break; ./ ---JavaScriptProgram: SourceElements ; +--QmlJSProgram: SourceElements ; --/. --case $rule_number: { -- sym(1).Node = makeAstNode<AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ()); @@ -2876,5 +2877,5 @@ QT_END_NAMESPACE -#endif // JAVASCRIPTPARSER_P_H +#endif // QMLJSPARSER_P_H :/ diff --git a/src/declarative/qml/parser/javascriptast.cpp b/src/declarative/qml/parser/qmljsast.cpp index ada19d5..d10c071 100644 --- a/src/declarative/qml/parser/javascriptast.cpp +++ b/src/declarative/qml/parser/qmljsast.cpp @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "javascriptast_p.h" +#include "qmljsast_p.h" -#include "javascriptastvisitor_p.h" +#include "qmljsastvisitor_p.h" QT_BEGIN_NAMESPACE -namespace JavaScript { namespace AST { +namespace QmlJS { namespace AST { int NumericLiteral::suffixLength[] = { 0, // noSuffix @@ -955,7 +955,7 @@ void UiSourceElement::accept0(Visitor *visitor) visitor->endVisit(this); } -} } // namespace JavaScript::AST +} } // namespace QmlJS::AST QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/qmljsast_p.h index 8c1e2bc..8dc32ed 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/qmljsast_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef JAVASCRIPTAST_P_H -#define JAVASCRIPTAST_P_H +#ifndef QMLJSAST_P_H +#define QMLJSAST_P_H // // W A R N I N G @@ -53,12 +53,12 @@ // We mean it. // -#include "javascriptastvisitor_p.h" +#include "qmljsastvisitor_p.h" #include <QtCore/QString> QT_BEGIN_NAMESPACE -#define JAVASCRIPT_DECLARE_AST_NODE(name) \ +#define QMLJS_DECLARE_AST_NODE(name) \ enum { K = Kind_##name }; namespace QSOperator // ### rename @@ -104,7 +104,7 @@ enum Op { } // namespace QSOperator -namespace JavaScript { +namespace QmlJS { class NameId; namespace AST { @@ -271,7 +271,7 @@ public: class NestedExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(NestedExpression) + QMLJS_DECLARE_AST_NODE(NestedExpression) NestedExpression(ExpressionNode *expression) : expression(expression) @@ -294,7 +294,7 @@ public: class ThisExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(ThisExpression) + QMLJS_DECLARE_AST_NODE(ThisExpression) ThisExpression() { kind = K; } virtual ~ThisExpression() {} @@ -314,7 +314,7 @@ public: class IdentifierExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(IdentifierExpression) + QMLJS_DECLARE_AST_NODE(IdentifierExpression) IdentifierExpression(NameId *n): name (n) { kind = K; } @@ -337,7 +337,7 @@ public: class NullExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(NullExpression) + QMLJS_DECLARE_AST_NODE(NullExpression) NullExpression() { kind = K; } virtual ~NullExpression() {} @@ -357,7 +357,7 @@ public: class TrueLiteral: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(TrueLiteral) + QMLJS_DECLARE_AST_NODE(TrueLiteral) TrueLiteral() { kind = K; } virtual ~TrueLiteral() {} @@ -377,7 +377,7 @@ public: class FalseLiteral: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(FalseLiteral) + QMLJS_DECLARE_AST_NODE(FalseLiteral) FalseLiteral() { kind = K; } virtual ~FalseLiteral() {} @@ -397,9 +397,9 @@ public: class NumericLiteral: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(NumericLiteral) + QMLJS_DECLARE_AST_NODE(NumericLiteral) - enum Suffix { // ### keep it in sync with the Suffix enum in javascriptlexer_p.h + enum Suffix { // ### keep it in sync with the Suffix enum in qmljslexer_p.h noSuffix, emSuffix, exSuffix, @@ -442,7 +442,7 @@ public: class StringLiteral: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(StringLiteral) + QMLJS_DECLARE_AST_NODE(StringLiteral) StringLiteral(NameId *v): value (v) { kind = K; } @@ -465,7 +465,7 @@ public: class RegExpLiteral: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(RegExpLiteral) + QMLJS_DECLARE_AST_NODE(RegExpLiteral) RegExpLiteral(NameId *p, int f): pattern (p), flags (f) { kind = K; } @@ -489,7 +489,7 @@ public: class ArrayLiteral: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(ArrayLiteral) + QMLJS_DECLARE_AST_NODE(ArrayLiteral) ArrayLiteral(Elision *e): elements (0), elision (e) @@ -524,7 +524,7 @@ public: class ObjectLiteral: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(ObjectLiteral) + QMLJS_DECLARE_AST_NODE(ObjectLiteral) ObjectLiteral(): properties (0) { kind = K; } @@ -551,7 +551,7 @@ public: class ElementList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(ElementList) + QMLJS_DECLARE_AST_NODE(ElementList) ElementList(Elision *e, ExpressionNode *expr): elision (e), expression (expr), next (this) @@ -586,7 +586,7 @@ public: class Elision: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(Elision) + QMLJS_DECLARE_AST_NODE(Elision) Elision(): next (this) { kind = K; } @@ -617,7 +617,7 @@ public: class PropertyNameAndValueList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(PropertyNameAndValueList) + QMLJS_DECLARE_AST_NODE(PropertyNameAndValueList) PropertyNameAndValueList(PropertyName *n, ExpressionNode *v): name (n), value (v), next (this) @@ -653,7 +653,7 @@ public: class PropertyName: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(PropertyName) + QMLJS_DECLARE_AST_NODE(PropertyName) PropertyName() { kind = K; } virtual ~PropertyName() {} @@ -665,7 +665,7 @@ public: class IdentifierPropertyName: public PropertyName { public: - JAVASCRIPT_DECLARE_AST_NODE(IdentifierPropertyName) + QMLJS_DECLARE_AST_NODE(IdentifierPropertyName) IdentifierPropertyName(NameId *n): id (n) { kind = K; } @@ -681,7 +681,7 @@ public: class StringLiteralPropertyName: public PropertyName { public: - JAVASCRIPT_DECLARE_AST_NODE(StringLiteralPropertyName) + QMLJS_DECLARE_AST_NODE(StringLiteralPropertyName) StringLiteralPropertyName(NameId *n): id (n) { kind = K; } @@ -696,7 +696,7 @@ public: class NumericLiteralPropertyName: public PropertyName { public: - JAVASCRIPT_DECLARE_AST_NODE(NumericLiteralPropertyName) + QMLJS_DECLARE_AST_NODE(NumericLiteralPropertyName) NumericLiteralPropertyName(double n): id (n) { kind = K; } @@ -711,7 +711,7 @@ public: class ArrayMemberExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(ArrayMemberExpression) + QMLJS_DECLARE_AST_NODE(ArrayMemberExpression) ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e): base (b), expression (e) @@ -737,7 +737,7 @@ public: class FieldMemberExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(FieldMemberExpression) + QMLJS_DECLARE_AST_NODE(FieldMemberExpression) FieldMemberExpression(ExpressionNode *b, NameId *n): base (b), name (n) @@ -763,7 +763,7 @@ public: class NewMemberExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(NewMemberExpression) + QMLJS_DECLARE_AST_NODE(NewMemberExpression) NewMemberExpression(ExpressionNode *b, ArgumentList *a): base (b), arguments (a) @@ -790,7 +790,7 @@ public: class NewExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(NewExpression) + QMLJS_DECLARE_AST_NODE(NewExpression) NewExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -813,7 +813,7 @@ public: class CallExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(CallExpression) + QMLJS_DECLARE_AST_NODE(CallExpression) CallExpression(ExpressionNode *b, ArgumentList *a): base (b), arguments (a) @@ -839,7 +839,7 @@ public: class ArgumentList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(ArgumentList) + QMLJS_DECLARE_AST_NODE(ArgumentList) ArgumentList(ExpressionNode *e): expression (e), next (this) @@ -873,7 +873,7 @@ public: class PostIncrementExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(PostIncrementExpression) + QMLJS_DECLARE_AST_NODE(PostIncrementExpression) PostIncrementExpression(ExpressionNode *b): base (b) { kind = K; } @@ -896,7 +896,7 @@ public: class PostDecrementExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(PostDecrementExpression) + QMLJS_DECLARE_AST_NODE(PostDecrementExpression) PostDecrementExpression(ExpressionNode *b): base (b) { kind = K; } @@ -919,7 +919,7 @@ public: class DeleteExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(DeleteExpression) + QMLJS_DECLARE_AST_NODE(DeleteExpression) DeleteExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -941,7 +941,7 @@ public: class VoidExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(VoidExpression) + QMLJS_DECLARE_AST_NODE(VoidExpression) VoidExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -964,7 +964,7 @@ public: class TypeOfExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(TypeOfExpression) + QMLJS_DECLARE_AST_NODE(TypeOfExpression) TypeOfExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -987,7 +987,7 @@ public: class PreIncrementExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(PreIncrementExpression) + QMLJS_DECLARE_AST_NODE(PreIncrementExpression) PreIncrementExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1010,7 +1010,7 @@ public: class PreDecrementExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(PreDecrementExpression) + QMLJS_DECLARE_AST_NODE(PreDecrementExpression) PreDecrementExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1033,7 +1033,7 @@ public: class UnaryPlusExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(UnaryPlusExpression) + QMLJS_DECLARE_AST_NODE(UnaryPlusExpression) UnaryPlusExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1056,7 +1056,7 @@ public: class UnaryMinusExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(UnaryMinusExpression) + QMLJS_DECLARE_AST_NODE(UnaryMinusExpression) UnaryMinusExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1079,7 +1079,7 @@ public: class TildeExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(TildeExpression) + QMLJS_DECLARE_AST_NODE(TildeExpression) TildeExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1102,7 +1102,7 @@ public: class NotExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(NotExpression) + QMLJS_DECLARE_AST_NODE(NotExpression) NotExpression(ExpressionNode *e): expression (e) { kind = K; } @@ -1125,7 +1125,7 @@ public: class BinaryExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(BinaryExpression) + QMLJS_DECLARE_AST_NODE(BinaryExpression) BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r): left (l), op (o), right (r) @@ -1153,7 +1153,7 @@ public: class ConditionalExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(ConditionalExpression) + QMLJS_DECLARE_AST_NODE(ConditionalExpression) ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f): expression (e), ok (t), ko (f) @@ -1180,7 +1180,7 @@ public: class Expression: public ExpressionNode // ### rename { public: - JAVASCRIPT_DECLARE_AST_NODE(Expression) + QMLJS_DECLARE_AST_NODE(Expression) Expression(ExpressionNode *l, ExpressionNode *r): left (l), right (r) { kind = K; } @@ -1204,7 +1204,7 @@ public: class Block: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(Block) + QMLJS_DECLARE_AST_NODE(Block) Block(StatementList *slist): statements (slist) { kind = K; } @@ -1228,7 +1228,7 @@ public: class StatementList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(StatementList) + QMLJS_DECLARE_AST_NODE(StatementList) StatementList(Statement *stmt): statement (stmt), next (this) @@ -1261,7 +1261,7 @@ public: class VariableStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(VariableStatement) + QMLJS_DECLARE_AST_NODE(VariableStatement) VariableStatement(VariableDeclarationList *vlist): declarations (vlist) @@ -1286,7 +1286,7 @@ public: class VariableDeclaration: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(VariableDeclaration) + QMLJS_DECLARE_AST_NODE(VariableDeclaration) VariableDeclaration(NameId *n, ExpressionNode *e): name (n), expression (e), readOnly(false) @@ -1306,7 +1306,7 @@ public: class VariableDeclarationList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(VariableDeclarationList) + QMLJS_DECLARE_AST_NODE(VariableDeclarationList) VariableDeclarationList(VariableDeclaration *decl): declaration (decl), next (this) @@ -1345,7 +1345,7 @@ public: class EmptyStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(EmptyStatement) + QMLJS_DECLARE_AST_NODE(EmptyStatement) EmptyStatement() { kind = K; } virtual ~EmptyStatement() {} @@ -1365,7 +1365,7 @@ public: class ExpressionStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(ExpressionStatement) + QMLJS_DECLARE_AST_NODE(ExpressionStatement) ExpressionStatement(ExpressionNode *e): expression (e) { kind = K; } @@ -1388,7 +1388,7 @@ public: class IfStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(IfStatement) + QMLJS_DECLARE_AST_NODE(IfStatement) IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0): expression (e), ok (t), ko (f) @@ -1422,7 +1422,7 @@ public: class DoWhileStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(DoWhileStatement) + QMLJS_DECLARE_AST_NODE(DoWhileStatement) DoWhileStatement(Statement *stmt, ExpressionNode *e): statement (stmt), expression (e) @@ -1451,7 +1451,7 @@ public: class WhileStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(WhileStatement) + QMLJS_DECLARE_AST_NODE(WhileStatement) WhileStatement(ExpressionNode *e, Statement *stmt): expression (e), statement (stmt) @@ -1478,7 +1478,7 @@ public: class ForStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(ForStatement) + QMLJS_DECLARE_AST_NODE(ForStatement) ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt): initialiser (i), condition (c), expression (e), statement (stmt) @@ -1509,7 +1509,7 @@ public: class LocalForStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(LocalForStatement) + QMLJS_DECLARE_AST_NODE(LocalForStatement) LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt): declarations (vlist), condition (c), expression (e), statement (stmt) @@ -1541,7 +1541,7 @@ public: class ForEachStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(ForEachStatement) + QMLJS_DECLARE_AST_NODE(ForEachStatement) ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt): initialiser (i), expression (e), statement (stmt) @@ -1570,7 +1570,7 @@ public: class LocalForEachStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(LocalForEachStatement) + QMLJS_DECLARE_AST_NODE(LocalForEachStatement) LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt): declaration (v), expression (e), statement (stmt) @@ -1600,7 +1600,7 @@ public: class ContinueStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(ContinueStatement) + QMLJS_DECLARE_AST_NODE(ContinueStatement) ContinueStatement(NameId *l = 0): label (l) { kind = K; } @@ -1625,7 +1625,7 @@ public: class BreakStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(BreakStatement) + QMLJS_DECLARE_AST_NODE(BreakStatement) BreakStatement(NameId *l = 0): label (l) { kind = K; } @@ -1650,7 +1650,7 @@ public: class ReturnStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(ReturnStatement) + QMLJS_DECLARE_AST_NODE(ReturnStatement) ReturnStatement(ExpressionNode *e): expression (e) { kind = K; } @@ -1674,7 +1674,7 @@ public: class WithStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(WithStatement) + QMLJS_DECLARE_AST_NODE(WithStatement) WithStatement(ExpressionNode *e, Statement *stmt): expression (e), statement (stmt) @@ -1701,7 +1701,7 @@ public: class CaseBlock: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(CaseBlock) + QMLJS_DECLARE_AST_NODE(CaseBlock) CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0): clauses (c), defaultClause (d), moreClauses (r) @@ -1722,7 +1722,7 @@ public: class SwitchStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(SwitchStatement) + QMLJS_DECLARE_AST_NODE(SwitchStatement) SwitchStatement(ExpressionNode *e, CaseBlock *b): expression (e), block (b) @@ -1749,7 +1749,7 @@ public: class CaseClauses: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(CaseClauses) + QMLJS_DECLARE_AST_NODE(CaseClauses) CaseClauses(CaseClause *c): clause (c), next (this) @@ -1782,7 +1782,7 @@ public: class CaseClause: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(CaseClause) + QMLJS_DECLARE_AST_NODE(CaseClause) CaseClause(ExpressionNode *e, StatementList *slist): expression (e), statements (slist) @@ -1802,7 +1802,7 @@ public: class DefaultClause: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(DefaultClause) + QMLJS_DECLARE_AST_NODE(DefaultClause) DefaultClause(StatementList *slist): statements (slist) @@ -1821,7 +1821,7 @@ public: class LabelledStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(LabelledStatement) + QMLJS_DECLARE_AST_NODE(LabelledStatement) LabelledStatement(NameId *l, Statement *stmt): label (l), statement (stmt) @@ -1847,7 +1847,7 @@ public: class ThrowStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(ThrowStatement) + QMLJS_DECLARE_AST_NODE(ThrowStatement) ThrowStatement(ExpressionNode *e): expression (e) { kind = K; } @@ -1871,7 +1871,7 @@ public: class Catch: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(Catch) + QMLJS_DECLARE_AST_NODE(Catch) Catch(NameId *n, Block *stmt): name (n), statement (stmt) @@ -1893,7 +1893,7 @@ public: class Finally: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(Finally) + QMLJS_DECLARE_AST_NODE(Finally) Finally(Block *stmt): statement (stmt) @@ -1911,7 +1911,7 @@ public: class TryStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(TryStatement) + QMLJS_DECLARE_AST_NODE(TryStatement) TryStatement(Statement *stmt, Catch *c, Finally *f): statement (stmt), catchExpression (c), finallyExpression (f) @@ -1952,7 +1952,7 @@ public: class FunctionExpression: public ExpressionNode { public: - JAVASCRIPT_DECLARE_AST_NODE(FunctionExpression) + QMLJS_DECLARE_AST_NODE(FunctionExpression) FunctionExpression(NameId *n, FormalParameterList *f, FunctionBody *b): name (n), formals (f), body (b) @@ -1983,7 +1983,7 @@ public: class FunctionDeclaration: public FunctionExpression { public: - JAVASCRIPT_DECLARE_AST_NODE(FunctionDeclaration) + QMLJS_DECLARE_AST_NODE(FunctionDeclaration) FunctionDeclaration(NameId *n, FormalParameterList *f, FunctionBody *b): FunctionExpression(n, f, b) @@ -1997,7 +1997,7 @@ public: class FormalParameterList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(FormalParameterList) + QMLJS_DECLARE_AST_NODE(FormalParameterList) FormalParameterList(NameId *n): name (n), next (this) @@ -2032,7 +2032,7 @@ public: class FunctionBody: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(FunctionBody) + QMLJS_DECLARE_AST_NODE(FunctionBody) FunctionBody(SourceElements *elts): elements (elts) @@ -2049,7 +2049,7 @@ public: class Program: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(Program) + QMLJS_DECLARE_AST_NODE(Program) Program(SourceElements *elts): elements (elts) @@ -2066,7 +2066,7 @@ public: class SourceElements: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(SourceElements) + QMLJS_DECLARE_AST_NODE(SourceElements) SourceElements(SourceElement *elt): element (elt), next (this) @@ -2099,7 +2099,7 @@ public: class SourceElement: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(SourceElement) + QMLJS_DECLARE_AST_NODE(SourceElement) inline SourceElement() { kind = K; } @@ -2110,7 +2110,7 @@ public: class FunctionSourceElement: public SourceElement { public: - JAVASCRIPT_DECLARE_AST_NODE(FunctionSourceElement) + QMLJS_DECLARE_AST_NODE(FunctionSourceElement) FunctionSourceElement(FunctionDeclaration *f): declaration (f) @@ -2127,7 +2127,7 @@ public: class StatementSourceElement: public SourceElement { public: - JAVASCRIPT_DECLARE_AST_NODE(StatementSourceElement) + QMLJS_DECLARE_AST_NODE(StatementSourceElement) StatementSourceElement(Statement *stmt): statement (stmt) @@ -2144,7 +2144,7 @@ public: class DebuggerStatement: public Statement { public: - JAVASCRIPT_DECLARE_AST_NODE(DebuggerStatement) + QMLJS_DECLARE_AST_NODE(DebuggerStatement) DebuggerStatement() { kind = K; } @@ -2167,7 +2167,7 @@ public: class UiProgram: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(UiProgram) + QMLJS_DECLARE_AST_NODE(UiProgram) UiProgram(UiImportList *imports, UiObjectMemberList *members) : imports(imports), members(members) @@ -2183,7 +2183,7 @@ public: class UiQualifiedId: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(UiQualifiedId) + QMLJS_DECLARE_AST_NODE(UiQualifiedId) UiQualifiedId(NameId *name) : next(this), name(name) @@ -2217,7 +2217,7 @@ public: class UiImport: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(UiImport) + QMLJS_DECLARE_AST_NODE(UiImport) UiImport(NameId *fileName) : fileName(fileName) @@ -2235,7 +2235,7 @@ public: class UiImportList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(UiImportList) + QMLJS_DECLARE_AST_NODE(UiImportList) UiImportList(UiImport *import) : import(import), @@ -2274,7 +2274,7 @@ public: class UiObjectMemberList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(UiObjectMemberList) + QMLJS_DECLARE_AST_NODE(UiObjectMemberList) UiObjectMemberList(UiObjectMember *member) : next(this), member(member) @@ -2305,7 +2305,7 @@ public: class UiArrayMemberList: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(UiArrayMemberList) + QMLJS_DECLARE_AST_NODE(UiArrayMemberList) UiArrayMemberList(UiObjectMember *member) : next(this), member(member) @@ -2337,7 +2337,7 @@ public: class UiObjectInitializer: public Node { public: - JAVASCRIPT_DECLARE_AST_NODE(UiObjectInitializer) + QMLJS_DECLARE_AST_NODE(UiObjectInitializer) UiObjectInitializer(UiObjectMemberList *members) : members(members) @@ -2354,7 +2354,7 @@ public: class UiPublicMember: public UiObjectMember { public: - JAVASCRIPT_DECLARE_AST_NODE(UiPublicMember) + QMLJS_DECLARE_AST_NODE(UiPublicMember) UiPublicMember(NameId *memberType, NameId *name) @@ -2399,7 +2399,7 @@ public: class UiObjectDefinition: public UiObjectMember { public: - JAVASCRIPT_DECLARE_AST_NODE(UiObjectDefinition) + QMLJS_DECLARE_AST_NODE(UiObjectDefinition) UiObjectDefinition(UiQualifiedId *qualifiedTypeNameId, UiObjectInitializer *initializer) @@ -2422,7 +2422,7 @@ public: class UiSourceElement: public UiObjectMember { public: - JAVASCRIPT_DECLARE_AST_NODE(UiSourceElement) + QMLJS_DECLARE_AST_NODE(UiSourceElement) UiSourceElement(Node *sourceElement) : sourceElement(sourceElement) @@ -2458,7 +2458,7 @@ public: class UiObjectBinding: public UiObjectMember { public: - JAVASCRIPT_DECLARE_AST_NODE(UiObjectBinding) + QMLJS_DECLARE_AST_NODE(UiObjectBinding) UiObjectBinding(UiQualifiedId *qualifiedId, UiQualifiedId *qualifiedTypeNameId, @@ -2486,7 +2486,7 @@ public: class UiScriptBinding: public UiObjectMember { public: - JAVASCRIPT_DECLARE_AST_NODE(UiScriptBinding) + QMLJS_DECLARE_AST_NODE(UiScriptBinding) UiScriptBinding(UiQualifiedId *qualifiedId, Statement *statement) @@ -2511,7 +2511,7 @@ public: class UiArrayBinding: public UiObjectMember { public: - JAVASCRIPT_DECLARE_AST_NODE(UiArrayBinding) + QMLJS_DECLARE_AST_NODE(UiArrayBinding) UiArrayBinding(UiQualifiedId *qualifiedId, UiArrayMemberList *members) diff --git a/src/declarative/qml/parser/javascriptastfwd_p.h b/src/declarative/qml/parser/qmljsastfwd_p.h index 23270e5..339bea4 100644 --- a/src/declarative/qml/parser/javascriptastfwd_p.h +++ b/src/declarative/qml/parser/qmljsastfwd_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef JAVASCRIPTAST_FWD_P_H -#define JAVASCRIPTAST_FWD_P_H +#ifndef QMLJSAST_FWD_P_H +#define QMLJSAST_FWD_P_H #include <QtCore/qglobal.h> @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -namespace JavaScript { namespace AST { +namespace QmlJS { namespace AST { class SourceLocation { diff --git a/src/declarative/qml/parser/javascriptastvisitor.cpp b/src/declarative/qml/parser/qmljsastvisitor.cpp index eac291d..642bcee 100644 --- a/src/declarative/qml/parser/javascriptastvisitor.cpp +++ b/src/declarative/qml/parser/qmljsastvisitor.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "javascriptastvisitor_p.h" +#include "qmljsastvisitor_p.h" QT_BEGIN_NAMESPACE -namespace JavaScript { namespace AST { +namespace QmlJS { namespace AST { Visitor::Visitor() { @@ -53,6 +53,6 @@ Visitor::~Visitor() { } -} } // namespace JavaScript::AST +} } // namespace QmlJS::AST QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptastvisitor_p.h b/src/declarative/qml/parser/qmljsastvisitor_p.h index 7c73e43..3677b1a 100644 --- a/src/declarative/qml/parser/javascriptastvisitor_p.h +++ b/src/declarative/qml/parser/qmljsastvisitor_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef JAVASCRIPTASTVISITOR_P_H -#define JAVASCRIPTASTVISITOR_P_H +#ifndef QMLJSASTVISITOR_P_H +#define QMLJSASTVISITOR_P_H // // W A R N I N G @@ -53,11 +53,11 @@ // We mean it. // -#include "javascriptastfwd_p.h" +#include "qmljsastfwd_p.h" QT_BEGIN_NAMESPACE -namespace JavaScript { namespace AST { +namespace QmlJS { namespace AST { class Visitor { @@ -97,7 +97,7 @@ public: virtual void endVisit(UiArrayMemberList *) {} virtual void endVisit(UiQualifiedId *) {} - // JavaScript + // QmlJS virtual bool visit(ThisExpression *) { return true; } virtual void endVisit(ThisExpression *) {} @@ -325,4 +325,4 @@ public: QT_END_NAMESPACE -#endif // JAVASCRIPTASTVISITOR_P_H +#endif // QMLJSASTVISITOR_P_H diff --git a/src/declarative/qml/parser/javascriptengine_p.cpp b/src/declarative/qml/parser/qmljsengine_p.cpp index d893a90..42885d8 100644 --- a/src/declarative/qml/parser/javascriptengine_p.cpp +++ b/src/declarative/qml/parser/qmljsengine_p.cpp @@ -27,16 +27,16 @@ ** **************************************************************************/ -#include "javascriptengine_p.h" -#include "javascriptnodepool_p.h" +#include "qmljsengine_p.h" +#include "qmljsnodepool_p.h" #include <qnumeric.h> #include <QHash> QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { -uint qHash(const JavaScript::NameId &id) +uint qHash(const QmlJS::NameId &id) { return qHash(id.asString()); } QString numberToString(double value) @@ -186,6 +186,6 @@ void Engine::setNodePool(NodePool *nodePool) -} // end of namespace JavaScript +} // end of namespace QmlJS QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/qmljsengine_p.h index 3bd924a..b9ff042 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/qmljsengine_p.h @@ -27,17 +27,17 @@ ** **************************************************************************/ -#ifndef JAVASCRIPTENGINE_P_H -#define JAVASCRIPTENGINE_P_H +#ifndef QMLJSENGINE_P_H +#define QMLJSENGINE_P_H #include <QString> #include <QSet> -#include "javascriptastfwd_p.h" +#include "qmljsastfwd_p.h" QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { class NameId { QString _text; @@ -60,17 +60,17 @@ public: { return _text < other._text; } }; -uint qHash(const JavaScript::NameId &id); +uint qHash(const QmlJS::NameId &id); -} // end of namespace JavaScript +} // end of namespace QmlJS #if defined(Q_CC_MSVC) && _MSC_VER <= 1300 -//this ensures that code outside JavaScript can use the hash function +//this ensures that code outside QmlJS can use the hash function //it also a workaround for some compilers -inline uint qHash(const JavaScript::NameId &nameId) { return JavaScript::qHash(nameId); } +inline uint qHash(const QmlJS::NameId &nameId) { return QmlJS::qHash(nameId); } #endif -namespace JavaScript { +namespace QmlJS { class Lexer; class NodePool; @@ -138,8 +138,8 @@ public: void setNodePool(NodePool *nodePool); }; -} // end of namespace JavaScript +} // end of namespace QmlJS QT_END_NAMESPACE -#endif // JAVASCRIPTENGINE_P_H +#endif // QMLJSENGINE_P_H diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/qmljsgrammar.cpp index a879bfe..835ee44 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/qmljsgrammar.cpp @@ -40,9 +40,9 @@ ** ****************************************************************************/ -#include "javascriptgrammar_p.h" +#include "qmljsgrammar_p.h" -const char *const JavaScriptGrammar::spell [] = { +const char *const QmlJSGrammar::spell [] = { "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue", "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===", "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier", @@ -54,7 +54,7 @@ const char *const JavaScriptGrammar::spell [] = { "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "public", "import", 0, 0}; -const int JavaScriptGrammar::lhs [] = { +const int QmlJSGrammar::lhs [] = { 91, 92, 92, 95, 95, 96, 96, 94, 93, 98, 98, 100, 100, 101, 101, 97, 99, 99, 103, 104, 104, 99, 99, 99, 99, 99, 99, 99, 111, 111, @@ -89,7 +89,7 @@ const int JavaScriptGrammar::lhs [] = { 185, 186, 186, 189, 190, 190, 191, 191, 187, 187, 118, 118, 192}; -const int JavaScriptGrammar:: rhs[] = { +const int QmlJSGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 0, 1, 1, 2, 1, 3, 2, 3, 2, 1, 5, 1, 2, 2, 4, 3, 3, 3, 3, 3, 3, 1, 1, @@ -124,7 +124,7 @@ const int JavaScriptGrammar:: rhs[] = { 1, 0, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 2}; -const int JavaScriptGrammar::action_default [] = { +const int QmlJSGrammar::action_default [] = { 8, 2, 0, 4, 3, 0, 0, 0, 6, 7, 5, 65, 45, 46, 43, 44, 47, 9, 0, 1, 0, 0, 16, 66, 41, 248, 0, 0, 46, 14, @@ -185,7 +185,7 @@ const int JavaScriptGrammar::action_default [] = { 0, 12, 0, 18, 13, 20, 21, 257, 250, 0, 258, 254, 0, 256, 246, 0, 247, 251, 323}; -const int JavaScriptGrammar::goto_default [] = { +const int QmlJSGrammar::goto_default [] = { 6, 5, 19, 1, 4, 3, 32, 34, 33, 570, 22, 18, 538, 539, 231, 226, 230, 232, 229, 236, 517, 235, 264, 57, 65, 495, 494, 388, 387, 48, @@ -198,7 +198,7 @@ const int JavaScriptGrammar::goto_default [] = { 454, 453, 473, 474, 220, 234, 216, 219, 233, 241, 240, 0}; -const int JavaScriptGrammar::action_index [] = { +const int QmlJSGrammar::action_index [] = { 8, -91, 14, -91, -15, 296, 67, 94, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, 109, -91, 184, 408, -91, -91, -91, -91, 45, 125, 170, -91, @@ -319,7 +319,7 @@ const int JavaScriptGrammar::action_index [] = { -102, -102, 128, -102, -102, -102, -102, -102, -102, -102, -102, -102, -6, -102, -102, 58, -102, -102, -102}; -const int JavaScriptGrammar::action_info [] = { +const int QmlJSGrammar::action_info [] = { 338, 174, 289, 485, 472, 472, -89, 480, -105, 380, 43, 472, -79, -78, -100, 448, -97, 435, -102, 134, 304, 326, 132, 104, 478, 375, 489, 372, 374, 456, @@ -573,7 +573,7 @@ const int JavaScriptGrammar::action_info [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -const int JavaScriptGrammar::action_check [] = { +const int QmlJSGrammar::action_check [] = { 60, 8, 36, 36, 33, 33, 7, 60, 7, 36, 29, 33, 7, 7, 7, 36, 7, 55, 7, 78, 1, 78, 48, 1, 36, 33, 36, 36, 60, 5, diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/qmljsgrammar_p.h index 830f533..c514485 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/qmljsgrammar_p.h @@ -51,10 +51,10 @@ // We mean it. // -#ifndef JAVASCRIPTGRAMMAR_P_H -#define JAVASCRIPTGRAMMAR_P_H +#ifndef QMLJSGRAMMAR_P_H +#define QMLJSGRAMMAR_P_H -class JavaScriptGrammar +class QmlJSGrammar { public: enum { @@ -196,5 +196,5 @@ public: }; -#endif // JAVASCRIPTGRAMMAR_P_H +#endif // QMLJSGRAMMAR_P_H diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/qmljslexer.cpp index ea36a7a..843f6ae 100644 --- a/src/declarative/qml/parser/javascriptlexer.cpp +++ b/src/declarative/qml/parser/qmljslexer.cpp @@ -43,9 +43,9 @@ #include "config.h" #endif -#include "javascriptengine_p.h" -#include "javascriptlexer_p.h" -#include "javascriptgrammar_p.h" +#include "qmljsengine_p.h" +#include "qmljslexer_p.h" +#include "qmljsgrammar_p.h" #include <ctype.h> #include <stdlib.h> @@ -65,11 +65,11 @@ extern double qstrtod(const char *s00, char const **se, bool *ok); } \ while (0) -namespace JavaScript { +namespace QmlJS { extern double integerFromString(const char *buf, int size, int radix); } -using namespace JavaScript; +using namespace QmlJS; Lexer::Lexer(Engine *eng) : driver(eng), @@ -154,66 +154,66 @@ int Lexer::findReservedWord(const QChar *c, int size) const switch (size) { case 2: { if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o')) - return JavaScriptGrammar::T_DO; + return QmlJSGrammar::T_DO; else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('f')) - return JavaScriptGrammar::T_IF; + return QmlJSGrammar::T_IF; else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')) - return JavaScriptGrammar::T_IN; + return QmlJSGrammar::T_IN; } break; case 3: { if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('r')) - return JavaScriptGrammar::T_FOR; + return QmlJSGrammar::T_FOR; else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('w')) - return JavaScriptGrammar::T_NEW; + return QmlJSGrammar::T_NEW; else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('y')) - return JavaScriptGrammar::T_TRY; + return QmlJSGrammar::T_TRY; else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('r')) - return JavaScriptGrammar::T_VAR; + return QmlJSGrammar::T_VAR; else if (check_reserved) { if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') && c[2] == QLatin1Char('t')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; case 4: { if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e')) - return JavaScriptGrammar::T_CASE; + return QmlJSGrammar::T_CASE; else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('l') && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e')) - return JavaScriptGrammar::T_ELSE; + return QmlJSGrammar::T_ELSE; else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h') && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('s')) - return JavaScriptGrammar::T_THIS; + return QmlJSGrammar::T_THIS; else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('d')) - return JavaScriptGrammar::T_VOID; + return QmlJSGrammar::T_VOID; else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('i') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('h')) - return JavaScriptGrammar::T_WITH; + return QmlJSGrammar::T_WITH; else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('e')) - return JavaScriptGrammar::T_TRUE; + return QmlJSGrammar::T_TRUE; else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('u') && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('l')) - return JavaScriptGrammar::T_NULL; + return QmlJSGrammar::T_NULL; else if (check_reserved) { if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('n') && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('m')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('y') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('l') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('g')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('h') && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('r')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('g') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('o')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -221,48 +221,48 @@ int Lexer::findReservedWord(const QChar *c, int size) const if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('e') && c[3] == QLatin1Char('a') && c[4] == QLatin1Char('k')) - return JavaScriptGrammar::T_BREAK; + return QmlJSGrammar::T_BREAK; else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('c') && c[4] == QLatin1Char('h')) - return JavaScriptGrammar::T_CATCH; + return QmlJSGrammar::T_CATCH; else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h') && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o') && c[4] == QLatin1Char('w')) - return JavaScriptGrammar::T_THROW; + return QmlJSGrammar::T_THROW; else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('h') && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('l') && c[4] == QLatin1Char('e')) - return JavaScriptGrammar::T_WHILE; + return QmlJSGrammar::T_WHILE; else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('s') && c[4] == QLatin1Char('t')) - return JavaScriptGrammar::T_CONST; + return QmlJSGrammar::T_CONST; else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('s') && c[4] == QLatin1Char('e')) - return JavaScriptGrammar::T_FALSE; + return QmlJSGrammar::T_FALSE; else if (check_reserved) { if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('h') && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('r') && c[4] == QLatin1Char('t')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('u') && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e') && c[4] == QLatin1Char('r')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i') && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a') && c[4] == QLatin1Char('l')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('l') && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('s') && c[4] == QLatin1Char('s')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('l') && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('a') && c[4] == QLatin1Char('t')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -270,56 +270,56 @@ int Lexer::findReservedWord(const QChar *c, int size) const if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('e') && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('e')) - return JavaScriptGrammar::T_DELETE; + return QmlJSGrammar::T_DELETE; else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('u') && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('n')) - return JavaScriptGrammar::T_RETURN; + return QmlJSGrammar::T_RETURN; else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('w') && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('t') && c[4] == QLatin1Char('c') && c[5] == QLatin1Char('h')) - return JavaScriptGrammar::T_SWITCH; + return QmlJSGrammar::T_SWITCH; else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('y') && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e') && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('f')) - return JavaScriptGrammar::T_TYPEOF; + return QmlJSGrammar::T_TYPEOF; else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m') && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o') && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t')) - return JavaScriptGrammar::T_IMPORT; + return QmlJSGrammar::T_IMPORT; else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('i') && c[2] == QLatin1Char('g') && c[3] == QLatin1Char('n') && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('l')) - return JavaScriptGrammar::T_SIGNAL; + return QmlJSGrammar::T_SIGNAL; else if (check_reserved) { if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x') && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o') && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('t') && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('t') && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('b') && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('e')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m') && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o') && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('u') && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('l') && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c')) - return JavaScriptGrammar::T_PUBLIC; + return QmlJSGrammar::T_PUBLIC; else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('i') && c[4] == QLatin1Char('v') && c[5] == QLatin1Char('e')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h') && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o') && c[4] == QLatin1Char('w') && c[5] == QLatin1Char('s')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -328,33 +328,33 @@ int Lexer::findReservedWord(const QChar *c, int size) const && c[2] == QLatin1Char('f') && c[3] == QLatin1Char('a') && c[4] == QLatin1Char('u') && c[5] == QLatin1Char('l') && c[6] == QLatin1Char('t')) - return JavaScriptGrammar::T_DEFAULT; + return QmlJSGrammar::T_DEFAULT; else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i') && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a') && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('l') && c[6] == QLatin1Char('y')) - return JavaScriptGrammar::T_FINALLY; + return QmlJSGrammar::T_FINALLY; else if (check_reserved) { if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('l') && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('a') && c[6] == QLatin1Char('n')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e') && c[4] == QLatin1Char('n') && c[5] == QLatin1Char('d') && c[6] == QLatin1Char('s')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('c') && c[3] == QLatin1Char('k') && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('g') && c[6] == QLatin1Char('e')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('v') && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('t') && c[6] == QLatin1Char('e')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -363,33 +363,33 @@ int Lexer::findReservedWord(const QChar *c, int size) const && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('t') && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('n') && c[6] == QLatin1Char('u') && c[7] == QLatin1Char('e')) - return JavaScriptGrammar::T_CONTINUE; + return QmlJSGrammar::T_CONTINUE; else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('u') && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c') && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i') && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n')) - return JavaScriptGrammar::T_FUNCTION; + return QmlJSGrammar::T_FUNCTION; else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('u') && c[4] == QLatin1Char('g') && c[5] == QLatin1Char('g') && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('r')) - return JavaScriptGrammar::T_DEBUGGER; + return QmlJSGrammar::T_DEBUGGER; else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('p') && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('r') && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('y')) - return JavaScriptGrammar::T_PROPERTY; + return QmlJSGrammar::T_PROPERTY; else if (check_reserved) { if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('b') && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t') && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('a') && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('t')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('a') && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i') && c[6] == QLatin1Char('l') && c[7] == QLatin1Char('e')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -400,19 +400,19 @@ int Lexer::findReservedWord(const QChar *c, int size) const && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('f') && c[6] == QLatin1Char('a') && c[7] == QLatin1Char('c') && c[8] == QLatin1Char('e')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('n') && c[4] == QLatin1Char('s') && c[5] == QLatin1Char('i') && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n') && c[8] == QLatin1Char('t')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('t') && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('c') && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('e') && c[8] == QLatin1Char('d')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -422,14 +422,14 @@ int Lexer::findReservedWord(const QChar *c, int size) const && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('n') && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('e') && c[8] == QLatin1Char('o') && c[9] == QLatin1Char('f')) - return JavaScriptGrammar::T_INSTANCEOF; + return QmlJSGrammar::T_INSTANCEOF; else if (check_reserved) { if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m') && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('l') && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('m') && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n') && c[8] == QLatin1Char('t') && c[9] == QLatin1Char('s')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -441,7 +441,7 @@ int Lexer::findReservedWord(const QChar *c, int size) const && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n') && c[8] == QLatin1Char('i') && c[9] == QLatin1Char('z') && c[10] == QLatin1Char('e') && c[11] == QLatin1Char('d')) - return JavaScriptGrammar::T_RESERVED_WORD; + return QmlJSGrammar::T_RESERVED_WORD; } } break; @@ -485,7 +485,7 @@ int Lexer::lex() syncProhibitAutomaticSemicolon(); if (!terminator && !delimited && !prohibitAutomaticSemicolon) { // automatic semicolon insertion if program incomplete - token = JavaScriptGrammar::T_SEMICOLON; + token = QmlJSGrammar::T_SEMICOLON; stackToken = 0; setDone(Other); } else { @@ -499,7 +499,7 @@ int Lexer::lex() terminator = true; syncProhibitAutomaticSemicolon(); if (restrKeyword) { - token = JavaScriptGrammar::T_SEMICOLON; + token = QmlJSGrammar::T_SEMICOLON; setDone(Other); } } else if (current == '"' || current == '\'') { @@ -528,11 +528,11 @@ int Lexer::lex() token = matchPunctuator(current, next1, next2, next3); if (token != -1) { if (terminator && !delimited && !prohibitAutomaticSemicolon - && (token == JavaScriptGrammar::T_PLUS_PLUS - || token == JavaScriptGrammar::T_MINUS_MINUS)) { + && (token == QmlJSGrammar::T_PLUS_PLUS + || token == QmlJSGrammar::T_MINUS_MINUS)) { // automatic semicolon insertion stackToken = token; - token = JavaScriptGrammar::T_SEMICOLON; + token = QmlJSGrammar::T_SEMICOLON; } setDone(Other); } @@ -636,7 +636,7 @@ int Lexer::lex() terminator = true; bol = true; if (restrKeyword) { - token = JavaScriptGrammar::T_SEMICOLON; + token = QmlJSGrammar::T_SEMICOLON; setDone(Other); } else state = Start; @@ -840,11 +840,11 @@ int Lexer::lex() case IgnoreParentheses: break; case CountParentheses: - if (token == JavaScriptGrammar::T_RPAREN) { + if (token == QmlJSGrammar::T_RPAREN) { --parenthesesCount; if (parenthesesCount == 0) parenthesesState = BalancedParentheses; - } else if (token == JavaScriptGrammar::T_LPAREN) { + } else if (token == QmlJSGrammar::T_LPAREN) { ++parenthesesCount; } break; @@ -857,7 +857,7 @@ int Lexer::lex() case Eof: return 0; case Other: - if (token == JavaScriptGrammar::T_RBRACE || token == JavaScriptGrammar::T_SEMICOLON) + if (token == QmlJSGrammar::T_RBRACE || token == QmlJSGrammar::T_SEMICOLON) delimited = true; return token; case Identifier: @@ -867,16 +867,16 @@ int Lexer::lex() qsyylval.ustr = driver->intern(buffer16, pos16); else qsyylval.ustr = 0; - return JavaScriptGrammar::T_IDENTIFIER; + return QmlJSGrammar::T_IDENTIFIER; } - if (token == JavaScriptGrammar::T_CONTINUE || token == JavaScriptGrammar::T_BREAK - || token == JavaScriptGrammar::T_RETURN || token == JavaScriptGrammar::T_THROW) { + if (token == QmlJSGrammar::T_CONTINUE || token == QmlJSGrammar::T_BREAK + || token == QmlJSGrammar::T_RETURN || token == QmlJSGrammar::T_THROW) { restrKeyword = true; - } else if (token == JavaScriptGrammar::T_IF || token == JavaScriptGrammar::T_FOR - || token == JavaScriptGrammar::T_WHILE || token == JavaScriptGrammar::T_WITH) { + } else if (token == QmlJSGrammar::T_IF || token == QmlJSGrammar::T_FOR + || token == QmlJSGrammar::T_WHILE || token == QmlJSGrammar::T_WITH) { parenthesesState = CountParentheses; parenthesesCount = 0; - } else if (token == JavaScriptGrammar::T_DO) { + } else if (token == QmlJSGrammar::T_DO) { parenthesesState = BalancedParentheses; } return token; @@ -885,10 +885,10 @@ int Lexer::lex() qsyylval.ustr = driver->intern(buffer16, pos16); else qsyylval.ustr = 0; - return multiLineString?JavaScriptGrammar::T_MULTILINE_STRING_LITERAL:JavaScriptGrammar::T_STRING_LITERAL; + return multiLineString?QmlJSGrammar::T_MULTILINE_STRING_LITERAL:QmlJSGrammar::T_STRING_LITERAL; case Number: qsyylval.dval = dval; - return JavaScriptGrammar::T_NUMERIC_LITERAL; + return QmlJSGrammar::T_NUMERIC_LITERAL; case Bad: return -1; default: @@ -939,103 +939,103 @@ int Lexer::matchPunctuator(ushort c1, ushort c2, { if (c1 == '>' && c2 == '>' && c3 == '>' && c4 == '=') { shift(4); - return JavaScriptGrammar::T_GT_GT_GT_EQ; + return QmlJSGrammar::T_GT_GT_GT_EQ; } else if (c1 == '=' && c2 == '=' && c3 == '=') { shift(3); - return JavaScriptGrammar::T_EQ_EQ_EQ; + return QmlJSGrammar::T_EQ_EQ_EQ; } else if (c1 == '!' && c2 == '=' && c3 == '=') { shift(3); - return JavaScriptGrammar::T_NOT_EQ_EQ; + return QmlJSGrammar::T_NOT_EQ_EQ; } else if (c1 == '>' && c2 == '>' && c3 == '>') { shift(3); - return JavaScriptGrammar::T_GT_GT_GT; + return QmlJSGrammar::T_GT_GT_GT; } else if (c1 == '<' && c2 == '<' && c3 == '=') { shift(3); - return JavaScriptGrammar::T_LT_LT_EQ; + return QmlJSGrammar::T_LT_LT_EQ; } else if (c1 == '>' && c2 == '>' && c3 == '=') { shift(3); - return JavaScriptGrammar::T_GT_GT_EQ; + return QmlJSGrammar::T_GT_GT_EQ; } else if (c1 == '<' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_LE; + return QmlJSGrammar::T_LE; } else if (c1 == '>' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_GE; + return QmlJSGrammar::T_GE; } else if (c1 == '!' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_NOT_EQ; + return QmlJSGrammar::T_NOT_EQ; } else if (c1 == '+' && c2 == '+') { shift(2); - return JavaScriptGrammar::T_PLUS_PLUS; + return QmlJSGrammar::T_PLUS_PLUS; } else if (c1 == '-' && c2 == '-') { shift(2); - return JavaScriptGrammar::T_MINUS_MINUS; + return QmlJSGrammar::T_MINUS_MINUS; } else if (c1 == '=' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_EQ_EQ; + return QmlJSGrammar::T_EQ_EQ; } else if (c1 == '+' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_PLUS_EQ; + return QmlJSGrammar::T_PLUS_EQ; } else if (c1 == '-' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_MINUS_EQ; + return QmlJSGrammar::T_MINUS_EQ; } else if (c1 == '*' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_STAR_EQ; + return QmlJSGrammar::T_STAR_EQ; } else if (c1 == '/' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_DIVIDE_EQ; + return QmlJSGrammar::T_DIVIDE_EQ; } else if (c1 == '&' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_AND_EQ; + return QmlJSGrammar::T_AND_EQ; } else if (c1 == '^' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_XOR_EQ; + return QmlJSGrammar::T_XOR_EQ; } else if (c1 == '%' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_REMAINDER_EQ; + return QmlJSGrammar::T_REMAINDER_EQ; } else if (c1 == '|' && c2 == '=') { shift(2); - return JavaScriptGrammar::T_OR_EQ; + return QmlJSGrammar::T_OR_EQ; } else if (c1 == '<' && c2 == '<') { shift(2); - return JavaScriptGrammar::T_LT_LT; + return QmlJSGrammar::T_LT_LT; } else if (c1 == '>' && c2 == '>') { shift(2); - return JavaScriptGrammar::T_GT_GT; + return QmlJSGrammar::T_GT_GT; } else if (c1 == '&' && c2 == '&') { shift(2); - return JavaScriptGrammar::T_AND_AND; + return QmlJSGrammar::T_AND_AND; } else if (c1 == '|' && c2 == '|') { shift(2); - return JavaScriptGrammar::T_OR_OR; + return QmlJSGrammar::T_OR_OR; } switch(c1) { - case '=': shift(1); return JavaScriptGrammar::T_EQ; - case '>': shift(1); return JavaScriptGrammar::T_GT; - case '<': shift(1); return JavaScriptGrammar::T_LT; - case ',': shift(1); return JavaScriptGrammar::T_COMMA; - case '!': shift(1); return JavaScriptGrammar::T_NOT; - case '~': shift(1); return JavaScriptGrammar::T_TILDE; - case '?': shift(1); return JavaScriptGrammar::T_QUESTION; - case ':': shift(1); return JavaScriptGrammar::T_COLON; - case '.': shift(1); return JavaScriptGrammar::T_DOT; - case '+': shift(1); return JavaScriptGrammar::T_PLUS; - case '-': shift(1); return JavaScriptGrammar::T_MINUS; - case '*': shift(1); return JavaScriptGrammar::T_STAR; - case '/': shift(1); return JavaScriptGrammar::T_DIVIDE_; - case '&': shift(1); return JavaScriptGrammar::T_AND; - case '|': shift(1); return JavaScriptGrammar::T_OR; - case '^': shift(1); return JavaScriptGrammar::T_XOR; - case '%': shift(1); return JavaScriptGrammar::T_REMAINDER; - case '(': shift(1); return JavaScriptGrammar::T_LPAREN; - case ')': shift(1); return JavaScriptGrammar::T_RPAREN; - case '{': shift(1); return JavaScriptGrammar::T_LBRACE; - case '}': shift(1); return JavaScriptGrammar::T_RBRACE; - case '[': shift(1); return JavaScriptGrammar::T_LBRACKET; - case ']': shift(1); return JavaScriptGrammar::T_RBRACKET; - case ';': shift(1); return JavaScriptGrammar::T_SEMICOLON; + case '=': shift(1); return QmlJSGrammar::T_EQ; + case '>': shift(1); return QmlJSGrammar::T_GT; + case '<': shift(1); return QmlJSGrammar::T_LT; + case ',': shift(1); return QmlJSGrammar::T_COMMA; + case '!': shift(1); return QmlJSGrammar::T_NOT; + case '~': shift(1); return QmlJSGrammar::T_TILDE; + case '?': shift(1); return QmlJSGrammar::T_QUESTION; + case ':': shift(1); return QmlJSGrammar::T_COLON; + case '.': shift(1); return QmlJSGrammar::T_DOT; + case '+': shift(1); return QmlJSGrammar::T_PLUS; + case '-': shift(1); return QmlJSGrammar::T_MINUS; + case '*': shift(1); return QmlJSGrammar::T_STAR; + case '/': shift(1); return QmlJSGrammar::T_DIVIDE_; + case '&': shift(1); return QmlJSGrammar::T_AND; + case '|': shift(1); return QmlJSGrammar::T_OR; + case '^': shift(1); return QmlJSGrammar::T_XOR; + case '%': shift(1); return QmlJSGrammar::T_REMAINDER; + case '(': shift(1); return QmlJSGrammar::T_LPAREN; + case ')': shift(1); return QmlJSGrammar::T_RPAREN; + case '{': shift(1); return QmlJSGrammar::T_LBRACE; + case '}': shift(1); return QmlJSGrammar::T_RBRACE; + case '[': shift(1); return QmlJSGrammar::T_LBRACKET; + case ']': shift(1); return QmlJSGrammar::T_RBRACKET; + case ';': shift(1); return QmlJSGrammar::T_SEMICOLON; default: return -1; } diff --git a/src/declarative/qml/parser/javascriptlexer_p.h b/src/declarative/qml/parser/qmljslexer_p.h index a47c1ae..e1ff23e 100644 --- a/src/declarative/qml/parser/javascriptlexer_p.h +++ b/src/declarative/qml/parser/qmljslexer_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef JAVASCRIPTLEXER_P_H -#define JAVASCRIPTLEXER_P_H +#ifndef QMLJSLEXER_P_H +#define QMLJSLEXER_P_H // // W A R N I N G @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { class Engine; class NameId; @@ -260,7 +260,7 @@ private: bool prohibitAutomaticSemicolon; }; -} // namespace JavaScript +} // namespace QmlJS QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptmemorypool_p.h b/src/declarative/qml/parser/qmljsmemorypool_p.h index cff7677..d7506be 100644 --- a/src/declarative/qml/parser/javascriptmemorypool_p.h +++ b/src/declarative/qml/parser/qmljsmemorypool_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef JAVASCRIPTMEMORYPOOL_P_H -#define JAVASCRIPTMEMORYPOOL_P_H +#ifndef QMLJSMEMORYPOOL_P_H +#define QMLJSMEMORYPOOL_P_H // // W A R N I N G @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { class MemoryPool : public QSharedData { @@ -123,7 +123,7 @@ private: Q_DISABLE_COPY(MemoryPool) }; -} // namespace JavaScript +} // namespace QmlJS QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptnodepool_p.h b/src/declarative/qml/parser/qmljsnodepool_p.h index cb56fbb..1a5b7f6 100644 --- a/src/declarative/qml/parser/javascriptnodepool_p.h +++ b/src/declarative/qml/parser/qmljsnodepool_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef JAVASCRIPTNODEPOOL_P_H -#define JAVASCRIPTNODEPOOL_P_H +#ifndef QMLJSNODEPOOL_P_H +#define QMLJSNODEPOOL_P_H // // W A R N I N G @@ -56,11 +56,11 @@ #include <QtCore/QHash> #include <QtCore/QString> -#include "javascriptmemorypool_p.h" +#include "qmljsmemorypool_p.h" QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { namespace AST { class Node; @@ -131,7 +131,7 @@ private: Q_DISABLE_COPY(NodePool) }; -} // namespace JavaScript +} // namespace QmlJS QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/qmljsparser.cpp index bbffc4f..6ecff3d 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/qmljsparser.cpp @@ -45,22 +45,22 @@ #include <string.h> -#include "javascriptengine_p.h" -#include "javascriptlexer_p.h" -#include "javascriptast_p.h" -#include "javascriptnodepool_p.h" +#include "qmljsengine_p.h" +#include "qmljslexer_p.h" +#include "qmljsast_p.h" +#include "qmljsnodepool_p.h" -#include "javascriptparser_p.h" +#include "qmljsparser_p.h" #include <QVarLengthArray> // -// This file is automatically generated from javascript.g. +// This file is automatically generated from qmljs.g. // Changes will be lost. // -using namespace JavaScript; +using namespace QmlJS; QT_BEGIN_NAMESPACE @@ -78,7 +78,7 @@ void Parser::reallocateStack() inline static bool automatic(Engine *driver, int token) { - return token == JavaScriptGrammar::T_RBRACE + return token == QmlJSGrammar::T_RBRACE || token == 0 || driver->lexer()->prevTerminator(); } @@ -389,13 +389,13 @@ case 43: } break; case 45: { - QString s = QLatin1String(JavaScriptGrammar::spell[T_PROPERTY]); + QString s = QLatin1String(QmlJSGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } case 46: { - QString s = QLatin1String(JavaScriptGrammar::spell[T_SIGNAL]); + QString s = QLatin1String(QmlJSGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/qmljsparser_p.h index b6a2432..cd2c7f5 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/qmljsparser_p.h @@ -53,16 +53,16 @@ // // -// This file is automatically generated from javascript.g. +// This file is automatically generated from qmljs.g. // Changes will be lost. // -#ifndef JAVASCRIPTPARSER_P_H -#define JAVASCRIPTPARSER_P_H +#ifndef QMLJSPARSER_P_H +#define QMLJSPARSER_P_H -#include "javascriptgrammar_p.h" -#include "javascriptast_p.h" -#include "javascriptengine_p.h" +#include "qmljsgrammar_p.h" +#include "qmljsast_p.h" +#include "qmljsengine_p.h" #include <QtCore/QList> @@ -70,12 +70,12 @@ QT_BEGIN_NAMESPACE class QString; -namespace JavaScript { +namespace QmlJS { class Engine; class NameId; -class Parser: protected JavaScriptGrammar +class Parser: protected QmlJSGrammar { public: union Value { @@ -193,7 +193,7 @@ protected: QList<DiagnosticMessage> diagnostic_messages; }; -} // end of namespace JavaScript +} // end of namespace QmlJS @@ -205,4 +205,4 @@ QT_END_NAMESPACE -#endif // JAVASCRIPTPARSER_P_H +#endif // QMLJSPARSER_P_H diff --git a/src/declarative/qml/parser/javascriptprettypretty.cpp b/src/declarative/qml/parser/qmljsprettypretty.cpp index 0342b39..1045792 100644 --- a/src/declarative/qml/parser/javascriptprettypretty.cpp +++ b/src/declarative/qml/parser/qmljsprettypretty.cpp @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#include "javascriptprettypretty_p.h" +#include "qmljsprettypretty_p.h" -#include "javascriptengine_p.h" +#include "qmljsengine_p.h" -#include "javascriptast_p.h" +#include "qmljsast_p.h" #include <QtCore/QString> #include <QtCore/QTextStream> @@ -56,11 +56,11 @@ QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { QString numberToString(double value); } -using namespace JavaScript; +using namespace QmlJS; PrettyPretty::PrettyPretty(QTextStream &o): out(o), m_indentLevel(0) @@ -242,7 +242,7 @@ void PrettyPretty::endVisit(AST::StringLiteral *node) bool PrettyPretty::visit(AST::NumericLiteral *node) { - out << JavaScript::numberToString(node->value); + out << QmlJS::numberToString(node->value); return true; } @@ -255,7 +255,7 @@ bool PrettyPretty::visit(AST::RegExpLiteral *node) { out << "/" << Engine::toString(node->pattern) << "/"; if (node->flags) - out << JavaScript::Ecma::RegExp::flagsToString(node->flags); + out << QmlJS::Ecma::RegExp::flagsToString(node->flags); return true; } diff --git a/src/declarative/qml/parser/javascriptprettypretty_p.h b/src/declarative/qml/parser/qmljsprettypretty_p.h index c692da5..fe82ca2 100644 --- a/src/declarative/qml/parser/javascriptprettypretty_p.h +++ b/src/declarative/qml/parser/qmljsprettypretty_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef JAVASCRIPTPRETTYPRETTY_P_H -#define JAVASCRIPTPRETTYPRETTY_P_H +#ifndef QMLJSPRETTYPRETTY_P_H +#define QMLJSPRETTYPRETTY_P_H // // W A R N I N G @@ -55,13 +55,13 @@ #include <QtCore/qglobal.h> -#include "javascriptastvisitor_p.h" +#include "qmljsastvisitor_p.h" QT_BEGIN_NAMESPACE class QTextStream; -namespace JavaScript { +namespace QmlJS { class PrettyPretty: protected AST::Visitor { @@ -322,7 +322,7 @@ private: Q_DISABLE_COPY(PrettyPretty) }; -} // namespace JavaScript +} // namespace QmlJS QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlbasicscript.cpp b/src/declarative/qml/qmlbasicscript.cpp index d8e65bf..dd6766e 100644 --- a/src/declarative/qml/qmlbasicscript.cpp +++ b/src/declarative/qml/qmlbasicscript.cpp @@ -17,12 +17,12 @@ #include <QStack> #include <qfxperf.h> #include <private/qmlrefcount_p.h> -#include <private/javascriptast_p.h> -#include <private/javascriptengine_p.h> +#include <private/qmljsast_p.h> +#include <private/qmljsengine_p.h> QT_BEGIN_NAMESPACE -using namespace JavaScript; +using namespace QmlJS; struct ScriptInstruction { enum { @@ -270,16 +270,16 @@ struct QmlBasicScriptCompiler QmlParser::Object *component; QHash<QString, QPair<QmlParser::Object *, int> > ids; - bool compile(JavaScript::AST::Node *); + bool compile(QmlJS::AST::Node *); - bool compileExpression(JavaScript::AST::Node *); + bool compileExpression(QmlJS::AST::Node *); - bool tryConstant(JavaScript::AST::Node *); - bool parseConstant(JavaScript::AST::Node *); - bool tryName(JavaScript::AST::Node *); - bool parseName(JavaScript::AST::Node *, QmlParser::Object ** = 0); - bool tryBinaryExpression(JavaScript::AST::Node *); - bool compileBinaryExpression(JavaScript::AST::Node *); + bool tryConstant(QmlJS::AST::Node *); + bool parseConstant(QmlJS::AST::Node *); + bool tryName(QmlJS::AST::Node *); + bool parseName(QmlJS::AST::Node *, QmlParser::Object ** = 0); + bool tryBinaryExpression(QmlJS::AST::Node *); + bool compileBinaryExpression(QmlJS::AST::Node *); QByteArray data; QList<ScriptInstruction> bytecode; @@ -288,10 +288,10 @@ struct QmlBasicScriptCompiler /*! \internal \class QmlBasicScript - \brief The QmlBasicScript class provides a fast implementation of a limited subset of JavaScript bindings. + \brief The QmlBasicScript class provides a fast implementation of a limited subset of QmlJS bindings. QmlBasicScript instances are used to accelerate binding. Instead of using - the slower, fully fledged JavaScript engine, many simple bindings can be + the slower, fully fledged QmlJS engine, many simple bindings can be evaluated using the QmlBasicScript engine. To see if the QmlBasicScript engine can handle a binding, call compile() @@ -495,12 +495,12 @@ bool QmlBasicScript::compile(const Expression &expression) return d != 0; } -bool QmlBasicScriptCompiler::compile(JavaScript::AST::Node *node) +bool QmlBasicScriptCompiler::compile(QmlJS::AST::Node *node) { return compileExpression(node); } -bool QmlBasicScriptCompiler::tryConstant(JavaScript::AST::Node *node) +bool QmlBasicScriptCompiler::tryConstant(QmlJS::AST::Node *node) { if (node->kind == AST::Node::Kind_TrueLiteral || node->kind == AST::Node::Kind_FalseLiteral) @@ -516,7 +516,7 @@ bool QmlBasicScriptCompiler::tryConstant(JavaScript::AST::Node *node) return false; } -bool QmlBasicScriptCompiler::parseConstant(JavaScript::AST::Node *node) +bool QmlBasicScriptCompiler::parseConstant(QmlJS::AST::Node *node) { ScriptInstruction instr; @@ -534,7 +534,7 @@ bool QmlBasicScriptCompiler::parseConstant(JavaScript::AST::Node *node) return true; } -bool QmlBasicScriptCompiler::tryName(JavaScript::AST::Node *node) +bool QmlBasicScriptCompiler::tryName(QmlJS::AST::Node *node) { return node->kind == AST::Node::Kind_IdentifierExpression || node->kind == AST::Node::Kind_FieldMemberExpression; @@ -629,7 +629,7 @@ bool QmlBasicScriptCompiler::parseName(AST::Node *node, return true; } -bool QmlBasicScriptCompiler::compileExpression(JavaScript::AST::Node *node) +bool QmlBasicScriptCompiler::compileExpression(QmlJS::AST::Node *node) { if (tryBinaryExpression(node)) return compileBinaryExpression(node); diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index d29ac1f..3123254 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -62,7 +62,7 @@ #include "private/qmlcustomparser_p_p.h" #include <private/qmlcontext_p.h> #include <private/qmlcomponent_p.h> -#include "parser/javascriptast_p.h" +#include "parser/qmljsast_p.h" #include "qmlscriptparser_p.h" @@ -1484,7 +1484,7 @@ bool QmlCompiler::compileBinding(QmlParser::Value *value, //////////////////////////////////////////////////////////////////////////////// // AST Dump //////////////////////////////////////////////////////////////////////////////// -class Dump: protected JavaScript::AST::Visitor +class Dump: protected QmlJS::AST::Visitor { std::ostream &out; int depth; @@ -1494,11 +1494,11 @@ public: : out(out), depth(-1) { } - void operator()(JavaScript::AST::Node *node) - { JavaScript::AST::Node::acceptChild(node, this); } + void operator()(QmlJS::AST::Node *node) + { QmlJS::AST::Node::acceptChild(node, this); } protected: - virtual bool preVisit(JavaScript::AST::Node *node) + virtual bool preVisit(QmlJS::AST::Node *node) { const char *name = typeid(*node).name(); #ifdef Q_CC_GNU @@ -1508,7 +1508,7 @@ protected: return true; } - virtual void postVisit(JavaScript::AST::Node *) + virtual void postVisit(QmlJS::AST::Node *) { --depth; } diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 66781ce..2c1d324 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -823,7 +823,7 @@ QScriptValue QmlEngine::qmlScriptObject(QObject* object, QmlEngine* engine) This function takes the URL of a QML file as its only argument. It returns a component object which can be used to create and load that QML file. - Example JavaScript is below, remember that QML files that might be loaded + Example QmlJS is below, remember that QML files that might be loaded over the network cannot be expected to be ready immediately. \code var component; diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index fadfbb1..5ad4a6e 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -290,7 +290,7 @@ QmlParser::Variant::Variant(const QString &v) { } -QmlParser::Variant::Variant(const QString &v, JavaScript::AST::Node *n) +QmlParser::Variant::Variant(const QString &v, QmlJS::AST::Node *n) : t(Script), n(n), s(v) { } @@ -342,7 +342,7 @@ QString QmlParser::Variant::asScript() const } } -JavaScript::AST::Node *QmlParser::Variant::asAST() const +QmlJS::AST::Node *QmlParser::Variant::asAST() const { if (type() == Script) return n; diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 1481391..a38ce69 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -namespace JavaScript { namespace AST { class Node; } } +namespace QmlJS { namespace AST { class Node; } } /* XXX @@ -178,7 +178,7 @@ namespace QmlParser Variant(bool); Variant(double, const QString &asWritten=QString()); Variant(const QString &); - Variant(const QString &, JavaScript::AST::Node *); + Variant(const QString &, QmlJS::AST::Node *); Variant &operator=(const Variant &); Type type() const; @@ -192,14 +192,14 @@ namespace QmlParser QString asString() const; double asNumber() const; QString asScript() const; - JavaScript::AST::Node *asAST() const; + QmlJS::AST::Node *asAST() const; private: Type t; union { bool b; double d; - JavaScript::AST::Node *n; + QmlJS::AST::Node *n; }; QString s; }; diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index ee2981e..6c2e3e0 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -42,12 +42,12 @@ #include "qmlscriptparser_p.h" #include "qmlparser_p.h" -#include "parser/javascriptengine_p.h" -#include "parser/javascriptparser_p.h" -#include "parser/javascriptlexer_p.h" -#include "parser/javascriptnodepool_p.h" -#include "parser/javascriptastvisitor_p.h" -#include "parser/javascriptast_p.h" +#include "parser/qmljsengine_p.h" +#include "parser/qmljsparser_p.h" +#include "parser/qmljslexer_p.h" +#include "parser/qmljsnodepool_p.h" +#include "parser/qmljsastvisitor_p.h" +#include "parser/qmljsast_p.h" #include "rewriter/textwriter_p.h" @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE -using namespace JavaScript; +using namespace QmlJS; using namespace QmlParser; namespace { @@ -715,7 +715,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node) obj->dynamicSlots << slot; } else { QmlError error; - error.setDescription(QCoreApplication::translate("QmlParser","JavaScript declaration outside Script element")); + error.setDescription(QCoreApplication::translate("QmlParser","QmlJS declaration outside Script element")); error.setLine(node->firstSourceLocation().startLine); error.setColumn(node->firstSourceLocation().startColumn); _parser->_errors << error; diff --git a/src/declarative/qml/rewriter/rewriter.cpp b/src/declarative/qml/rewriter/rewriter.cpp index fce4fdf..2ce927c 100644 --- a/src/declarative/qml/rewriter/rewriter.cpp +++ b/src/declarative/qml/rewriter/rewriter.cpp @@ -40,11 +40,11 @@ ****************************************************************************/ #include "rewriter_p.h" -#include "javascriptast_p.h" +#include "qmljsast_p.h" QT_BEGIN_NAMESPACE -using namespace JavaScript; +using namespace QmlJS; void Rewriter::replace(const AST::SourceLocation &loc, const QString &text) { replace(loc.offset, loc.length, text); } @@ -76,8 +76,8 @@ QString Rewriter::textAt(const AST::SourceLocation &loc) const QString Rewriter::textAt(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc) const { return _code.mid(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset); } -void Rewriter::accept(JavaScript::AST::Node *node) -{ JavaScript::AST::Node::acceptChild(node, this); } +void Rewriter::accept(QmlJS::AST::Node *node) +{ QmlJS::AST::Node::acceptChild(node, this); } void Rewriter::moveTextBefore(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc, diff --git a/src/declarative/qml/rewriter/rewriter_p.h b/src/declarative/qml/rewriter/rewriter_p.h index 02b4ee4..fcb9ca5 100644 --- a/src/declarative/qml/rewriter/rewriter_p.h +++ b/src/declarative/qml/rewriter/rewriter_p.h @@ -46,12 +46,12 @@ #include <QtCore/QString> #include "textwriter_p.h" -#include "javascriptastvisitor_p.h" +#include "qmljsastvisitor_p.h" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { //////////////////////////////////////////////////////////////////////////////// // Replacement @@ -143,7 +143,7 @@ private: QList<Replacement> _replacementList; }; -} // end of namespace JavaScript +} // end of namespace QmlJS QT_END_NAMESPACE QT_END_HEADER diff --git a/src/declarative/qml/rewriter/textwriter.cpp b/src/declarative/qml/rewriter/textwriter.cpp index 21122ff..fbbdb2bbab 100644 --- a/src/declarative/qml/rewriter/textwriter.cpp +++ b/src/declarative/qml/rewriter/textwriter.cpp @@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE -using namespace JavaScript; +using namespace QmlJS; TextWriter::TextWriter() :string(0), cursor(0) diff --git a/src/declarative/qml/rewriter/textwriter_p.h b/src/declarative/qml/rewriter/textwriter_p.h index 57800bf..3041e04 100644 --- a/src/declarative/qml/rewriter/textwriter_p.h +++ b/src/declarative/qml/rewriter/textwriter_p.h @@ -49,7 +49,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -namespace JavaScript { +namespace QmlJS { class TextWriter { @@ -91,7 +91,7 @@ public: }; -} // end of namespace JavaScript +} // end of namespace QmlJS QT_END_NAMESPACE QT_END_HEADER |