Moved the qmljs shared folder into the shared library.

This commit is contained in:
Erik Verbruggen
2010-01-18 13:13:34 +01:00
parent 41c4253301
commit 205c9b3f9a
34 changed files with 14248 additions and 13 deletions
+22
View File
@@ -0,0 +1,22 @@
OTHER_FILES += $$PWD/qmljs.g
##INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
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/qmljsglobal_p.h
SOURCES += $$PWD/qmljsast.cpp \
$$PWD/qmljsastvisitor.cpp \
$$PWD/qmljsengine_p.cpp \
$$PWD/qmljsgrammar.cpp \
$$PWD/qmljslexer.cpp \
$$PWD/qmljsparser.cpp
File diff suppressed because it is too large Load Diff
+955
View File
@@ -0,0 +1,955 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qmljsast_p.h"
#include "qmljsastvisitor_p.h"
QT_QML_BEGIN_NAMESPACE
namespace QmlJS { namespace AST {
void Node::accept(Visitor *visitor)
{
if (visitor->preVisit(this)) {
accept0(visitor);
}
visitor->postVisit(this);
}
void Node::accept(Node *node, Visitor *visitor)
{
if (node)
node->accept(visitor);
}
ExpressionNode *Node::expressionCast()
{
return 0;
}
BinaryExpression *Node::binaryExpressionCast()
{
return 0;
}
Statement *Node::statementCast()
{
return 0;
}
UiObjectMember *Node::uiObjectMemberCast()
{
return 0;
}
ExpressionNode *ExpressionNode::expressionCast()
{
return this;
}
BinaryExpression *BinaryExpression::binaryExpressionCast()
{
return this;
}
Statement *Statement::statementCast()
{
return this;
}
UiObjectMember *UiObjectMember::uiObjectMemberCast()
{
return this;
}
void NestedExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void ThisExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void IdentifierExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void NullExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void TrueLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void FalseLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void StringLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void NumericLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void RegExpLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void ArrayLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(elements, visitor);
accept(elision, visitor);
}
visitor->endVisit(this);
}
void ObjectLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(properties, visitor);
}
visitor->endVisit(this);
}
void ElementList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (ElementList *it = this; it; it = it->next) {
accept(it->elision, visitor);
accept(it->expression, visitor);
}
}
visitor->endVisit(this);
}
void Elision::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
// ###
}
visitor->endVisit(this);
}
void PropertyNameAndValueList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (PropertyNameAndValueList *it = this; it; it = it->next) {
accept(it->name, visitor);
accept(it->value, visitor);
}
}
visitor->endVisit(this);
}
void IdentifierPropertyName::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void StringLiteralPropertyName::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void NumericLiteralPropertyName::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void ArrayMemberExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(base, visitor);
accept(expression, visitor);
}
visitor->endVisit(this);
}
void FieldMemberExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(base, visitor);
}
visitor->endVisit(this);
}
void NewMemberExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(base, visitor);
accept(arguments, visitor);
}
visitor->endVisit(this);
}
void NewExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void CallExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(base, visitor);
accept(arguments, visitor);
}
visitor->endVisit(this);
}
void ArgumentList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (ArgumentList *it = this; it; it = it->next) {
accept(it->expression, visitor);
}
}
visitor->endVisit(this);
}
void PostIncrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(base, visitor);
}
visitor->endVisit(this);
}
void PostDecrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(base, visitor);
}
visitor->endVisit(this);
}
void DeleteExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void VoidExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void TypeOfExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void PreIncrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void PreDecrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void UnaryPlusExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void UnaryMinusExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void TildeExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void NotExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void BinaryExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(left, visitor);
accept(right, visitor);
}
visitor->endVisit(this);
}
void ConditionalExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
accept(ok, visitor);
accept(ko, visitor);
}
visitor->endVisit(this);
}
void Expression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(left, visitor);
accept(right, visitor);
}
visitor->endVisit(this);
}
void Block::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statements, visitor);
}
visitor->endVisit(this);
}
void StatementList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (StatementList *it = this; it; it = it->next) {
accept(it->statement, visitor);
}
}
visitor->endVisit(this);
}
void VariableStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(declarations, visitor);
}
visitor->endVisit(this);
}
void VariableDeclarationList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (VariableDeclarationList *it = this; it; it = it->next) {
accept(it->declaration, visitor);
}
}
visitor->endVisit(this);
}
void VariableDeclaration::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void EmptyStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void ExpressionStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void IfStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
accept(ok, visitor);
accept(ko, visitor);
}
visitor->endVisit(this);
}
void DoWhileStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statement, visitor);
accept(expression, visitor);
}
visitor->endVisit(this);
}
void WhileStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
accept(statement, visitor);
}
visitor->endVisit(this);
}
void ForStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(initialiser, visitor);
accept(condition, visitor);
accept(expression, visitor);
accept(statement, visitor);
}
visitor->endVisit(this);
}
void LocalForStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(declarations, visitor);
accept(condition, visitor);
accept(expression, visitor);
accept(statement, visitor);
}
visitor->endVisit(this);
}
void ForEachStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(initialiser, visitor);
accept(expression, visitor);
accept(statement, visitor);
}
visitor->endVisit(this);
}
void LocalForEachStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(declaration, visitor);
accept(expression, visitor);
accept(statement, visitor);
}
visitor->endVisit(this);
}
void ContinueStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void BreakStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void ReturnStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void WithStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
accept(statement, visitor);
}
visitor->endVisit(this);
}
void SwitchStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
accept(block, visitor);
}
visitor->endVisit(this);
}
void CaseBlock::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(clauses, visitor);
accept(defaultClause, visitor);
accept(moreClauses, visitor);
}
visitor->endVisit(this);
}
void CaseClauses::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (CaseClauses *it = this; it; it = it->next) {
accept(it->clause, visitor);
}
}
visitor->endVisit(this);
}
void CaseClause::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
accept(statements, visitor);
}
visitor->endVisit(this);
}
void DefaultClause::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statements, visitor);
}
visitor->endVisit(this);
}
void LabelledStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statement, visitor);
}
visitor->endVisit(this);
}
void ThrowStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void TryStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statement, visitor);
accept(catchExpression, visitor);
accept(finallyExpression, visitor);
}
visitor->endVisit(this);
}
void Catch::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statement, visitor);
}
visitor->endVisit(this);
}
void Finally::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statement, visitor);
}
visitor->endVisit(this);
}
void FunctionDeclaration::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(formals, visitor);
accept(body, visitor);
}
visitor->endVisit(this);
}
void FunctionExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(formals, visitor);
accept(body, visitor);
}
visitor->endVisit(this);
}
void FormalParameterList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
// ###
}
visitor->endVisit(this);
}
void FunctionBody::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(elements, visitor);
}
visitor->endVisit(this);
}
void Program::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(elements, visitor);
}
visitor->endVisit(this);
}
void SourceElements::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (SourceElements *it = this; it; it = it->next) {
accept(it->element, visitor);
}
}
visitor->endVisit(this);
}
void FunctionSourceElement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(declaration, visitor);
}
visitor->endVisit(this);
}
void StatementSourceElement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(statement, visitor);
}
visitor->endVisit(this);
}
void DebuggerStatement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void UiProgram::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(imports, visitor);
accept(members, visitor);
}
visitor->endVisit(this);
}
void UiSignature::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(formals, visitor);
}
visitor->endVisit(this);
}
void UiFormalList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (UiFormalList *it = this; it; it = it->next) {
accept(it->formal, visitor);
}
}
visitor->endVisit(this);
}
void UiFormal::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void UiPublicMember::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
}
visitor->endVisit(this);
}
void UiObjectDefinition::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(qualifiedTypeNameId, visitor);
accept(initializer, visitor);
}
visitor->endVisit(this);
}
void UiObjectInitializer::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(members, visitor);
}
visitor->endVisit(this);
}
void UiObjectBinding::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(qualifiedId, visitor);
accept(qualifiedTypeNameId, visitor);
accept(initializer, visitor);
}
visitor->endVisit(this);
}
void UiScriptBinding::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(qualifiedId, visitor);
accept(statement, visitor);
}
visitor->endVisit(this);
}
void UiArrayBinding::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(qualifiedId, visitor);
accept(members, visitor);
}
visitor->endVisit(this);
}
void UiObjectMemberList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (UiObjectMemberList *it = this; it; it = it->next)
accept(it->member, visitor);
}
visitor->endVisit(this);
}
void UiArrayMemberList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (UiArrayMemberList *it = this; it; it = it->next)
accept(it->member, visitor);
}
visitor->endVisit(this);
}
void UiQualifiedId::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void UiImport::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(importUri, visitor);
}
visitor->endVisit(this);
}
void UiImportList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(import, visitor);
accept(next, visitor);
}
visitor->endVisit(this);
}
void UiSourceElement::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(sourceElement, visitor);
}
visitor->endVisit(this);
}
} } // namespace QmlJS::AST
QT_QML_END_NAMESPACE
File diff suppressed because it is too large Load Diff
+189
View File
@@ -0,0 +1,189 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJSAST_FWD_P_H
#define QMLJSAST_FWD_P_H
#include "qmljsglobal_p.h"
#include <QtCore/qglobal.h>
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
QT_QML_BEGIN_NAMESPACE
namespace QmlJS { namespace AST {
class SourceLocation
{
public:
SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
: offset(offset), length(length),
startLine(line), startColumn(column)
{ }
bool isValid() const { return length != 0; }
quint32 begin() const { return offset; }
quint32 end() const { return offset + length; }
// attributes
// ### encode
quint32 offset;
quint32 length;
quint32 startLine;
quint32 startColumn;
};
class Visitor;
class Node;
class ExpressionNode;
class Statement;
class ThisExpression;
class IdentifierExpression;
class NullExpression;
class TrueLiteral;
class FalseLiteral;
class NumericLiteral;
class StringLiteral;
class RegExpLiteral;
class ArrayLiteral;
class ObjectLiteral;
class ElementList;
class Elision;
class PropertyNameAndValueList;
class PropertyName;
class IdentifierPropertyName;
class StringLiteralPropertyName;
class NumericLiteralPropertyName;
class ArrayMemberExpression;
class FieldMemberExpression;
class NewMemberExpression;
class NewExpression;
class CallExpression;
class ArgumentList;
class PostIncrementExpression;
class PostDecrementExpression;
class DeleteExpression;
class VoidExpression;
class TypeOfExpression;
class PreIncrementExpression;
class PreDecrementExpression;
class UnaryPlusExpression;
class UnaryMinusExpression;
class TildeExpression;
class NotExpression;
class BinaryExpression;
class ConditionalExpression;
class Expression; // ### rename
class Block;
class StatementList;
class VariableStatement;
class VariableDeclarationList;
class VariableDeclaration;
class EmptyStatement;
class ExpressionStatement;
class IfStatement;
class DoWhileStatement;
class WhileStatement;
class ForStatement;
class LocalForStatement;
class ForEachStatement;
class LocalForEachStatement;
class ContinueStatement;
class BreakStatement;
class ReturnStatement;
class WithStatement;
class SwitchStatement;
class CaseBlock;
class CaseClauses;
class CaseClause;
class DefaultClause;
class LabelledStatement;
class ThrowStatement;
class TryStatement;
class Catch;
class Finally;
class FunctionDeclaration;
class FunctionExpression;
class FormalParameterList;
class FunctionBody;
class Program;
class SourceElements;
class SourceElement;
class FunctionSourceElement;
class StatementSourceElement;
class DebuggerStatement;
class NestedExpression;
// ui elements
class UiProgram;
class UiImportList;
class UiImport;
class UiPublicMember;
class UiObjectDefinition;
class UiObjectInitializer;
class UiObjectBinding;
class UiScriptBinding;
class UiSourceElement;
class UiArrayBinding;
class UiObjectMember;
class UiObjectMemberList;
class UiArrayMemberList;
class UiQualifiedId;
class UiFormalList;
class UiFormal;
class UiSignature;
} } // namespace AST
QT_QML_END_NAMESPACE
#endif
+58
View File
@@ -0,0 +1,58 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qmljsastvisitor_p.h"
QT_QML_BEGIN_NAMESPACE
namespace QmlJS { namespace AST {
Visitor::Visitor()
{
}
Visitor::~Visitor()
{
}
} } // namespace QmlJS::AST
QT_QML_END_NAMESPACE
+335
View File
@@ -0,0 +1,335 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJSASTVISITOR_P_H
#define QMLJSASTVISITOR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmljsastfwd_p.h"
#include "qmljsglobal_p.h"
QT_QML_BEGIN_NAMESPACE
namespace QmlJS { namespace AST {
class QML_PARSER_EXPORT Visitor
{
public:
Visitor();
virtual ~Visitor();
virtual bool preVisit(Node *) { return true; }
virtual void postVisit(Node *) {}
// Ui
virtual bool visit(UiProgram *) { return true; }
virtual bool visit(UiImportList *) { return true; }
virtual bool visit(UiImport *) { return true; }
virtual bool visit(UiPublicMember *) { return true; }
virtual bool visit(UiSourceElement *) { return true; }
virtual bool visit(UiObjectDefinition *) { return true; }
virtual bool visit(UiObjectInitializer *) { return true; }
virtual bool visit(UiObjectBinding *) { return true; }
virtual bool visit(UiScriptBinding *) { return true; }
virtual bool visit(UiArrayBinding *) { return true; }
virtual bool visit(UiObjectMemberList *) { return true; }
virtual bool visit(UiArrayMemberList *) { return true; }
virtual bool visit(UiQualifiedId *) { return true; }
virtual bool visit(UiSignature *) { return true; }
virtual bool visit(UiFormalList *) { return true; }
virtual bool visit(UiFormal *) { return true; }
virtual void endVisit(UiProgram *) {}
virtual void endVisit(UiImportList *) {}
virtual void endVisit(UiImport *) {}
virtual void endVisit(UiPublicMember *) {}
virtual void endVisit(UiSourceElement *) {}
virtual void endVisit(UiObjectDefinition *) {}
virtual void endVisit(UiObjectInitializer *) {}
virtual void endVisit(UiObjectBinding *) {}
virtual void endVisit(UiScriptBinding *) {}
virtual void endVisit(UiArrayBinding *) {}
virtual void endVisit(UiObjectMemberList *) {}
virtual void endVisit(UiArrayMemberList *) {}
virtual void endVisit(UiQualifiedId *) {}
virtual void endVisit(UiSignature *) {}
virtual void endVisit(UiFormalList *) {}
virtual void endVisit(UiFormal *) {}
// QmlJS
virtual bool visit(ThisExpression *) { return true; }
virtual void endVisit(ThisExpression *) {}
virtual bool visit(IdentifierExpression *) { return true; }
virtual void endVisit(IdentifierExpression *) {}
virtual bool visit(NullExpression *) { return true; }
virtual void endVisit(NullExpression *) {}
virtual bool visit(TrueLiteral *) { return true; }
virtual void endVisit(TrueLiteral *) {}
virtual bool visit(FalseLiteral *) { return true; }
virtual void endVisit(FalseLiteral *) {}
virtual bool visit(StringLiteral *) { return true; }
virtual void endVisit(StringLiteral *) {}
virtual bool visit(NumericLiteral *) { return true; }
virtual void endVisit(NumericLiteral *) {}
virtual bool visit(RegExpLiteral *) { return true; }
virtual void endVisit(RegExpLiteral *) {}
virtual bool visit(ArrayLiteral *) { return true; }
virtual void endVisit(ArrayLiteral *) {}
virtual bool visit(ObjectLiteral *) { return true; }
virtual void endVisit(ObjectLiteral *) {}
virtual bool visit(ElementList *) { return true; }
virtual void endVisit(ElementList *) {}
virtual bool visit(Elision *) { return true; }
virtual void endVisit(Elision *) {}
virtual bool visit(PropertyNameAndValueList *) { return true; }
virtual void endVisit(PropertyNameAndValueList *) {}
virtual bool visit(NestedExpression *) { return true; }
virtual void endVisit(NestedExpression *) {}
virtual bool visit(IdentifierPropertyName *) { return true; }
virtual void endVisit(IdentifierPropertyName *) {}
virtual bool visit(StringLiteralPropertyName *) { return true; }
virtual void endVisit(StringLiteralPropertyName *) {}
virtual bool visit(NumericLiteralPropertyName *) { return true; }
virtual void endVisit(NumericLiteralPropertyName *) {}
virtual bool visit(ArrayMemberExpression *) { return true; }
virtual void endVisit(ArrayMemberExpression *) {}
virtual bool visit(FieldMemberExpression *) { return true; }
virtual void endVisit(FieldMemberExpression *) {}
virtual bool visit(NewMemberExpression *) { return true; }
virtual void endVisit(NewMemberExpression *) {}
virtual bool visit(NewExpression *) { return true; }
virtual void endVisit(NewExpression *) {}
virtual bool visit(CallExpression *) { return true; }
virtual void endVisit(CallExpression *) {}
virtual bool visit(ArgumentList *) { return true; }
virtual void endVisit(ArgumentList *) {}
virtual bool visit(PostIncrementExpression *) { return true; }
virtual void endVisit(PostIncrementExpression *) {}
virtual bool visit(PostDecrementExpression *) { return true; }
virtual void endVisit(PostDecrementExpression *) {}
virtual bool visit(DeleteExpression *) { return true; }
virtual void endVisit(DeleteExpression *) {}
virtual bool visit(VoidExpression *) { return true; }
virtual void endVisit(VoidExpression *) {}
virtual bool visit(TypeOfExpression *) { return true; }
virtual void endVisit(TypeOfExpression *) {}
virtual bool visit(PreIncrementExpression *) { return true; }
virtual void endVisit(PreIncrementExpression *) {}
virtual bool visit(PreDecrementExpression *) { return true; }
virtual void endVisit(PreDecrementExpression *) {}
virtual bool visit(UnaryPlusExpression *) { return true; }
virtual void endVisit(UnaryPlusExpression *) {}
virtual bool visit(UnaryMinusExpression *) { return true; }
virtual void endVisit(UnaryMinusExpression *) {}
virtual bool visit(TildeExpression *) { return true; }
virtual void endVisit(TildeExpression *) {}
virtual bool visit(NotExpression *) { return true; }
virtual void endVisit(NotExpression *) {}
virtual bool visit(BinaryExpression *) { return true; }
virtual void endVisit(BinaryExpression *) {}
virtual bool visit(ConditionalExpression *) { return true; }
virtual void endVisit(ConditionalExpression *) {}
virtual bool visit(Expression *) { return true; }
virtual void endVisit(Expression *) {}
virtual bool visit(Block *) { return true; }
virtual void endVisit(Block *) {}
virtual bool visit(StatementList *) { return true; }
virtual void endVisit(StatementList *) {}
virtual bool visit(VariableStatement *) { return true; }
virtual void endVisit(VariableStatement *) {}
virtual bool visit(VariableDeclarationList *) { return true; }
virtual void endVisit(VariableDeclarationList *) {}
virtual bool visit(VariableDeclaration *) { return true; }
virtual void endVisit(VariableDeclaration *) {}
virtual bool visit(EmptyStatement *) { return true; }
virtual void endVisit(EmptyStatement *) {}
virtual bool visit(ExpressionStatement *) { return true; }
virtual void endVisit(ExpressionStatement *) {}
virtual bool visit(IfStatement *) { return true; }
virtual void endVisit(IfStatement *) {}
virtual bool visit(DoWhileStatement *) { return true; }
virtual void endVisit(DoWhileStatement *) {}
virtual bool visit(WhileStatement *) { return true; }
virtual void endVisit(WhileStatement *) {}
virtual bool visit(ForStatement *) { return true; }
virtual void endVisit(ForStatement *) {}
virtual bool visit(LocalForStatement *) { return true; }
virtual void endVisit(LocalForStatement *) {}
virtual bool visit(ForEachStatement *) { return true; }
virtual void endVisit(ForEachStatement *) {}
virtual bool visit(LocalForEachStatement *) { return true; }
virtual void endVisit(LocalForEachStatement *) {}
virtual bool visit(ContinueStatement *) { return true; }
virtual void endVisit(ContinueStatement *) {}
virtual bool visit(BreakStatement *) { return true; }
virtual void endVisit(BreakStatement *) {}
virtual bool visit(ReturnStatement *) { return true; }
virtual void endVisit(ReturnStatement *) {}
virtual bool visit(WithStatement *) { return true; }
virtual void endVisit(WithStatement *) {}
virtual bool visit(SwitchStatement *) { return true; }
virtual void endVisit(SwitchStatement *) {}
virtual bool visit(CaseBlock *) { return true; }
virtual void endVisit(CaseBlock *) {}
virtual bool visit(CaseClauses *) { return true; }
virtual void endVisit(CaseClauses *) {}
virtual bool visit(CaseClause *) { return true; }
virtual void endVisit(CaseClause *) {}
virtual bool visit(DefaultClause *) { return true; }
virtual void endVisit(DefaultClause *) {}
virtual bool visit(LabelledStatement *) { return true; }
virtual void endVisit(LabelledStatement *) {}
virtual bool visit(ThrowStatement *) { return true; }
virtual void endVisit(ThrowStatement *) {}
virtual bool visit(TryStatement *) { return true; }
virtual void endVisit(TryStatement *) {}
virtual bool visit(Catch *) { return true; }
virtual void endVisit(Catch *) {}
virtual bool visit(Finally *) { return true; }
virtual void endVisit(Finally *) {}
virtual bool visit(FunctionDeclaration *) { return true; }
virtual void endVisit(FunctionDeclaration *) {}
virtual bool visit(FunctionExpression *) { return true; }
virtual void endVisit(FunctionExpression *) {}
virtual bool visit(FormalParameterList *) { return true; }
virtual void endVisit(FormalParameterList *) {}
virtual bool visit(FunctionBody *) { return true; }
virtual void endVisit(FunctionBody *) {}
virtual bool visit(Program *) { return true; }
virtual void endVisit(Program *) {}
virtual bool visit(SourceElements *) { return true; }
virtual void endVisit(SourceElements *) {}
virtual bool visit(FunctionSourceElement *) { return true; }
virtual void endVisit(FunctionSourceElement *) {}
virtual bool visit(StatementSourceElement *) { return true; }
virtual void endVisit(StatementSourceElement *) {}
virtual bool visit(DebuggerStatement *) { return true; }
virtual void endVisit(DebuggerStatement *) {}
};
} } // namespace AST
QT_QML_END_NAMESPACE
#endif // QMLJSASTVISITOR_P_H
+212
View File
@@ -0,0 +1,212 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qmljsengine_p.h"
#include "qmljsglobal_p.h"
#include "qmljsnodepool_p.h"
#include <qnumeric.h>
#include <QHash>
QT_QML_BEGIN_NAMESPACE
namespace QmlJS {
uint qHash(const QmlJS::NameId &id)
{ return qHash(id.asString()); }
QString numberToString(double value)
{ return QString::number(value); }
int Ecma::RegExp::flagFromChar(const QChar &ch)
{
static QHash<QChar, int> flagsHash;
if (flagsHash.isEmpty()) {
flagsHash[QLatin1Char('g')] = Global;
flagsHash[QLatin1Char('i')] = IgnoreCase;
flagsHash[QLatin1Char('m')] = Multiline;
}
QHash<QChar, int>::const_iterator it;
it = flagsHash.constFind(ch);
if (it == flagsHash.constEnd())
return 0;
return it.value();
}
QString Ecma::RegExp::flagsToString(int flags)
{
QString result;
if (flags & Global)
result += QLatin1Char('g');
if (flags & IgnoreCase)
result += QLatin1Char('i');
if (flags & Multiline)
result += QLatin1Char('m');
return result;
}
NodePool::NodePool(const QString &fileName, Engine *engine)
: m_fileName(fileName), m_engine(engine)
{
m_engine->setNodePool(this);
}
NodePool::~NodePool()
{
}
Code *NodePool::createCompiledCode(AST::Node *, CompilationUnit &)
{
Q_ASSERT(0);
return 0;
}
static int toDigit(char c)
{
if ((c >= '0') && (c <= '9'))
return c - '0';
else if ((c >= 'a') && (c <= 'z'))
return 10 + c - 'a';
else if ((c >= 'A') && (c <= 'Z'))
return 10 + c - 'A';
return -1;
}
double integerFromString(const char *buf, int size, int radix)
{
if (size == 0)
return qSNaN();
double sign = 1.0;
int i = 0;
if (buf[0] == '+') {
++i;
} else if (buf[0] == '-') {
sign = -1.0;
++i;
}
if (((size-i) >= 2) && (buf[i] == '0')) {
if (((buf[i+1] == 'x') || (buf[i+1] == 'X'))
&& (radix < 34)) {
if ((radix != 0) && (radix != 16))
return 0;
radix = 16;
i += 2;
} else {
if (radix == 0) {
radix = 8;
++i;
}
}
} else if (radix == 0) {
radix = 10;
}
int j = i;
for ( ; i < size; ++i) {
int d = toDigit(buf[i]);
if ((d == -1) || (d >= radix))
break;
}
double result;
if (j == i) {
if (!qstrcmp(buf, "Infinity"))
result = qInf();
else
result = qSNaN();
} else {
result = 0;
double multiplier = 1;
for (--i ; i >= j; --i, multiplier *= radix)
result += toDigit(buf[i]) * multiplier;
}
result *= sign;
return result;
}
double integerFromString(const QString &str, int radix)
{
QByteArray ba = str.trimmed().toLatin1();
return integerFromString(ba.constData(), ba.size(), radix);
}
Engine::Engine()
: _lexer(0), _nodePool(0)
{ }
Engine::~Engine()
{ }
QSet<NameId> Engine::literals() const
{ return _literals; }
void Engine::addComment(int pos, int len, int line, int col)
{ if (len > 0) _comments.append(QmlJS::AST::SourceLocation(pos, len, line, col)); }
QList<QmlJS::AST::SourceLocation> Engine::comments() const
{ return _comments; }
NameId *Engine::intern(const QChar *u, int s)
{ return const_cast<NameId *>(&*_literals.insert(NameId(u, s))); }
QString Engine::toString(NameId *id)
{ return id->asString(); }
Lexer *Engine::lexer() const
{ return _lexer; }
void Engine::setLexer(Lexer *lexer)
{ _lexer = lexer; }
NodePool *Engine::nodePool() const
{ return _nodePool; }
void Engine::setNodePool(NodePool *nodePool)
{ _nodePool = nodePool; }
} // end of namespace QmlJS
QT_QML_END_NAMESPACE
+173
View File
@@ -0,0 +1,173 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJSENGINE_P_H
#define QMLJSENGINE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmljsglobal_p.h"
#include "qmljsastfwd_p.h"
#include <QString>
#include <QSet>
QT_QML_BEGIN_NAMESPACE
namespace QmlJS {
class QML_PARSER_EXPORT NameId
{
QString _text;
public:
NameId(const QChar *u, int s)
: _text(u, s)
{ }
const QString asString() const
{ return _text; }
bool operator == (const NameId &other) const
{ return _text == other._text; }
bool operator != (const NameId &other) const
{ return _text != other._text; }
bool operator < (const NameId &other) const
{ return _text < other._text; }
};
uint qHash(const QmlJS::NameId &id);
} // end of namespace QmlJS
#if defined(Q_CC_MSVC) && _MSC_VER <= 1300
//this ensures that code outside QmlJS can use the hash function
//it also a workaround for some compilers
inline uint qHash(const QmlJS::NameId &nameId) { return QmlJS::qHash(nameId); }
#endif
namespace QmlJS {
class Lexer;
class NodePool;
namespace Ecma {
class QML_PARSER_EXPORT RegExp
{
public:
enum RegExpFlag {
Global = 0x01,
IgnoreCase = 0x02,
Multiline = 0x04
};
public:
static int flagFromChar(const QChar &);
static QString flagsToString(int flags);
};
} // end of namespace Ecma
class QML_PARSER_EXPORT DiagnosticMessage
{
public:
enum Kind { Warning, Error };
DiagnosticMessage()
: kind(Error) {}
DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message)
: kind(kind), loc(loc), message(message) {}
bool isWarning() const
{ return kind == Warning; }
bool isError() const
{ return kind == Error; }
Kind kind;
AST::SourceLocation loc;
QString message;
};
class QML_PARSER_EXPORT Engine
{
Lexer *_lexer;
NodePool *_nodePool;
QSet<NameId> _literals;
QList<QmlJS::AST::SourceLocation> _comments;
public:
Engine();
~Engine();
QSet<NameId> literals() const;
void addComment(int pos, int len, int line, int col);
QList<QmlJS::AST::SourceLocation> comments() const;
NameId *intern(const QChar *u, int s);
static QString toString(NameId *id);
Lexer *lexer() const;
void setLexer(Lexer *lexer);
NodePool *nodePool() const;
void setNodePool(NodePool *nodePool);
};
} // end of namespace QmlJS
QT_QML_END_NAMESPACE
#endif // QMLJSENGINE_P_H
+64
View File
@@ -0,0 +1,64 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJSGLOBAL_P_H
#define QMLJSGLOBAL_P_H
#include <QtCore/qglobal.h>
#ifdef QT_CREATOR
# define QT_QML_BEGIN_NAMESPACE
# define QT_QML_END_NAMESPACE
# ifdef QML_BUILD_LIB
# define QML_PARSER_EXPORT Q_DECL_EXPORT
# elif QML_BUILD_STATIC_LIB
# define QML_PARSER_EXPORT
# else
# define QML_PARSER_EXPORT Q_DECL_IMPORT
# endif // QML_BUILD_LIB
#else // !QT_CREATOR
# define QT_QML_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
# define QT_QML_END_NAMESPACE QT_END_NAMESPACE
# define QML_PARSER_EXPORT
#endif // QT_CREATOR
#endif // QMLJSGLOBAL_P_H
+939
View File
@@ -0,0 +1,939 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
// This file was generated by qlalr - DO NOT EDIT!
#include "qmljsgrammar_p.h"
QT_BEGIN_NAMESPACE
const char *const QmlJSGrammar::spell [] = {
"end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue",
"default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===",
"finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier",
"if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=",
"-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=",
"||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return",
")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch",
"this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^",
"^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", "public",
"import", "as", 0, 0, 0, 0, 0, 0, 0, 0};
const short QmlJSGrammar::lhs [] = {
100, 100, 100, 100, 100, 100, 101, 107, 107, 110,
110, 112, 111, 111, 111, 111, 111, 111, 111, 111,
114, 109, 108, 117, 117, 118, 118, 119, 119, 116,
105, 105, 105, 105, 105, 105, 105, 125, 125, 125,
126, 126, 127, 127, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 115, 115, 115, 115, 130, 130, 130, 130,
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
130, 130, 130, 130, 120, 132, 132, 132, 132, 131,
131, 134, 134, 136, 136, 136, 136, 136, 136, 137,
137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
138, 138, 113, 113, 113, 113, 113, 141, 141, 142,
142, 142, 142, 140, 140, 143, 143, 144, 144, 145,
145, 145, 146, 146, 146, 146, 146, 146, 146, 146,
146, 146, 147, 147, 147, 147, 148, 148, 148, 149,
149, 149, 149, 150, 150, 150, 150, 150, 150, 150,
151, 151, 151, 151, 151, 151, 152, 152, 152, 152,
152, 153, 153, 153, 153, 153, 154, 154, 155, 155,
156, 156, 157, 157, 158, 158, 159, 159, 160, 160,
161, 161, 162, 162, 163, 163, 164, 164, 165, 165,
135, 135, 166, 166, 167, 167, 167, 167, 167, 167,
167, 167, 167, 167, 167, 167, 103, 103, 168, 168,
169, 169, 170, 170, 102, 102, 102, 102, 102, 102,
102, 102, 102, 102, 102, 102, 102, 102, 102, 121,
182, 182, 181, 181, 129, 129, 183, 183, 184, 184,
186, 186, 185, 187, 190, 188, 188, 191, 189, 189,
122, 123, 123, 124, 124, 171, 171, 171, 171, 171,
171, 171, 172, 172, 172, 172, 173, 173, 173, 173,
174, 174, 175, 177, 192, 192, 195, 195, 193, 193,
196, 194, 176, 176, 176, 178, 178, 179, 179, 179,
197, 198, 180, 180, 128, 139, 202, 202, 199, 199,
200, 200, 203, 106, 204, 204, 104, 104, 201, 201,
133, 133, 205};
const short QmlJSGrammar::rhs [] = {
2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
2, 1, 2, 2, 3, 3, 5, 5, 4, 4,
2, 0, 1, 1, 2, 1, 3, 2, 3, 2,
1, 5, 4, 3, 3, 3, 3, 1, 1, 1,
0, 1, 2, 4, 6, 6, 3, 3, 7, 7,
4, 4, 5, 5, 6, 6, 7, 7, 7, 7,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 3, 3, 4,
5, 3, 4, 3, 1, 1, 2, 3, 4, 1,
2, 3, 5, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 4, 3, 5, 1, 2, 4,
4, 4, 3, 0, 1, 1, 3, 1, 1, 1,
2, 2, 1, 2, 2, 2, 2, 2, 2, 2,
2, 2, 1, 3, 3, 3, 1, 3, 3, 1,
3, 3, 3, 1, 3, 3, 3, 3, 3, 3,
1, 3, 3, 3, 3, 3, 1, 3, 3, 3,
3, 1, 3, 3, 3, 3, 1, 3, 1, 3,
1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
1, 3, 1, 3, 1, 3, 1, 5, 1, 5,
1, 3, 1, 3, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 3, 0, 1,
1, 3, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
1, 2, 0, 1, 3, 3, 1, 1, 1, 3,
1, 3, 2, 2, 2, 0, 1, 2, 0, 1,
1, 2, 2, 7, 5, 7, 7, 5, 9, 10,
7, 8, 2, 2, 3, 3, 2, 2, 3, 3,
3, 3, 5, 5, 3, 5, 1, 2, 0, 1,
4, 3, 3, 3, 3, 3, 3, 3, 3, 4,
5, 2, 2, 2, 8, 8, 1, 3, 0, 1,
0, 1, 1, 1, 1, 2, 1, 1, 0, 1,
0, 1, 2};
const short QmlJSGrammar::action_default [] = {
0, 0, 0, 0, 0, 0, 22, 0, 170, 237,
201, 209, 205, 149, 221, 197, 3, 134, 68, 150,
213, 217, 138, 167, 148, 153, 133, 187, 174, 0,
75, 76, 71, 339, 63, 341, 0, 0, 0, 0,
73, 0, 0, 69, 72, 0, 0, 64, 66, 65,
74, 67, 0, 70, 0, 0, 163, 0, 0, 150,
169, 152, 151, 0, 0, 0, 165, 166, 164, 168,
0, 198, 0, 0, 0, 0, 188, 0, 0, 0,
0, 0, 0, 178, 0, 0, 0, 172, 173, 171,
176, 180, 179, 177, 175, 190, 189, 191, 0, 206,
0, 202, 0, 0, 144, 131, 143, 132, 100, 101,
102, 127, 103, 128, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 129, 117, 118,
119, 120, 121, 122, 123, 124, 125, 126, 130, 0,
0, 142, 238, 145, 0, 146, 0, 147, 141, 0,
234, 227, 225, 232, 233, 231, 230, 236, 229, 228,
226, 235, 222, 0, 210, 0, 0, 214, 0, 0,
218, 0, 0, 144, 136, 0, 135, 0, 140, 154,
0, 340, 329, 330, 0, 327, 0, 328, 0, 331,
245, 252, 251, 259, 247, 0, 248, 332, 0, 338,
249, 250, 255, 253, 335, 333, 337, 256, 0, 267,
0, 0, 0, 0, 339, 63, 0, 341, 64, 239,
281, 65, 0, 0, 0, 268, 0, 0, 257, 258,
0, 246, 254, 282, 283, 326, 336, 0, 297, 298,
299, 300, 0, 293, 294, 295, 296, 323, 324, 0,
0, 0, 0, 0, 286, 287, 243, 241, 203, 211,
207, 223, 199, 244, 0, 150, 215, 219, 192, 181,
0, 0, 200, 0, 0, 0, 0, 193, 0, 0,
0, 0, 0, 185, 183, 186, 184, 182, 195, 194,
196, 0, 208, 0, 204, 0, 242, 150, 0, 224,
239, 240, 0, 239, 0, 0, 289, 0, 0, 0,
291, 0, 212, 0, 0, 216, 0, 0, 220, 279,
0, 271, 280, 274, 0, 278, 0, 239, 272, 0,
239, 0, 0, 290, 0, 0, 0, 292, 340, 329,
0, 0, 331, 0, 325, 0, 315, 0, 0, 0,
285, 0, 284, 0, 342, 0, 99, 261, 264, 0,
100, 267, 103, 128, 105, 106, 71, 110, 111, 63,
112, 115, 69, 72, 64, 239, 65, 74, 118, 67,
120, 70, 122, 123, 268, 125, 126, 130, 0, 92,
0, 0, 94, 98, 96, 83, 95, 97, 0, 93,
82, 262, 260, 138, 139, 144, 0, 137, 0, 314,
0, 301, 302, 0, 313, 0, 0, 0, 304, 309,
307, 310, 0, 0, 308, 309, 0, 305, 0, 306,
263, 312, 0, 263, 311, 0, 316, 317, 0, 263,
318, 319, 0, 0, 320, 0, 0, 0, 321, 322,
156, 155, 0, 0, 0, 288, 0, 0, 0, 303,
276, 269, 0, 277, 273, 0, 275, 265, 0, 266,
270, 86, 0, 0, 90, 77, 0, 79, 88, 0,
80, 89, 91, 81, 87, 78, 0, 84, 160, 158,
162, 159, 157, 161, 6, 334, 4, 2, 61, 85,
0, 0, 64, 66, 65, 31, 5, 0, 62, 0,
40, 39, 38, 0, 0, 53, 0, 54, 0, 59,
60, 0, 40, 0, 0, 0, 0, 0, 49, 50,
0, 51, 0, 52, 0, 55, 56, 0, 0, 0,
0, 0, 57, 58, 0, 47, 41, 48, 42, 0,
0, 0, 0, 44, 0, 45, 46, 43, 0, 0,
30, 34, 35, 36, 37, 138, 263, 0, 0, 100,
267, 103, 128, 105, 106, 71, 110, 111, 63, 112,
115, 69, 72, 64, 239, 65, 74, 118, 67, 120,
70, 122, 123, 268, 125, 126, 130, 138, 0, 26,
0, 0, 32, 27, 33, 28, 24, 0, 29, 25,
8, 0, 10, 0, 9, 0, 1, 21, 12, 0,
13, 0, 14, 0, 19, 20, 0, 15, 16, 0,
17, 18, 11, 23, 7, 343};
const short QmlJSGrammar::goto_default [] = {
7, 616, 206, 195, 204, 506, 494, 615, 634, 610,
614, 612, 617, 22, 613, 18, 505, 607, 598, 560,
507, 190, 194, 196, 200, 523, 549, 548, 199, 231,
26, 473, 472, 355, 354, 9, 353, 356, 106, 17,
144, 24, 13, 143, 19, 25, 56, 23, 8, 28,
27, 268, 15, 262, 10, 258, 12, 260, 11, 259,
20, 266, 21, 267, 14, 261, 257, 298, 410, 263,
264, 201, 192, 191, 203, 232, 202, 207, 228, 229,
193, 359, 358, 230, 462, 461, 320, 321, 464, 323,
463, 322, 418, 422, 425, 421, 420, 440, 441, 184,
198, 180, 183, 197, 205, 0};
const short QmlJSGrammar::action_index [] = {
439, 1109, 2228, 2228, 2132, 814, -74, 18, 147, -100,
31, -17, -49, 232, -100, 318, 85, -100, -100, 554,
33, 94, 331, 215, -100, -100, -100, 448, 231, 1109,
-100, -100, -100, 320, -100, 1940, 1472, 1109, 1109, 1109,
-100, 724, 1109, -100, -100, 1109, 1109, -100, -100, -100,
-100, -100, 1109, -100, 1109, 1109, -100, 1109, 1109, 129,
157, -100, -100, 1109, 1109, 1109, -100, -100, -100, 200,
1109, 293, 1109, 1109, 1109, 1109, 466, 1109, 1109, 1109,
1109, 1109, 1109, 179, 1109, 1109, 1109, 119, 125, 95,
188, 198, 184, 203, 178, 567, 567, 484, 1109, -5,
1109, 67, 1844, 1109, 1109, -100, -100, -100, -100, -100,
-100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
-100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
-100, -100, -100, -100, -100, -100, -100, -100, -100, 110,
1109, -100, -100, 70, 61, -100, 1109, -100, -100, 1109,
-100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
-100, -100, -100, 1109, 55, 1109, 1109, 73, 63, 1109,
-100, 1844, 1109, 1109, -100, 141, -100, 41, -100, -100,
87, -100, 255, 80, 78, -100, 287, -100, 83, 2228,
-100, -100, -100, -100, -100, 225, -100, -100, 52, -100,
-100, -100, -100, -100, -100, 2228, -100, -100, 420, -100,
408, 113, 2132, 50, 330, 65, 46, 2420, 72, 1109,
-100, 74, 75, 1109, 77, -100, 53, 56, -100, -100,
323, -100, -100, -100, -100, -100, -100, 96, -100, -100,
-100, -100, 99, -100, -100, -100, -100, -100, -100, 60,
47, 1109, 118, 93, -100, -100, 1291, -100, 79, 66,
64, -100, 413, 76, 51, 664, 89, 97, 393, 183,
337, 1109, 413, 1109, 1109, 1109, 1109, 411, 1109, 1109,
1109, 1109, 1109, 252, 272, 212, 217, 221, 490, 490,
383, 1109, 64, 1109, 84, 1109, -100, 536, 1109, -100,
1109, 69, 68, 1109, 44, 2132, -100, 1109, 124, 2132,
-100, 1109, 54, 1109, 1109, 71, 88, 1109, -100, 82,
122, 154, -100, -100, 1109, -100, 343, 1109, -100, 81,
1109, 90, 2132, -100, 1109, 112, 2132, -100, 86, 333,
-39, -10, 2228, -33, -100, 2132, -100, 1109, 246, 2132,
4, 2132, -100, 10, 16, -21, -100, -100, 2132, -26,
480, 19, 462, 128, 1109, 2132, 6, -9, 400, 8,
-22, 840, -3, -6, -100, 1202, -100, -7, -28, 5,
1109, 2, -23, 1109, 0, 1109, -34, -30, 1109, -100,
2036, 21, -100, -100, -100, -100, -100, -100, 1109, -100,
-100, -100, -100, 209, -100, 1109, 40, -100, 2132, -100,
101, -100, -100, 2132, -100, 1109, 120, 43, -100, 62,
-100, 59, 109, 1109, -100, 57, 58, -100, 39, -100,
2132, -100, 117, 2132, -100, 199, -100, -100, 107, 2132,
34, -100, 24, 11, -100, 346, -19, 14, -100, -100,
-100, -100, 1109, 133, 2132, -100, 1109, 126, 2132, -100,
20, -100, 173, -100, -100, 1109, -100, -100, 303, -100,
-100, -100, 100, 1656, -100, -100, 1564, -100, -100, 1748,
-100, -100, -100, -100, -100, -100, 131, -100, -100, -100,
-100, -100, -100, -100, -100, 2228, -100, -100, -100, 158,
-20, 752, 165, -16, 22, -100, -100, 98, -100, 189,
-100, -100, -100, 28, 170, -100, 1109, -100, 230, -100,
-100, 247, 1, 13, 238, 37, -24, 106, -100, -100,
273, -100, 1109, -100, 265, -100, -100, 242, -4, 12,
1109, 241, -100, -100, 234, -100, 245, -100, 3, 9,
311, 190, 316, -100, 134, -100, -100, -100, 1380, 1020,
-100, -100, -100, -100, -100, 359, 2324, 1472, 15, 444,
38, 394, 138, 1109, 2132, 36, 17, 397, 42, 23,
840, 32, 29, -100, 1202, -100, 26, 35, 48, 1109,
45, 25, 1109, 49, 1109, 27, 30, 314, 132, -100,
7, 752, -100, -100, -100, -100, -100, 930, -100, -100,
-100, 752, -100, 253, -87, 617, -100, -100, 102, 290,
-100, 191, -100, 140, -100, -100, 275, -100, -100, 91,
-100, -100, -100, -100, -100, -100,
-106, 12, -87, 18, 17, 212, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -53,
-106, -106, -106, -106, -106, -106, -106, -106, -106, 162,
-106, -106, -106, -4, -106, -106, -11, 24, 75, 76,
-106, 83, 55, -106, -106, 157, 158, -106, -106, -106,
-106, -106, 150, -106, 172, 176, -106, 168, 167, -106,
-106, -106, -106, 173, 154, 115, -106, -106, -106, -106,
147, -106, 121, 113, 112, 125, -106, 128, 143, 146,
140, 139, 136, -106, 122, 138, 130, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, 149, -106,
153, -106, 110, 82, 46, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
35, -106, -106, -106, -106, -106, 37, -106, -106, 45,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, 92, -106, 88, 58, -106, -106, 51,
-106, 209, 72, 78, -106, -106, -106, -106, -106, -106,
-106, -106, 27, -106, -106, -106, 63, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, 50, -106, -106, 28, -106,
29, -106, 47, -106, 33, -106, -106, 66, -106, 73,
-106, -106, -106, 81, 53, -106, -106, -106, -106, -106,
-13, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, 9, -106, -106, -106, -106, 111, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
3, 186, -106, 220, 228, 234, 204, -106, 90, 91,
94, 97, 93, -106, -106, -106, -106, -106, -106, -106,
-106, 210, -106, 187, -106, 214, -106, -106, 208, -106,
207, -106, -106, 155, -106, 8, -106, 4, -106, -1,
-106, 217, -106, 177, 185, -106, -106, 184, -106, -106,
-106, -106, -106, -106, 183, -106, 194, 105, -106, -106,
99, -106, 71, -106, 74, -106, 65, -106, -106, 114,
-106, -106, -55, -106, -106, 64, -106, 44, -106, 30,
-106, 31, -106, -106, -106, -106, -106, -106, 57, -106,
36, -106, 40, -106, 70, 59, -106, -106, 42, -106,
-106, 104, -106, -106, -106, 38, -106, -106, -106, -106,
79, -106, 69, 108, -106, 84, -106, -106, 56, -106,
68, -106, -106, -106, -106, -106, -106, -106, 52, -106,
-106, -106, -106, -106, -106, 109, -106, -106, 77, -106,
-106, -106, -106, 86, -106, 80, -106, -106, -106, -106,
-106, -59, -106, 43, -106, -63, -106, -106, -106, -106,
98, -106, -106, 95, -106, -106, -106, -106, -106, 60,
-34, -106, -106, 32, -106, 41, -106, 39, -106, -106,
-106, -106, 49, -106, 61, -106, 62, -106, 48, -106,
-106, -106, -106, -106, -106, 23, -106, -106, 96, -106,
-106, -106, -106, 34, -106, -106, 133, -106, -106, 54,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, 67, -106, -106, -106, -106,
-106, 22, -106, -106, -106, -106, -106, -106, -106, -22,
-106, -106, -106, -106, -106, -106, 2, -106, -106, -106,
-106, -106, -106, -106, -19, -106, -106, -106, -106, -106,
-106, -106, 100, -106, -106, -106, -106, -21, -106, -106,
-3, -106, -106, -106, -106, -106, 13, -106, -106, -106,
11, 14, 10, -106, -106, -106, -106, -106, 279, 283,
-106, -106, -106, -106, -106, -106, 19, 273, 15, 16,
-106, 21, -106, 224, 6, -106, -106, 25, -106, -106,
85, -106, -106, -106, 26, -106, -106, -106, -106, 20,
-106, 7, 87, -106, 107, -106, -106, -106, -106, -106,
-106, 317, -106, -106, -106, -106, -106, 277, -106, -106,
-106, 0, -106, -106, -2, 271, -106, -106, -106, 1,
-106, -106, -106, -106, -106, -106, 5, -106, -106, -106,
-106, -106, -106, -106, -106, -106};
const short QmlJSGrammar::action_info [] = {
-97, -98, 452, 611, -116, 527, 456, -124, 415, -121,
439, 551, -119, -108, 347, -94, 611, 388, 635, 540,
351, 341, 344, 342, 390, 539, -127, 256, 398, 402,
100, 98, 70, -97, 400, 163, -98, 465, 524, -116,
559, 447, 530, -108, 439, -127, 509, 439, 559, -94,
537, 544, -121, 256, 443, -119, -124, 514, 439, 347,
445, 526, 423, 452, 423, 430, 456, 423, 70, 554,
169, 415, 345, 311, 100, 163, 419, 140, 146, 408,
271, 413, 347, 251, 295, 271, 256, 0, 186, 452,
0, 311, 456, 140, 429, 317, 0, 0, 0, 324,
407, 178, 291, 98, 305, 558, 0, 235, 476, 0,
439, 415, 300, 442, 291, 0, 189, 171, 140, 426,
140, 148, 339, 182, 433, 140, 140, 443, 140, 303,
326, 559, 140, 0, 140, 57, 172, 250, 188, 140,
601, 140, 330, 293, 165, 0, 58, 313, 166, 140,
332, 314, 631, 630, 255, 254, 477, 241, 240, 57,
246, 245, 412, 411, 427, 57, 141, 529, 528, 63,
58, 61, 336, 171, 248, 247, 58, 516, 253, 0,
417, 468, 62, 327, 309, 334, 458, 57, 602, 248,
247, 487, 172, 454, 522, 556, 555, 176, 58, 248,
247, 625, 624, 84, 84, 85, 85, 140, 84, 84,
85, 85, 63, 84, 64, 85, 86, 86, 510, 510,
65, 86, 86, 84, 171, 85, 86, 63, 84, 0,
85, 517, 515, 140, 469, 467, 86, 84, 140, 85,
512, 86, 84, 172, 85, 405, 84, 102, 85, 140,
86, 511, 628, 627, 140, 86, 84, 64, 85, 86,
437, 436, 171, 65, 512, 512, 103, 510, 104, 86,
546, 510, 64, 140, 510, 511, 511, 84, 65, 85,
532, 172, 626, 405, 34, 0, 234, 233, 0, 0,
86, 520, 519, 0, 0, 547, 545, 84, 0, 85,
621, 0, 543, 542, 34, 0, 349, 0, 0, 0,
86, 72, 73, 512, 622, 620, 34, 512, 0, 34,
512, 47, 49, 48, 511, 0, 536, 535, 511, 171,
0, 511, 34, 0, 533, 531, 72, 73, 74, 75,
34, 47, 49, 48, 619, 34, 171, -85, 172, 34,
173, 0, 34, 47, 49, 48, 47, 49, 48, 34,
0, 0, 34, 74, 75, 172, 34, 173, 0, 47,
49, 48, 34, 0, 171, 34, 0, 47, 49, 48,
0, 0, 47, 49, 48, 0, 47, 49, 48, 47,
49, 48, -85, 172, 0, 173, 47, 49, 48, 47,
49, 48, 0, 47, 49, 48, 278, 279, 0, 47,
49, 48, 47, 49, 48, 280, 278, 279, 281, 0,
282, 0, 0, 34, 0, 280, 34, 0, 281, 34,
282, 273, 274, -339, 278, 279, -339, 34, 0, 0,
0, 0, 0, 280, 0, 0, 281, 0, 282, 34,
0, 0, 0, 0, 0, 244, 243, 0, 275, 276,
47, 49, 48, 47, 49, 48, 47, 49, 48, 244,
243, 77, 78, 34, 47, 49, 48, 0, 0, 79,
80, 239, 238, 81, 0, 82, 47, 49, 48, 77,
78, 34, 0, 0, 0, 0, 0, 79, 80, 0,
0, 81, 0, 82, 0, 239, 238, 77, 78, 34,
47, 49, 48, 278, 279, 79, 80, 0, 0, 81,
0, 82, 280, 244, 243, 281, 0, 282, 47, 49,
48, 6, 5, 4, 1, 3, 2, 0, 0, 150,
0, 239, 238, 0, 0, 0, 47, 49, 48, 151,
0, 0, 0, 152, 0, 0, 0, 150, 0, 0,
0, 0, 153, 0, 154, 0, 0, 151, 0, 0,
0, 152, 0, 0, 0, 155, 0, 156, 61, 0,
153, 0, 154, 0, 0, 157, 0, 0, 158, 62,
77, 78, 0, 155, 159, 156, 61, 0, 79, 80,
160, 0, 81, 157, 82, 0, 158, 62, 0, 0,
0, 0, 159, 0, 0, 0, 161, 0, 160, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 30,
31, 0, 0, 0, 161, 0, 0, 0, 0, 33,
0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
35, 36, 0, 37, 0, 0, 0, 0, 0, 0,
501, 0, 0, 0, 44, 0, 0, 150, 0, 0,
0, 0, 0, 0, 0, 0, 0, 151, 0, 0,
0, 152, 50, 47, 49, 48, 0, 51, 0, 0,
153, 0, 154, 0, 0, 307, 0, 0, 43, 53,
32, 0, 0, 155, 40, 156, 61, 0, 0, 0,
0, 0, 0, 157, 0, 0, 158, 62, 0, 0,
0, 0, 159, 0, 0, 0, 0, 0, 160, 0,
0, 0, 0, 0, 0, 0, 30, 31, 0, 0,
0, 0, 0, 0, 161, 0, 33, 0, 0, 0,
0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
37, 0, 0, 0, 30, 31, 0, 41, 0, 0,
0, 44, 0, 0, 33, 0, 0, 0, 0, 0,
0, 34, 0, 0, 0, 35, 36, 0, 37, 50,
47, 49, 48, 0, 51, 501, 0, 0, 0, 44,
0, 0, 0, 0, 0, 43, 53, 32, 0, 0,
0, 40, 0, 0, 0, 0, 0, 50, 47, 49,
48, 0, 51, 0, 500, 0, 30, 31, 0, 0,
0, 0, 0, 43, 53, 32, 214, 0, 0, 40,
0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
37, 0, 30, 31, 0, 0, 0, 501, 0, 0,
0, 44, 33, 0, 0, 0, 0, 0, 0, 34,
0, 0, 0, 35, 36, 0, 37, 0, 0, 50,
502, 504, 503, 41, 51, 0, 0, 44, 0, 225,
0, 0, 0, 0, 0, 43, 53, 32, 209, 0,
0, 40, 0, 0, 0, 50, 47, 49, 48, 0,
51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 43, 53, 32, 0, 0, 0, 40, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
500, 0, 30, 31, 0, 0, 0, 0, 0, 0,
0, 0, 214, 0, 0, 0, 0, 0, 0, 34,
0, 0, 0, 35, 36, 0, 37, 0, 0, 0,
0, 0, 0, 501, 0, 0, 0, 44, 0, 0,
0, 0, 0, 0, 0, 608, 0, 0, 0, 0,
0, 0, 0, 0, 0, 50, 502, 504, 503, 0,
51, 0, 0, 0, 0, 225, 0, 0, 0, 0,
0, 43, 53, 32, 209, 0, 0, 40, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
500, 0, 30, 31, 0, 0, 0, 0, 0, 0,
0, 0, 214, 0, 0, 0, 0, 0, 0, 34,
0, 0, 0, 35, 36, 0, 37, 0, 0, 0,
0, 0, 0, 501, 0, 0, 0, 44, 0, 0,
0, 0, 0, 0, 0, 605, 0, 0, 0, 0,
0, 0, 0, 0, 0, 50, 502, 504, 503, 0,
51, 0, 0, 0, 0, 225, 0, 0, 0, 0,
0, 43, 53, 32, 209, 0, 0, 40, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29, 30, 31, 0, 0, 0, 0, 0, 0, 0,
0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
0, 0, 35, 36, 0, 37, 0, 0, 0, 38,
0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
45, 0, 46, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 50, 47, 49, 48, 0, 51,
0, 52, 0, 54, 0, 55, 0, 0, 0, 0,
43, 53, 32, 0, 0, 0, 40, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, -117,
0, 0, 0, 29, 30, 31, 0, 0, 0, 0,
0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
0, 0, 0, 45, 0, 46, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 50, 47, 49,
48, 0, 51, 0, 52, 0, 54, 0, 55, 0,
0, 0, 0, 43, 53, 32, 0, 0, 0, 40,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
34, 0, 0, 0, 35, 36, 0, 37, 0, 0,
0, 38, 0, 39, 41, 42, 0, 0, 44, 0,
0, 0, 45, 0, 46, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 50, 47, 49, 48,
0, 51, 0, 52, 0, 54, 270, 55, 0, 0,
0, 0, 43, 53, 32, 0, 0, 0, 40, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 29, 30, 31, 0, 0, 0, 0, 0, 0,
0, 0, 33, 0, 0, 0, 0, 0, 0, 34,
216, 0, 0, 566, 567, 0, 37, 0, 0, 0,
38, 0, 39, 41, 42, 0, 0, 44, 0, 0,
0, 45, 0, 46, 0, 0, 0, 0, 0, 0,
0, 220, 0, 0, 0, 50, 47, 49, 48, 0,
51, 0, 52, 0, 54, 0, 55, 0, 0, 0,
0, 43, 53, 32, 0, 0, 0, 40, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
474, 0, 0, 29, 30, 31, 0, 0, 0, 0,
0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
0, 0, 0, 45, 0, 46, 0, 0, 475, 0,
0, 0, 0, 0, 0, 0, 0, 50, 47, 49,
48, 0, 51, 0, 52, 0, 54, 0, 55, 0,
0, 0, 0, 43, 53, 32, 0, 0, 0, 40,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 474, 0, 0, 29, 30, 31, 0, 0,
0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
0, 44, 0, 0, 0, 45, 0, 46, 0, 0,
480, 0, 0, 0, 0, 0, 0, 0, 0, 50,
47, 49, 48, 0, 51, 0, 52, 0, 54, 0,
55, 0, 0, 0, 0, 43, 53, 32, 0, 0,
0, 40, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 482, 0, 0, 29, 30, 31,
0, 0, 0, 0, 0, 0, 0, 0, 33, 0,
0, 0, 0, 0, 0, 34, 0, 0, 0, 35,
36, 0, 37, 0, 0, 0, 38, 0, 39, 41,
42, 0, 0, 44, 0, 0, 0, 45, 0, 46,
0, 0, 485, 0, 0, 0, 0, 0, 0, 0,
0, 50, 47, 49, 48, 0, 51, 0, 52, 0,
54, 0, 55, 0, 0, 0, 0, 43, 53, 32,
0, 0, 0, 40, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 482, 0, 0, 29,
30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
0, 35, 36, 0, 37, 0, 0, 0, 38, 0,
39, 41, 42, 0, 0, 44, 0, 0, 0, 45,
0, 46, 0, 0, 483, 0, 0, 0, 0, 0,
0, 0, 0, 50, 47, 49, 48, 0, 51, 0,
52, 0, 54, 0, 55, 0, 0, 0, 0, 43,
53, 32, 0, 0, 0, 40, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 108, 109,
110, 0, 0, 112, 114, 115, 0, 0, 116, 0,
117, 0, 0, 0, 119, 120, 121, 0, 0, 0,
0, 0, 0, 34, 122, 123, 124, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 125, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 128, 0, 0, 0, 0, 0, 0,
47, 49, 48, 129, 130, 131, 0, 133, 134, 135,
136, 137, 138, 0, 0, 126, 132, 118, 111, 113,
127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 108, 109, 110, 0, 0, 112,
114, 115, 0, 0, 116, 0, 117, 0, 0, 0,
119, 120, 121, 0, 0, 0, 0, 0, 0, 392,
122, 123, 124, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 125, 0, 0, 0, 393, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 128,
0, 0, 0, 0, 0, 397, 394, 396, 0, 129,
130, 131, 0, 133, 134, 135, 136, 137, 138, 0,
0, 126, 132, 118, 111, 113, 127, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
108, 109, 110, 0, 0, 112, 114, 115, 0, 0,
116, 0, 117, 0, 0, 0, 119, 120, 121, 0,
0, 0, 0, 0, 0, 392, 122, 123, 124, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 125,
0, 0, 0, 393, 0, 0, 0, 0, 0, 0,
0, 395, 0, 0, 0, 128, 0, 0, 0, 0,
0, 397, 394, 396, 0, 129, 130, 131, 0, 133,
134, 135, 136, 137, 138, 0, 0, 126, 132, 118,
111, 113, 127, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 208, 0, 0, 0,
0, 210, 0, 29, 30, 31, 212, 0, 0, 0,
0, 0, 0, 213, 33, 0, 0, 0, 0, 0,
0, 215, 216, 0, 0, 217, 36, 0, 37, 0,
0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
0, 0, 0, 45, 0, 46, 0, 0, 0, 0,
0, 219, 0, 220, 0, 0, 0, 50, 218, 221,
48, 222, 51, 223, 52, 224, 54, 225, 55, 226,
227, 0, 0, 43, 53, 32, 209, 211, 0, 40,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 208, 0, 0, 0, 0, 210, 0, 29,
30, 31, 212, 0, 0, 0, 0, 0, 0, 213,
214, 0, 0, 0, 0, 0, 0, 215, 216, 0,
0, 217, 36, 0, 37, 0, 0, 0, 38, 0,
39, 41, 42, 0, 0, 44, 0, 0, 0, 45,
0, 46, 0, 0, 0, 0, 0, 219, 0, 220,
0, 0, 0, 50, 218, 221, 48, 222, 51, 223,
52, 224, 54, 225, 55, 226, 227, 0, 0, 43,
53, 32, 209, 211, 0, 40, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 569, 109,
110, 0, 0, 571, 114, 573, 30, 31, 574, 0,
117, 0, 0, 0, 119, 576, 577, 0, 0, 0,
0, 0, 0, 578, 579, 123, 124, 217, 36, 0,
37, 0, 0, 0, 38, 0, 39, 580, 42, 0,
0, 582, 0, 0, 0, 45, 0, 46, 0, 0,
0, 0, 0, 584, 0, 220, 0, 0, 0, 586,
583, 585, 48, 587, 588, 589, 52, 591, 592, 593,
594, 595, 596, 0, 0, 581, 590, 575, 570, 572,
127, 40, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 360, 109, 110, 0, 0, 362,
114, 364, 30, 31, 365, 0, 117, 0, 0, 0,
119, 367, 368, 0, 0, 0, 0, 0, 0, 369,
370, 123, 124, 217, 36, 0, 37, 0, 0, 0,
38, 0, 39, 371, 42, 0, 0, 373, 0, 0,
0, 45, 0, 46, 0, -263, 0, 0, 0, 375,
0, 220, 0, 0, 0, 377, 374, 376, 48, 378,
379, 380, 52, 382, 383, 384, 385, 386, 387, 0,
0, 372, 381, 366, 361, 363, 127, 40, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
541, 310, 460, 513, 538, 518, 525, 308, 249, 632,
306, 181, 252, 618, 149, 16, 623, 495, 319, 497,
629, 357, 496, 435, 471, 553, 557, 486, 438, 301,
428, 237, 350, 352, 604, 521, 242, 424, 550, 552,
181, 301, 185, 237, 242, 343, 432, 348, 338, 249,
459, 237, 453, 449, 236, 242, 446, 181, 466, 401,
448, 249, 357, 455, 444, 457, 346, 337, 357, 484,
142, 236, 147, 333, 438, 175, 301, 335, 187, 409,
162, 145, 435, 416, 435, 139, 170, 399, 414, 481,
438, 389, 0, 168, 0, 0, 403, 357, 403, 59,
357, 490, 301, 534, 391, 0, 0, 0, 301, 0,
0, 460, 0, 145, 59, 0, 179, 403, 177, 59,
59, 488, 489, 0, 404, 105, 404, 0, 59, 185,
451, 59, 59, 450, 59, 59, 59, 59, 59, 283,
284, 59, 287, 285, 145, 404, 286, 107, 167, 406,
164, 59, 59, 451, 450, 265, 59, 59, 301, 59,
269, 68, 96, 95, 479, 59, 59, 331, 478, 59,
87, 76, 59, 329, 59, 97, 434, 83, 89, 431,
59, 470, 59, 59, 59, 94, 88, 59, 93, 92,
59, 59, 90, 59, 59, 91, 493, 59, 59, 71,
67, 59, 59, 491, 492, 99, 59, 101, 179, 319,
301, 59, 59, 340, 69, 60, 59, 59, 450, 66,
59, 59, 451, 304, 105, 499, 269, 297, 297, 297,
59, 59, 269, 269, 269, 269, 269, 0, 315, 272,
498, 508, 294, 0, 0, 0, 107, 174, 59, 325,
318, 316, 297, 269, 59, 290, 0, 269, 297, 269,
0, 59, 0, 269, 59, 0, 269, 292, 59, 269,
179, 277, 59, 0, 299, 302, 312, 269, 59, 288,
296, 328, 609, 269, 499, 289, 597, 633, 606, 599,
499, 600, 565, 600, 0, 0, 499, 0, 0, 568,
561, 562, 563, 564, 0, 498, 508, 0, 471, 0,
0, 498, 508, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
499, 0, 0, 603, 0, 0, 0, 600, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0};
const short QmlJSGrammar::action_check [] = {
7, 7, 36, 90, 7, 29, 36, 7, 36, 7,
33, 8, 7, 7, 36, 7, 90, 7, 0, 7,
16, 60, 55, 33, 8, 29, 7, 36, 7, 55,
79, 48, 1, 7, 55, 2, 7, 17, 37, 7,
33, 60, 29, 7, 33, 7, 66, 33, 33, 7,
66, 29, 7, 36, 20, 7, 7, 29, 33, 36,
36, 24, 5, 36, 5, 7, 36, 5, 1, 60,
7, 36, 7, 2, 79, 2, 33, 8, 8, 7,
1, 7, 36, 36, 8, 1, 36, -1, 8, 36,
-1, 2, 36, 8, 55, 7, -1, -1, -1, 17,
60, 60, 48, 48, 60, 7, -1, 55, 8, -1,
33, 36, 61, 6, 48, -1, 33, 15, 8, 10,
8, 60, 36, 36, 7, 8, 8, 20, 8, 61,
8, 33, 8, -1, 8, 40, 34, 77, 60, 8,
8, 8, 61, 79, 50, -1, 51, 50, 54, 8,
60, 54, 61, 62, 61, 62, 56, 61, 62, 40,
61, 62, 61, 62, 55, 40, 56, 61, 62, 12,
51, 42, 60, 15, 61, 62, 51, 7, 60, -1,
60, 8, 53, 61, 60, 31, 60, 40, 56, 61,
62, 60, 34, 60, 29, 61, 62, 56, 51, 61,
62, 61, 62, 25, 25, 27, 27, 8, 25, 25,
27, 27, 12, 25, 57, 27, 38, 38, 29, 29,
63, 38, 38, 25, 15, 27, 38, 12, 25, -1,
27, 61, 62, 8, 61, 62, 38, 25, 8, 27,
75, 38, 25, 34, 27, 36, 25, 15, 27, 8,
38, 86, 61, 62, 8, 38, 25, 57, 27, 38,
61, 62, 15, 63, 75, 75, 34, 29, 36, 38,
36, 29, 57, 8, 29, 86, 86, 25, 63, 27,
7, 34, 91, 36, 29, -1, 61, 62, -1, -1,
38, 61, 62, -1, -1, 61, 62, 25, -1, 27,
47, -1, 61, 62, 29, -1, 60, -1, -1, -1,
38, 18, 19, 75, 61, 62, 29, 75, -1, 29,
75, 66, 67, 68, 86, -1, 61, 62, 86, 15,
-1, 86, 29, -1, 61, 62, 18, 19, 45, 46,
29, 66, 67, 68, 91, 29, 15, 33, 34, 29,
36, -1, 29, 66, 67, 68, 66, 67, 68, 29,
-1, -1, 29, 45, 46, 34, 29, 36, -1, 66,
67, 68, 29, -1, 15, 29, -1, 66, 67, 68,
-1, -1, 66, 67, 68, -1, 66, 67, 68, 66,
67, 68, 33, 34, -1, 36, 66, 67, 68, 66,
67, 68, -1, 66, 67, 68, 23, 24, -1, 66,
67, 68, 66, 67, 68, 32, 23, 24, 35, -1,
37, -1, -1, 29, -1, 32, 29, -1, 35, 29,
37, 18, 19, 36, 23, 24, 36, 29, -1, -1,
-1, -1, -1, 32, -1, -1, 35, -1, 37, 29,
-1, -1, -1, -1, -1, 61, 62, -1, 45, 46,
66, 67, 68, 66, 67, 68, 66, 67, 68, 61,
62, 23, 24, 29, 66, 67, 68, -1, -1, 31,
32, 61, 62, 35, -1, 37, 66, 67, 68, 23,
24, 29, -1, -1, -1, -1, -1, 31, 32, -1,
-1, 35, -1, 37, -1, 61, 62, 23, 24, 29,
66, 67, 68, 23, 24, 31, 32, -1, -1, 35,
-1, 37, 32, 61, 62, 35, -1, 37, 66, 67,
68, 92, 93, 94, 95, 96, 97, -1, -1, 3,
-1, 61, 62, -1, -1, -1, 66, 67, 68, 13,
-1, -1, -1, 17, -1, -1, -1, 3, -1, -1,
-1, -1, 26, -1, 28, -1, -1, 13, -1, -1,
-1, 17, -1, -1, -1, 39, -1, 41, 42, -1,
26, -1, 28, -1, -1, 49, -1, -1, 52, 53,
23, 24, -1, 39, 58, 41, 42, -1, 31, 32,
64, -1, 35, 49, 37, -1, 52, 53, -1, -1,
-1, -1, 58, -1, -1, -1, 80, -1, 64, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 12,
13, -1, -1, -1, 80, -1, -1, -1, -1, 22,
-1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
33, 34, -1, 36, -1, -1, -1, -1, -1, -1,
43, -1, -1, -1, 47, -1, -1, 3, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 13, -1, -1,
-1, 17, 65, 66, 67, 68, -1, 70, -1, -1,
26, -1, 28, -1, -1, 31, -1, -1, 81, 82,
83, -1, -1, 39, 87, 41, 42, -1, -1, -1,
-1, -1, -1, 49, -1, -1, 52, 53, -1, -1,
-1, -1, 58, -1, -1, -1, -1, -1, 64, -1,
-1, -1, -1, -1, -1, -1, 12, 13, -1, -1,
-1, -1, -1, -1, 80, -1, 22, -1, -1, -1,
-1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
36, -1, -1, -1, 12, 13, -1, 43, -1, -1,
-1, 47, -1, -1, 22, -1, -1, -1, -1, -1,
-1, 29, -1, -1, -1, 33, 34, -1, 36, 65,
66, 67, 68, -1, 70, 43, -1, -1, -1, 47,
-1, -1, -1, -1, -1, 81, 82, 83, -1, -1,
-1, 87, -1, -1, -1, -1, -1, 65, 66, 67,
68, -1, 70, -1, 10, -1, 12, 13, -1, -1,
-1, -1, -1, 81, 82, 83, 22, -1, -1, 87,
-1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
36, -1, 12, 13, -1, -1, -1, 43, -1, -1,
-1, 47, 22, -1, -1, -1, -1, -1, -1, 29,
-1, -1, -1, 33, 34, -1, 36, -1, -1, 65,
66, 67, 68, 43, 70, -1, -1, 47, -1, 75,
-1, -1, -1, -1, -1, 81, 82, 83, 84, -1,
-1, 87, -1, -1, -1, 65, 66, 67, 68, -1,
70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 81, 82, 83, -1, -1, -1, 87, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
10, -1, 12, 13, -1, -1, -1, -1, -1, -1,
-1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
-1, -1, -1, 33, 34, -1, 36, -1, -1, -1,
-1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
-1, -1, -1, -1, -1, 55, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 65, 66, 67, 68, -1,
70, -1, -1, -1, -1, 75, -1, -1, -1, -1,
-1, 81, 82, 83, 84, -1, -1, 87, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
10, -1, 12, 13, -1, -1, -1, -1, -1, -1,
-1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
-1, -1, -1, 33, 34, -1, 36, -1, -1, -1,
-1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
-1, -1, -1, -1, -1, 55, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 65, 66, 67, 68, -1,
70, -1, -1, -1, -1, 75, -1, -1, -1, -1,
-1, 81, 82, 83, 84, -1, -1, 87, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
-1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
-1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
-1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
51, -1, 53, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
-1, 72, -1, 74, -1, 76, -1, -1, -1, -1,
81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7,
-1, -1, -1, 11, 12, 13, -1, -1, -1, -1,
-1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
-1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
-1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
-1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
68, -1, 70, -1, 72, -1, 74, -1, 76, -1,
-1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
-1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
29, -1, -1, -1, 33, 34, -1, 36, -1, -1,
-1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
-1, -1, 51, -1, 53, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
-1, 70, -1, 72, -1, 74, 75, 76, -1, -1,
-1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 11, 12, 13, -1, -1, -1, -1, -1, -1,
-1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
30, -1, -1, 33, 34, -1, 36, -1, -1, -1,
40, -1, 42, 43, 44, -1, -1, 47, -1, -1,
-1, 51, -1, 53, -1, -1, -1, -1, -1, -1,
-1, 61, -1, -1, -1, 65, 66, 67, 68, -1,
70, -1, 72, -1, 74, -1, 76, -1, -1, -1,
-1, 81, 82, 83, -1, -1, -1, 87, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
8, -1, -1, 11, 12, 13, -1, -1, -1, -1,
-1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
-1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
-1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
-1, -1, -1, 51, -1, 53, -1, -1, 56, -1,
-1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
68, -1, 70, -1, 72, -1, 74, -1, 76, -1,
-1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 8, -1, -1, 11, 12, 13, -1, -1,
-1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
-1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
-1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
56, -1, -1, -1, -1, -1, -1, -1, -1, 65,
66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
-1, 87, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 8, -1, -1, 11, 12, 13,
-1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
-1, -1, -1, -1, -1, 29, -1, -1, -1, 33,
34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
-1, -1, 56, -1, -1, -1, -1, -1, -1, -1,
-1, 65, 66, 67, 68, -1, 70, -1, 72, -1,
74, -1, 76, -1, -1, -1, -1, 81, 82, 83,
-1, -1, -1, 87, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 8, -1, -1, 11,
12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
-1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
-1, 53, -1, -1, 56, -1, -1, -1, -1, -1,
-1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 4, 5,
6, -1, -1, 9, 10, 11, -1, -1, 14, -1,
16, -1, -1, -1, 20, 21, 22, -1, -1, -1,
-1, -1, -1, 29, 30, 31, 32, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 43, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 59, -1, -1, -1, -1, -1, -1,
66, 67, 68, 69, 70, 71, -1, 73, 74, 75,
76, 77, 78, -1, -1, 81, 82, 83, 84, 85,
86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 4, 5, 6, -1, -1, 9,
10, 11, -1, -1, 14, -1, 16, -1, -1, -1,
20, 21, 22, -1, -1, -1, -1, -1, -1, 29,
30, 31, 32, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
-1, -1, -1, -1, -1, 65, 66, 67, -1, 69,
70, 71, -1, 73, 74, 75, 76, 77, 78, -1,
-1, 81, 82, 83, 84, 85, 86, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
4, 5, 6, -1, -1, 9, 10, 11, -1, -1,
14, -1, 16, -1, -1, -1, 20, 21, 22, -1,
-1, -1, -1, -1, -1, 29, 30, 31, 32, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 43,
-1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
-1, 55, -1, -1, -1, 59, -1, -1, -1, -1,
-1, 65, 66, 67, -1, 69, 70, 71, -1, 73,
74, 75, 76, 77, 78, -1, -1, 81, 82, 83,
84, 85, 86, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 4, -1, -1, -1,
-1, 9, -1, 11, 12, 13, 14, -1, -1, -1,
-1, -1, -1, 21, 22, -1, -1, -1, -1, -1,
-1, 29, 30, -1, -1, 33, 34, -1, 36, -1,
-1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
-1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
-1, 59, -1, 61, -1, -1, -1, 65, 66, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, -1, -1, 81, 82, 83, 84, 85, -1, 87,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 4, -1, -1, -1, -1, 9, -1, 11,
12, 13, 14, -1, -1, -1, -1, -1, -1, 21,
22, -1, -1, -1, -1, -1, -1, 29, 30, -1,
-1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
-1, 53, -1, -1, -1, -1, -1, 59, -1, 61,
-1, -1, -1, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, -1, -1, 81,
82, 83, 84, 85, -1, 87, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 4, 5,
6, -1, -1, 9, 10, 11, 12, 13, 14, -1,
16, -1, -1, -1, 20, 21, 22, -1, -1, -1,
-1, -1, -1, 29, 30, 31, 32, 33, 34, -1,
36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
-1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
-1, -1, -1, 59, -1, 61, -1, -1, -1, 65,
66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
76, 77, 78, -1, -1, 81, 82, 83, 84, 85,
86, 87, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 4, 5, 6, -1, -1, 9,
10, 11, 12, 13, 14, -1, 16, -1, -1, -1,
20, 21, 22, -1, -1, -1, -1, -1, -1, 29,
30, 31, 32, 33, 34, -1, 36, -1, -1, -1,
40, -1, 42, 43, 44, -1, -1, 47, -1, -1,
-1, 51, -1, 53, -1, 55, -1, -1, -1, 59,
-1, 61, -1, -1, -1, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, -1,
-1, 81, 82, 83, 84, 85, 86, 87, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3, 2, 15, 25, 25, 3, 25, 3, 2, 11,
2, 15, 3, 13, 67, 3, 15, 104, 15, 2,
15, 2, 4, 3, 35, 15, 15, 3, 21, 3,
93, 15, 2, 2, 19, 13, 15, 96, 25, 25,
15, 3, 15, 15, 15, 100, 3, 3, 15, 2,
2, 15, 3, 21, 4, 15, 15, 15, 35, 2,
21, 2, 2, 2, 98, 3, 2, 2, 2, 35,
35, 4, 35, 2, 21, 3, 3, 3, 15, 2,
35, 35, 3, 3, 3, 3, 35, 35, 2, 35,
21, 35, -1, 35, -1, -1, 13, 2, 13, 44,
2, 46, 3, 3, 36, -1, -1, -1, 3, -1,
-1, 15, -1, 35, 44, -1, 46, 13, 40, 44,
44, 46, 46, -1, 41, 15, 41, -1, 44, 15,
46, 44, 44, 46, 44, 44, 44, 44, 44, 49,
49, 44, 49, 49, 35, 41, 49, 37, 60, 40,
58, 44, 44, 46, 46, 44, 44, 44, 3, 44,
49, 46, 50, 50, 31, 44, 44, 68, 35, 44,
48, 50, 44, 68, 44, 50, 81, 49, 48, 81,
44, 85, 44, 44, 44, 49, 48, 44, 49, 49,
44, 44, 49, 44, 44, 49, 46, 44, 44, 52,
46, 44, 44, 46, 46, 56, 44, 54, 46, 15,
3, 44, 44, 99, 47, 47, 44, 44, 46, 46,
44, 44, 46, 68, 15, 13, 49, 44, 44, 44,
44, 44, 49, 49, 49, 49, 49, -1, 61, 53,
28, 29, 55, -1, -1, -1, 37, 38, 44, 66,
66, 66, 44, 49, 44, 51, -1, 49, 44, 49,
-1, 44, -1, 49, 44, -1, 49, 57, 44, 49,
46, 51, 44, -1, 66, 68, 59, 49, 44, 51,
66, 87, 5, 49, 13, 51, 13, 16, 5, 16,
13, 20, 13, 20, -1, -1, 13, -1, -1, 20,
21, 22, 23, 24, -1, 28, 29, -1, 35, -1,
-1, 28, 29, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
13, -1, -1, 16, -1, -1, -1, 20, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1};
QT_END_NAMESPACE
+209
View File
@@ -0,0 +1,209 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
// This file was generated by qlalr - DO NOT EDIT!
#ifndef QMLJSGRAMMAR_P_H
#define QMLJSGRAMMAR_P_H
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
class QmlJSGrammar
{
public:
enum {
EOF_SYMBOL = 0,
REDUCE_HERE = 99,
SHIFT_THERE = 98,
T_AND = 1,
T_AND_AND = 2,
T_AND_EQ = 3,
T_AS = 91,
T_AUTOMATIC_SEMICOLON = 62,
T_BREAK = 4,
T_CASE = 5,
T_CATCH = 6,
T_COLON = 7,
T_COMMA = 8,
T_COMMENT = 88,
T_CONST = 84,
T_CONTINUE = 9,
T_DEBUGGER = 85,
T_DEFAULT = 10,
T_DELETE = 11,
T_DIVIDE_ = 12,
T_DIVIDE_EQ = 13,
T_DO = 14,
T_DOT = 15,
T_ELSE = 16,
T_EQ = 17,
T_EQ_EQ = 18,
T_EQ_EQ_EQ = 19,
T_FALSE = 83,
T_FEED_JS_EXPRESSION = 95,
T_FEED_JS_PROGRAM = 97,
T_FEED_JS_SOURCE_ELEMENT = 96,
T_FEED_JS_STATEMENT = 94,
T_FEED_UI_OBJECT_MEMBER = 93,
T_FEED_UI_PROGRAM = 92,
T_FINALLY = 20,
T_FOR = 21,
T_FUNCTION = 22,
T_GE = 23,
T_GT = 24,
T_GT_GT = 25,
T_GT_GT_EQ = 26,
T_GT_GT_GT = 27,
T_GT_GT_GT_EQ = 28,
T_IDENTIFIER = 29,
T_IF = 30,
T_IMPORT = 90,
T_IN = 31,
T_INSTANCEOF = 32,
T_LBRACE = 33,
T_LBRACKET = 34,
T_LE = 35,
T_LPAREN = 36,
T_LT = 37,
T_LT_LT = 38,
T_LT_LT_EQ = 39,
T_MINUS = 40,
T_MINUS_EQ = 41,
T_MINUS_MINUS = 42,
T_MULTILINE_STRING_LITERAL = 87,
T_NEW = 43,
T_NOT = 44,
T_NOT_EQ = 45,
T_NOT_EQ_EQ = 46,
T_NULL = 81,
T_NUMERIC_LITERAL = 47,
T_OR = 48,
T_OR_EQ = 49,
T_OR_OR = 50,
T_PLUS = 51,
T_PLUS_EQ = 52,
T_PLUS_PLUS = 53,
T_PROPERTY = 66,
T_PUBLIC = 89,
T_QUESTION = 54,
T_RBRACE = 55,
T_RBRACKET = 56,
T_READONLY = 68,
T_REMAINDER = 57,
T_REMAINDER_EQ = 58,
T_RESERVED_WORD = 86,
T_RETURN = 59,
T_RPAREN = 60,
T_SEMICOLON = 61,
T_SIGNAL = 67,
T_STAR = 63,
T_STAR_EQ = 64,
T_STRING_LITERAL = 65,
T_SWITCH = 69,
T_THIS = 70,
T_THROW = 71,
T_TILDE = 72,
T_TRUE = 82,
T_TRY = 73,
T_TYPEOF = 74,
T_VAR = 75,
T_VOID = 76,
T_WHILE = 77,
T_WITH = 78,
T_XOR = 79,
T_XOR_EQ = 80,
ACCEPT_STATE = 635,
RULE_COUNT = 343,
STATE_COUNT = 636,
TERMINAL_COUNT = 100,
NON_TERMINAL_COUNT = 106,
GOTO_INDEX_OFFSET = 636,
GOTO_INFO_OFFSET = 2520,
GOTO_CHECK_OFFSET = 2520
};
static const char *const spell [];
static const short lhs [];
static const short rhs [];
static const short goto_default [];
static const short action_default [];
static const short action_index [];
static const short action_info [];
static const short action_check [];
static inline int nt_action (int state, int nt)
{
const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;
if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)
return goto_default [nt];
return action_info [GOTO_INFO_OFFSET + yyn];
}
static inline int t_action (int state, int token)
{
const int yyn = action_index [state] + token;
if (yyn < 0 || action_check [yyn] != token)
return - action_default [state];
return action_info [yyn];
}
};
QT_END_NAMESPACE
#endif // QMLJSGRAMMAR_P_H
File diff suppressed because it is too large Load Diff
+249
View File
@@ -0,0 +1,249 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJSLEXER_P_H
#define QMLJSLEXER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmljsglobal_p.h"
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
namespace QmlJS {
class Engine;
class NameId;
class QML_PARSER_EXPORT Lexer
{
public:
Lexer(Engine *eng, bool tokenizeComments = false);
~Lexer();
void setCode(const QString &c, int lineno);
int lex();
int currentLineNo() const { return yylineno; }
int currentColumnNo() const { return yycolumn; }
int tokenOffset() const { return startpos; }
int tokenLength() const { return pos - startpos; }
int startLineNo() const { return startlineno; }
int startColumnNo() const { return startcolumn; }
int endLineNo() const { return currentLineNo(); }
int endColumnNo() const
{ int col = currentColumnNo(); return (col > 0) ? col - 1 : col; }
bool prevTerminator() const { return terminator; }
enum State { Start,
Identifier,
InIdentifier,
InSingleLineComment,
InMultiLineComment,
InNum,
InNum0,
InHex,
InOctal,
InDecimal,
InExponentIndicator,
InExponent,
Hex,
Octal,
Number,
String,
Eof,
InString,
InEscapeSequence,
InHexEscape,
InUnicodeEscape,
Other,
Bad };
enum Error {
NoError,
IllegalCharacter,
UnclosedStringLiteral,
IllegalEscapeSequence,
IllegalUnicodeEscapeSequence,
UnclosedComment,
IllegalExponentIndicator,
IllegalIdentifier
};
enum ParenthesesState {
IgnoreParentheses,
CountParentheses,
BalancedParentheses
};
enum RegExpBodyPrefix {
NoPrefix,
EqualPrefix
};
bool scanRegExp(RegExpBodyPrefix prefix = NoPrefix);
NameId *pattern;
int flags;
State lexerState() const
{ return state; }
QString errorMessage() const
{ return errmsg; }
void setErrorMessage(const QString &err)
{ errmsg = err; }
void setErrorMessage(const char *err)
{ setErrorMessage(QString::fromLatin1(err)); }
Error error() const
{ return err; }
void clearError()
{ err = NoError; }
private:
Engine *driver;
int yylineno;
bool done;
char *buffer8;
QChar *buffer16;
uint size8, size16;
uint pos8, pos16;
bool terminator;
bool restrKeyword;
// encountered delimiter like "'" and "}" on last run
bool delimited;
int stackToken;
State state;
void setDone(State s);
uint pos;
void shift(uint p);
int lookupKeyword(const char *);
bool isWhiteSpace() const;
bool isLineTerminator() const;
bool isHexDigit(ushort c) const;
bool isOctalDigit(ushort c) const;
int matchPunctuator(ushort c1, ushort c2,
ushort c3, ushort c4);
ushort singleEscape(ushort c) const;
ushort convertOctal(ushort c1, ushort c2,
ushort c3) const;
public:
static unsigned char convertHex(ushort c1);
static unsigned char convertHex(ushort c1, ushort c2);
static QChar convertUnicode(ushort c1, ushort c2,
ushort c3, ushort c4);
static bool isIdentLetter(ushort c);
static bool isDecimalDigit(ushort c);
inline int ival() const { return qsyylval.ival; }
inline double dval() const { return qsyylval.dval; }
inline NameId *ustr() const { return qsyylval.ustr; }
const QChar *characterBuffer() const { return buffer16; }
int characterCount() const { return pos16; }
private:
void record8(ushort c);
void record16(QChar c);
void recordStartPos();
int findReservedWord(const QChar *buffer, int size) const;
void syncProhibitAutomaticSemicolon();
const QChar *code;
uint length;
int yycolumn;
int startpos;
int startlineno;
int startcolumn;
int bol; // begin of line
union {
int ival;
double dval;
NameId *ustr;
} qsyylval;
// current and following unicode characters
ushort current, next1, next2, next3;
struct keyword {
const char *name;
int token;
};
QString errmsg;
Error err;
bool wantRx;
bool check_reserved;
ParenthesesState parenthesesState;
int parenthesesCount;
bool prohibitAutomaticSemicolon;
bool tokenizeComments;
};
} // namespace QmlJS
QT_QML_END_NAMESPACE
#endif
+133
View File
@@ -0,0 +1,133 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJSMEMORYPOOL_P_H
#define QMLJSMEMORYPOOL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmljsglobal_p.h"
#include <QtCore/qglobal.h>
#include <QtCore/qshareddata.h>
#include <string.h>
QT_QML_BEGIN_NAMESPACE
namespace QmlJS {
class QML_PARSER_EXPORT MemoryPool : public QSharedData
{
public:
enum { maxBlockCount = -1 };
enum { defaultBlockSize = 1 << 12 };
MemoryPool() {
m_blockIndex = maxBlockCount;
m_currentIndex = 0;
m_storage = 0;
m_currentBlock = 0;
m_currentBlockSize = 0;
}
virtual ~MemoryPool() {
for (int index = 0; index < m_blockIndex + 1; ++index)
qFree(m_storage[index]);
qFree(m_storage);
}
char *allocate(int bytes) {
bytes += (8 - bytes) & 7; // ensure multiple of 8 bytes (maintain alignment)
if (m_currentBlock == 0 || m_currentBlockSize < m_currentIndex + bytes) {
++m_blockIndex;
m_currentBlockSize = defaultBlockSize << m_blockIndex;
m_storage = reinterpret_cast<char**>(qRealloc(m_storage, sizeof(char*) * (1 + m_blockIndex)));
m_currentBlock = m_storage[m_blockIndex] = reinterpret_cast<char*>(qMalloc(m_currentBlockSize));
::memset(m_currentBlock, 0, m_currentBlockSize);
m_currentIndex = (8 - quintptr(m_currentBlock)) & 7; // ensure first chunk is 64-bit aligned
Q_ASSERT(m_currentIndex + bytes <= m_currentBlockSize);
}
char *p = reinterpret_cast<char *>
(m_currentBlock + m_currentIndex);
m_currentIndex += bytes;
return p;
}
int bytesAllocated() const {
int bytes = 0;
for (int index = 0; index < m_blockIndex; ++index)
bytes += (defaultBlockSize << index);
bytes += m_currentIndex;
return bytes;
}
private:
int m_blockIndex;
int m_currentIndex;
char *m_currentBlock;
int m_currentBlockSize;
char **m_storage;
private:
Q_DISABLE_COPY(MemoryPool)
};
} // namespace QmlJS
QT_QML_END_NAMESPACE
#endif
+139
View File
@@ -0,0 +1,139 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJSNODEPOOL_P_H
#define QMLJSNODEPOOL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qmljsglobal_p.h"
#include "qmljsmemorypool_p.h"
#include <QtCore/QHash>
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
namespace QmlJS {
namespace AST {
class Node;
} // namespace AST
class Code;
class CompilationUnit;
class Engine;
template <typename NodeType>
inline NodeType *makeAstNode(MemoryPool *storage)
{
NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType();
return node;
}
template <typename NodeType, typename Arg1>
inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1)
{
NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1);
return node;
}
template <typename NodeType, typename Arg1, typename Arg2>
inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2)
{
NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2);
return node;
}
template <typename NodeType, typename Arg1, typename Arg2, typename Arg3>
inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3)
{
NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3);
return node;
}
template <typename NodeType, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
{
NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3, arg4);
return node;
}
class QML_PARSER_EXPORT NodePool : public MemoryPool
{
public:
NodePool(const QString &fileName, Engine *engine);
virtual ~NodePool();
Code *createCompiledCode(AST::Node *node, CompilationUnit &compilation);
inline QString fileName() const { return m_fileName; }
inline Engine *engine() const { return m_engine; }
#ifndef J_SCRIPT_NO_EVENT_NOTIFY
inline qint64 id() const { return m_id; }
#endif
private:
QHash<AST::Node*, Code*> m_codeCache;
QString m_fileName;
Engine *m_engine;
#ifndef J_SCRIPT_NO_EVENT_NOTIFY
qint64 m_id;
#endif
private:
Q_DISABLE_COPY(NodePool)
};
} // namespace QmlJS
QT_QML_END_NAMESPACE
#endif
File diff suppressed because it is too large Load Diff
+246
View File
@@ -0,0 +1,246 @@
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
//
// This file is automatically generated from qmljs.g.
// Changes will be lost.
//
#ifndef QMLJSPARSER_P_H
#define QMLJSPARSER_P_H
#include "qmljsglobal_p.h"
#include "qmljsgrammar_p.h"
#include "qmljsast_p.h"
#include "qmljsengine_p.h"
#include <QtCore/QList>
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
namespace QmlJS {
class Engine;
class NameId;
class QML_PARSER_EXPORT Parser: protected QmlJSGrammar
{
public:
union Value {
int ival;
double dval;
NameId *sval;
AST::ArgumentList *ArgumentList;
AST::CaseBlock *CaseBlock;
AST::CaseClause *CaseClause;
AST::CaseClauses *CaseClauses;
AST::Catch *Catch;
AST::DefaultClause *DefaultClause;
AST::ElementList *ElementList;
AST::Elision *Elision;
AST::ExpressionNode *Expression;
AST::Finally *Finally;
AST::FormalParameterList *FormalParameterList;
AST::FunctionBody *FunctionBody;
AST::FunctionDeclaration *FunctionDeclaration;
AST::Node *Node;
AST::PropertyName *PropertyName;
AST::PropertyNameAndValueList *PropertyNameAndValueList;
AST::SourceElement *SourceElement;
AST::SourceElements *SourceElements;
AST::Statement *Statement;
AST::StatementList *StatementList;
AST::Block *Block;
AST::VariableDeclaration *VariableDeclaration;
AST::VariableDeclarationList *VariableDeclarationList;
AST::UiProgram *UiProgram;
AST::UiImportList *UiImportList;
AST::UiImport *UiImport;
AST::UiParameterList *UiParameterList;
AST::UiPublicMember *UiPublicMember;
AST::UiObjectDefinition *UiObjectDefinition;
AST::UiObjectInitializer *UiObjectInitializer;
AST::UiObjectBinding *UiObjectBinding;
AST::UiScriptBinding *UiScriptBinding;
AST::UiArrayBinding *UiArrayBinding;
AST::UiObjectMember *UiObjectMember;
AST::UiObjectMemberList *UiObjectMemberList;
AST::UiArrayMemberList *UiArrayMemberList;
AST::UiQualifiedId *UiQualifiedId;
AST::UiSignature *UiSignature;
AST::UiFormalList *UiFormalList;
AST::UiFormal *UiFormal;
};
public:
Parser(Engine *engine);
~Parser();
// parse a UI program
bool parse() { return parse(T_FEED_UI_PROGRAM); }
bool parseStatement() { return parse(T_FEED_JS_STATEMENT); }
bool parseExpression() { return parse(T_FEED_JS_EXPRESSION); }
bool parseSourceElement() { return parse(T_FEED_JS_SOURCE_ELEMENT); }
bool parseUiObjectMember() { return parse(T_FEED_UI_OBJECT_MEMBER); }
bool parseProgram() { return parse(T_FEED_JS_PROGRAM); }
AST::UiProgram *ast() const
{ return AST::cast<AST::UiProgram *>(program); }
AST::Statement *statement() const
{
if (! program)
return 0;
return program->statementCast();
}
AST::ExpressionNode *expression() const
{
if (! program)
return 0;
return program->expressionCast();
}
AST::UiObjectMember *uiObjectMember() const
{
if (! program)
return 0;
return program->uiObjectMemberCast();
}
AST::Node *rootNode() const
{ return program; }
QList<DiagnosticMessage> diagnosticMessages() const
{ return diagnostic_messages; }
inline DiagnosticMessage diagnosticMessage() const
{
foreach (const DiagnosticMessage &d, diagnostic_messages) {
if (! d.kind == DiagnosticMessage::Warning)
return d;
}
return DiagnosticMessage();
}
inline QString errorMessage() const
{ return diagnosticMessage().message; }
inline int errorLineNumber() const
{ return diagnosticMessage().loc.startLine; }
inline int errorColumnNumber() const
{ return diagnosticMessage().loc.startColumn; }
protected:
bool parse(int startToken);
void reallocateStack();
inline Value &sym(int index)
{ return sym_stack [tos + index - 1]; }
inline AST::SourceLocation &loc(int index)
{ return location_stack [tos + index - 1]; }
AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);
protected:
Engine *driver;
int tos;
int stack_size;
Value *sym_stack;
int *state_stack;
AST::SourceLocation *location_stack;
AST::Node *program;
// error recovery
enum { TOKEN_BUFFER_SIZE = 3 };
struct SavedToken {
int token;
double dval;
AST::SourceLocation loc;
};
double yylval;
AST::SourceLocation yylloc;
AST::SourceLocation yyprevlloc;
SavedToken token_buffer[TOKEN_BUFFER_SIZE];
SavedToken *first_token;
SavedToken *last_token;
QList<DiagnosticMessage> diagnostic_messages;
};
} // end of namespace QmlJS
#define J_SCRIPT_REGEXPLITERAL_RULE1 74
#define J_SCRIPT_REGEXPLITERAL_RULE2 75
QT_QML_END_NAMESPACE
#endif // QMLJSPARSER_P_H
+43
View File
@@ -0,0 +1,43 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QML_GLOBAL_H
#define QML_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(QML_BUILD_LIB)
# define QML_EXPORT Q_DECL_EXPORT
#elif defined(QML_BUILD_STATIC_LIB)
# define QML_EXPORT
#else
# define QML_EXPORT Q_DECL_IMPORT
#endif
#endif // QML_GLOBAL_H
+213
View File
@@ -0,0 +1,213 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qmlidcollector.h"
#include "qmldocument.h"
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/parser/qmljslexer_p.h>
#include <qmljs/parser/qmljsparser_p.h>
#include <qmljs/parser/qmljsnodepool_p.h>
#include <qmljs/parser/qmljsastfwd_p.h>
using namespace Qml;
using namespace QmlJS;
using namespace QmlJS::AST;
QmlDocument::QmlDocument(const QString &fileName)
: _engine(0)
, _pool(0)
, _uiProgram(0)
, _jsProgram(0)
, _fileName(fileName)
, _parsedCorrectly(false)
{
const int slashIdx = fileName.lastIndexOf('/');
if (slashIdx != -1)
_path = fileName.left(slashIdx);
if (fileName.toLower().endsWith(".qml"))
_componentName = fileName.mid(slashIdx + 1, fileName.size() - (slashIdx + 1) - 4);
}
QmlDocument::~QmlDocument()
{
if (_engine)
delete _engine;
if (_pool)
delete _pool;
qDeleteAll(_symbols);
}
QmlDocument::Ptr QmlDocument::create(const QString &fileName)
{
QmlDocument::Ptr doc(new QmlDocument(fileName));
return doc;
}
AST::UiProgram *QmlDocument::qmlProgram() const
{
return _uiProgram;
}
AST::Program *QmlDocument::jsProgram() const
{
return _jsProgram;
}
QList<DiagnosticMessage> QmlDocument::diagnosticMessages() const
{
return _diagnosticMessages;
}
QString QmlDocument::source() const
{
return _source;
}
void QmlDocument::setSource(const QString &source)
{
_source = source;
}
bool QmlDocument::parseQml()
{
Q_ASSERT(! _engine);
Q_ASSERT(! _pool);
Q_ASSERT(! _uiProgram);
Q_ASSERT(! _jsProgram);
_engine = new Engine();
_pool = new NodePool(_fileName, _engine);
_ids.clear();
Lexer lexer(_engine);
Parser parser(_engine);
lexer.setCode(_source, /*line = */ 1);
_parsedCorrectly = parser.parse();
_uiProgram = parser.ast();
_diagnosticMessages = parser.diagnosticMessages();
if (_uiProgram) {
for (QmlJS::AST::UiObjectMemberList *iter = _uiProgram->members; iter; iter = iter->next)
if (iter->member)
_symbols.append(new QmlSymbolFromFile(_fileName, iter->member));
Internal::QmlIdCollector collect;
_ids = collect(*this);
if (_diagnosticMessages.isEmpty())
_diagnosticMessages = collect.diagnosticMessages();
}
return _parsedCorrectly;
}
bool QmlDocument::parseJavaScript()
{
Q_ASSERT(! _engine);
Q_ASSERT(! _pool);
Q_ASSERT(! _uiProgram);
Q_ASSERT(! _jsProgram);
_engine = new Engine();
_pool = new NodePool(_fileName, _engine);
_ids.clear();
Lexer lexer(_engine);
Parser parser(_engine);
lexer.setCode(_source, /*line = */ 1);
_parsedCorrectly = parser.parseProgram();
_jsProgram = cast<Program*>(parser.rootNode());
_diagnosticMessages = parser.diagnosticMessages();
return _parsedCorrectly;
}
QmlSymbolFromFile *QmlDocument::findSymbol(QmlJS::AST::Node *node) const
{
foreach (QmlSymbol *symbol, _symbols)
if (symbol->isSymbolFromFile())
if (symbol->asSymbolFromFile()->node() == node)
return symbol->asSymbolFromFile();
return 0;
}
Snapshot::Snapshot()
{
}
Snapshot::~Snapshot()
{
}
void Snapshot::insert(const QmlDocument::Ptr &document)
{
if (document && (document->qmlProgram() || document->jsProgram()))
QMap<QString, QmlDocument::Ptr>::insert(document->fileName(), document);
}
QmlDocument::PtrList Snapshot::importedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const
{
QmlDocument::PtrList result;
const QString docPath = doc->path() + '/' + importPath;
foreach (QmlDocument::Ptr candidate, *this) {
if (candidate == doc)
continue;
if (candidate->path() == doc->path() || candidate->path() == docPath)
result.append(candidate);
}
return result;
}
QMap<QString, QmlDocument::Ptr> Snapshot::componentsDefinedByImportedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const
{
QMap<QString, QmlDocument::Ptr> result;
const QString docPath = doc->path() + '/' + importPath;
foreach (QmlDocument::Ptr candidate, *this) {
if (candidate == doc)
continue;
if (candidate->path() == doc->path() || candidate->path() == docPath)
result.insert(candidate->componentName(), candidate);
}
return result;
}
+114
View File
@@ -0,0 +1,114 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLDOCUMENT_H
#define QMLDOCUMENT_H
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QPair>
#include <QtCore/QSharedPointer>
#include <QtCore/QString>
#include "parser/qmljsengine_p.h"
#include "qml_global.h"
#include "qmlsymbol.h"
namespace Qml {
class QML_EXPORT QmlDocument
{
public:
typedef QSharedPointer<QmlDocument> Ptr;
typedef QList<QmlDocument::Ptr> PtrList;
typedef QMap<QString, Qml::QmlIdSymbol*> IdTable;
protected:
QmlDocument(const QString &fileName);
public:
~QmlDocument();
static QmlDocument::Ptr create(const QString &fileName);
QmlJS::AST::UiProgram *qmlProgram() const;
QmlJS::AST::Program *jsProgram() const;
QList<QmlJS::DiagnosticMessage> diagnosticMessages() const;
QString source() const;
void setSource(const QString &source);
bool parseQml();
bool parseJavaScript();
bool isParsedCorrectly() const
{ return _parsedCorrectly; }
IdTable ids() const { return _ids; }
QString fileName() const { return _fileName; }
QString path() const { return _path; }
QString componentName() const { return _componentName; }
Qml::QmlSymbolFromFile *findSymbol(QmlJS::AST::Node *node) const;
Qml::QmlSymbol::List symbols() const
{ return _symbols; }
private:
QmlJS::Engine *_engine;
QmlJS::NodePool *_pool;
QmlJS::AST::UiProgram *_uiProgram;
QmlJS::AST::Program *_jsProgram;
QList<QmlJS::DiagnosticMessage> _diagnosticMessages;
QString _fileName;
QString _path;
QString _componentName;
QString _source;
bool _parsedCorrectly;
IdTable _ids;
Qml::QmlSymbol::List _symbols;
};
class QML_EXPORT Snapshot: public QMap<QString, QmlDocument::Ptr>
{
public:
Snapshot();
~Snapshot();
void insert(const QmlDocument::Ptr &document);
QmlDocument::Ptr document(const QString &fileName) const
{ return value(fileName); }
QmlDocument::PtrList importedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const;
QMap<QString, QmlDocument::Ptr> componentsDefinedByImportedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const;
};
} // end of namespace Qml
#endif // QMLDOCUMENT_H
+121
View File
@@ -0,0 +1,121 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include <QDebug>
#include <qmljs/parser/qmljsast_p.h>
#include "qmlidcollector.h"
using namespace QmlJS;
using namespace QmlJS::AST;
using namespace Qml;
using namespace Qml::Internal;
QMap<QString, QmlIdSymbol*> QmlIdCollector::operator()(Qml::QmlDocument &doc)
{
_doc = &doc;
_ids.clear();
_currentSymbol = 0;
Node::accept(doc.qmlProgram(), this);
return _ids;
}
bool QmlIdCollector::visit(UiArrayBinding *ast)
{
QmlSymbolFromFile *oldSymbol = switchSymbol(ast);
Node::accept(ast->members, this);
_currentSymbol = oldSymbol;
return false;
}
bool QmlIdCollector::visit(QmlJS::AST::UiObjectBinding *ast)
{
QmlSymbolFromFile *oldSymbol = switchSymbol(ast);
Node::accept(ast->initializer, this);
_currentSymbol = oldSymbol;
return false;
}
bool QmlIdCollector::visit(QmlJS::AST::UiObjectDefinition *ast)
{
QmlSymbolFromFile *oldSymbol = switchSymbol(ast);
Node::accept(ast->initializer, this);
_currentSymbol = oldSymbol;
return false;
}
bool QmlIdCollector::visit(QmlJS::AST::UiScriptBinding *ast)
{
if (!(ast->qualifiedId->next) && ast->qualifiedId->name->asString() == "id")
if (ExpressionStatement *e = cast<ExpressionStatement*>(ast->statement))
if (IdentifierExpression *i = cast<IdentifierExpression*>(e->expression))
if (i->name)
addId(i->name->asString(), ast);
return false;
}
QmlSymbolFromFile *QmlIdCollector::switchSymbol(QmlJS::AST::UiObjectMember *node)
{
QmlSymbolFromFile *newSymbol = 0;
if (_currentSymbol == 0) {
newSymbol = _doc->findSymbol(node);
} else {
newSymbol = _currentSymbol->findMember(node);
}
QmlSymbolFromFile *oldSymbol = _currentSymbol;
if (newSymbol) {
_currentSymbol = newSymbol;
} else {
QString filename = _doc->fileName();
qWarning() << "Scope without symbol @"<<filename<<":"<<node->firstSourceLocation().startLine<<":"<<node->firstSourceLocation().startColumn;
}
return oldSymbol;
}
void QmlIdCollector::addId(const QString &id, QmlJS::AST::UiScriptBinding *ast)
{
if (!_currentSymbol)
return;
if (_ids.contains(id)) {
_diagnosticMessages.append(DiagnosticMessage(DiagnosticMessage::Warning, ast->statement->firstSourceLocation(), "Duplicate ID"));
} else {
if (QmlSymbolFromFile *symbol = _currentSymbol->findMember(ast))
if (QmlIdSymbol *idSymbol = symbol->asIdSymbol())
_ids[id] = idSymbol;
}
}
+74
View File
@@ -0,0 +1,74 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLIDCOLLECTOR_H
#define QMLIDCOLLECTOR_H
#include <qmljs/parser/qmljsastvisitor_p.h>
#include <qmljs/parser/qmljsengine_p.h>
#include <qmljs/qmldocument.h>
#include <qmljs/qmlsymbol.h>
#include <QMap>
#include <QPair>
#include <QStack>
#include <QString>
namespace Qml {
namespace Internal {
class QML_EXPORT QmlIdCollector: protected QmlJS::AST::Visitor
{
public:
QMap<QString, Qml::QmlIdSymbol*> operator()(Qml::QmlDocument &doc);
QList<QmlJS::DiagnosticMessage> diagnosticMessages()
{ return _diagnosticMessages; }
protected:
virtual bool visit(QmlJS::AST::UiArrayBinding *ast);
virtual bool visit(QmlJS::AST::UiObjectBinding *ast);
virtual bool visit(QmlJS::AST::UiObjectDefinition *ast);
virtual bool visit(QmlJS::AST::UiScriptBinding *ast);
private:
Qml::QmlSymbolFromFile *switchSymbol(QmlJS::AST::UiObjectMember *node);
void addId(const QString &id, QmlJS::AST::UiScriptBinding *ast);
private:
Qml::QmlDocument *_doc;
QMap<QString, Qml::QmlIdSymbol*> _ids;
Qml::QmlSymbolFromFile *_currentSymbol;
QList<QmlJS::DiagnosticMessage> _diagnosticMessages;
};
} // namespace Internal
} // namespace Qml
#endif // QMLIDCOLLECTOR_H
+29 -13
View File
@@ -4,21 +4,37 @@ contains(CONFIG, dll) {
DEFINES += QML_BUILD_STATIC_LIB
}
INCLUDEPATH += $$PWD
include(parser/parser.pri)
include($$PWD/../../shared/qmljs/qmljs.pri)
DEPENDPATH += $$PWD
INCLUDEPATH += $$PWD/..
##contains(QT, gui) {
##HEADERS += \
## $$PWD/Nothing.h
##
##SOURCES += \
## $$PWD/Nothing.cpp
##}
HEADERS += \
$$PWD/qml_global.h \
$$PWD/qmlidcollector.h \
$$PWD/qmldocument.h \
$$PWD/qmlpackageinfo.h \
$$PWD/qmlsymbol.h \
$$PWD/qmlmetatypebackend.h \
$$PWD/qmltypesystem.h
#HEADERS += \
# $$PWD/qmlsymbol.h
SOURCES += \
$$PWD/qmlidcollector.cpp \
$$PWD/qmldocument.cpp \
$$PWD/qmlsymbol.cpp \
$$PWD/qmlpackageinfo.cpp \
$$PWD/qmlmetatypebackend.cpp \
$$PWD/qmltypesystem.cpp
#SOURCES += \
# $$PWD/qmlsymbol.cpp
contains(QT_CONFIG, declarative) {
QT += declarative
DEFINES += BUILD_DECLARATIVE_BACKEND
HEADERS += \
$$PWD/qtdeclarativemetatypebackend.h
SOURCES += \
$$PWD/qtdeclarativemetatypebackend.cpp
}
+43
View File
@@ -0,0 +1,43 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qmlmetatypebackend.h"
#include "qmltypesystem.h"
using namespace Qml;
QmlMetaTypeBackend::QmlMetaTypeBackend(QmlTypeSystem *typeSystem):
m_typeSystem(typeSystem)
{
Q_ASSERT(typeSystem);
}
QmlMetaTypeBackend::~QmlMetaTypeBackend()
{
}
+60
View File
@@ -0,0 +1,60 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLMETATYPEBACKEND_H
#define QMLMETATYPEBACKEND_H
#include <qmljs/qml_global.h>
#include <qmljs/qmlpackageinfo.h>
#include <qmljs/qmlsymbol.h>
namespace Qml {
class QmlTypeSystem;
class QML_EXPORT QmlMetaTypeBackend
{
public:
QmlMetaTypeBackend(QmlTypeSystem *typeSystem);
virtual ~QmlMetaTypeBackend() = 0;
virtual QList<QmlSymbol *> availableTypes(const QString &package, int majorVersion, int minorVersion) = 0;
virtual QmlSymbol *resolve(const QString &typeName, const QList<PackageInfo> &packages) = 0;
protected:
QmlTypeSystem *typeSystem() const
{ return m_typeSystem; }
private:
QmlTypeSystem *m_typeSystem;
};
} // namespace Qml
#endif // QMLMETATYPEBACKEND_H
+39
View File
@@ -0,0 +1,39 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qmlpackageinfo.h"
using namespace Qml;
PackageInfo::PackageInfo(const QString &name, int majorVersion, int minorVersion):
m_name(name),
m_majorVersion(majorVersion),
m_minorVersion(minorVersion)
{
}
+61
View File
@@ -0,0 +1,61 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef PACKAGEINFO_H
#define PACKAGEINFO_H
#include <qmljs/qml_global.h>
#include <QtCore/QString>
namespace Qml {
class QML_EXPORT PackageInfo
{
public:
PackageInfo(const QString &name, int majorVersion, int minorVersion);
QString name() const
{ return m_name; }
int majorVersion() const
{ return m_majorVersion; }
int minorVersion() const
{ return m_minorVersion; }
private:
QString m_name;
int m_majorVersion;
int m_minorVersion;
};
} // namespace Qml
#endif // PACKAGEINFO_H
+234
View File
@@ -0,0 +1,234 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qmlsymbol.h"
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/parser/qmljsengine_p.h>
using namespace Qml;
using namespace QmlJS;
using namespace QmlJS::AST;
QmlSymbol::~QmlSymbol()
{
}
bool QmlSymbol::isBuildInSymbol()
{ return asBuildInSymbol() != 0; }
bool QmlSymbol::isSymbolFromFile()
{ return asSymbolFromFile() != 0; }
bool QmlSymbol::isIdSymbol()
{ return asIdSymbol() != 0; }
bool QmlSymbol::isPropertyDefinitionSymbol()
{ return asPropertyDefinitionSymbol() != 0; }
QmlBuildInSymbol *QmlSymbol::asBuildInSymbol()
{ return 0; }
QmlSymbolFromFile *QmlSymbol::asSymbolFromFile()
{ return 0; }
QmlIdSymbol *QmlSymbol::asIdSymbol()
{ return 0; }
QmlPropertyDefinitionSymbol *QmlSymbol::asPropertyDefinitionSymbol()
{ return 0; }
QmlBuildInSymbol::~QmlBuildInSymbol()
{}
QmlBuildInSymbol *QmlBuildInSymbol::asBuildInSymbol()
{ return this; }
QmlSymbolWithMembers::~QmlSymbolWithMembers()
{ qDeleteAll(_members); }
const QmlSymbol::List QmlSymbolWithMembers::members()
{ return _members; }
QmlSymbolFromFile::QmlSymbolFromFile(const QString &fileName, QmlJS::AST::UiObjectMember *node):
_fileName(fileName),
_node(node)
{
if (UiObjectBinding *objectBinding = cast<UiObjectBinding*>(_node)) {
if (objectBinding->initializer)
for (UiObjectMemberList *iter = objectBinding->initializer->members; iter; iter = iter->next)
if (iter->member)
todo.append(iter->member);
} else if (UiObjectDefinition *objectDefinition = cast<UiObjectDefinition*>(_node)) {
if (objectDefinition->initializer)
for (UiObjectMemberList *iter = objectDefinition->initializer->members; iter; iter = iter->next)
if (iter->member)
todo.append(iter->member);
} else if (UiArrayBinding *arrayBinding = cast<UiArrayBinding*>(_node)) {
for (UiArrayMemberList *iter = arrayBinding->members; iter; iter = iter->next)
if (iter->member)
todo.append(iter->member);
}
}
QmlSymbolFromFile::~QmlSymbolFromFile()
{}
QmlSymbolFromFile *QmlSymbolFromFile::asSymbolFromFile()
{ return this; }
int QmlSymbolFromFile::line() const
{ return _node->firstSourceLocation().startLine; }
int QmlSymbolFromFile::column() const
{ return _node->firstSourceLocation().startColumn; }
static inline QString toString(UiQualifiedId *qId)
{
QString result;
for (UiQualifiedId *iter = qId; iter; iter = iter->next) {
if (!iter->name)
continue;
result += iter->name->asString();
if (iter->next)
result += '.';
}
return result;
}
const QString QmlSymbolFromFile::name() const
{
if (UiObjectBinding *objectBinding = cast<UiObjectBinding*>(_node))
return toString(objectBinding->qualifiedId);
else if (UiScriptBinding *scriptBinding = cast<UiScriptBinding*>(_node))
return toString(scriptBinding->qualifiedId);
else if (UiArrayBinding *arrayBinding = cast<UiArrayBinding*>(_node))
return toString(arrayBinding->qualifiedId);
else if (UiObjectDefinition *objectDefinition = cast<UiObjectDefinition*>(_node))
return toString(objectDefinition->qualifiedTypeNameId);
else
return QString::null;
}
const QmlSymbol::List QmlSymbolFromFile::members()
{
if (!todo.isEmpty()) {
foreach (Node *todoNode, todo) {
if (UiObjectBinding *objectBinding = cast<UiObjectBinding*>(todoNode))
_members.append(new QmlSymbolFromFile(fileName(), objectBinding));
else if (UiObjectDefinition *objectDefinition = cast<UiObjectDefinition*>(todoNode))
_members.append(new QmlSymbolFromFile(fileName(), objectDefinition));
else if (UiArrayBinding *arrayBinding = cast<UiArrayBinding*>(todoNode))
_members.append(new QmlSymbolFromFile(fileName(), arrayBinding));
else if (UiPublicMember *publicMember = cast<UiPublicMember*>(todoNode))
_members.append(new QmlPropertyDefinitionSymbol(fileName(), publicMember));
else if (UiScriptBinding *scriptBinding = cast<UiScriptBinding*>(todoNode)) {
if (scriptBinding->qualifiedId && scriptBinding->qualifiedId->name && scriptBinding->qualifiedId->name->asString() == QLatin1String("id") && !scriptBinding->qualifiedId->next)
_members.append(new QmlIdSymbol(fileName(), scriptBinding, this));
else
_members.append(new QmlSymbolFromFile(fileName(), scriptBinding));
}
}
todo.clear();
}
return _members;
}
bool QmlSymbolFromFile::isProperty() const
{ return cast<UiObjectDefinition*>(_node) == 0; }
QmlSymbolFromFile *QmlSymbolFromFile::findMember(QmlJS::AST::Node *memberNode)
{
List symbols = members();
foreach (QmlSymbol *symbol, symbols)
if (symbol->isSymbolFromFile())
if (memberNode == symbol->asSymbolFromFile()->node())
return symbol->asSymbolFromFile();
return 0;
}
QmlIdSymbol::QmlIdSymbol(const QString &fileName, QmlJS::AST::UiScriptBinding *idNode, QmlSymbolFromFile *parentNode):
QmlSymbolFromFile(fileName, idNode),
_parentNode(parentNode)
{}
QmlIdSymbol::~QmlIdSymbol()
{}
QmlIdSymbol *QmlIdSymbol::asIdSymbol()
{ return this; }
int QmlIdSymbol::line() const
{ return idNode()->statement->firstSourceLocation().startLine; }
int QmlIdSymbol::column() const
{ return idNode()->statement->firstSourceLocation().startColumn; }
const QString QmlIdSymbol::id() const
{
if (ExpressionStatement *e = cast<ExpressionStatement*>(idNode()->statement))
if (IdentifierExpression *i = cast<IdentifierExpression*>(e->expression))
if (i->name)
return i->name->asString();
return QString();
}
QmlJS::AST::UiScriptBinding *QmlIdSymbol::idNode() const
{ return cast<UiScriptBinding*>(node()); }
QmlPropertyDefinitionSymbol::QmlPropertyDefinitionSymbol(const QString &fileName, QmlJS::AST::UiPublicMember *propertyNode):
QmlSymbolFromFile(fileName, propertyNode)
{}
QmlPropertyDefinitionSymbol::~QmlPropertyDefinitionSymbol()
{}
QmlPropertyDefinitionSymbol *QmlPropertyDefinitionSymbol::asPropertyDefinitionSymbol()
{ return this; }
int QmlPropertyDefinitionSymbol::line() const
{ return propertyNode()->identifierToken.startLine; }
int QmlPropertyDefinitionSymbol::column() const
{ return propertyNode()->identifierToken.startColumn; }
QmlJS::AST::UiPublicMember *QmlPropertyDefinitionSymbol::propertyNode() const
{ return cast<UiPublicMember*>(node()); }
const QString QmlPropertyDefinitionSymbol::name() const
{ return propertyNode()->name->asString(); }
+163
View File
@@ -0,0 +1,163 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLSYMBOL_H
#define QMLSYMBOL_H
#include <qmljs/parser/qmljsastfwd_p.h>
#include <qmljs/qml_global.h>
#include <QList>
#include <QString>
namespace Qml {
class QML_EXPORT QmlSymbol
{
public:
typedef QList<QmlSymbol *> List;
public:
virtual ~QmlSymbol() = 0;
virtual const QString name() const = 0;
virtual const List members() = 0;
virtual bool isProperty() const = 0;
bool isBuildInSymbol();
bool isSymbolFromFile();
bool isIdSymbol();
bool isPropertyDefinitionSymbol();
virtual class QmlBuildInSymbol *asBuildInSymbol();
virtual class QmlSymbolFromFile *asSymbolFromFile();
virtual class QmlIdSymbol *asIdSymbol();
virtual class QmlPropertyDefinitionSymbol *asPropertyDefinitionSymbol();
};
class QML_EXPORT QmlBuildInSymbol: public QmlSymbol
{
public:
virtual ~QmlBuildInSymbol() = 0;
virtual QmlBuildInSymbol *asBuildInSymbol();
virtual QmlBuildInSymbol *type() const = 0;
using QmlSymbol::members;
virtual List members(bool includeBaseClassMembers) = 0;
};
class QML_EXPORT QmlSymbolWithMembers: public QmlSymbol
{
public:
virtual ~QmlSymbolWithMembers() = 0;
virtual const List members();
protected:
List _members;
};
class QML_EXPORT QmlSymbolFromFile: public QmlSymbolWithMembers
{
public:
QmlSymbolFromFile(const QString &fileName, QmlJS::AST::UiObjectMember *node);
virtual ~QmlSymbolFromFile();
virtual QmlSymbolFromFile *asSymbolFromFile();
QString fileName() const
{ return _fileName; }
virtual int line() const;
virtual int column() const;
QmlJS::AST::UiObjectMember *node() const
{ return _node; }
virtual const QString name() const;
virtual const List members();
virtual bool isProperty() const;
virtual QmlSymbolFromFile *findMember(QmlJS::AST::Node *memberNode);
private:
void fillTodo(QmlJS::AST::UiObjectMemberList *members);
private:
QString _fileName;
QmlJS::AST::UiObjectMember *_node;
QList<QmlJS::AST::Node*> todo;
};
class QML_EXPORT QmlIdSymbol: public QmlSymbolFromFile
{
public:
QmlIdSymbol(const QString &fileName, QmlJS::AST::UiScriptBinding *idNode, QmlSymbolFromFile *parentNode);
virtual ~QmlIdSymbol();
QmlIdSymbol *asIdSymbol();
virtual int line() const;
virtual int column() const;
QmlSymbolFromFile *parentNode() const
{ return _parentNode; }
virtual const QString name() const
{ return "id"; }
virtual const QString id() const;
private:
QmlJS::AST::UiScriptBinding *idNode() const;
private:
QmlSymbolFromFile *_parentNode;
};
class QML_EXPORT QmlPropertyDefinitionSymbol: public QmlSymbolFromFile
{
public:
QmlPropertyDefinitionSymbol(const QString &fileName, QmlJS::AST::UiPublicMember *propertyNode);
virtual ~QmlPropertyDefinitionSymbol();
QmlPropertyDefinitionSymbol *asPropertyDefinitionSymbol();
virtual int line() const;
virtual int column() const;
virtual const QString name() const;
private:
QmlJS::AST::UiPublicMember *propertyNode() const;
};
} // namespace Qml
#endif // QMLSYMBOL_H
+70
View File
@@ -0,0 +1,70 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qmlmetatypebackend.h"
#include "qmltypesystem.h"
#ifdef BUILD_DECLARATIVE_BACKEND
# include "qtdeclarativemetatypebackend.h"
#endif // BUILD_DECLARATIVE_BACKEND
#include <QDebug>
using namespace Qml;
QmlTypeSystem::QmlTypeSystem()
{
#ifdef BUILD_DECLARATIVE_BACKEND
backends.append(new Internal::QtDeclarativeMetaTypeBackend(this));
#endif // BUILD_DECLARATIVE_BACKEND
}
QmlTypeSystem::~QmlTypeSystem()
{
qDeleteAll(backends);
}
QList<QmlSymbol *> QmlTypeSystem::availableTypes(const QString &package, int majorVersion, int minorVersion)
{
QList<QmlSymbol *> results;
foreach (QmlMetaTypeBackend *backend, backends)
results.append(backend->availableTypes(package, majorVersion, minorVersion));
return results;
}
QmlSymbol *QmlTypeSystem::resolve(const QString &typeName, const QList<PackageInfo> &packages)
{
foreach (QmlMetaTypeBackend *backend, backends)
if (QmlSymbol *symbol = backend->resolve(typeName, packages))
return symbol;
return 0;
}
+61
View File
@@ -0,0 +1,61 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLTYPESYSTEM_H
#define QMLTYPESYSTEM_H
#include <qmljs/qml_global.h>
#include <qmljs/qmlpackageinfo.h>
#include <qmljs/qmlsymbol.h>
#include <QtCore/QList>
#include <QtCore/QObject>
namespace Qml {
class QmlMetaTypeBackend;
class QML_EXPORT QmlTypeSystem: public QObject
{
Q_OBJECT
public:
QmlTypeSystem();
virtual ~QmlTypeSystem();
QList<QmlSymbol *> availableTypes(const QString &package, int majorVersion, int minorVersion);
QmlSymbol *resolve(const QString &typeName, const QList<PackageInfo> &packages);
private:
QList<QmlMetaTypeBackend *> backends;
};
} // namespace Qml
#endif // QMLTYPESYSTEM_H
@@ -0,0 +1,181 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qtdeclarativemetatypebackend.h"
#include <QDebug>
namespace Qml {
namespace Internal {
class QmlDeclarativeSymbol: public QmlBuildInSymbol
{
public:
virtual ~QmlDeclarativeSymbol()
{}
protected:
QmlDeclarativeSymbol(QtDeclarativeMetaTypeBackend* backend):
m_backend(backend)
{ Q_ASSERT(backend); }
QtDeclarativeMetaTypeBackend* backend() const
{ return m_backend; }
private:
QtDeclarativeMetaTypeBackend* m_backend;
};
class QmlDeclarativeObjectSymbol: public QmlDeclarativeSymbol
{
QmlDeclarativeObjectSymbol(const QmlDeclarativeObjectSymbol &);
QmlDeclarativeObjectSymbol &operator=(const QmlDeclarativeObjectSymbol &);
public:
QmlDeclarativeObjectSymbol(QtDeclarativeMetaTypeBackend* backend):
QmlDeclarativeSymbol(backend)
{
}
virtual ~QmlDeclarativeObjectSymbol()
{ qDeleteAll(m_members); }
virtual const QString name() const
{ return m_name; }
virtual QmlBuildInSymbol *type() const
{ return 0; }
virtual const List members()
{
return m_members;
}
virtual List members(bool includeBaseClassMembers)
{
List result = members();
return result;
}
virtual bool isProperty() const
{ return false; }
public:
static QString key(const QString &typeNameWithPackage, int majorVersion, int minorVersion)
{
return QString(typeNameWithPackage)
+ QLatin1Char('@')
+ QString::number(majorVersion)
+ QLatin1Char('.')
+ QString::number(minorVersion);
}
static QString key(const QString &packageName, const QString &typeName, int majorVersion, int minorVersion)
{
return packageName
+ QLatin1Char('/')
+ typeName
+ QLatin1Char('@')
+ QString::number(majorVersion)
+ QLatin1Char('.')
+ QString::number(minorVersion);
}
private:
QString m_name;
bool m_membersToBeDone;
List m_members;
};
class QmlDeclarativePropertySymbol: public QmlDeclarativeSymbol
{
QmlDeclarativePropertySymbol(const QmlDeclarativePropertySymbol &);
QmlDeclarativePropertySymbol &operator=(const QmlDeclarativePropertySymbol &);
public:
QmlDeclarativePropertySymbol(QtDeclarativeMetaTypeBackend* backend):
QmlDeclarativeSymbol(backend)
{
}
virtual ~QmlDeclarativePropertySymbol()
{}
virtual const QString name() const
{ return QString(); }
virtual QmlBuildInSymbol *type() const
{ return 0; }
virtual const List members()
{
return List();
}
virtual List members(bool /*includeBaseClassMembers*/)
{
return members();
}
virtual bool isProperty() const
{ return true; }
private:
};
} // namespace Internal
} // namespace Qml
using namespace Qml;
using namespace Qml::Internal;
QtDeclarativeMetaTypeBackend::QtDeclarativeMetaTypeBackend(QmlTypeSystem *typeSystem):
QmlMetaTypeBackend(typeSystem)
{
}
QtDeclarativeMetaTypeBackend::~QtDeclarativeMetaTypeBackend()
{
}
QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::availableTypes(const QString &package, int majorVersion, int minorVersion)
{
QList<QmlSymbol *> result;
return result;
}
QmlSymbol *QtDeclarativeMetaTypeBackend::resolve(const QString &typeName, const QList<PackageInfo> &packages)
{
QList<QmlSymbol *> result;
return 0;
}
@@ -0,0 +1,72 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QTDECLARATIVEMETATYPEBACKEND_H
#define QTDECLARATIVEMETATYPEBACKEND_H
#include <qmljs/qmlmetatypebackend.h>
#include <QtCore/QList>
namespace Qml {
namespace Internal {
class QmlDeclarativeSymbol;
class QmlDeclarativeObjectSymbol;
class QmlDeclarativePropertySymbol;
class QtDeclarativeMetaTypeBackend: public QmlMetaTypeBackend
{
friend class QmlDeclarativeSymbol;
friend class QmlDeclarativeObjectSymbol;
friend class QmlDeclarativePropertySymbol;
public:
QtDeclarativeMetaTypeBackend(QmlTypeSystem *typeSystem);
~QtDeclarativeMetaTypeBackend();
virtual QList<QmlSymbol *> availableTypes(const QString &package, int majorVersion, int minorVersion);
virtual QmlSymbol *resolve(const QString &typeName, const QList<PackageInfo> &packages);
protected:
// QList<QmlSymbol *> members(const Qml::NodeMetaInfo &metaInfo);
// QList<QmlSymbol *> inheritedMembers(const Qml::NodeMetaInfo &metaInfo);
// QmlDeclarativeSymbol *typeOf(const Qml::PropertyMetaInfo &metaInfo);
private:
// QmlDeclarativeSymbol *getSymbol(const Qml::NodeMetaInfo &metaInfo);
private:
// QMap<QString, QmlDeclarativeSymbol*> m_symbols;
};
} // namespace Internal
} // namespace Qml
#endif // QTDECLARATIVEMETATYPEBACKEND_H