Changeset View
Changeset View
Standalone View
Standalone View
src/qmljsc/codegeneration/codegeneratorforqml.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Qml.js Compiler - a QML to JS compiler bringing QML's power to the web. | ||||
3 | * | ||||
4 | * Copyright (C) 2015 Jan Marker <jan@jangmarker.de> | ||||
5 | * | ||||
6 | * This program is free software: you can redistribute it and/or modify | ||||
7 | * it under the terms of the GNU General Public License as published by | ||||
8 | * the Free Software Foundation, either version 3 of the License, or | ||||
9 | * (at your option) any later version. | ||||
10 | * | ||||
11 | * This program is distributed in the hope that it will be useful, | ||||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
14 | * GNU General Public License for more details. | ||||
15 | * | ||||
16 | * You should have received a copy of the GNU General Public License | ||||
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
18 | * | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef QMLWEB_CODEGENERATORPASS_H | ||||
22 | #define QMLWEB_CODEGENERATORPASS_H | ||||
23 | | ||||
24 | #include <QStack> | ||||
25 | | ||||
26 | #include "../compilerpass.h" | ||||
27 | #include "../ir/visitor.h" | ||||
28 | | ||||
29 | namespace QmlJSc { | ||||
30 | | ||||
31 | class PureJavaScriptGenerator; | ||||
32 | | ||||
33 | class CodeGeneratorForQml : IR::Visitor { | ||||
34 | public: | ||||
35 | explicit CodeGeneratorForQml(); | ||||
36 | virtual ~CodeGeneratorForQml(); | ||||
37 | | ||||
38 | QString getGeneratedCode(); | ||||
39 | | ||||
40 | void endVisit(IR::File *file) override; | ||||
41 | void endVisit(IR::Import *import) override; | ||||
42 | void endVisit(IR::ObjectSpec *object) override; | ||||
43 | void endVisit(IR::Property *property) override; | ||||
44 | void endVisit(IR::Method *method) override; | ||||
45 | void endVisit(IR::Signal *signal) override; | ||||
46 | void endVisit(IR::ValueAssignment *valueAssignment) override; | ||||
47 | void endVisit(IR::SignalHandler *signalHandler) override; | ||||
48 | | ||||
49 | private: | ||||
50 | friend class TestCodeGeneratorForQml; | ||||
51 | | ||||
52 | PureJavaScriptGenerator *m_jsGenerator; | ||||
53 | QStack<QString> m_outputStack; | ||||
54 | }; | ||||
55 | | ||||
56 | } // namespace QmlJSc | ||||
57 | | ||||
58 | #endif //QMLWEB_CODEGENERATORPASS_H |