12 |
13 |
14 |
--------------------------------------------------------------------------------
/generator/typesystem_xmlpatterns-qtscript.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/generator/typesystem_webkit-qtscript.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/TwoWayButton.qs:
--------------------------------------------------------------------------------
1 | var button = new QPushButton();
2 |
3 | var off = new QState();
4 | off.assignProperty(button, "text", "Off");
5 |
6 | var on = new QState();
7 | on.assignProperty(button, "text", "On");
8 |
9 | off.addTransition(button, "clicked()", on);
10 | on.addTransition(button, "clicked()", off);
11 |
12 | var machine = new QStateMachine();
13 | machine.addState(off);
14 | machine.addState(on);
15 | machine.initialState = off;
16 |
17 | machine.start();
18 | button.resize(100, 100);
19 | button.show();
20 |
21 | QCoreApplication.exec();
22 |
--------------------------------------------------------------------------------
/generator/parser/rpp/pp-qt-configuration:
--------------------------------------------------------------------------------
1 | #define __cplusplus 1
2 |
3 | #define __STDC__
4 |
5 | // Qt
6 | #define QOBJECTDEFS_H
7 |
8 | // not yet supported
9 | #define Q_SLOTS slots
10 | #define Q_SIGNALS signals
11 | #define Q_FLAGS(a)
12 | #define Q_PRIVATE_SLOT(a, b)
13 | #define Q_DECLARE_INTERFACE(a,b)
14 | #define Q_INTERFACES(a)
15 | #define Q_GADGET
16 | #define Q_OVERRIDE(a)
17 | #define Q_OS_OS2
18 | #define Q_NO_USING_KEYWORD
19 |
20 | // There are symbols in Qt that exist in Debug but
21 | // not in release
22 | #define QT_NO_DEBUG
23 |
24 | #define QT_JAMBI_RUN
25 |
--------------------------------------------------------------------------------
/generator/parser/rpp/rpp.pri:
--------------------------------------------------------------------------------
1 | SOURCES += \
2 | $$RXXPATH/rpp/preprocessor.cpp
3 |
4 | HEADERS += \
5 | $$RXXPATH/rpp/pp-cctype.h \
6 | $$RXXPATH/rpp/pp-engine-bits.h \
7 | $$RXXPATH/rpp/pp-engine.h \
8 | $$RXXPATH/rpp/pp-environment.h \
9 | $$RXXPATH/rpp/pp-fwd.h \
10 | $$RXXPATH/rpp/pp-internal.h \
11 | $$RXXPATH/rpp/pp-iterator.h \
12 | $$RXXPATH/rpp/pp-macro-expander.h \
13 | $$RXXPATH/rpp/pp-macro.h \
14 | $$RXXPATH/rpp/pp-scanner.h \
15 | $$RXXPATH/rpp/pp-string.h \
16 | $$RXXPATH/rpp/pp-symbol.h \
17 | $$RXXPATH/rpp/pp.h \
18 | $$RXXPATH/rpp/preprocessor.h
19 |
20 | INCLUDEPATH += $$PWD $$RXXPATH/rpp
21 |
--------------------------------------------------------------------------------
/generator/parser/r++.macros:
--------------------------------------------------------------------------------
1 |
2 | #define __attribute__(a...)
3 | #define __typeof__ __typeof
4 |
5 | #define __extension
6 | #define __extension__
7 |
8 | #define __restrict
9 | #define __restrict__
10 |
11 | #define __volatile volatile
12 | #define __volatile__ volatile
13 |
14 | #define __inline inline
15 | #define __inline__ inline
16 |
17 | #define __const const
18 | #define __const__ const
19 |
20 | #define __asm asm
21 | #define __asm__ asm
22 |
23 | #define __GNUC__ 3
24 | //#define __GNUC_MINOR__ 4
25 |
26 | #define __ROBC__ 0
27 | #define __ROBC_MINOR__ 1
28 |
29 |
--------------------------------------------------------------------------------
/generator/generator.pro:
--------------------------------------------------------------------------------
1 | include(generator.pri)
2 |
3 | # Input
4 | HEADERS += \
5 | generatorsetqtscript.h \
6 | metaqtscriptbuilder.h \
7 | metaqtscript.h \
8 | classgenerator.h \
9 | shellgenerator.h \
10 | shellimplgenerator.h \
11 | shellheadergenerator.h \
12 | setupgenerator.h \
13 | docgenerator.h
14 |
15 | SOURCES += \
16 | generatorsetqtscript.cpp \
17 | metaqtscriptbuilder.cpp \
18 | metaqtscript.cpp \
19 | classgenerator.cpp \
20 | shellgenerator.cpp \
21 | shellimplgenerator.cpp \
22 | shellheadergenerator.cpp \
23 | setupgenerator.cpp \
24 | docgenerator.cpp
25 |
26 | CONFIG -= debug
27 | CONFIG += release
28 |
--------------------------------------------------------------------------------
/generator/build_all.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/generator/generator.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | qtscript_masterinclude.h
4 | build_all.txt
5 | typesystem_core.xml
6 | typesystem_gui.xml
7 | typesystem_sql.xml
8 | typesystem_opengl.xml
9 | typesystem_svg.xml
10 | typesystem_network.xml
11 | typesystem_xml.xml
12 | typesystem_phonon.xml
13 | typesystem_webkit.xml
14 | typesystem_xmlpatterns.xml
15 | parser/rpp/pp-qt-configuration
16 |
17 |
18 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | Qt Script Generator labs package, version 0.2
2 |
3 |
4 | The Qt Script Generator is a tool that generates Qt bindings for Qt Script.
5 |
6 | ---
7 |
8 | Instructions:
9 |
10 | 1) Build the generator: cd path/to/this/project/generator, qmake && make
11 |
12 | 2) Run the generator (without arguments)
13 | This will generate C++ files in path/to/this/project/generated_cpp
14 | and documentation in path/to/this/project/doc
15 |
16 | 3) Build the bindings plugins: cd path/to/this/project/qtbindings, qmake && make
17 | The plugins will be put under path/to/this/project/plugins
18 |
19 | 4) To use the plugins in your application, add the plugins path to the library paths
20 | (QCoreApplication::setLibraryPaths()), then call QScriptEngine::importExtension()
21 | (plugin keys are "qt.core", "qt.gui", etc).
22 |
23 | There is a simple script interpreter / launcher in path/to/this/project/qtbindings/qs_eval
24 | that imports all the bindings. You can use it to run the examples found in
25 | path/to/this/project/examples. E.g., with the examples directory being the working directory:
26 |
27 | ../qtbindings/qs_eval/qs_eval CollidingMice.js
28 |
29 |
30 | See the generated doc/index.html for more information.
31 |
32 | Have fun!
33 |
--------------------------------------------------------------------------------
/LGPL_EXCEPTION.txt:
--------------------------------------------------------------------------------
1 | Nokia Qt LGPL Exception version 1.1
2 |
3 | As an additional permission to the GNU Lesser General Public License version
4 | 2.1, the object code form of a "work that uses the Library" may incorporate
5 | material from a header file that is part of the Library. You may distribute
6 | such object code under terms of your choice, provided that:
7 | (i) the header files of the Library have not been modified; and
8 | (ii) the incorporated material is limited to numerical parameters, data
9 | structure layouts, accessors, macros, inline functions and
10 | templates; and
11 | (iii) you comply with the terms of Section 6 of the GNU Lesser General
12 | Public License version 2.1.
13 |
14 | Moreover, you may apply this exception to a modified version of the Library,
15 | provided that such modification does not involve copying material from the
16 | Library into the modified Library's header files unless such material is
17 | limited to (i) numerical parameters; (ii) data structure layouts;
18 | (iii) accessors; and (iv) small macros, templates and inline functions of
19 | five lines or less in length.
20 |
21 | Furthermore, you are not required to apply this additional permission to a
22 | modified version of the Library.
23 |
--------------------------------------------------------------------------------
/generator/generate.sh:
--------------------------------------------------------------------------------
1 | xsltproc --stringparam source $PWD/typesystem_core-qtscript.xml merge.xsl typesystem_core-common.xml > typesystem_core.xml
2 |
3 | xsltproc --stringparam source $PWD/typesystem_gui-qtscript.xml merge.xsl typesystem_gui-common.xml > typesystem_gui.xml
4 |
5 | xsltproc --stringparam source $PWD/typesystem_svg-qtscript.xml merge.xsl typesystem_svg-common.xml > typesystem_svg.xml
6 |
7 | xsltproc --stringparam source $PWD/typesystem_network-qtscript.xml merge.xsl typesystem_network-common.xml > typesystem_network.xml
8 |
9 | xsltproc --stringparam source $PWD/typesystem_opengl-qtscript.xml merge.xsl typesystem_opengl-common.xml > typesystem_opengl.xml
10 |
11 | xsltproc --stringparam source $PWD/typesystem_xml-qtscript.xml merge.xsl typesystem_xml-common.xml > typesystem_xml.xml
12 |
13 | xsltproc --stringparam source $PWD/typesystem_sql-qtscript.xml merge.xsl typesystem_sql-common.xml > typesystem_sql.xml
14 |
15 | xsltproc --stringparam source $PWD/typesystem_phonon-qtscript.xml merge.xsl typesystem_phonon-common.xml > typesystem_phonon.xml
16 |
17 | xsltproc --stringparam source $PWD/typesystem_webkit-qtscript.xml merge.xsl typesystem_webkit-common.xml > typesystem_webkit.xml
18 |
19 | xsltproc --stringparam source $PWD/typesystem_xmlpatterns-qtscript.xml merge.xsl typesystem_xmlpatterns-common.xml > typesystem_xmlpatterns.xml
20 |
21 | # ./generator qtscript_masterinclude.h typesystem_core.xml --diff
22 |
--------------------------------------------------------------------------------
/generator/typesystem_xml-qtscript.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | QTextStream & %out% = *qscriptvalue_cast<QTextStream*>(%in%);
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | QTextStream & %out% = *qscriptvalue_cast<QTextStream*>(%in%);
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/generator/typesystem_svg-common.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/tools/qsexec/README.TXT:
--------------------------------------------------------------------------------
1 | Runs QtScript code from the command line.
2 |
3 | USAGE
4 | -----
5 | qsexec
6 | Runs QtScript in interactive mode, i.e. presents a prompt and executes
7 | commands as given.
8 | qsexec FILE [ARGS ...]
9 | Runs the script in FILE with the given command line arguments
10 | (see SCRIPT EXTENSIONS below).
11 | qsexec -f FILE1 [FILE2 ...]
12 | Runs all the scripts FILE1 FILE2 ... consecutively sharing the same engine.
13 |
14 | SCRIPT EXTENSIONS
15 | -----------------
16 | The qsexec tool adds some useful functionality to the global object:
17 |
18 | - qs.system.os
19 | A string that specifies the operating system the script is run on
20 | (e.g. "linux", "windows", "mac").
21 | - qs.script.args
22 | Array containing the strings given as [args ...] on the command line
23 | (single file mode only).
24 | - qs.script.absoluteFilePath
25 | File system path (including the file name) of the script that is processed
26 | at the moment as a string.
27 | - qs.script.absolutePath
28 | File system path (excluding the file name) of the script that is processed
29 | at the moment as a string.
30 | - qs.script.importExtension(name)
31 | Lets the script resolve and load the script extension with the given name.
32 | - qs.script.include(fileName)
33 | Dynamically loads and executes the script in the given file (relative to the
34 | currently processed file or absolute). Multiple includes of the same file
35 | result in only one execution of the file (only the first include triggers
36 | the execution).
37 |
38 | NOTE
39 | ----
40 | The qsexec tool doesn't import any script extensions (like qt.core) itself.
41 | A script that needs a script extension has to load it via
42 | qs.script.importExtension("myextension");
43 |
--------------------------------------------------------------------------------
/examples/AnimatedBox.qs:
--------------------------------------------------------------------------------
1 | function createBox(parent) {
2 | var result = new QWidget();
3 | result.styleSheet = "background: #00f060";
4 | return result;
5 | }
6 |
7 | var scene = new QGraphicsScene();
8 | scene.setSceneRect(0, 0, 400, 400);
9 | scene.itemIndexMethod = QGraphicsScene.NoIndex;
10 |
11 | box = scene.addWidget(createBox());
12 |
13 | var machine = new QStateMachine();
14 |
15 | var s1 = new QState(machine);
16 | s1.assignProperty(box, "geometry", new QRect(-50, 50, 100, 100));
17 | s1.assignProperty(box, "opacity", 1.0);
18 |
19 | var s2 = new QState(machine);
20 | s2.assignProperty(box, "geometry", new QRect(250, 200, 200, 150));
21 | s2.assignProperty(box, "opacity", 0.2);
22 |
23 | var timer = new QTimer();
24 | timer.interval = 2000;
25 | timer.singleShot = false;
26 | timer.start();
27 |
28 | var t1 = s1.addTransition(timer, "timeout()", s2);
29 |
30 | var geometryAnim = new QPropertyAnimation(box, "geometry");
31 | geometryAnim.easingCurve = new QEasingCurve(QEasingCurve.InOutElastic);
32 | geometryAnim.duration = 1500;
33 | t1.addAnimation(geometryAnim);
34 |
35 | var opacityAnim = new QPropertyAnimation(box, "opacity");
36 | opacityAnim.easingCurve = new QEasingCurve(QEasingCurve.InOutQuad);
37 | opacityAnim.duration = 1500;
38 | t1.addAnimation(opacityAnim);
39 |
40 | var t2 = s2.addTransition(timer, "timeout()", s1);
41 | t2.addAnimation(geometryAnim);
42 | t2.addAnimation(opacityAnim);
43 |
44 | machine.initialState = s1;
45 | machine.start();
46 |
47 | var view = new QGraphicsView(scene);
48 | view.setRenderHint(QPainter.Antialiasing);
49 | view.backgroundBrush = new QBrush(new QColor(0, 48, 32));
50 | view.viewportUpdateMode = QGraphicsView.FullViewportUpdate;
51 |
52 | view.resize(600, 410);
53 | view.show();
54 |
55 | QCoreApplication.exec();
56 |
--------------------------------------------------------------------------------
/generator/parser/rxx.pri:
--------------------------------------------------------------------------------
1 |
2 | isEmpty(RXXPATH):RXXPATH = $$PWD
3 |
4 | INCLUDEPATH += $$RXXPATH
5 |
6 | DEFINES += RXX_ALLOCATOR_INIT_0
7 |
8 | HEADERS += $$RXXPATH/ast.h \
9 | $$RXXPATH/lexer.h \
10 | $$RXXPATH/list.h \
11 | $$RXXPATH/parser.h \
12 | $$RXXPATH/rxx_allocator.h \
13 | $$RXXPATH/rpp-allocator.h \
14 | $$RXXPATH/smallobject.h \
15 | $$RXXPATH/tokens.h \
16 | $$RXXPATH/symbol.h \
17 | $$RXXPATH/control.h \
18 | $$RXXPATH/visitor.h \
19 | $$RXXPATH/default_visitor.h \
20 | $$RXXPATH/dumptree.h \
21 | $$RXXPATH/binder.h \
22 | $$RXXPATH/codemodel.h \
23 | $$RXXPATH/codemodel_pointer.h \
24 | $$RXXPATH/codemodel_fwd.h \
25 | $$RXXPATH/type_compiler.h \
26 | $$RXXPATH/name_compiler.h \
27 | $$RXXPATH/declarator_compiler.h \
28 | $$RXXPATH/class_compiler.h \
29 | $$RXXPATH/codemodel_finder.h \
30 | $$RXXPATH/compiler_utils.h
31 | SOURCES += $$RXXPATH/ast.cpp \
32 | $$RXXPATH/lexer.cpp \
33 | $$RXXPATH/list.cpp \
34 | $$RXXPATH/parser.cpp \
35 | $$RXXPATH/smallobject.cpp \
36 | $$RXXPATH/control.cpp \
37 | $$RXXPATH/visitor.cpp \
38 | $$RXXPATH/default_visitor.cpp \
39 | $$RXXPATH/dumptree.cpp \
40 | $$RXXPATH/tokens.cpp \
41 | $$RXXPATH/binder.cpp \
42 | $$RXXPATH/codemodel.cpp \
43 | $$RXXPATH/type_compiler.cpp \
44 | $$RXXPATH/name_compiler.cpp \
45 | $$RXXPATH/declarator_compiler.cpp \
46 | $$RXXPATH/class_compiler.cpp \
47 | $$RXXPATH/codemodel_finder.cpp \
48 | $$RXXPATH/compiler_utils.cpp
49 |
--------------------------------------------------------------------------------
/generator/typesystem_svg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/doc/classic.css:
--------------------------------------------------------------------------------
1 | h3.fn,span.fn
2 | {
3 | margin-left: 1cm;
4 | text-indent: -1cm;
5 | }
6 |
7 | a:link
8 | {
9 | color: #004faf;
10 | text-decoration: none
11 | }
12 |
13 | a:visited
14 | {
15 | color: #672967;
16 | text-decoration: none
17 | }
18 |
19 | a.obsolete
20 | {
21 | color: #661100;
22 | text-decoration: none
23 | }
24 |
25 | a.compat
26 | {
27 | color: #661100;
28 | text-decoration: none
29 | }
30 |
31 | a.obsolete:visited
32 | {
33 | color: #995500;
34 | text-decoration: none
35 | }
36 |
37 | a.compat:visited
38 | {
39 | color: #995500;
40 | text-decoration: none
41 | }
42 |
43 | td.postheader
44 | {
45 | font-family: sans-serif
46 | }
47 |
48 | tr.address
49 | {
50 | font-family: sans-serif
51 | }
52 |
53 | body
54 | {
55 | background: #ffffff;
56 | color: black
57 | }
58 |
59 | table tr.odd {
60 | background: #f0f0f0;
61 | color: black;
62 | }
63 |
64 | table tr.even {
65 | background: #e4e4e4;
66 | color: black;
67 | }
68 |
69 | table.annotated th {
70 | padding: 3px;
71 | text-align: left
72 | }
73 |
74 | table.annotated td {
75 | padding: 3px;
76 | }
77 |
78 | table tr pre
79 | {
80 | padding-top: none;
81 | padding-bottom: none;
82 | padding-left: none;
83 | padding-right: none;
84 | border: none;
85 | background: none
86 | }
87 |
88 | tr.qt-style
89 | {
90 | background: #a2c511;
91 | color: black
92 | }
93 |
94 | body pre
95 | {
96 | padding: 0.2em;
97 | border: #e7e7e7 1px solid;
98 | background: #f1f1f1;
99 | color: black
100 | }
101 |
102 | span.preprocessor, span.preprocessor a
103 | {
104 | color: darkblue;
105 | }
106 |
107 | span.comment
108 | {
109 | color: darkred;
110 | font-style: italic
111 | }
112 |
113 | span.string,span.char
114 | {
115 | color: darkgreen;
116 | }
117 |
118 | .title
119 | {
120 | text-align: center
121 | }
122 |
123 | .subtitle
124 | {
125 | font-size: 0.8em
126 | }
127 |
128 | .small-subtitle
129 | {
130 | font-size: 0.65em
131 | }
132 |
--------------------------------------------------------------------------------
/generator/parser/rpp/builtin-macros.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
--------------------------------------------------------------------------------
/generator/generator.pri:
--------------------------------------------------------------------------------
1 | isEmpty(GENERATORPATH):GENERATORPATH = $$PWD
2 | INCLUDEPATH += $$GENERATORPATH
3 |
4 | TEMPLATE = app
5 | TARGET +=
6 | DEPENDPATH += $$GENERATORPATH tests parser
7 | mac:CONFIG -= app_bundle
8 | INCLUDEPATH += $$GENERATORPATH/.
9 | INCLUDEPATH += $$GENERATORPATH/../common
10 |
11 | unix:CONFIG += debug_and_release
12 |
13 | CONFIG += console
14 | RESOURCES += generator.qrc
15 |
16 | include($$GENERATORPATH/parser/rxx.pri)
17 |
18 | include($$GENERATORPATH/parser/rpp/rpp.pri)
19 |
20 | win32-msvc2005:{
21 | QMAKE_CXXFLAGS += -wd4996
22 | QMAKE_CFLAGS += -wd4996
23 | }
24 |
25 | # Input
26 | HEADERS += \
27 | $$GENERATORPATH/generator.h \
28 | $$GENERATORPATH/main.h \
29 | $$GENERATORPATH/reporthandler.h \
30 | $$GENERATORPATH/typeparser.h \
31 | $$GENERATORPATH/typesystem.h \
32 | $$GENERATORPATH/asttoxml.h \
33 | $$GENERATORPATH/fileout.h \
34 | $$GENERATORPATH/generatorset.h \
35 | $$GENERATORPATH/metajava.h \
36 | $$GENERATORPATH/customtypes.h \
37 | $$GENERATORPATH/abstractmetabuilder.h \
38 | $$GENERATORPATH/abstractmetalang.h \
39 | $$GENERATORPATH/prigenerator.h \
40 |
41 |
42 |
43 |
44 | SOURCES += \
45 | $$GENERATORPATH/generator.cpp \
46 | $$GENERATORPATH/main.cpp \
47 | $$GENERATORPATH/reporthandler.cpp \
48 | $$GENERATORPATH/typeparser.cpp \
49 | $$GENERATORPATH/typesystem.cpp \
50 | $$GENERATORPATH/asttoxml.cpp \
51 | $$GENERATORPATH/fileout.cpp \
52 | $$GENERATORPATH/generatorset.cpp \
53 | $$GENERATORPATH/metajava.cpp \
54 | $$GENERATORPATH/customtypes.cpp \
55 | $$GENERATORPATH/abstractmetabuilder.cpp \
56 | $$GENERATORPATH/abstractmetalang.cpp \
57 | $$GENERATORPATH/prigenerator.cpp \
58 |
59 |
60 |
61 | QT = core xml
62 |
63 | win32-msvc.net {
64 | QMAKE_CXXFLAGS += /Zm500
65 | QMAKE_CXXFLAGS -= -Zm200
66 | QMAKE_CFLAGS -= -Zm200
67 | }
68 |
69 | mac {
70 | contains(QT_CONFIG, x86):contains(QT_CONFIG, ppc):CONFIG += x86 ppc
71 | CONFIG -= precompile_header
72 | }
73 |
--------------------------------------------------------------------------------
/generator/metajava.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "metajava.h"
43 |
--------------------------------------------------------------------------------
/generator/parser/rpp-allocator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "rxx_allocator.h"
43 |
--------------------------------------------------------------------------------
/generator/metaqtscriptbuilder.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "metaqtscriptbuilder.h"
43 |
44 |
--------------------------------------------------------------------------------
/generator/parser/list.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #include "list.h"
44 |
45 | // kate: space-indent on; indent-width 2; replace-tabs on;
46 |
--------------------------------------------------------------------------------
/generator/parser/smallobject.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #include "smallobject.h"
44 |
45 | // kate: space-indent on; indent-width 2; replace-tabs on;
46 |
--------------------------------------------------------------------------------
/generator/metaqtscript.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "metaqtscript.h"
43 |
44 |
45 | bool MetaQtScriptClass::hasDefaultToStringFunction() const
46 | {
47 | return 0 < queryFunctionsByName("toString").size();
48 | }
49 |
--------------------------------------------------------------------------------
/generator/parser/rpp/pp-fwd.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef PP_FWD_H
43 | #define PP_FWD_H
44 |
45 | namespace rpp {
46 |
47 | template class pp_string;
48 |
49 | typedef pp_string pp_fast_string;
50 |
51 | #endif // PP_FWD_H
52 |
53 | } // namespace rpp
54 |
55 | // kate: space-indent on; indent-width 2; replace-tabs on;
56 |
--------------------------------------------------------------------------------
/generator/parser/ast.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "ast.h"
43 | #include "lexer.h"
44 |
45 | // kate: space-indent on; indent-width 2; replace-tabs on;
46 |
47 | QString AST::toString(TokenStream *stream) const
48 | {
49 | const Token &tk = stream->token((int) start_token);
50 | const Token &end_tk = stream->token ((int) end_token);
51 | return QString::fromLatin1(tk.text + tk.position, end_tk.position - tk.position);
52 | }
53 |
--------------------------------------------------------------------------------
/generator/parser/dumptree.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef DUMPTREE_H
44 | #define DUMPTREE_H
45 |
46 | #include "default_visitor.h"
47 |
48 | class DumpTree: protected DefaultVisitor
49 | {
50 | public:
51 | DumpTree();
52 |
53 | void dump(AST *node) { visit(node); }
54 |
55 | protected:
56 | virtual void visit(AST *node);
57 | };
58 |
59 | #endif // DUMPTREE_H
60 |
61 | // kate: space-indent on; indent-width 2; replace-tabs on;
62 |
--------------------------------------------------------------------------------
/generator/setupgenerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef SETUPGENERATOR_H
43 | #define SETUPGENERATOR_H
44 |
45 | #include "generator.h"
46 | #include "metaqtscript.h"
47 |
48 | class SetupGenerator : public Generator
49 | {
50 | Q_OBJECT
51 |
52 | public:
53 | virtual void generate();
54 |
55 | void addClass(const AbstractMetaClass *cls);
56 |
57 | private:
58 | QHash > packHash;
59 | };
60 | #endif // SETUPGENERATOR_H
61 |
62 |
--------------------------------------------------------------------------------
/generator/parser/smallobject.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef SMALLOBJECT_H
44 | #define SMALLOBJECT_H
45 |
46 | #include "rxx_allocator.h"
47 | #include
48 |
49 | class pool
50 | {
51 | rxx_allocator __alloc;
52 |
53 | public:
54 | inline void *allocate(std::size_t __size);
55 | };
56 |
57 | inline void *pool::allocate(std::size_t __size)
58 | {
59 | return __alloc.allocate(__size);
60 | }
61 |
62 | #endif
63 |
64 | // kate: space-indent on; indent-width 2; replace-tabs on;
65 |
--------------------------------------------------------------------------------
/generator/generatorset.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "generatorset.h"
43 |
44 | GeneratorSet::GeneratorSet() :
45 | outDir(".."),
46 | printStdout(false)
47 | {}
48 |
49 | bool GeneratorSet::readParameters(const QMap args) {
50 | if (args.contains("output-directory")) {
51 | outDir = args.value("output-directory");
52 | }
53 |
54 | printStdout = args.contains("print-stdout");
55 |
56 | return !(args.contains("help") || args.contains("h") || args.contains("?"));
57 | }
58 |
--------------------------------------------------------------------------------
/generator/asttoxml.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef ASTTOXML
44 | #define ASTTOXML
45 |
46 | #include "codemodel.h"
47 |
48 | #include
49 | #include
50 |
51 | void astToXML(const QString name);
52 | void writeOutNamespace(QXmlStreamWriter &s, NamespaceModelItem &item);
53 | void writeOutEnum(QXmlStreamWriter &s, EnumModelItem &item);
54 | void writeOutFunction(QXmlStreamWriter &s, FunctionModelItem &item);
55 | void writeOutClass(QXmlStreamWriter &s, ClassModelItem &item);
56 |
57 |
58 | #endif // ASTTOXML
59 |
--------------------------------------------------------------------------------
/generator/typesystem_network-qtscript.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/generator/docgenerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef DOCGENERATOR_H
43 | #define DOCGENERATOR_H
44 |
45 | #include "generator.h"
46 |
47 | class DocGenerator : public Generator
48 | {
49 | public:
50 | DocGenerator();
51 |
52 | virtual bool shouldGenerate(const AbstractMetaClass *meta_class) const;
53 | virtual void generate();
54 | virtual QString fileNameForClass(const AbstractMetaClass *meta_class) const;
55 | virtual QString subDirectoryForClass(const AbstractMetaClass *cls) const;
56 | virtual void write(QTextStream &s, const AbstractMetaClass *meta_class);
57 | };
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/generator/parser/compiler_utils.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef COMPILER_UTILS_H
44 | #define COMPILER_UTILS_H
45 |
46 | #include
47 |
48 | #include "codemodel.h"
49 |
50 | class QString;
51 | class QStringList;
52 | struct TypeSpecifierAST;
53 | struct DeclaratorAST;
54 | class TokenStream;
55 | class Binder;
56 |
57 | namespace CompilerUtils
58 | {
59 |
60 | TypeInfo typeDescription(TypeSpecifierAST *type_specifier, DeclaratorAST *declarator, Binder *binder);
61 |
62 | } // namespace CompilerUtils
63 |
64 | #endif // COMPILER_UTILS_H
65 |
66 | // kate: space-indent on; indent-width 2; replace-tabs on;
67 |
--------------------------------------------------------------------------------
/generator/prigenerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef PRIGENERATOR_H
43 | #define PRIGENERATOR_H
44 |
45 | #include "generator.h"
46 |
47 | #include
48 | #include
49 |
50 | struct Pri
51 | {
52 | QStringList headers;
53 | QStringList sources;
54 | };
55 |
56 | class PriGenerator : public Generator
57 | {
58 | Q_OBJECT
59 |
60 | public:
61 | virtual void generate();
62 |
63 | void addHeader(const QString &folder, const QString &header);
64 | void addSource(const QString &folder, const QString &source);
65 |
66 | private:
67 | QHash priHash;
68 |
69 | };
70 | #endif // PRIGENERATOR_H
71 |
72 |
--------------------------------------------------------------------------------
/generator/shellimplgenerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef SHELLIMPLGENERATOR_H
43 | #define SHELLIMPLGENERATOR_H
44 |
45 | #include "shellgenerator.h"
46 | #include "metaqtscript.h"
47 |
48 | class ShellImplGenerator : public ShellGenerator
49 | {
50 | Q_OBJECT
51 |
52 | public:
53 | ShellImplGenerator(PriGenerator *pri)
54 | {
55 | priGenerator = pri;
56 | }
57 |
58 | virtual QString fileNameForClass(const AbstractMetaClass *cls) const;
59 |
60 | void write(QTextStream &s, const AbstractMetaClass *meta_class);
61 | void writeInjectedCode(QTextStream &s, const AbstractMetaClass *meta_class);
62 |
63 | };
64 |
65 | #endif // SHELLIMPLGENERATOR_H
66 |
--------------------------------------------------------------------------------
/generator/fileout.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef FILEOUT_H
43 | #define FILEOUT_H
44 |
45 | #include
46 | #include
47 | #include
48 |
49 | class FileOut : public QObject
50 | {
51 | Q_OBJECT
52 |
53 | private:
54 | QByteArray tmp;
55 | QString name;
56 |
57 | public:
58 | FileOut(QString name);
59 | ~FileOut()
60 | {
61 | if( !isDone )
62 | done();
63 | }
64 |
65 | bool done();
66 |
67 | QTextStream stream;
68 |
69 | static bool dummy;
70 | static bool diff;
71 | static bool license;
72 |
73 | private:
74 | bool isDone;
75 | };
76 |
77 | #endif // FILEOUT_H
78 |
--------------------------------------------------------------------------------
/generator/parser/rpp/pp-cctype.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef PP_CCTYPE_H
43 | #define PP_CCTYPE_H
44 |
45 | #include
46 |
47 | namespace rpp {
48 |
49 | inline bool pp_isalpha (int __ch)
50 | { return std::isalpha ((unsigned char) __ch) != 0; }
51 |
52 | inline bool pp_isalnum (int __ch)
53 | { return std::isalnum ((unsigned char) __ch) != 0; }
54 |
55 | inline bool pp_isdigit (int __ch)
56 | { return std::isdigit ((unsigned char) __ch) != 0; }
57 |
58 | inline bool pp_isspace (int __ch)
59 | { return std::isspace ((unsigned char) __ch) != 0; }
60 |
61 | } // namespace rpp
62 |
63 | #endif // PP_CCTYPE_H
64 |
65 | // kate: space-indent on; indent-width 2; replace-tabs on;
66 |
--------------------------------------------------------------------------------
/generator/shellheadergenerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef SHELL_HEADER_GENERATOR
43 | #define SHELL_HEADER_GENERATOR
44 |
45 | #include "shellgenerator.h"
46 | #include "metaqtscript.h"
47 |
48 | class ShellHeaderGenerator : public ShellGenerator
49 | {
50 | Q_OBJECT
51 |
52 | public:
53 | ShellHeaderGenerator(PriGenerator *pri)
54 | {
55 | priGenerator = pri;
56 | }
57 |
58 | virtual QString fileNameForClass(const AbstractMetaClass *cls) const;
59 |
60 | void write(QTextStream &s, const AbstractMetaClass *meta_class);
61 | void writeInjectedCode(QTextStream &s, const AbstractMetaClass *meta_class);
62 | };
63 |
64 | #endif // SHELL_HEADER_GENERATOR
65 |
--------------------------------------------------------------------------------
/generator/generatorsetqtscript.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef GENERATOR_SET_QT_SCRIPT_H
43 | #define GENERATOR_SET_QT_SCRIPT_H
44 |
45 | #include "generatorset.h"
46 | #include "metaqtscriptbuilder.h"
47 |
48 | class GeneratorSetQtScript : public GeneratorSet
49 | {
50 | Q_OBJECT
51 |
52 | public:
53 | GeneratorSetQtScript();
54 |
55 | QString usage();
56 | bool readParameters(const QMap args);
57 |
58 | void buildModel(const QString pp_file);
59 | void dumpObjectTree();
60 |
61 | QString generate( );
62 |
63 | private:
64 | MetaQtScriptBuilder builder;
65 |
66 | };
67 |
68 | #endif // GENERATOR_SET_QT_SCRIPT_H
69 |
--------------------------------------------------------------------------------
/generator/generatorset.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef GENERATOR_SET_H
43 | #define GENERATOR_SET_H
44 |
45 | #include
46 | #include
47 | #include
48 | #include
49 |
50 | class GeneratorSet : public QObject
51 | {
52 | Q_OBJECT
53 |
54 | public:
55 | GeneratorSet();
56 |
57 | virtual QString usage() = 0;
58 | virtual bool readParameters(const QMap args) = 0;
59 | virtual void buildModel(const QString pp_file) = 0;
60 | virtual void dumpObjectTree() = 0;
61 | virtual QString generate() = 0;
62 |
63 | static GeneratorSet *getInstance();
64 | QString outDir;
65 | bool printStdout;
66 | };
67 |
68 | #endif // GENERATOR_SET_H
69 |
--------------------------------------------------------------------------------
/generator/parser/include/stdarg.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef __STDARG
44 | #define __STDARG
45 |
46 | #if !defined(_VA_LIST) && !defined(__VA_LIST_DEFINED)
47 | #define _VA_LIST
48 | #define _VA_LIST_DEFINED
49 |
50 | typedef char *__va_list;
51 | #endif
52 | static float __va_arg_tmp;
53 | typedef __va_list va_list;
54 |
55 | #define va_start(list, start) ((void)0)
56 | #define __va_arg(list, mode, n) ((void)0)
57 | #define _bigendian_va_arg(list, mode, n) ((void)0)
58 | #define _littleendian_va_arg(list, mode, n) ((void)0)
59 | #define va_end(list) ((void)0)
60 | #define va_arg(list, mode) ((void)0)
61 |
62 | typedef void *__gnuc_va_list;
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/generator/merge.xsl:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/generator/typeparser.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef TYPEPARSER_H
43 | #define TYPEPARSER_H
44 |
45 | #include
46 | #include
47 | #include
48 |
49 | class TypeParser
50 | {
51 | public:
52 | struct Info
53 | {
54 | Info() : is_reference(false), is_constant(false), is_busted(false), indirections(0) { }
55 | QStringList qualified_name;
56 | QStringList arrays;
57 | QList template_instantiations;
58 | uint is_reference : 1;
59 | uint is_constant : 1;
60 | uint is_busted : 1;
61 | uint indirections : 5;
62 |
63 | QString toString() const;
64 | QString instantiationName() const;
65 | };
66 |
67 | static Info parse(const QString &str);
68 | };
69 |
70 | #endif // TYPEPARSER_H
71 |
--------------------------------------------------------------------------------
/qtbindings/qtscript_core/qtscriptconcurrent.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef QTSCRIPTCONCURRENT_H
43 | #define QTSCRIPTCONCURRENT_H
44 |
45 | #ifndef QT_NO_CONCURRENT
46 |
47 | #include
48 | #include
49 | #include
50 | #include
51 |
52 | typedef QFutureWatcher QtScriptVoidFutureWatcher;
53 | typedef QFuture QtScriptVoidFuture;
54 | typedef QFutureSynchronizer QtScriptVoidFutureSynchronizer;
55 | typedef QFuture QtScriptFuture;
56 | typedef QFutureWatcher QtScriptFutureWatcher;
57 | typedef QFutureSynchronizer QtScriptFutureSynchronizer;
58 | typedef QFutureIterator QtScriptFutureIterator;
59 |
60 | #endif // QT_NO_CONCURRENT
61 |
62 | #endif
63 |
--------------------------------------------------------------------------------
/generator/parser/rpp/pp-configuration:
--------------------------------------------------------------------------------
1 | #define __DBL_MIN_EXP__ (-1021)
2 | #define __FLT_MIN__ 1.17549435e-38F
3 | #define __CHAR_BIT__ 8
4 | #define __WCHAR_MAX__ 2147483647
5 | #define __DBL_DENORM_MIN__ 4.9406564584124654e-324
6 | #define __FLT_EVAL_METHOD__ 2
7 | #define __DBL_MIN_10_EXP__ (-307)
8 | #define __FINITE_MATH_ONLY__ 0
9 | #define __GNUC_PATCHLEVEL__ 2
10 | #define __SHRT_MAX__ 32767
11 | #define __LDBL_MAX__ 1.18973149535723176502e+4932L
12 | #define __UINTMAX_TYPE__ long long unsigned int
13 | #define __linux 1
14 | #define __unix 1
15 | #define __LDBL_MAX_EXP__ 16384
16 | #define __linux__ 1
17 | #define __SCHAR_MAX__ 127
18 | #define __USER_LABEL_PREFIX__
19 | #define __STDC_HOSTED__ 1
20 | #define __LDBL_HAS_INFINITY__ 1
21 | #define __DBL_DIG__ 15
22 | #define __FLT_EPSILON__ 1.19209290e-7F
23 | #define __GXX_WEAK__ 1
24 | #define __LDBL_MIN__ 3.36210314311209350626e-4932L
25 | #define __unix__ 1
26 | #define __DECIMAL_DIG__ 21
27 | #define __gnu_linux__ 1
28 | #define __LDBL_HAS_QUIET_NAN__ 1
29 | #define __GNUC__ 4
30 | #define __DBL_MAX__ 1.7976931348623157e+308
31 | #define __DBL_HAS_INFINITY__ 1
32 | #define __cplusplus 1
33 | #define __DEPRECATED 1
34 | #define __DBL_MAX_EXP__ 1024
35 | #define __GNUG__ 4
36 | #define __LONG_LONG_MAX__ 9223372036854775807LL
37 | #define __GXX_ABI_VERSION 1002
38 | #define __FLT_MIN_EXP__ (-125)
39 | #define __DBL_MIN__ 2.2250738585072014e-308
40 | #define __FLT_MIN_10_EXP__ (-37)
41 | #define __DBL_HAS_QUIET_NAN__ 1
42 | #define __REGISTER_PREFIX__
43 | #define __NO_INLINE__ 1
44 | #define __i386 1
45 | #define __FLT_MANT_DIG__ 24
46 | #define __VERSION__ "4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)"
47 | #define i386 1
48 | #define __i486__ 1
49 | #define unix 1
50 | #define __i386__ 1
51 | #define __SIZE_TYPE__ unsigned int
52 | #define __ELF__ 1
53 | #define __FLT_RADIX__ 2
54 | #define __LDBL_EPSILON__ 1.08420217248550443401e-19L
55 | #define __FLT_HAS_QUIET_NAN__ 1
56 | #define __FLT_MAX_10_EXP__ 38
57 | #define __LONG_MAX__ 2147483647L
58 | #define __FLT_HAS_INFINITY__ 1
59 | #define linux 1
60 | #define __EXCEPTIONS 1
61 | #define __LDBL_MANT_DIG__ 64
62 | #define __WCHAR_TYPE__ int
63 | #define __FLT_DIG__ 6
64 | #define __INT_MAX__ 2147483647
65 | #define __i486 1
66 | #define __FLT_MAX_EXP__ 128
67 | #define __DBL_MANT_DIG__ 53
68 | #define __WINT_TYPE__ unsigned int
69 | #define __LDBL_MIN_EXP__ (-16381)
70 | #define __LDBL_MAX_10_EXP__ 4932
71 | #define __DBL_EPSILON__ 2.2204460492503131e-16
72 | #define __tune_i486__ 1
73 | #define __INTMAX_MAX__ 9223372036854775807LL
74 | #define __FLT_DENORM_MIN__ 1.40129846e-45F
75 | #define __FLT_MAX__ 3.40282347e+38F
76 | #define __INTMAX_TYPE__ long long int
77 | #define __GNUC_MINOR__ 0
78 | #define __DBL_MAX_10_EXP__ 308
79 | #define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
80 | #define __PTRDIFF_TYPE__ int
81 | #define __LDBL_MIN_10_EXP__ (-4931)
82 | #define __LDBL_DIG__ 18
83 | #define _GNU_SOURCE 1
84 |
85 |
86 | #define __STDC__
87 |
--------------------------------------------------------------------------------
/generator/metajava.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef METAJAVA_H
43 | #define METAJAVA_H
44 |
45 | #include "abstractmetalang.h"
46 |
47 | class MetaJavaClass;
48 | class MetaJavaField;
49 | class MetaJavaFunction;
50 | class MetaJavaType;
51 | class MetaJavaVariable;
52 | class MetaJavaArgument;
53 | class MetaJavaEnumValue;
54 | class MetaJavaEnum;
55 |
56 |
57 |
58 | class MetaJavaType : public AbstractMetaType
59 | {};
60 |
61 | class MetaJavaArgument : public AbstractMetaArgument
62 | {};
63 |
64 | class MetaJavaField : public AbstractMetaField
65 | {};
66 |
67 | class MetaJavaFunction : public AbstractMetaFunction
68 | {};
69 |
70 | class MetaJavaEnumValue : public AbstractMetaEnumValue
71 | {};
72 |
73 | class MetaJavaEnum : public AbstractMetaEnum
74 | {};
75 |
76 | class MetaJavaClass : public AbstractMetaClass
77 | {};
78 |
79 | #endif // METAJAVA_H
80 |
--------------------------------------------------------------------------------
/examples/DigitalClock.js:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | function tr(s) { return s; }
43 |
44 |
45 | function DigitalClock(parent)
46 | {
47 | QLCDNumber.call(this, parent);
48 |
49 | this.segmentStyle = QLCDNumber.Filled;
50 |
51 | var timer = new QTimer(this);
52 | timer.timeout.connect(this, this.showTime);
53 | timer.start(1000);
54 |
55 | this.showTime();
56 |
57 | this.windowTitle = tr("Digital Clock");
58 | this.resize(150, 60);
59 | }
60 |
61 | DigitalClock.prototype = new QLCDNumber();
62 |
63 | DigitalClock.prototype.showTime = function()
64 | {
65 | var time = QTime.currentTime();
66 | var format = "hh";
67 | format += ((time.second() % 2) == 0) ? " " : ":";
68 | format += "mm";
69 | var text = time.toString(format);
70 | this.display(text);
71 | }
72 |
73 |
74 | var clock = new DigitalClock(5); // ### fixme
75 | clock.show();
76 | QCoreApplication.exec();
77 |
--------------------------------------------------------------------------------
/generator/classgenerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef CLASS_GENERATOR
43 | #define CLASS_GENERATOR
44 |
45 | #include "generator.h"
46 | #include "metaqtscript.h"
47 | #include "prigenerator.h"
48 | #include "setupgenerator.h"
49 |
50 | class ClassGenerator : public Generator
51 | {
52 | Q_OBJECT
53 |
54 | public:
55 | ClassGenerator(PriGenerator *pri, SetupGenerator *setup);
56 |
57 | virtual QString fileNameForClass(const AbstractMetaClass *meta_class) const;
58 | virtual QString subDirectoryForClass(const AbstractMetaClass *cls) const
59 | {
60 | return "generated_cpp/" + cls->package().replace(".", "_") + "/";
61 | }
62 | virtual bool shouldGenerate(const AbstractMetaClass *meta_class) const;
63 | void write(QTextStream &s, const AbstractMetaClass *meta_class);
64 |
65 | private:
66 | PriGenerator *priGenerator;
67 | SetupGenerator *setupGenerator;
68 | QStringList describeFunctons;
69 | };
70 |
71 | #endif // CLASS_GENERATOR
72 |
--------------------------------------------------------------------------------
/generator/parser/compiler_utils.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #include "compiler_utils.h"
44 | #include "type_compiler.h"
45 | #include "name_compiler.h"
46 | #include "declarator_compiler.h"
47 | #include "ast.h"
48 | #include "binder.h"
49 |
50 | TypeInfo CompilerUtils::typeDescription(TypeSpecifierAST *type_specifier, DeclaratorAST *declarator, Binder *binder)
51 | {
52 | TypeCompiler type_cc (binder);
53 | DeclaratorCompiler decl_cc (binder);
54 |
55 | type_cc.run (type_specifier);
56 | decl_cc.run (declarator);
57 |
58 | TypeInfo typeInfo;
59 | typeInfo.setQualifiedName (type_cc.qualifiedName ());
60 | typeInfo.setConstant (type_cc.isConstant ());
61 | typeInfo.setVolatile (type_cc.isVolatile ());
62 | typeInfo.setReference (decl_cc.isReference ());
63 | typeInfo.setIndirections (decl_cc.indirection ());
64 | typeInfo.setArrayElements (decl_cc.arrayElements ());
65 |
66 | return typeInfo;
67 | }
68 |
69 | // kate: space-indent on; indent-width 2; replace-tabs on;
70 |
--------------------------------------------------------------------------------
/generator/metaqtscript.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef METAQTSCRIPT_H
43 | #define METAQTSCRIPT_H
44 |
45 | #include "abstractmetalang.h"
46 |
47 | class MetaQtScriptClass;
48 | class MetaQtScriptField;
49 | class MetaQtScriptFunction;
50 | class MetaQtScriptType;
51 | class MetaQtScriptVariable;
52 | class MetaQtScriptArgument;
53 | class MetaQtScriptEnumValue;
54 | class MetaQtScriptEnum;
55 |
56 |
57 |
58 | class MetaQtScriptType : public AbstractMetaType
59 | {};
60 |
61 | class MetaQtScriptArgument : public AbstractMetaArgument
62 | {};
63 |
64 | class MetaQtScriptField : public AbstractMetaField
65 | {};
66 |
67 | class MetaQtScriptFunction : public AbstractMetaFunction
68 | {};
69 |
70 | class MetaQtScriptEnumValue : public AbstractMetaEnumValue
71 | {};
72 |
73 | class MetaQtScriptEnum : public AbstractMetaEnum
74 | {};
75 |
76 | class MetaQtScriptClass : public AbstractMetaClass
77 | {
78 | virtual bool hasDefaultToStringFunction() const;
79 | };
80 |
81 | #endif // METAQTSCRIPT_H
82 |
--------------------------------------------------------------------------------
/generator/parser/class_compiler.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #include "class_compiler.h"
44 | #include "lexer.h"
45 | #include "binder.h"
46 |
47 | ClassCompiler::ClassCompiler(Binder *binder)
48 | : _M_binder (binder),
49 | _M_token_stream(binder->tokenStream ()),
50 | name_cc(_M_binder),
51 | type_cc(_M_binder)
52 | {
53 | }
54 |
55 | ClassCompiler::~ClassCompiler()
56 | {
57 | }
58 |
59 | void ClassCompiler::run(ClassSpecifierAST *node)
60 | {
61 | name_cc.run(node->name);
62 | _M_name = name_cc.name();
63 | _M_base_classes.clear();
64 |
65 | visit(node);
66 | }
67 |
68 | void ClassCompiler::visitClassSpecifier(ClassSpecifierAST *node)
69 | {
70 | visit(node->base_clause);
71 | }
72 |
73 | void ClassCompiler::visitBaseSpecifier(BaseSpecifierAST *node)
74 | {
75 | name_cc.run(node->name);
76 | QString name = name_cc.name();
77 |
78 | if (! name.isEmpty())
79 | _M_base_classes.append(name);
80 | }
81 |
82 |
83 | // kate: space-indent on; indent-width 2; replace-tabs on;
84 |
--------------------------------------------------------------------------------
/generator/parser/rpp/pp-macro.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef PP_MACRO_H
43 | #define PP_MACRO_H
44 |
45 | namespace rpp {
46 |
47 | struct pp_macro
48 | {
49 | #if defined (PP_WITH_MACRO_POSITION)
50 | pp_fast_string const *file;
51 | #endif
52 | pp_fast_string const *name;
53 | pp_fast_string const *definition;
54 | std::vector formals;
55 |
56 | union
57 | {
58 | int unsigned state;
59 |
60 | struct
61 | {
62 | int unsigned hidden: 1;
63 | int unsigned function_like: 1;
64 | int unsigned variadics: 1;
65 | };
66 | };
67 |
68 | int lines;
69 | pp_macro *next;
70 | std::size_t hash_code;
71 |
72 | inline pp_macro():
73 | #if defined (PP_WITH_MACRO_POSITION)
74 | file (0),
75 | #endif
76 | name (0),
77 | definition (0),
78 | state (0),
79 | lines (0),
80 | next (0),
81 | hash_code (0)
82 | {}
83 | };
84 |
85 | } // namespace rpp
86 |
87 | #endif // PP_MACRO_H
88 |
89 | // kate: space-indent on; indent-width 2; replace-tabs on;
90 |
--------------------------------------------------------------------------------
/generator/parser/rpp/preprocessor.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef PREPROCESSOR_H
43 | #define PREPROCESSOR_H
44 |
45 | #include
46 | #include
47 | #include
48 |
49 | class QByteArray;
50 | class PreprocessorPrivate;
51 |
52 | class Preprocessor
53 | {
54 | public:
55 | Preprocessor();
56 | ~Preprocessor();
57 |
58 | void processFile(const QString &fileName);
59 | void processString(const QByteArray &str);
60 |
61 | void addIncludePaths(const QStringList &includePaths);
62 |
63 | QByteArray result() const;
64 |
65 | QStringList macroNames() const;
66 |
67 | struct MacroItem
68 | {
69 | QString name;
70 | QStringList parameters;
71 | QString definition;
72 | bool isFunctionLike;
73 | #ifdef PP_WITH_MACRO_POSITION
74 | QString fileName;
75 | #endif
76 | };
77 | QList macros() const;
78 |
79 | private:
80 | Q_DISABLE_COPY(Preprocessor)
81 | PreprocessorPrivate *d;
82 | };
83 |
84 | #endif
85 |
--------------------------------------------------------------------------------
/generator/parser/name_compiler.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef NAME_COMPILER_H
44 | #define NAME_COMPILER_H
45 |
46 | #include "default_visitor.h"
47 | #include
48 |
49 | class TokenStream;
50 | class Binder;
51 |
52 | class NameCompiler: protected DefaultVisitor
53 | {
54 | public:
55 | NameCompiler(Binder *binder);
56 |
57 | void run(NameAST *node) { internal_run(node); }
58 | void run(UnqualifiedNameAST *node) { internal_run(node); }
59 |
60 | QString name() const { return _M_name.join("::"); }
61 | QStringList qualifiedName() const { return _M_name; }
62 |
63 | protected:
64 | virtual void visitUnqualifiedName(UnqualifiedNameAST *node);
65 | virtual void visitTemplateArgument(TemplateArgumentAST *node);
66 |
67 | QString internal_run(AST *node);
68 | QString decode_operator(std::size_t index) const;
69 |
70 | private:
71 | Binder *_M_binder;
72 | TokenStream *_M_token_stream;
73 | QStringList _M_name;
74 | };
75 |
76 | #endif // NAME_COMPILER_H
77 |
78 | // kate: space-indent on; indent-width 2; replace-tabs on;
79 |
--------------------------------------------------------------------------------
/generator/parser/class_compiler.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef CLASS_COMPILER_H
44 | #define CLASS_COMPILER_H
45 |
46 | #include
47 | #include
48 |
49 | #include "default_visitor.h"
50 | #include "name_compiler.h"
51 | #include "type_compiler.h"
52 |
53 | class TokenStream;
54 | class Binder;
55 |
56 | class ClassCompiler: protected DefaultVisitor
57 | {
58 | public:
59 | ClassCompiler(Binder *binder);
60 | virtual ~ClassCompiler();
61 |
62 | inline QString name() const { return _M_name; }
63 | inline QStringList baseClasses() const { return _M_base_classes; }
64 |
65 | void run(ClassSpecifierAST *node);
66 |
67 | protected:
68 | virtual void visitClassSpecifier(ClassSpecifierAST *node);
69 | virtual void visitBaseSpecifier(BaseSpecifierAST *node);
70 |
71 | private:
72 | Binder *_M_binder;
73 | TokenStream *_M_token_stream;
74 | QString _M_name;
75 | QStringList _M_base_classes;
76 | NameCompiler name_cc;
77 | TypeCompiler type_cc;
78 | };
79 |
80 | #endif // CLASS_COMPILER_H
81 |
82 | // kate: space-indent on; indent-width 2; replace-tabs on;
83 |
--------------------------------------------------------------------------------
/generator/reporthandler.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "reporthandler.h"
43 | #include "typesystem.h"
44 |
45 | int ReportHandler::m_warning_count = 0;
46 | int ReportHandler::m_suppressed_count = 0;
47 | QString ReportHandler::m_context;
48 | ReportHandler::DebugLevel ReportHandler::m_debug_level = NoDebug;
49 | QSet ReportHandler::m_reported_warnings;
50 |
51 |
52 | void ReportHandler::warning(const QString &text)
53 | {
54 | QString warningText = QString("WARNING(%1) :: %2").arg(m_context).arg(text);
55 |
56 | TypeDatabase *db = TypeDatabase::instance();
57 | if (db && db->isSuppressedWarning(warningText)) {
58 | ++m_suppressed_count;
59 | } else if (!m_reported_warnings.contains(warningText)) {
60 | qDebug(qPrintable(warningText));
61 | ++m_warning_count;
62 |
63 | m_reported_warnings.insert(warningText);
64 | }
65 | }
66 |
67 | void ReportHandler::debug(DebugLevel level, const QString &text)
68 | {
69 | if (m_debug_level == NoDebug)
70 | return;
71 |
72 | if (level <= m_debug_level)
73 | qDebug(" - DEBUG(%s) :: %s", qPrintable(m_context), qPrintable(text));
74 | }
75 |
--------------------------------------------------------------------------------
/generator/customtypes.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef CUSTOMTYPES_H
43 | #define CUSTOMTYPES_H
44 |
45 | #include "typesystem.h"
46 |
47 |
48 | class QModelIndexTypeEntry : public CustomTypeEntry
49 | {
50 | public:
51 | QModelIndexTypeEntry() : CustomTypeEntry("QModelIndex")
52 | {
53 | setCodeGeneration(GenerateNothing);
54 | }
55 |
56 | virtual QString javaPackage() const { return "com.trolltech.qt.core"; }
57 |
58 | virtual bool isValue() const { return true; }
59 |
60 | virtual void generateCppJavaToQt(QTextStream &s,
61 | const AbstractMetaType *java_type,
62 | const QString &env_name,
63 | const QString &qt_name,
64 | const QString &java_name) const;
65 |
66 | virtual void generateCppQtToJava(QTextStream &s,
67 | const AbstractMetaType *java_type,
68 | const QString &env_name,
69 | const QString &qt_name,
70 | const QString &java_name) const;
71 |
72 | };
73 |
74 | #endif
75 |
--------------------------------------------------------------------------------
/generator/parser/codemodel_finder.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef CODEMODEL_FINDER_H
44 | #define CODEMODEL_FINDER_H
45 |
46 | #include "default_visitor.h"
47 | #include "codemodel_fwd.h"
48 | #include "name_compiler.h"
49 |
50 | class TokenStream;
51 | class Binder;
52 |
53 | class CodeModelFinder: protected DefaultVisitor
54 | {
55 | enum ResolvePolicy
56 | {
57 | ResolveScope,
58 | ResolveItem
59 | };
60 |
61 | public:
62 | CodeModelFinder(CodeModel *model, Binder *binder);
63 | virtual ~CodeModelFinder();
64 |
65 | ScopeModelItem resolveScope(NameAST *name, ScopeModelItem scope);
66 |
67 | inline CodeModel *model() const { return _M_model; }
68 |
69 | protected:
70 | virtual void visitName(NameAST *node);
71 | virtual void visitUnqualifiedName(UnqualifiedNameAST *node);
72 |
73 | ScopeModelItem changeCurrentScope(ScopeModelItem scope);
74 |
75 | private:
76 | CodeModel *_M_model;
77 | Binder *_M_binder;
78 | TokenStream *_M_token_stream;
79 | NameCompiler name_cc;
80 |
81 | ScopeModelItem _M_current_scope;
82 | ResolvePolicy _M_resolve_policy;
83 | };
84 |
85 | #endif // CODEMODEL_FINDER_H
86 |
87 | // kate: space-indent on; indent-width 2; replace-tabs on;
88 |
--------------------------------------------------------------------------------
/generator/customtypes.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "customtypes.h"
43 |
44 | #include "metajava.h"
45 |
46 | #include
47 | #include
48 |
49 |
50 | void QModelIndexTypeEntry::generateCppJavaToQt(QTextStream &s,
51 | const AbstractMetaType *,
52 | const QString &env_name,
53 | const QString &qt_name,
54 | const QString &java_name) const
55 | {
56 | s << "QModelIndex " << qt_name << " = qtjambi_to_QModelIndex(" << env_name << ", "
57 | << java_name << ")";
58 | }
59 |
60 |
61 | void QModelIndexTypeEntry::generateCppQtToJava(QTextStream &s,
62 | const AbstractMetaType *,
63 | const QString &env_name,
64 | const QString &qt_name,
65 | const QString &java_name) const
66 | {
67 | s << "jobject " << java_name << " = qtjambi_from_QModelIndex(" << env_name << ", "
68 | << qt_name << ")";
69 | }
70 |
--------------------------------------------------------------------------------
/generator/parser/type_compiler.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 |
43 | #ifndef TYPE_COMPILER_H
44 | #define TYPE_COMPILER_H
45 |
46 | #include "default_visitor.h"
47 |
48 | #include
49 | #include
50 | #include
51 |
52 | class TokenStream;
53 | class Binder;
54 |
55 | class TypeCompiler: protected DefaultVisitor
56 | {
57 | public:
58 | TypeCompiler(Binder *binder);
59 |
60 | inline QStringList qualifiedName() const { return _M_type; }
61 | inline QList cv() const { return _M_cv; }
62 |
63 | bool isConstant() const;
64 | bool isVolatile() const;
65 |
66 | QStringList cvString() const;
67 |
68 | void run(TypeSpecifierAST *node);
69 |
70 | protected:
71 | virtual void visitClassSpecifier(ClassSpecifierAST *node);
72 | virtual void visitEnumSpecifier(EnumSpecifierAST *node);
73 | virtual void visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *node);
74 | virtual void visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node);
75 |
76 | virtual void visitName(NameAST *node);
77 |
78 | private:
79 | Binder *_M_binder;
80 | TokenStream *_M_token_stream;
81 | QStringList _M_type;
82 | QList _M_cv;
83 | };
84 |
85 | #endif // TYPE_COMPILER_H
86 |
87 | // kate: space-indent on; indent-width 2; replace-tabs on;
88 |
--------------------------------------------------------------------------------
/generator/metaqtscriptbuilder.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef METAQTSCRIPTBUILDER_H
43 | #define METAQTSCRIPTBUILDER_H
44 |
45 | #include "abstractmetabuilder.h"
46 | #include "metaqtscript.h"
47 |
48 | class MetaQtScriptBuilder : public AbstractMetaBuilder
49 | {
50 |
51 | protected:
52 | virtual MetaQtScriptClass *createMetaClass()
53 | {
54 | return new MetaQtScriptClass();
55 | };
56 |
57 | virtual MetaQtScriptEnum *createMetaEnum()
58 | {
59 | return new MetaQtScriptEnum();
60 | };
61 |
62 | virtual MetaQtScriptEnumValue *createMetaEnumValue()
63 | {
64 | return new MetaQtScriptEnumValue();
65 | };
66 |
67 | virtual MetaQtScriptField *createMetaField()
68 | {
69 | return new MetaQtScriptField();
70 | };
71 |
72 | virtual MetaQtScriptFunction *createMetaFunction()
73 | {
74 | return new MetaQtScriptFunction();
75 | };
76 |
77 | virtual MetaQtScriptArgument *createMetaArgument()
78 | {
79 | return new MetaQtScriptArgument();
80 | };
81 |
82 | virtual MetaQtScriptType *createMetaType()
83 | {
84 | return new MetaQtScriptType();
85 | };
86 |
87 | };
88 |
89 | #endif // METAQTSCRIPTBUILDER_H
90 |
--------------------------------------------------------------------------------
/generator/reporthandler.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef REPORTHANDLER_H
43 | #define REPORTHANDLER_H
44 |
45 | #include
46 | #include
47 |
48 | class ReportHandler
49 | {
50 | public:
51 | enum DebugLevel { NoDebug, SparseDebug, MediumDebug, FullDebug };
52 |
53 | static void setContext(const QString &context) { m_context = context; }
54 |
55 | static DebugLevel debugLevel() { return m_debug_level; }
56 | static void setDebugLevel(DebugLevel level) { m_debug_level = level; }
57 |
58 | static int warningCount() { return m_warning_count; }
59 |
60 | static int suppressedCount() { return m_suppressed_count; }
61 |
62 | static void warning(const QString &str);
63 |
64 | static void debugSparse(const QString &str) {
65 | debug(SparseDebug, str);
66 | }
67 | static void debugMedium(const QString &str) {
68 | debug(MediumDebug, str);
69 | }
70 | static void debugFull(const QString &str) {
71 | debug(FullDebug, str);
72 | }
73 | static void debug(DebugLevel level, const QString &str);
74 |
75 | private:
76 | static int m_warning_count;
77 | static int m_suppressed_count;
78 | static DebugLevel m_debug_level;
79 | static QString m_context;
80 | static QSet m_reported_warnings;
81 | };
82 |
83 | #endif // REPORTHANDLER_H
84 |
--------------------------------------------------------------------------------
/generator/typesystem_phonon-qtscript.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/generator/prigenerator.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #include "prigenerator.h"
43 | #include "reporthandler.h"
44 | #include "fileout.h"
45 |
46 | void PriGenerator::addHeader(const QString &folder, const QString &header)
47 | {
48 | priHash[folder].headers << header;
49 | }
50 |
51 | void PriGenerator::addSource(const QString &folder, const QString &source)
52 | {
53 | priHash[folder].sources << source;
54 | }
55 |
56 | void PriGenerator::generate()
57 | {
58 | QHashIterator pri(priHash);
59 | while (pri.hasNext()) {
60 | pri.next();
61 | QStringList list = pri.value().headers;
62 | if (list.isEmpty())
63 | continue;
64 |
65 | QString folder = pri.key();
66 | FileOut file(m_out_dir + "/generated_cpp/" + folder + "/" + folder + ".pri");
67 | file.stream << "HEADERS += \\\n";
68 | qSort(list.begin(), list.end());
69 | foreach (const QString &entry, list) {
70 | file.stream << " $$PWD/" << entry << " \\\n";
71 | }
72 |
73 | file.stream << "\n";
74 | file.stream << "SOURCES += \\\n";
75 | list = pri.value().sources;
76 | qSort(list.begin(), list.end());
77 | foreach (const QString &entry, list) {
78 | file.stream << " $$PWD/" << entry << " \\\n";
79 | }
80 | file.stream << " $$PWD/" << folder << "_init.cpp\n";
81 |
82 | if (file.done())
83 | ++m_num_generated_written;
84 | ++m_num_generated;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/generator/parser/rpp/pp-iterator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef PP_ITERATOR_H
43 | #define PP_ITERATOR_H
44 |
45 | #include
46 |
47 | namespace rpp {
48 |
49 | class pp_null_output_iterator
50 | : public std::iterator
51 | {
52 | public:
53 | pp_null_output_iterator() {}
54 |
55 | template
56 | pp_null_output_iterator &operator=(_Tp const &)
57 | { return *this; }
58 |
59 | inline pp_null_output_iterator &operator * () { return *this; }
60 | inline pp_null_output_iterator &operator ++ () { return *this; }
61 | inline pp_null_output_iterator operator ++ (int) { return *this; }
62 | };
63 |
64 | template
65 | class pp_output_iterator
66 | : public std::iterator
67 | {
68 | std::string &_M_result;
69 |
70 | public:
71 | explicit pp_output_iterator(std::string &__result):
72 | _M_result (__result) {}
73 |
74 | inline pp_output_iterator &operator=(typename _Container::const_reference __v)
75 | {
76 | if (_M_result.capacity () == _M_result.size ())
77 | _M_result.reserve (_M_result.capacity () << 2);
78 |
79 | _M_result.push_back(__v);
80 | return *this;
81 | }
82 |
83 | inline pp_output_iterator &operator * () { return *this; }
84 | inline pp_output_iterator &operator ++ () { return *this; }
85 | inline pp_output_iterator operator ++ (int) { return *this; }
86 | };
87 |
88 | } // namespace rpp
89 |
90 | #endif // PP_ITERATOR_H
91 |
92 | // kate: space-indent on; indent-width 2; replace-tabs on;
93 |
--------------------------------------------------------------------------------
/generator/parser/rpp/pp.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 | ** Contact: http://www.qt-project.org/legal
5 | **
6 | ** This file is part of the Qt Script Generator project on Qt Labs.
7 | **
8 | ** $QT_BEGIN_LICENSE:LGPL$
9 | ** Commercial License Usage
10 | ** Licensees holding valid commercial Qt licenses may use this file in
11 | ** accordance with the commercial license agreement provided with the
12 | ** Software or, alternatively, in accordance with the terms contained in
13 | ** a written agreement between you and Digia. For licensing terms and
14 | ** conditions see http://qt.digia.com/licensing. For further information
15 | ** use the contact form at http://qt.digia.com/contact-us.
16 | **
17 | ** GNU Lesser General Public License Usage
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
19 | ** General Public License version 2.1 as published by the Free Software
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
21 | ** packaging of this file. Please review the following information to
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 | **
25 | ** In addition, as a special exception, Digia gives you certain additional
26 | ** rights. These rights are described in the Digia Qt LGPL Exception
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 | **
29 | ** GNU General Public License Usage
30 | ** Alternatively, this file may be used under the terms of the GNU
31 | ** General Public License version 3.0 as published by the Free Software
32 | ** Foundation and appearing in the file LICENSE.GPL included in the
33 | ** packaging of this file. Please review the following information to
34 | ** ensure the GNU General Public License version 3.0 requirements will be
35 | ** met: http://www.gnu.org/copyleft/gpl.html.
36 | **
37 | **
38 | ** $QT_END_LICENSE$
39 | **
40 | ****************************************************************************/
41 |
42 | #ifndef PP_H
43 | #define PP_H
44 |
45 | #if defined(_WIN64) || defined(WIN64) || defined(__WIN64__) \
46 | || defined(_WIN32) || defined(WIN32) || defined(__WIN32__)
47 | # define PP_OS_WIN
48 | #endif
49 |
50 | #include
51 | #include