diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-01-26 14:53:11 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-01-26 14:55:33 +0100 |
commit | ab8c19f2f8c208fdfd5eabc296c6c192c13272a4 (patch) | |
tree | bf7f1349625de125f78057c81d9bd81ce8dd7c37 /src/libs/qmljs/qmljscheck.h | |
parent | 1e6a0523a141922bd59a5b04477a51b462d0f278 (diff) | |
download | qt-creator-ab8c19f2f8c208fdfd5eabc296c6c192c13272a4.tar.gz |
Some initial work on the type checker for QML/JS.
Diffstat (limited to 'src/libs/qmljs/qmljscheck.h')
-rw-r--r-- | src/libs/qmljs/qmljscheck.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljscheck.h b/src/libs/qmljs/qmljscheck.h index 2d7352f151..6864de4f8c 100644 --- a/src/libs/qmljs/qmljscheck.h +++ b/src/libs/qmljs/qmljscheck.h @@ -35,17 +35,29 @@ namespace QmlJS { +namespace Interpreter { + class Engine; + class Value; + class ObjectValue; + class FunctionValue; +} // end of namespace Interpreter + class QMLJS_EXPORT Check: protected AST::Visitor { public: - Check(); + Check(Interpreter::Engine *engine); virtual ~Check(); - void operator()(QmlJS::Document::Ptr doc); + const Interpreter::Value *operator()(AST::ExpressionNode *ast, const Interpreter::ObjectValue *scope); + const Interpreter::Value *check(AST::ExpressionNode *ast); protected: void accept(AST::Node *node); + Interpreter::Engine *switchEngine(Interpreter::Engine *engine); + const Interpreter::Value *switchResult(const Interpreter::Value *result); + const Interpreter::ObjectValue *switchScope(const Interpreter::ObjectValue *scope); + // Ui virtual bool visit(AST::UiProgram *ast); virtual bool visit(AST::UiImportList *ast); @@ -142,6 +154,9 @@ protected: private: QmlJS::Document::Ptr _doc; + Interpreter::Engine *_engine; + const Interpreter::ObjectValue *_scope; + const Interpreter::Value *_result; }; } // end of namespace Qml |