summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/parser/qmljsparser_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/parser/qmljsparser_p.h')
-rw-r--r--src/declarative/qml/parser/qmljsparser_p.h41
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