diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-07-15 22:30:14 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-07-15 22:30:14 (GMT) |
commit | 50f400ac20e918db1d0a6496003d953dedaba42a (patch) | |
tree | b1e03e544c0fd09f2070c5ebb95bd291b7dc39b2 /src/declarative/qml/parser/qmljsparser_p.h | |
parent | fe591031a8550a8a8c97fa08f0bdf8c2f9d4cf93 (diff) | |
parent | bcae9d84fb5dd2bdc5a5298c8841702505a02867 (diff) | |
download | Qt-50f400ac20e918db1d0a6496003d953dedaba42a.zip Qt-50f400ac20e918db1d0a6496003d953dedaba42a.tar.gz Qt-50f400ac20e918db1d0a6496003d953dedaba42a.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/parser/qmljsparser_p.h')
-rw-r--r-- | src/declarative/qml/parser/qmljsparser_p.h | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/src/declarative/qml/parser/qmljsparser_p.h b/src/declarative/qml/parser/qmljsparser_p.h index e4ca20a..9273039 100644 --- a/src/declarative/qml/parser/qmljsparser_p.h +++ b/src/declarative/qml/parser/qmljsparser_p.h @@ -1,7 +1,5 @@ // This file was generated by qlalr - DO NOT EDIT! -#line 148 "qmljs.g" - /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). @@ -128,10 +126,29 @@ public: Parser(Engine *engine); ~Parser(); - bool parse(); + // 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); } + + AST::UiProgram *ast() const + { return AST::cast<AST::UiProgram *>(program); } + + AST::Statement *statement() const + { + if (! program) + return 0; - AST::UiProgram *ast() - { return program; } + return program->statementCast(); + } + + AST::ExpressionNode *expression() const + { + if (! program) + return 0; + + return program->expressionCast(); + } QList<DiagnosticMessage> diagnosticMessages() const { return diagnostic_messages; } @@ -156,6 +173,8 @@ public: { return diagnosticMessage().loc.startColumn; } protected: + bool parse(int startToken); + void reallocateStack(); inline Value &sym(int index) @@ -174,7 +193,7 @@ protected: int *state_stack; AST::SourceLocation *location_stack; - AST::UiProgram *program; + AST::Node *program; // error recovery enum { TOKEN_BUFFER_SIZE = 3 }; @@ -200,15 +219,9 @@ protected: -#line 1015 "qmljs.g" - -#define J_SCRIPT_REGEXPLITERAL_RULE1 69 - -#line 1032 "qmljs.g" - -#define J_SCRIPT_REGEXPLITERAL_RULE2 70 +#define J_SCRIPT_REGEXPLITERAL_RULE1 72 -#line 2994 "qmljs.g" +#define J_SCRIPT_REGEXPLITERAL_RULE2 73 QT_END_NAMESPACE |