42 #include <QtCore/QtDebug> 43 #include <QtGui/QApplication> 47 #include "private/qdeclarativejsengine_p.h" 48 #include "private/qdeclarativejslexer_p.h" 49 #include "private/qdeclarativejsast_p.h" 50 #include "private/qdeclarativejsnodepool_p.h" 54 #include "private/qdeclarativejsparser_p.h" 55 #include <QVarLengthArray> 125 locations.
append(m->identifierToken);
134 for (
int i = nameIds.
size() - 1; i != -1; --i) {
135 currentId = makeAstNode<AST::UiQualifiedId>(
driver->
nodePool(), currentId, nameIds[i]);
139 return currentId->
finish();
148 bool hadErrors =
false;
170 yytoken = lexer->
lex();
191 }
else if (action < 0) {
192 const int r = -action - 1;
273 node = makeAstNode<AST::UiImport>(
driver->
nodePool(), importIdLiteral->value);
276 node = makeAstNode<AST::UiImport>(
driver->
nodePool(), qualifiedId);
286 QLatin1String(
"Expected a qualified name id or a string literal")));
364 case 34:
case 35:
case 36:
case 37:
500 propertyName->
next = 0;
522 propertyName->
next = 0;
682 node->rbraceToken =
loc(3);
1783 }
while (action != 0);
1809 action = errorState;
1824 if (
t_action(errorState, yytoken)) {
1828 msg =
qApp->translate(
"QDeclarativeParser",
"Syntax error");
1833 action = errorState;
1837 static int tokens[] = {
1855 for (
int *tk = tokens; *tk !=
EOF_SYMBOL; ++tk) {
1857 if (a > 0 &&
t_action(a, yytoken)) {
1869 action = errorState;
1881 if (a > 0 &&
t_action(a, yytoken)) {
1890 action = errorState;
1895 const QString msg =
qApp->translate(
"QDeclarativeParser",
"Syntax error");
QString errorMessage() const
enum QDeclarativeJS::AST::UiPublicMember::@102 type
static bool automatic(Engine *driver, int token)
SourceLocation identifierToken
AST::ElementList * ElementList
SourceLocation rparenToken
QList< DiagnosticMessage > diagnostic_messages
SourceLocation lbracketToken
SourceLocation rparenToken
SourceLocation commaToken
int characterCount() const
UiArrayMemberList * finish()
SourceLocation literalToken
SourceLocation falseToken
SourceLocation decrementToken
SourceLocation rbraceToken
SourceLocation rparenToken
AST::UiArrayMemberList * UiArrayMemberList
#define it(className, varName)
SourceLocation identifierToken
SourceLocation lparenToken
AST::VariableDeclarationList * VariableDeclarationList
SourceLocation lbracketToken
SourceLocation semicolonToken
UiParameterList * finish()
Q_CORE_EXPORT void qFree(void *ptr)
AST::UiQualifiedId * UiQualifiedId
AST::CaseClause * CaseClause
AST::FunctionBody * FunctionBody
SourceLocation semicolonToken
SourceLocation identifierToken
SourceLocation identifierToken
NameId * intern(const QChar *u, int s)
int length() const
Returns the number of characters in this string.
SourceLocation colonToken
static AST::SourceLocation location(Lexer *lexer)
SourceLocation lparenToken
SourceLocation lbracketToken
SourceLocation finallyToken
SourceLocation switchToken
SourceLocation lparenToken
SourceLocation identifierToken
SourceLocation colonToken
SourceLocation lparenToken
SourceLocation firstSemicolonToken
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
AST::VariableDeclaration * VariableDeclaration
long ASN1_INTEGER_get ASN1_INTEGER * a
SourceLocation continueToken
SourceLocation rbraceToken
AST::SourceLocation * location_stack
Q_CORE_EXPORT void * qRealloc(void *ptr, size_t size)
SourceLocation literalToken
AST::UiProgram * UiProgram
SourceLocation lbraceToken
SourceLocation importToken
AST::FunctionDeclaration * FunctionDeclaration
SourceLocation lparenToken
SourceLocation importIdToken
The QString class provides a Unicode character string.
SourceLocation commaToken
SourceLocation identifierToken
SourceLocation whileToken
SourceLocation incrementToken
AST::SourceElements * SourceElements
UiObjectMemberList * finish()
SourceLocation literalToken
SourceLocation rparenToken
SourceLocation rbracketToken
SourceLocation semicolonToken
SourceLocation catchToken
SourceLocation defaultToken
SourceLocation rparenToken
SourceLocation debuggerToken
AST::SourceLocation yylloc
SourceLocation lparenToken
SourceLocation lparenToken
bool scanRegExp(RegExpBodyPrefix prefix=NoPrefix)
SourceLocation identifierToken
SourceLocation commaToken
SourceLocation throwToken
SourceLocation semicolonToken
SourceLocation commaToken
SourceLocation secondSemicolonToken
SourceLocation rparenToken
SourceLocation colonToken
static const char *const spell[]
AST::StatementList * StatementList
const QChar * characterBuffer() const
SourceLocation semicolonToken
SourceLocation colonToken
SourceLocation secondSemicolonToken
SourceLocation semicolonToken
SourceLocation lparenToken
PropertyNameAndValueList * finish()
SourceLocation rparenToken
SourceLocation incrementToken
NodePool * nodePool() const
SourceLocation firstSemicolonToken
SourceLocation breakToken
AST::UiObjectInitializer * UiObjectInitializer
AST::CaseBlock * CaseBlock
SourceLocation typeofToken
AST::FormalParameterList * FormalParameterList
#define QT_QML_END_NAMESPACE
SourceLocation lbraceToken
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
SourceLocation readonlyToken
SourceLocation colonToken
SourceLocation typeModifierToken
SourceLocation lbraceToken
SourceLocation rparenToken
#define QT_QML_BEGIN_NAMESPACE
SourceLocation identifierToken
SourceLocation propertyNameToken
SourceLocation lparenToken
SourceLocation rbraceToken
SourceLocation identifierToken
SourceLocation lparenToken
SourceLocation colonToken
int startColumnNo() const
static int nt_action(int state, int nt)
SourceLocation commaToken
SourceLocation propertyToken
SourceLocation questionToken
SourceLocation fileNameToken
SourceLocation rbracketToken
AST::DefaultClause * DefaultClause
SourceLocation semicolonToken
static int t_action(int state, int token)
SourceLocation returnToken
SourceLocation defaultToken
SourceLocation rbraceToken
SourceLocation commaToken
SourceLocation rparenToken
SourceLocation semicolonToken
SourceLocation operatorToken
AST::ExpressionNode * Expression
SourceLocation lbraceToken
SourceLocation rparenToken
SourceLocation commaToken
AST::UiQualifiedId * reparseAsQualifiedId(AST::ExpressionNode *expr)
AST::ArgumentList * ArgumentList
SourceLocation semicolonToken
SourceLocation minusToken
SourceLocation commaToken
AST::UiParameterList * UiParameterList
SourceLocation declarationKindToken
AST::UiImportList * UiImportList
AST::CaseClauses * CaseClauses
SourceLocation semicolonToken
SourceLocation rparenToken
SourceLocation identifierToken
SourceLocation whileToken
AST::SourceLocation yyprevlloc
SourceLocation colonToken
SourceLocation identifierToken
AST::PropertyName * PropertyName
SourceLocation rbraceToken
SourceLocation deleteToken
SavedToken token_buffer[TOKEN_BUFFER_SIZE]
SourceLocation lparenToken
SourceLocation decrementToken
SourceLocation lparenToken
bool prevTerminator() const
SourceLocation tildeToken
AST::UiObjectMemberList * UiObjectMemberList
SourceLocation rbracketToken
SourceLocation commaToken
SourceLocation rparenToken
static const short action_index[]
SourceLocation lparenToken
SourceLocation functionToken
SourceLocation colonToken
SourceElements * finish()
AST::SourceLocation & loc(int index)
VariableDeclarationList * finish(bool readOnly)
SourceLocation versionToken
const QChar * constData() const
Returns a pointer to the data stored in the QString.
AST::PropertyNameAndValueList * PropertyNameAndValueList
AST::SourceElement * SourceElement
UiParameterList * parameters
SourceLocation lbraceToken
SourceLocation rparenToken
SourceLocation lparenToken
AST::UiObjectMember * UiObjectMember
AST::Statement * Statement
SourceLocation rparenToken
SourceLocation semicolonToken
SourceLocation colonToken