| 
									
										
										
										
											2010-01-28 14:53:53 +01:00
										 |  |  | #ifndef QMLJSLINK_H
 | 
					
						
							|  |  |  | #define QMLJSLINK_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  | #include <qmljs/qmljsdocument.h>
 | 
					
						
							|  |  |  | #include <qmljs/qmljsbind.h>
 | 
					
						
							| 
									
										
										
										
											2010-01-28 14:53:53 +01:00
										 |  |  | #include <qmljs/qmljsinterpreter.h>
 | 
					
						
							|  |  |  | #include <qmljs/parser/qmljsastfwd_p.h>
 | 
					
						
							|  |  |  | #include <qmljs/parser/qmljsengine_p.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QtCore/QList>
 | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  | #include <QtCore/QHash>
 | 
					
						
							| 
									
										
										
										
											2010-01-28 14:53:53 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace QmlJS { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |     Temporarily links a set of bound documents together to allow resolving cross-document | 
					
						
							|  |  |  |     dependencies. The link is undone when this object is destoyed. | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | class QMLJS_EXPORT Link | 
					
						
							| 
									
										
										
										
											2010-01-28 14:53:53 +01:00
										 |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  |     // Link all documents in snapshot reachable from doc.
 | 
					
						
							|  |  |  |     Link(Document::Ptr doc, const Snapshot &snapshot, Interpreter::Engine *interp); | 
					
						
							|  |  |  |     ~Link(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-03 10:24:25 +01:00
										 |  |  |     Interpreter::Context *context(); | 
					
						
							| 
									
										
										
										
											2010-02-03 10:59:52 +01:00
										 |  |  |     Interpreter::Engine *engine(); | 
					
						
							| 
									
										
										
										
											2010-02-03 10:24:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  |     // Get the scope chain for the currentObject inside doc.
 | 
					
						
							| 
									
										
										
										
											2010-02-03 10:59:52 +01:00
										 |  |  |     void scopeChainAt(Document::Ptr doc, AST::Node *currentObject); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-28 14:53:53 +01:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  |     static QList<Document::Ptr> reachableDocuments(Document::Ptr startDoc, const Snapshot &snapshot); | 
					
						
							| 
									
										
										
										
											2010-02-02 17:06:48 +01:00
										 |  |  |     static AST::UiQualifiedId *qualifiedTypeNameId(AST::Node *node); | 
					
						
							| 
									
										
										
										
											2010-01-28 14:53:53 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  |     void linkImports(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void populateImportedTypes(Interpreter::ObjectValue *typeEnv, Document::Ptr doc); | 
					
						
							|  |  |  |     void importFile(Interpreter::ObjectValue *typeEnv, Document::Ptr doc, | 
					
						
							|  |  |  |                     AST::UiImport *import, const QString &startPath); | 
					
						
							|  |  |  |     void importNonFile(Interpreter::ObjectValue *typeEnv, Document::Ptr doc, | 
					
						
							|  |  |  |                        AST::UiImport *import); | 
					
						
							| 
									
										
										
										
											2010-02-03 15:59:15 +01:00
										 |  |  |     void importObject(Bind *bind, const QString &name, Interpreter::ObjectValue *object, NameId *targetNamespace); | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     Snapshot _snapshot; | 
					
						
							| 
									
										
										
										
											2010-02-03 10:24:25 +01:00
										 |  |  |     Interpreter::Context _context; | 
					
						
							| 
									
										
										
										
											2010-02-02 15:55:17 +01:00
										 |  |  |     QList<Document::Ptr> _docs; | 
					
						
							| 
									
										
										
										
											2010-01-28 14:53:53 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace QmlJS
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // QMLJSLINK_H
 |