summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>2016-12-01 14:06:38 +0100
committerJuergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>2016-12-01 14:06:38 +0100
commit04367affb556438fd186351d00462ea155606538 (patch)
tree17bc8364483dcbf8b8bb7167f8090f804cf229a0
parent5ea98ebef79fc4eb88ae13fd6163e9e393649042 (diff)
downloadqtivi-qface-04367affb556438fd186351d00462ea155606538.tar.gz
wipe out
-rw-r--r--INSTALL.md43
-rw-r--r--LICENSE.GPLV3684
-rw-r--r--README.md47
-rw-r--r--USAGE.md96
-rwxr-xr-xcli.py185
-rw-r--r--docs/api.md20
-rw-r--r--docs/builtin.md58
-rw-r--r--docs/domain.md5
-rw-r--r--docs/extending.md1
-rw-r--r--docs/grammar.md106
-rw-r--r--docs/qface_concept.pngbin24584 -> 0 bytes
-rw-r--r--docs/usage.md117
-rw-r--r--docs/welcome.md11
-rw-r--r--examples/qtcpp/echo/echo.pro12
-rw-r--r--examples/qtcpp/echo/echo.qdl15
-rw-r--r--examples/qtcpp/echo/main.cpp8
-rwxr-xr-xgenerator/csv/csv.py22
-rw-r--r--generator/csv/templates/modules.csv12
-rw-r--r--generator/qtcpp/log.yaml18
-rw-r--r--generator/qtcpp/qtcpp.py93
-rw-r--r--generator/qtcpp/templates/interface.cpp57
-rw-r--r--generator/qtcpp/templates/interface.h46
-rw-r--r--generator/qtcpp/templates/module.cpp43
-rw-r--r--generator/qtcpp/templates/module.h39
-rw-r--r--generator/qtcpp/templates/plugin.cpp26
-rw-r--r--generator/qtcpp/templates/plugin.h18
-rw-r--r--generator/qtcpp/templates/plugin.pri33
-rw-r--r--generator/qtcpp/templates/plugin.pro33
-rw-r--r--generator/qtcpp/templates/project.pri32
-rw-r--r--generator/qtcpp/templates/project.pro33
-rw-r--r--generator/qtcpp/templates/qmldir3
-rw-r--r--generator/qtcpp/templates/struct.cpp20
-rw-r--r--generator/qtcpp/templates/struct.h28
-rw-r--r--generator/qtcpp/templates/structmodel.cpp88
-rw-r--r--generator/qtcpp/templates/structmodel.h36
-rw-r--r--qface/__init__.py0
-rw-r--r--qface/generator.py129
-rw-r--r--qface/idl/__init__.py0
-rw-r--r--qface/idl/domain.py348
-rw-r--r--qface/idl/listener.py197
-rw-r--r--qface/idl/parser/T.g4112
-rw-r--r--qface/idl/parser/T.tokens58
-rw-r--r--qface/idl/parser/TLexer.py185
-rw-r--r--qface/idl/parser/TLexer.tokens58
-rw-r--r--qface/idl/parser/TListener.py199
-rw-r--r--qface/idl/parser/TParser.py1669
-rw-r--r--qface/idl/parser/TVisitor.py118
-rw-r--r--qface/idl/parser/__init__.py0
-rw-r--r--requirements.txt8
-rw-r--r--setup.py21
-rw-r--r--tests/in/com.pelagicore.ivi.climate.qdl111
-rw-r--r--tests/in/com.pelagicore.ivi.tuner.qdl54
-rw-r--r--tests/in/com.pelagicore.one.qdl19
-rw-r--r--tests/in/com.pelagicore.test.qdl44
-rw-r--r--tests/test_climate.py24
-rw-r--r--tests/test_generator.py40
-rw-r--r--tests/test_lookup.py37
-rw-r--r--tests/test_parser.py142
-rw-r--r--tests/test_validation.py64
59 files changed, 0 insertions, 5725 deletions
diff --git a/INSTALL.md b/INSTALL.md
deleted file mode 100644
index b5e82ae..0000000
--- a/INSTALL.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Installation
-
-Installing as python executable using pip3 (python3)
-
- git clone git@github.com:Pelagicore/qface.git
- cd qface
- pip3 install -e .
-
-Installs qface as an "editable" package. Means updates on the local git repo are reflected. If this is not what you want you can install it with
-
- cd qface
- pip3 install .
-
-
-# Setup Develoment
-
-To install the python dependencies use
-
- cd qface
- pip3 install -r requirements
- pip3 install -e .
-
-For updating the grammar you also need antlr4 (see http://www.antlr.org).
-
-# Tests
-
-The commands are controlled by the cli.py script.
-
- cd qface
- ./cli.py --help
-
-To run the tests once
-
- ./cli.py test
-
-To monitor the tests and auto-run the tests
-
- cd qface
- ./cli.py test_monitor
-
-
-
-
diff --git a/LICENSE.GPLV3 b/LICENSE.GPLV3
deleted file mode 100644
index 846b5ed..0000000
--- a/LICENSE.GPLV3
+++ /dev/null
@@ -1,684 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
-
- QFace is Copyright (C) 2016 Pelagicore AB
- Contact: http://www.pelagicore.com/
-
- You may use, distribute and copy QFace under the terms of the
- GNU General Public License version 3, which is displayed below.
-
--------------------------------------------------------------------------
-
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/README.md b/README.md
deleted file mode 100644
index d4cd157..0000000
--- a/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Qt Interface Builder (QFace)
-
-
-QFace is an generator framework based on a common modern IDL. It is not a generator a such but enforces a common IDL format and provides a library to write your own generator. It is actually very easy to create your own generator and generate your custom solution based on your needs from the same IDL.
-
-The IDL is designed after the Qt/QML interface and as such is optimized to generate source code used with Qt C++ or Qt QML, but it is not limited to this use case.
-
-QFace is already very fast by design and suitable for large IDL document sets. Additionally it can use a cache to avoid parsing unchanged IDL documents. It can automatically avoid writing new files if the target file has the same content.
-
-QFace is written out of the learnings of using IDLs in other large projects. Often in the project you need to adjust the code generation but in many generators this is awfully complicated. Or you need to run a report on the documents or generate specific documentation. In QFace this is enabled by having a very flexible code generation framework which enforces the same IDL.
-
-Please see the INSTALL and USAGE guides for more information.
-
-## Copyright and license
-
-Copyright (C) 2016 Pelagicore AG
-
-The source code in this repository is subject to the terms of the GPLv3 licence, please see included "LICENSE" file for details.
-
-
-## QFace Example
-
-
-```js
-// echo.qdl
-module org.example 1.0;
-
-/**!
-The echo interface to call someone
-on the other side
-*/
-interface Echo {
- readonly Message lastMessage;
- void echo(Message message);
- event void callMe();
-};
-
-struct Message {
- string text;
-};
-```
-
-Now calling the generator to generate the C++ code.
-
- qface --generator qtcpp --input echo.qdl --output out
-
-Depending on the used generator it reads the input file and runs it through the generator. The output files are written relative to the given output directory. The input can be either a file or a folder.
diff --git a/USAGE.md b/USAGE.md
deleted file mode 100644
index 00cf2b9..0000000
--- a/USAGE.md
+++ /dev/null
@@ -1,96 +0,0 @@
-# Usage
-
-There is a central client to interface the commands for generation, called cli.
-
-To use an existing generator just provide the path to the generator script.
-
- ./cli.py generator --generator generator/csv --input input --output output
-
-You can also create a YAML configuration file (e.g csv.yaml):
-
- generator: generator/csv
- input: input
- output: output
-
-And then call the client with:
-
- ./cli.py generate --runner csv.yaml
-
-To enable auto-live reloading just use the monitor target:
-
-
- ./cli.py generator_monitor --runner csv.yaml
-
-This will observe the generator folder and the input folder for changes and re-run the generator.
-
-# Grammar
-
-The IDL grammar is described in the grammar file (see qface/parser/idl/T.g4)
-
- module <identifier> <version>;
-
- [import <identifier> <version>];
-
- interface <identifier> {
- (readonly) <type> <property>;
- <type> <operation>([type name]);
- event <type> <operation>([type name]);
- list<type> <property>;
- model<type> <property>;
- }
-
- enum <identifier> {
- <name> = <value>
- }
-
- flag <identifier> {
- <name> = <value>
- }
-
- struct <identifier> {
- <type> <name>;
- }
-
-
-# Domain Model
-
-The IDL is converted into an in memory domain model (see qface/idl/domain.py).
-
- System
- Module
- Import
- Service
- Property
- Operation
- Enum
- Struct
-
-The domain model is the base for the code generation.
-
-# Code Generation
-
-The code generation is driven by a small script which iterates over the domain model and writes files using a template language (see http://jinja.pocoo.org) and espcially the template designer documentation (http://jinja.pocoo.org/docs/dev/templates/).
-
- from qface.generator import FileSystem, Generator
-
- def generate(input, output):
- system = FileSystem.parse_dir(input)
- generator = Generator(searchpath='templates')
- ctx = {'output': output, 'system': system}
- generator.write('{{output}}/modules.csv', 'modules.csv', ctx)
-
-This script reads the input directory returns a system object form the domain model. This is used as the root object for the code generation inside the template language.
-
- {% for module in system.modules %}
- {%- for interface in module.interfaces -%}
- SERVICE, {{module}}.{{interface}}
- {% endfor -%}
- {%- for struct in module.structs -%}
- STRUCT , {{module}}.{{struct}}
- {% endfor -%}
- {%- for enum in module.enums -%}
- ENUM , {{module}}.{{enum}}
- {% endfor -%}
- {% endfor %}
-
-The template iterates over the domain objects and generates text which is written into a file. The file name is also adjustable using the same template language.
diff --git a/cli.py b/cli.py
deleted file mode 100755
index 2b287f9..0000000
--- a/cli.py
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) Pelagicore AB 2016
-
-import click
-from subprocess import call
-from watchdog.events import FileSystemEventHandler
-from watchdog.observers import Observer
-from path import Path
-import time
-import os
-import sys
-import yaml
-
-
-CWD = Path(__file__).parent
-
-os.environ['PYTHONPATH'] = os.getcwd()
-
-
-def sh(cmd, all=False, **kwargs):
- click.echo('$ {0}'.format(cmd))
- return call(cmd, shell=True, **kwargs)
-
-
-@click.group()
-def cli():
- pass
-
-
-@cli.command()
-def antlr():
- """generate a new parser based on the grammar using antlr"""
- cwd = str(Path('qface/idl/parser').abspath())
- sh('antlr4 -Dlanguage=Python3 -Werror -package qface.idl.parser -o . -listener -visitor T.g4', cwd=cwd)
-
-
-@cli.command()
-@click.option('--debug/--nodebug')
-def test(debug):
- """run the tests"""
- sh('python3 -m pytest -v -s -l {0}'.format('-pdb' if debug else ''))
-
-
-@cli.command()
-def test_ci():
- """run the tests for CI integration"""
- sh('python3 -m pytest -v -s -l')
-
-
-class RunTestChangeHandler(FileSystemEventHandler):
- def __init__(self, clickContext):
- super(RunTestChangeHandler).__init__()
- self.clickContext = clickContext
-
- def on_any_event(self, event):
- if event.is_directory:
- return
- if Path(event.src_path).ext == '.py':
- sh('python3 -m pytest')
-
-
-@cli.command()
-@click.pass_context
-def test_monitor(ctx):
- """run the tests and re-run on changes"""
- sh('python3 -m pytest')
- while True:
- event_handler = RunTestChangeHandler(ctx)
- observer = Observer()
- observer.schedule(event_handler, './tests', recursive=True)
- observer.schedule(event_handler, './qface', recursive=True)
- observer.start()
- try:
- while True:
- time.sleep(1)
- except KeyboardInterrupt:
- observer.stop()
- observer.join()
-
-
-class RunScriptChangeHandler(FileSystemEventHandler):
- def __init__(self, script, cwd=None):
- super(RunTestChangeHandler).__init__()
- self.script = script
- self.cwd = cwd
-
- def on_modified(self, event):
- if event.src_path.endswith('.cache'):
- return
- if event.is_directory:
- return
- self.run()
-
- def run(self):
- sh('python3 {0}'.format(self.script), cwd=self.cwd)
-
-
-@cli.command()
-@click.option('--runner', type=click.File('r'), help="use the runner YAML file to configure the generation")
-@click.option('--reload/--no-reload', default=False, help="if enabled auto-reload the generator on input changes")
-@click.option('--generator', help="specifies the generator (either by name or path)")
-@click.option('--input', type=click.Path(exists=True), help="specifies the input folder")
-@click.option('--output', type=click.Path(exists=False), help="specified the output folder")
-@click.option('--list/--no-list', help="lists the available generators")
-@click.option('--clean/--no-clean', help="initially cleans the output directory")
-def generate(runner, generator, input, output, reload, list, clean):
- if list:
- entries = [str(x.name) for x in Path('generator').dirs()]
- click.echo('generators: {0}'.format(entries))
- sys.exit(0)
- """run the named generator"""
- if runner:
- config = yaml.load(runner)
- generator = config['generator']
- input = config['input']
- output = config['output']
- if not generator or not input or not output:
- print('generator, input and output arguments are required')
- sys.exit(-1)
- # check for embedded generator by name
- generator = CWD / 'generator/{0}'.format(generator)
- if not generator.exists():
- generator = Path(generator).abspath()
- # look if generator points to an external generator
- if not generator.exists():
- print('can not find the specified generator: ' + str(generator))
- sys.exit(-1)
- input = Path(input).abspath()
- output = Path(output).abspath()
- generator = Path(generator).abspath()
- if clean:
- output.rmtree_p()
- output.makedirs_p()
- if not reload:
- _generate_once(generator, input, output)
- else:
- _generate_reload(generator, input, output)
-
-
-def _generate_once(generator, input, output):
- script = '{0}.py'.format(generator.name)
- sh('python3 {0} --input {1} --output {2}'
- .format(script, input, output),
- cwd=generator)
-
-
-def _generate_reload(generator, input, output):
- """run the named generator and monitor the input and generator folder"""
- script = generator / '{0}.py --input {1} --output {2}'.format(generator.name, input, output)
- event_handler = RunScriptChangeHandler(script, cwd=generator)
- event_handler.run() # run always once
- observer = Observer()
- observer.schedule(event_handler, generator, recursive=True)
- observer.schedule(event_handler, input, recursive=True)
- observer.schedule(event_handler, './qface', recursive=True)
- observer.start()
-
- try:
- while True:
- time.sleep(2)
- except KeyboardInterrupt:
- observer.stop()
- observer.join()
-
-
-@click.option('--editable/--no-editable', default=False, help='install editable package')
-@cli.command()
-def install(editable):
- """install the script onto the system using pip3"""
- script_dir = str(Path(__file__).parent.abspath())
- print(script_dir)
- if editable:
- sh('pip3 install --editable {0} --upgrade'.format(script_dir))
- else:
- sh('pip3 install {0} --upgrade'.format(script_dir))
-
-
-@cli.command()
-def uninstall():
- """uninstall the script from the system using pip3"""
- sh('pip3 uninstall qface')
-
-
-if __name__ == '__main__':
- cli()
diff --git a/docs/api.md b/docs/api.md
deleted file mode 100644
index 647e3a3..0000000
--- a/docs/api.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# API
-
-The API mostly consist of two helper classes and the domain model. For the domain model, see the domain documentation.
-
-## qface.generator.FileSystem
-
-* FileSystem.parse_document(path: str, system: System = None)
-* FileSystem.parse_dir(path, identifier: str = None, clear_cache=True)
-* FileSystem.find_files(path, glob='*.qdl')
-
-## qface.generator.Generator
-
-* Generator(searchpath)
- Manages the templates and applies your context data
-* generator.get_template(self, name: str)
- Retrievs a single template file from the template loader
-* generator.render(self, name: str, context: dict)
-* generator.apply(self, template: Template, context: dict)
-* generator.write(self, fileTemplate: str, template: str, context: dict)
-* generator.register_filter(self, name, callback) \ No newline at end of file
diff --git a/docs/builtin.md b/docs/builtin.md
deleted file mode 100644
index fd04109..0000000
--- a/docs/builtin.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# Builtin Generators
-
-## QtCPP Generator
-
-This is one of the buit-in generators to generate a QtCPP API to be exported into QML.
-The structs/enums/flags are defined in an own Module Qbject which acts as a namespace and can not be instantiated.
-
-Each interface is generated into a QObject with proper properties, signals and invokables.
-
-For example an QDL like this:
-
-```js
-module sample 1.0
-
-interface Heater {
- real temperature;
- Status status;
- void increaseTemperature(qreal step);
- void decreaseTemperature(qreal step);
- event void error(string message);
-}
-
-enum Status {
- Null,
- Ready,
- Error
-}
-```
-
-The QTCPP generator will generate all CPP code including the plugin code and project files. Additional it will generate an empy simulation stub.
-
-In QML you would now be able to write the following code.
-
-```qml
- import sample 1.0
-
- Item {
- Heater {
- id: heater
- onStatusChanged: {
- if(status === SampleModule.Ready) {
- console.log('ready ...')
- }
- }
- onError: console.log(message)
- }
- Text {
- anchors.centerIn: parent
- text: heater.temperature
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- heater.increaseTemperature(0.5)
- }
- }
- }
-``` \ No newline at end of file
diff --git a/docs/domain.md b/docs/domain.md
deleted file mode 100644
index 7d68413..0000000
--- a/docs/domain.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Domain Model
-
-The domain model resembles the structure of our system as objects. It is build by the parser and is the input into the generator.
-
-It is important to understand the domain model as it is the main input for the template generation. \ No newline at end of file
diff --git a/docs/extending.md b/docs/extending.md
deleted file mode 100644
index 217634c..0000000
--- a/docs/extending.md
+++ /dev/null
@@ -1 +0,0 @@
-# Extending QFace
diff --git a/docs/grammar.md b/docs/grammar.md
deleted file mode 100644
index a60aded..0000000
--- a/docs/grammar.md
+++ /dev/null
@@ -1,106 +0,0 @@
-# QDL grammar
-
-QDL (Qt definnition language) is an IDL to define an interface. In general it is modeled to define an interface between Qt QML and C++. The QDL syntax is flexible enough also to be used in other context.
-
-```html
-module <module> <version>
-import <module> <version>
-
-interface <Identifier> {
- <type> <identifier>
- <type> <operation>(<parameter>*)
- event <type> <event>(<parameter>*)
-}
-
-struct <Identifier> {
- <type> <identifier>;
-}
-
-enum <Identifier> {
- <name> = <value>,
-}
-
-flag <Identifier> {
- <name> = <value>,
-}
-```
-
-A QDL document always describes one module. Each document can contain one or more interfaces, structs, flags or enums. Each document can import other modules using the import statement.
-
-
-## Module
-
-A module is identified name. A module should be normally a URI where all parts are lowercase (e.g. `entertainment.tuner`). A module can import other modules. This is used to ensure that dependencies are declared inside the QDL file.
-
-## Types
-
-Types are either local and can be references simply by its name, or they are from external module in this case they need to be referenced with the fully qualified name (`module + '.' + name`). A type can be an interface, struct, enum or flag.
-
-A module consist of either one or more interfaces, structs and enums/flags. They can come in any number or combination. The interface is the only type which can contain operations and events. The struct is merely a container to transport structured data. An enum/flag allows the user to encode information used inside the struct or interface as datatype.
-
-The QDL does not allow to extend interfaces. It is by design kept simple.
-
-Below is an example of a QDL file.
-
-```java
-module entertainment.tuner 1.0;
-
-import common 1.0
-
-/*! Service Tuner */
-interface Tuner {
- /*! property currentStation */
- readonly Station currentStation;
- /*! operation nextStation */
- void nextStation();
- /*! operation previousStation */
- void previousStation();
- /*! operation updateCurrentStation */
- void updateCurrentStation(int stationId);
-
- list<int> primitiveList;
- list<Station> complexList;
- model<int> primitiveModel;
- model<Station> complexModel;
-}
-
-/*! enum State */
-enum State {
- /*! value State.Null */
- Null=0,
- /*! value State.Loading */
- Loading=1,
- /*! value State.Ready */
- Ready=2,
- /*! value State.Error */
- Error=3
-}
-
-/*! enum Waveband */
-enum Waveband {
- /*! value Waveband.FM */
- FM=0,
- /*! value Waveband.AM */
- AM=1
-}
-
-flag Features {
- Mono = 0x1,
- Stereo = 0x2,
-}
-
-/*! struct Station */
-struct Station {
- /*! member stationId */
- int stationId;
- /*! member name */
- string name;
- /*! last time modified */
- common.TimeStamp modified;
-}
-```
-
-
-
-
-
diff --git a/docs/qface_concept.png b/docs/qface_concept.png
deleted file mode 100644
index eb31dbd..0000000
--- a/docs/qface_concept.png
+++ /dev/null
Binary files differ
diff --git a/docs/usage.md b/docs/usage.md
deleted file mode 100644
index d45669d..0000000
--- a/docs/usage.md
+++ /dev/null
@@ -1,117 +0,0 @@
-# Usage
-
-QFace requires one or more IDL files as input file and a generator to produce output files. The IDL files are named QDL (Qt definition language).
-
-There is a central client to interface the commands for generation, called cli.
-
-To use an existing generator just provide the path to the generator script.
-
-![concept](qface_concept.png)
-
-```sh
-./cli.py generator --generator generator/csv --input input --output output
-```
-
-You can also create a YAML configuration file (e.g csv.yaml):
-
-```yaml
-generator: generator/csv
-input: input
-output: output
-```
-
-And then call the client with:
-
-```sh
-./cli.py generate --runner csv.yaml
-```
-
-To enable auto-live reloading just use the monitor target:
-
-
-```sh
-./cli.py generator_monitor --runner csv.yaml
-```
-
-This will observe the generator folder and the input folder for changes and re-run the generator.
-
-## Grammar
-
-The IDL grammar is described in the grammar file (see qface/parser/idl/T.g4)
-
-```html
- module <identifier> <version>;
-
- [import <identifier> <version>];
-
- interface <identifier> {
- (readonly) <type> <property>;
- <type> <operation>([type name]);
- event <type> <operation>([type name]);
- list<type> <property>;
- model<type> <property>;
- }
-
- enum <identifier> {
- <name> = <value>
- }
-
- flag <identifier> {
- <name> = <value>
- }
-
- struct <identifier> {
- <type> <name>;
- }
-```
-
-## Domain Model
-
-The IDL is converted into an in memory domain model (see qface/idl/domain.py).
-
-```yaml
- - System
- - Module
- - Import
- - Service
- - Property
- - Operation
- - Event
- - Enum
- - Flag
- - Struct
-```
-
-The domain model is the base for the code generation.
-
-## Code Generation
-
-The code generation is driven by a small script which iterates over the domain model and writes files using a template language (see http://jinja.pocoo.org) and espcially the template designer documentation (http://jinja.pocoo.org/docs/dev/templates/).
-
-```python
-from qface.generator import FileSystem, Generator
-
-def generate(input, output):
- system = FileSystem.parse_dir(input)
- generator = Generator(searchpath='templates')
- ctx = {'output': output, 'system': system}
- generator.write('{{output}}/modules.csv', 'modules.csv', ctx)
-```
-
-This script reads the input directory returns a system object form the domain model. This is used as the root object for the code generation inside the template language.
-
-```jinja
- {% for module in system.modules %}
- {%- for interface in module.interfaces -%}
- SERVICE, {{module}}.{{interface}}
- {% endfor -%}
- {%- for struct in module.structs -%}
- STRUCT , {{module}}.{{struct}}
- {% endfor -%}
- {%- for enum in module.enums -%}
- ENUM , {{module}}.{{enum}}
- {% endfor -%}
- {% endfor %}
-```
-
-The template iterates over the domain objects and generates text which is written into a file. The file name is also adjustable using the same template language.
diff --git a/docs/welcome.md b/docs/welcome.md
deleted file mode 100644
index aee804c..0000000
--- a/docs/welcome.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Welcome
-
-QFace is a flexible Qt API generator. It uses a common IDL format (called qdl) to define an API. QFace comes with a set of predefined generators to generate QML Plugins. QFace can be easily extended with your own generator.
-
-
-* [API](api.md)
-* [Domain](domain.md)
-* [Extending](extending.md)
-* [Grammar](grammar.md)
-* [Usage](usage.md)
-* [Builtin](builtin.md) \ No newline at end of file
diff --git a/examples/qtcpp/echo/echo.pro b/examples/qtcpp/echo/echo.pro
deleted file mode 100644
index cfc7aef..0000000
--- a/examples/qtcpp/echo/echo.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-QT += core
-QT -= gui
-
-CONFIG += c++11
-
-TARGET = echo
-CONFIG += console
-CONFIG -= app_bundle
-
-TEMPLATE = app
-
-SOURCES += main.cpp
diff --git a/examples/qtcpp/echo/echo.qdl b/examples/qtcpp/echo/echo.qdl
deleted file mode 100644
index d308285..0000000
--- a/examples/qtcpp/echo/echo.qdl
+++ /dev/null
@@ -1,15 +0,0 @@
-module org.example 1.0;
-
-/*!
- * Provide a simple echo service.
- */
-interface Echo {
- /*!
- * The last echo message.
- */
- string currentMessage;
- /*!
- * Returns the passed in message
- */
- string echo(string message);
-}
diff --git a/examples/qtcpp/echo/main.cpp b/examples/qtcpp/echo/main.cpp
deleted file mode 100644
index 2e15127..0000000
--- a/examples/qtcpp/echo/main.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <QtCore>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication a(argc, argv);
-
- return a.exec();
-}
diff --git a/generator/csv/csv.py b/generator/csv/csv.py
deleted file mode 100755
index 3636997..0000000
--- a/generator/csv/csv.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) Pelagicore AB 2016
-
-import click
-from qface.generator import FileSystem, Generator
-
-
-def generate(input, output):
- system = FileSystem.parse_dir(input)
- generator = Generator(searchpath='templates')
- ctx = {'output': output, 'system': system}
- generator.write('{{output}}/modules.csv', 'modules.csv', ctx)
-
-
-@click.command()
-@click.option('--input', type=click.Path(exists=True))
-@click.option('--output', type=click.Path(exists=True))
-def runner(input, output):
- generate(input, output)
-
-if __name__ == '__main__':
- runner()
diff --git a/generator/csv/templates/modules.csv b/generator/csv/templates/modules.csv
deleted file mode 100644
index 567dc43..0000000
--- a/generator/csv/templates/modules.csv
+++ /dev/null
@@ -1,12 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-{% for module in system.modules %}
- {%- for interface in module.interfaces -%}
- SERVICE, {{module}}.{{interface}}
- {% endfor -%}
- {%- for struct in module.structs -%}
- STRUCT , {{module}}.{{struct}}
- {% endfor -%}
- {%- for enum in module.enums -%}
- ENUM , {{module}}.{{enum}}
- {% endfor -%}
-{% endfor %}
diff --git a/generator/qtcpp/log.yaml b/generator/qtcpp/log.yaml
deleted file mode 100644
index 61e7815..0000000
--- a/generator/qtcpp/log.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: 1
-formatters:
- simple:
- format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
-handlers:
- console:
- class: logging.StreamHandler
- level: DEBUG
- formatter: simple
- stream: ext://sys.stdout
-loggers:
- qface.generator:
- level: WARN
- handlers: [console]
- propagate: no
-root:
- level: DEBUG
- handlers: [console]
diff --git a/generator/qtcpp/qtcpp.py b/generator/qtcpp/qtcpp.py
deleted file mode 100644
index b3716b6..0000000
--- a/generator/qtcpp/qtcpp.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) Pelagicore AB 2016
-
-import click
-import logging
-import logging.config
-import yaml
-from qface.generator import FileSystem, Generator
-
-
-logging.config.dictConfig(yaml.load(open('log.yaml')))
-logger = logging.getLogger(__name__)
-
-
-def paramterType(symbol):
- module_name = symbol.module.module_name()
- if symbol.type.is_enum:
- return 'Qml{0}Module::{1} {2}'.format(module_name, symbol.type, symbol)
- if symbol.type.is_void or symbol.type.is_primitive:
- if symbol.type.name == 'string':
- return 'const QString &{0}'.format(symbol)
- if symbol.type.name == 'var':
- return 'const QVariant &{0}'.format(symbol)
- if symbol.type.name == 'real':
- return 'float {0}'.format(symbol)
- return '{0} {1}'.format(symbol.type, symbol)
- elif symbol.type.is_list:
- return 'const QList<{0}> &{1}'.format(symbol.type.nested, symbol)
- elif symbol.type.is_model:
- return '{0}Model *{1}'.format(symbol.type.nested, symbol)
- else:
- return 'const {0} &{1}'.format(symbol.type, symbol)
-
-
-def returnType(symbol):
- module_name = symbol.module.module_name()
- if symbol.type.is_enum:
- return 'Qml{0}Module::{1}'.format(module_name, symbol.type)
- if symbol.type.is_void or symbol.type.is_primitive:
- if symbol.type.name == 'string':
- return 'QString'
- if symbol.type.name == 'var':
- return 'QVariant'
- if symbol.type.name == 'real':
- return 'float'
- return symbol.type
- elif symbol.type.is_list:
- return 'QList<{0}>'.format(symbol.type.nested)
- elif symbol.type.is_model:
- return '{0}Model*'.format(symbol.type.nested)
- else:
- return symbol.type
-
-
-def generate(input, output):
- system = FileSystem.parse_dir(input)
- generator = Generator(searchpath='./templates')
- generator.register_filter('returnType', returnType)
- generator.register_filter('parameterType', paramterType)
- ctx = {'output': output}
- for module in system.modules:
- logger.debug('process %s' % module)
- ctx.update({'module': module})
- moduleOutput = generator.apply('{{output}}/{{module|lower}}', ctx)
- ctx.update({'path': moduleOutput})
- generator.write('{{path}}/qmldir', 'qmldir', ctx)
- generator.write('{{path}}/plugin.cpp', 'plugin.cpp', ctx)
- generator.write('{{path}}/plugin.h', 'plugin.h', ctx)
- generator.write('{{path}}/{{module|lower}}.pri', 'project.pri', ctx)
- generator.write('{{path}}/{{module|lower}}.pro', 'project.pro', ctx)
- generator.write('{{path}}/qml{{module.module_name|lower}}module.h', 'module.h', ctx)
- generator.write('{{path}}/qml{{module.module_name|lower}}module.cpp', 'module.cpp', ctx)
- for interface in module.interfaces:
- ctx.update({'interface': interface})
- generator.write('{{path}}/{{interface|lower}}.h', 'interface.h', ctx)
- generator.write('{{path}}/{{interface|lower}}.cpp', 'interface.cpp', ctx)
- for struct in module.structs:
- ctx.update({'struct': struct})
- generator.write('{{path}}/{{struct|lower}}.h', 'struct.h', ctx)
- generator.write('{{path}}/{{struct|lower}}.cpp', 'struct.cpp', ctx)
- generator.write('{{path}}/{{struct|lower}}model.h', 'structmodel.h', ctx)
- generator.write('{{path}}/{{struct|lower}}model.cpp', 'structmodel.cpp', ctx)
-
-
-@click.command()
-@click.option('--input', type=click.Path(exists=True))
-@click.option('--output', type=click.Path(exists=True))
-def runner(input, output):
- generate(input, output)
-
-
-if __name__ == '__main__':
- runner()
diff --git a/generator/qtcpp/templates/interface.cpp b/generator/qtcpp/templates/interface.cpp
deleted file mode 100644
index 3485071..0000000
--- a/generator/qtcpp/templates/interface.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#include <{{interface|lower}}.h>
-
-#include <QtQml>
-
-{% set class = 'Qml{0}'.format(interface) %}
-
-QObject* {{interface|lower}}_singletontype_provider(QQmlEngine*, QJSEngine*)
-{
- return new {{class}}();
-}
-
-
-{{interface.comment}}
-{{class}}::{{class}}(QObject *parent)
- : QObject(parent)
-{
-{% for property in interface.properties %}
-{% if property.type.is_model %}
- m_{{property}} = new {{property.type.nested}}Model(this);
-{% endif %}
-{% endfor %}
-}
-
-void {{class}}::registerQmlTypes(const QString& uri, int majorVersion, int minorVersion)
-{
- qmlRegisterSingletonType<{{class}}>(uri.toLatin1(), majorVersion, minorVersion, "{{interface}}", {{interface|lower}}_singletontype_provider);
-}
-
-{% for property in interface.properties %}
-void {{class}}::set{{property|upperfirst}}({{ property|parameterType }})
-{
- if(m_{{property}} == {{property}}) {
- return;
- }
- m_{{property}} = {{property}};
- emit {{property}}Changed({{property}});
-}
-
-{{property|returnType}} {{class}}::{{property}}() const
-{
- return m_{{property}};
-}
-
-{% endfor %}
-
-{% for operation in interface.operations %}
-{{operation.comment}}
-{{operation|returnType}} {{class}}::{{operation}}({{operation.parameters|map('parameterType')|join(', ')}})
-{
-}
-{% endfor %}
diff --git a/generator/qtcpp/templates/interface.h b/generator/qtcpp/templates/interface.h
deleted file mode 100644
index 2d1ffb1..0000000
--- a/generator/qtcpp/templates/interface.h
+++ /dev/null
@@ -1,46 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-{% set class = 'Qml{0}'.format(interface) %}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#pragma once
-
-#include <QtCore>
-
-#include "qml{{module.module_name|lower}}module.h"
-
-class {{class}} : public QObject
-{
- Q_OBJECT
-{% for property in interface.properties %}
- Q_PROPERTY({{property|returnType}} {{property}} READ {{property}} {%if not property.is_readonly%}WRITE set{{property|upperfirst}} {%endif%}NOTIFY {{property}}Changed)
-{% endfor %}
-
-public:
- {{class}}(QObject *parent=0);
-
- static void registerQmlTypes(const QString& uri, int majorVersion=1, int minorVersion=0);
-
-public Q_SLOTS:
-{% for operation in interface.operations %}
- {{operation|returnType}} {{operation}}({{operation.parameters|map('parameterType')|join(', ')}});
-{%- endfor %}
-
-public:
-{% for property in interface.properties %}
- void set{{property|upperfirst}}({{ property|parameterType }});
- {{property|returnType}} {{property}}() const;
-
-{% endfor %}
-Q_SIGNALS:
-{% for property in interface.properties %}
- void {{property}}Changed({{property|parameterType}});
-{% endfor %}
-
-private:
-{% for property in interface.properties %}
- {{property|returnType}} m_{{property}};
-{% endfor %}
-};
diff --git a/generator/qtcpp/templates/module.cpp b/generator/qtcpp/templates/module.cpp
deleted file mode 100644
index b3d8d19..0000000
--- a/generator/qtcpp/templates/module.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-{% set class = 'Qml{0}Module'.format(module.module_name()) %}
-
-
-#include "qml{{ module|lower }}.h"
-
-#include <QtQml>
-
-QObject* {{class|lower}}_singletontype_provider(QQmlEngine*, QJSEngine*)
-{
- return new {{class}}();
-}
-
-{{class}}::{{class}}(QObject *parent)
- : QObject(parent)
-{
-}
-
-{% for struct in module.structs %}
-{{struct}} {{class}}::create{{struct}}()
-{
- return {{struct}}();
-}
-{% endfor %}
-
-void {{class}}::registerTypes()
-{
- {% for struct in module.structs %}
- qRegisterMetaType<{{struct}}>();
- {% endfor %}
-}
-
-void {{class}}::registerQmlTypes(const QString& uri, int majorVersion, int minorVersion)
-{
- {% for struct in module.structs %}
- qmlRegisterUncreatableType<{{struct}}Model>(uri.toLatin1(), majorVersion, minorVersion, "{{struct}}Model", "Model can not be instantiated from QML");
- {% endfor %}
- qmlRegisterSingletonType<{{class}}>(uri.toLatin1(), majorVersion, minorVersion, "{{module}}", {{class|lower}}_singletontype_provider);
-}
diff --git a/generator/qtcpp/templates/module.h b/generator/qtcpp/templates/module.h
deleted file mode 100644
index 535823e..0000000
--- a/generator/qtcpp/templates/module.h
+++ /dev/null
@@ -1,39 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-{% set class = 'Qml{0}Module'.format(module.module_name) %}
-
-#pragma once
-
-#include <QtCore>
-
-{% for struct in module.structs %}
-#include "{{struct|lower}}.h"
-#include "{{struct|lower}}model.h"
-{% endfor %}
-
-class {{class}} : public QObject {
- Q_OBJECT
-public:
- {{class}}(QObject *parent=0);
-
-{% for enum in module.enums %}
- {% set comma = joiner(",") %}
- enum {{enum}} {
- {%- for member in enum.members -%}
- {{ comma() }}
- {{member.name}} = {{member.value}}
- {%- endfor %}
- };
- Q_ENUM({{enum}})
-{% endfor %}
-
-{% for struct in module.structs %}
- Q_INVOKABLE {{struct}} create{{struct}}();
-{% endfor %}
-
- static void registerTypes();
- static void registerQmlTypes(const QString& uri, int majorVersion = 1, int minorVersion = 0);
-};
diff --git a/generator/qtcpp/templates/plugin.cpp b/generator/qtcpp/templates/plugin.cpp
deleted file mode 100644
index 4ed383b..0000000
--- a/generator/qtcpp/templates/plugin.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-{% set module_name = 'Qml{0}Module'.format(module.module_name()) %}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#include "plugin.h"
-
-#include <qqml.h>
-
-#include "{{module_name|lower}}.h"
-
-{% for interface in module.interfaces %}
-#include "{{interface|lower}}.h"
-{% endfor %}
-
-void Plugin::registerTypes(const char *uri)
-{
- {{module_name}}::registerTypes();
- // @uri {{module|lower}}
- {{module_name}}::registerQmlTypes(uri, 1, 0);
-{% for interface in module.interfaces %}
- Qml{{interface}}::registerQmlTypes(uri, 1, 0);
-{% endfor %}
-}
diff --git a/generator/qtcpp/templates/plugin.h b/generator/qtcpp/templates/plugin.h
deleted file mode 100644
index 1952c35..0000000
--- a/generator/qtcpp/templates/plugin.h
+++ /dev/null
@@ -1,18 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#pragma once
-
-#include <QtQml>
-
-class Plugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-
-public:
- void registerTypes(const char *uri);
-};
diff --git a/generator/qtcpp/templates/plugin.pri b/generator/qtcpp/templates/plugin.pri
deleted file mode 100644
index bafed08..0000000
--- a/generator/qtcpp/templates/plugin.pri
+++ /dev/null
@@ -1,33 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-{% from 'helper.tpl' import qualifiedModuleName %}
-{% set moduleName = qualifiedModuleName(module) %}
-#############################################################################
-## This is an auto-generated file.
-## Do not edit! All changes made to it will be lost.
-#############################################################################
-
-QT += qml quick
-CONFIG += c++11
-
-
-HEADERS += \
- qml{{moduleName|lower}}.h \
-{% for interface in module.interfaces %}
- abstract{{interface|lower}}.h \
-{% endfor %}
-{% for struct in module.structs %}
- {{struct|lower}}.h \
- {{struct|lower}}model.h \
-{% endfor %}
- plugin.h
-
-SOURCES += \
- qml{{moduleName|lower}}.cpp \
-{% for interface in module.interfaces %}
- abstract{{interface|lower}}.cpp \
-{% endfor %}
-{% for struct in module.structs %}
- {{struct|lower}}.cpp \
- {{struct|lower}}model.cpp \
-{% endfor %}
- plugin.cpp
diff --git a/generator/qtcpp/templates/plugin.pro b/generator/qtcpp/templates/plugin.pro
deleted file mode 100644
index 045895a..0000000
--- a/generator/qtcpp/templates/plugin.pro
+++ /dev/null
@@ -1,33 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-#############################################################################
-## This is an auto-generated file.
-## Do not edit! All changes made to it will be lost.
-#############################################################################
-
-TEMPLATE = lib
-QT += qml quick
-CONFIG += qt plugin c++11
-TARGET = $$qtLibraryTarget({{module|lower}})
-
-uri = {{module}}
-
-include( {{module|lower}}.pri )
-
-
-DISTFILES = qmldir
-
-!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
- copy_qmldir.target = $$OUT_PWD/qmldir
- copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
- copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
- QMAKE_EXTRA_TARGETS += copy_qmldir
- PRE_TARGETDEPS += $$copy_qmldir.target
-}
-
-qmldir.files = qmldir
-unix {
- installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
- qmldir.path = $$installPath
- target.path = $$installPath
- INSTALLS += target qmldir
-}
diff --git a/generator/qtcpp/templates/project.pri b/generator/qtcpp/templates/project.pri
deleted file mode 100644
index 052a0f1..0000000
--- a/generator/qtcpp/templates/project.pri
+++ /dev/null
@@ -1,32 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-{% set module_name = 'Qml{0}Module'.format(module.module_name()) %}
-#############################################################################
-## This is an auto-generated file.
-## Do not edit! All changes made to it will be lost.
-#############################################################################
-
-QT += qml quick
-CONFIG += c++11
-
-
-HEADERS += \
- {{module_name|lower}}.h \
-{% for interface in module.interfaces %}
- {{interface|lower}}.h \
-{% endfor %}
-{% for struct in module.structs %}
- {{struct|lower}}.h \
- {{struct|lower}}model.h \
-{% endfor %}
- plugin.h
-
-SOURCES += \
- {{module_name|lower}}.cpp \
-{% for interface in module.interfaces %}
- {{interface|lower}}.cpp \
-{% endfor %}
-{% for struct in module.structs %}
- {{struct|lower}}.cpp \
- {{struct|lower}}model.cpp \
-{% endfor %}
- plugin.cpp
diff --git a/generator/qtcpp/templates/project.pro b/generator/qtcpp/templates/project.pro
deleted file mode 100644
index 045895a..0000000
--- a/generator/qtcpp/templates/project.pro
+++ /dev/null
@@ -1,33 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-#############################################################################
-## This is an auto-generated file.
-## Do not edit! All changes made to it will be lost.
-#############################################################################
-
-TEMPLATE = lib
-QT += qml quick
-CONFIG += qt plugin c++11
-TARGET = $$qtLibraryTarget({{module|lower}})
-
-uri = {{module}}
-
-include( {{module|lower}}.pri )
-
-
-DISTFILES = qmldir
-
-!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
- copy_qmldir.target = $$OUT_PWD/qmldir
- copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
- copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
- QMAKE_EXTRA_TARGETS += copy_qmldir
- PRE_TARGETDEPS += $$copy_qmldir.target
-}
-
-qmldir.files = qmldir
-unix {
- installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
- qmldir.path = $$installPath
- target.path = $$installPath
- INSTALLS += target qmldir
-}
diff --git a/generator/qtcpp/templates/qmldir b/generator/qtcpp/templates/qmldir
deleted file mode 100644
index 8139dbd..0000000
--- a/generator/qtcpp/templates/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-module {{module}}
-plugin {{module}}
diff --git a/generator/qtcpp/templates/struct.cpp b/generator/qtcpp/templates/struct.cpp
deleted file mode 100644
index 94b6ae7..0000000
--- a/generator/qtcpp/templates/struct.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-{% set ampersand = joiner(" &&") %}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#include <{{struct|lower}}.h>
-
-
-{{struct.comment}}
-
-bool {{struct}}::operator==(const {{struct}} &other) const
-{
- return (
- {%- for field in struct.fields %}{{ ampersand() }}
- m_{{field}} == other.m_{{field}}
- {%- endfor %} );
-}
-
diff --git a/generator/qtcpp/templates/struct.h b/generator/qtcpp/templates/struct.h
deleted file mode 100644
index 9517512..0000000
--- a/generator/qtcpp/templates/struct.h
+++ /dev/null
@@ -1,28 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#pragma once
-
-#include <QtCore>
-
-class {{struct}}
-{
- Q_GADGET
-{% for field in struct.fields %}
- Q_PROPERTY({{field|returnType}} {{field}} MEMBER m_{{field}})
-{% endfor %}
-
-public:
-{% for field in struct.fields %}
- {{field|returnType}} m_{{field}};
-{% endfor %}
-
- bool operator==(const {{struct}} &other) const;
-};
-
-Q_DECLARE_METATYPE({{struct}})
-
-
diff --git a/generator/qtcpp/templates/structmodel.cpp b/generator/qtcpp/templates/structmodel.cpp
deleted file mode 100644
index d03630c..0000000
--- a/generator/qtcpp/templates/structmodel.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-{% set class = '{0}Model'.format(struct) %}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#include <{{class|lower}}.h>
-
-{{class}}::{{class}}(QObject *parent)
- : QAbstractListModel(parent)
-{
- {% for field in struct.fields %}
- m_roleNames.insert(Roles::{{field|upperfirst}}, QByteArray("{{field}}"));
- {% endfor %}
-}
-
-int {{class}}::count() const
-{
- return m_data.count();
-}
-
-Contact {{class}}::get(int index)
-{
- return m_data.value(index);
-}
-
-int {{class}}::rowCount(const QModelIndex &parent) const
-{
- Q_UNUSED(parent)
- return m_data.count();
-}
-
-QVariant {{class}}::data(const QModelIndex &index, int role) const
-{
- if(index.row() < 0 || index.row() >= count()) {
- return QVariant();
- }
- const {{struct}} &{{struct|lower}} = m_data.at(index.row());
- switch(role) {
- {% for field in struct.fields %}
- case Roles::{{field|upperfirst}}:
- return QVariant::fromValue(contact.m_{{field}});
- break;
- {% endfor %}
- }
- return QVariant();
-}
-
-QHash<int, QByteArray> {{class}}::roleNames() const
-{
- return m_roleNames;
-}
-
-
-void {{class}}::insert{{struct}}(int row, const {{struct}} &{{struct|lower}})
-{
- if (row < 0)
- row = 0;
- if (row >= m_data.count())
- row = m_data.count();
-
- beginInsertRows(QModelIndex(), row, row);
- m_data.insert(row, {{struct|lower}});
- endInsertRows();
- emit countChanged(count());
-}
-
-void {{class}}::update{{struct}}(int row, const {{struct}} &{{struct|lower}})
-{
- if(row < 0 || row >= m_data.count()) {
- return;
- }
- m_data[row] = {{struct|lower}};
- const QModelIndex &index = createIndex(row, 0);
- emit dataChanged(index, index);
-}
-
-void {{class}}::remove{{struct}}(int row)
-{
- if(row < 0 || row >= m_data.count()) {
- return;
- }
- beginRemoveRows(QModelIndex(), row, row);
- m_data.removeAt(row);
- endRemoveRows();
-}
-
diff --git a/generator/qtcpp/templates/structmodel.h b/generator/qtcpp/templates/structmodel.h
deleted file mode 100644
index ba78e5e..0000000
--- a/generator/qtcpp/templates/structmodel.h
+++ /dev/null
@@ -1,36 +0,0 @@
-{# Copyright (c) Pelagicore AB 2016 #}
-/****************************************************************************
-** This is an auto-generated file.
-** Do not edit! All changes made to it will be lost.
-****************************************************************************/
-
-#pragma once
-
-#include <QtCore>
-
-#include "{{struct|lower}}.h"
-
-class {{struct}}Model : public QAbstractListModel
-{
- Q_OBJECT
- Q_PROPERTY(int count READ count NOTIFY countChanged)
-public:
- enum Roles { {{struct.fields|map('upperfirst')|join(', ')}} };
- {{struct}}Model(QObject *parent=0);
- Q_INVOKABLE {{struct}} get(int index);
- int count() const;
- Q_INVOKABLE void insert{{struct}}(int row, const {{struct}} &{{struct|lower}});
- Q_INVOKABLE void update{{struct}}(int row, const {{struct}} &{{struct|lower}});
- Q_INVOKABLE void remove{{struct}}(int row);
-public: // from QAbstractListModel
- virtual int rowCount(const QModelIndex &parent) const;
- virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QHash<int, QByteArray> roleNames() const;
-Q_SIGNALS:
- void countChanged(int count);
-private:
- QList<{{struct}}> m_data;
- QHash<int, QByteArray> m_roleNames;
-};
-
-
diff --git a/qface/__init__.py b/qface/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/qface/__init__.py
+++ /dev/null
diff --git a/qface/generator.py b/qface/generator.py
deleted file mode 100644
index a255e1a..0000000
--- a/qface/generator.py
+++ /dev/null
@@ -1,129 +0,0 @@
-# Copyright (c) Pelagicore AB 2016
-
-from jinja2 import Environment, FileSystemLoader, Template
-from path import Path
-from antlr4 import FileStream, CommonTokenStream, ParseTreeWalker
-from antlr4.error import DiagnosticErrorListener
-import shelve
-import logging
-import hashlib
-
-from .idl.parser.TLexer import TLexer
-from .idl.parser.TParser import TParser
-from .idl.parser.TListener import TListener
-from .idl.domain import System
-from .idl.listener import DomainListener
-
-logger = logging.getLogger(__name__)
-
-
-def upper_first_filter(s):
- s = str(s)
- return s[0].upper() + s[1:]
-
-
-class Generator(object):
- """Manages the templates and applies your context data"""
- def __init__(self, searchpath: str):
- if searchpath:
- searchpath = Path(searchpath).expand()
- self.env = Environment(loader=FileSystemLoader(searchpath), trim_blocks=True, lstrip_blocks=True)
- self.env.filters['upperfirst'] = upper_first_filter
-
- def get_template(self, name: str):
- """Retrievs a single template file from the template loader"""
- return self.env.get_template(name)
-
- def render(self, name: str, context: dict):
- """Returns the rendered text from a single template file from the
- template loader using the given context data"""
- template = self.get_template(name)
- return template.render(context)
-
- def apply(self, template: Template, context: dict):
- """Return the rendered text of a template instance"""
- return self.env.from_string(template).render(context)
-
- def write(self, fileTemplate: str, template: str, context: dict):
- """Using a templated file name it renders a template
- into a file given a context"""
- path = Path(self.apply(fileTemplate, context))
- path.parent.makedirs_p()
- logger.info('write {0}'.format(path))
- data = self.render(template, context)
- if self.hasDifferentContent(data, path):
- print('write file: {0}'.format(path))
- path.open('w').write(data)
-
- def hasDifferentContent(self, data, path):
- if not path.exists():
- return True
- dataHash = hashlib.new('md5', data.encode('utf-8')).digest()
- pathHash = path.read_hash('md5')
- return dataHash != pathHash
-
-
- def register_filter(self, name, callback):
- """Register your custom template filter"""
- self.env.filters[name] = callback
-
-
-class FileSystem(object):
- """QFace helper function to work with the file system"""
-
- @staticmethod
- def parse_document(path: str, system: System = None):
- """Parses a document and returns the resulting domain system
-
- :param path: document path to parse
- :param system: system to be used (optional)
- """
- logger.debug('parse document: {0}'.format(path))
-
- system = system or System()
-
- data = FileStream(str(path), encoding='utf-8')
- lexer = TLexer(data)
- stream = CommonTokenStream(lexer)
- parser = TParser(stream)
- parser.addErrorListener(DiagnosticErrorListener.DiagnosticErrorListener())
- tree = parser.documentSymbol()
- walker = ParseTreeWalker()
- walker.walk(DomainListener(system), tree)
-
- return system
-
- @staticmethod
- def parse_dir(path, identifier: str = None, clear_cache=True):
- """Recursively parses a directory and returns the resulting system.
- Stores the result of the run in the domain cache named after the identifier.
-
- :param path: directory to parse
- :param identifier: identifies the parse run. Used to name the cache
- :param clear_cache: clears the domain cache (defaults to true)
- """
- path = Path(path)
- logging.debug('parse_tree path={0}'.format(path))
- if not identifier:
- identifier = 'system'
- system = System()
- cache = shelve.open('qface.cache')
- if identifier in cache and clear_cache:
- del cache[identifier]
- if identifier in cache:
- # use the cached domain model
- system = cache[identifier]
- else:
- # if domain model not cached generate it
- for document in path.walkfiles('*.qdl'):
- FileSystem.parse_document(document, system)
- cache[identifier] = system
- return system
-
- @staticmethod
- def find_files(path, glob='*.qdl'):
- """Find recursively all files given by glob parameter
- in a give directory path"""
- path = Path(path)
- logging.debug('find_files path={0} glob={1}'.format(path, glob))
- return list(path.walkfiles(glob))
diff --git a/qface/idl/__init__.py b/qface/idl/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/qface/idl/__init__.py
+++ /dev/null
diff --git a/qface/idl/domain.py b/qface/idl/domain.py
deleted file mode 100644
index e726a7b..0000000
--- a/qface/idl/domain.py
+++ /dev/null
@@ -1,348 +0,0 @@
-# Copyright (c) Pelagicore AB 2016
-
-'''The domian module contains an object hierachy which resembles the
-QDL grammar as a domain model. It is created from the QDL and the main
-input for the code generation templates.
-
-.. note:: Changes on this API will result into broken templates
-
-.. code-block:: text
-
- System
- +- Module
- +- Import
- +- Interface
- +- Property
- +- Operation
- +- Event
- +- Struct (has attributes)
- +- Enum (has values)
-
-.. note:: When the API talks about an order list, the order is by appearance in the QDL file.
-'''
-
-from collections import OrderedDict, ChainMap
-import logging
-
-log = logging.getLogger(__name__)
-
-
-
-class System(object):
- """The root entity which consist of modules"""
- def __init__(self):
- log.debug('System()')
- self._moduleMap = OrderedDict() # type: dict[str, Module]
-
- def __unicode__(self):
- return 'system'
-
- def __repr__(self):
- return '<System>'
-
- @property
- def modules(self):
- '''returns ordered list of module symbols'''
- return self._moduleMap.values()
-
- def lookup(self, name: str):
- '''lookup a symbol by fully qualified name.'''
- # <module>
- print('lookup: ' + name)
- if name in self._moduleMap:
- return self._moduleMap[name]
- # <module>.<Symbol>
- (module_name, type_name) = self.split_typename(name)
- if not module_name and type_name:
- print('not able to lookup symbol: {0}'.format(name))
- return None
- module = self._moduleMap[module_name]
- return module.lookup(type_name)
-
- @staticmethod
- def split_typename(name):
- parts = name.rsplit('.', 1)
- if len(parts) == 1:
- return ('', parts[0])
- if len(parts) == 2:
- return parts
- return ('', '')
-
-
-
-class Symbol(object):
- """A symbol represents a base class for names elements"""
- def __init__(self, name: str, module: 'Module'):
- self.name = name
- """symbol name"""
- self.module = module
- """module the symbol belongs to"""
- self.comment = ''
- """comment which appeared in QDL right before symbol"""
-
- @property
- def system(self):
- '''returns reference to system'''
- return self.module._system
-
- @property
- def qualified_name(self):
- '''return the fully qualified name (`module + "." + name`)'''
- return '{0}.{1}'.format(self.module.name, self.name)
-
- def __unicode__(self):
- return self.name
-
- def __str__(self):
- return self.name
-
- def __repr__(self):
- return '<{0} name={1}>'.format(type(self), self.name)
-
-
-
-class TypedSymbol(Symbol):
- """A symbol which has a type, like an operation or property."""
- def __init__(self, name: str, module: 'Module'):
- super().__init__(name, module)
- self.type = TypeSymbol("", self)
- """type object of the symbol"""
-
-
-class TypeSymbol(Symbol):
- """Defines a type in the system"""
- def __init__(self, name: str, parent: Symbol):
- super().__init__(name, parent.module)
- log.debug('TypeSymbol()')
- self.parent = parent
- self.is_void = False # type:bool
- self.is_primitive = False # type:bool
- self.is_complex = False # type:bool
- self.is_list = False # type:bool
- self.is_model = False # type:bool
- self.nested = None
- """nested type if symbol is list or model"""
- self.__reference = None
- self.__is_resolved = False
-
- @property
- def is_bool(self):
- '''checks if type is primitive and bool'''
- return self.is_primitive and self.name == 'bool'
-
- @property
- def is_int(self):
- '''checks if type is primitive and int'''
- return self.is_primitive and self.name == 'int'
-
- @property
- def is_real(self):
- '''checks if type is primitive and real'''
- return self.is_primitive and self.name == 'real'
-
- @property
- def is_string(self):
- '''checks if type is primitive and string'''
- return self.is_primitive and self.name == 'string'
-
- @property
- def is_enum(self):
- '''checks if type is complex and enum'''
- return self.is_complex and isinstance(self.reference, Enum)
-
- @property
- def is_struct(self):
- '''checks if type is complex and struct'''
- return self.is_complex and isinstance(self.reference, Struct)
-
- @property
- def is_variant(self):
- '''checks if type is primitive and string'''
- return self.is_primitive and self.name == 'var'
-
- @property
- def reference(self):
- """returns the symbol reference of the type name"""
- if not self.__is_resolved:
- self._resolve()
- return self.__reference
-
- def _resolve(self):
- """resolve the type symbol from name by doing a lookup"""
- self.__is_resolved = True
- if self.is_complex:
- type = self.nested if self.nested else self
- type.__reference = self.module.lookup(type.name)
-
-
-class Module(Symbol):
- """Module is a namespace for types, e.g. interfaces, enums, structs"""
- def __init__(self, name: str, system: System):
- """init"""
- super().__init__(name, self)
- log.debug('Module()')
- self.version = '1.0'
- self._system = system
- self._system._moduleMap[name] = self
- self._interfaceMap = OrderedDict() # type: dict[str, Interface]
- self._structMap = OrderedDict() # type: dict[str, Struct]
- self._enumMap = OrderedDict() # type: dict[str, Enum]
- self._definitionMap = ChainMap(self._interfaceMap, self._structMap, self._enumMap)
- self._importMap = OrderedDict() # type: dict[str, Module]
-
- @property
- def interfaces(self):
- '''returns ordered list of interface symbols'''
- return self._interfaceMap.values()
-
- @property
- def structs(self):
- '''returns ordered list of struct symbols'''
- return self._structMap.values()
-
- @property
- def enums(self):
- '''returns ordered list of enum symbols'''
- return self._enumMap.values()
-
- @property
- def imports(self):
- '''returns ordered list of import symbols'''
- return self._importMap.values()
-
- def checkType(self, type: str):
- if type.is_primitive:
- return True
- (module_name, type_name) = System.split_typename(type.name)
- if module_name and module_name not in self._importMap:
- return False
- return True
-
- @property
- def name_parts(self):
- '''return module name splitted by '.' in parts'''
- return self.name.split('.')
-
- @property
- def module_name(self):
- return self.name.split('.')[-1].capitalize()
-
- def lookup(self, name: str):
- '''lookup a symbol by name. If symbol is not local
- it will be looked up system wide'''
- if name in self._definitionMap:
- return self._definitionMap[name]
- return self.system.lookup(name)
-
-
-class Interface(Symbol):
- """A interface is an object with operations, properties and events"""
- def __init__(self, name: str, module: Module):
- super().__init__(name, module)
- log.debug('Interface()')
- self.module._interfaceMap[name] = self
- self._propertyMap = OrderedDict() # type: dict[str, Property]
- self._operationMap = OrderedDict() # type: dict[str, Operation]
- self._eventMap = OrderedDict() # type: dict[str, Operation]
-
- @property
- def properties(self):
- '''returns ordered list of properties'''
- return self._propertyMap.values()
-
- @property
- def operations(self):
- '''returns ordered list of operations'''
- return self._operationMap.values()
-
- @property
- def events(self):
- '''returns ordered list of events'''
- return self._eventMap.values()
-
-
-class Operation(TypedSymbol):
- """An operation inside a interface"""
- def __init__(self, name: str, interface: Interface, is_event=False):
- super().__init__(name, interface.module)
- log.debug('Operation()')
- self.interface = interface
- self.is_event = is_event
- if is_event:
- self.interface._eventMap[name] = self
- else:
- self.interface._operationMap[name] = self
- self._parameterMap = OrderedDict() # type: dict[Parameter]
-
- @property
- def parameters(self):
- '''returns ordered list of parameters'''
- return self._parameterMap.values()
-
-
-class Parameter(TypedSymbol):
- """An operation parameter"""
- def __init__(self, name: str, operation: Operation):
- super().__init__(name, operation.module)
- log.debug('Parameter()')
- self.operation = operation
- self.operation._parameterMap[name] = self
-
-
-class Property(TypedSymbol):
- """A typed property inside a interface"""
- def __init__(self, name: str, interface: Interface):
- super().__init__(name, interface.module)
- log.debug('Property()')
- self.interface = interface
- self.interface._propertyMap[name] = self
- self.is_readonly = False
-
-
-class Struct(Symbol):
- """Represents a data container"""
- def __init__(self, name: str, module: Module):
- super().__init__(name, module)
- log.debug('Struct()')
- self.module._structMap[name] = self
- self._fieldMap = OrderedDict() # type: dict[str, Field]
-
- @property
- def fields(self):
- '''returns ordered list of members'''
- return self._fieldMap.values()
-
-
-class Field(TypedSymbol):
- """A member in a struct"""
- def __init__(self, name: str, struct: Struct):
- super().__init__(name, struct.module)
- log.debug('Field()')
- self.struct = struct # type:Struct
- self.struct._fieldMap[name] = self
-
-
-class Enum(Symbol):
- """An enum (flag) inside a module"""
- def __init__(self, name: str, module: Module):
- super().__init__(name, module)
- log.debug('Enum()')
- self.is_enum = True
- self.is_flag = False
- self.module._enumMap[name] = self
- self._memberMap = OrderedDict() # type: dict[EnumMember]
-
- @property
- def members(self):
- '''returns ordered list of members'''
- return self._memberMap.values()
-
-
-class EnumMember(Symbol):
- """A enum value"""
- def __init__(self, name: str, enum: Enum):
- super().__init__(name, enum.module)
- log.debug('EnumMember()')
- self.enum = enum
- self.enum._memberMap[name] = self
- self.value = 0
diff --git a/qface/idl/listener.py b/qface/idl/listener.py
deleted file mode 100644
index b257005..0000000
--- a/qface/idl/listener.py
+++ /dev/null
@@ -1,197 +0,0 @@
-# Copyright (c) Pelagicore AB 2016
-import logging
-from _operator import concat
-
-from .parser.TListener import TListener
-from .parser.TParser import TParser
-from .domain import *
-from antlr4 import ParserRuleContext
-
-
-log = logging.getLogger(__name__)
-
-# associates parser context to domain objects
-contextMap = {}
-
-class DomainListener(TListener):
- """The domain listener is called by the parser to fill the
- domain data struture. As a result a system is passed
- back"""
- def __init__(self, system):
- super(DomainListener, self).__init__()
- contextMap.clear()
- self.system = system or System() # type:System
- self.module = None # type:Module
- self.interface = None # type:Interface
- self.struct = None # type:Struct
- self.enum = None # type:Enum
- self.enumCounter = 0 # int
- self.operation = None # type:Operation
- self.parameter = None # type:Parameter
- self.property = None # type:Property
- self.field = None # type:Field
-
- def parse_type(self, ctx: ParserRuleContext, type: TypeSymbol):
- if not ctx.typeSymbol():
- # import pdb; pdb.set_trace()
- type.is_void = True
- type.name = 'void'
- else:
- if ctx.typeSymbol().primitiveTypeSymbol():
- ctxSymbol = ctx.typeSymbol().primitiveTypeSymbol() # type:TParser.PrimitiveTypeSymbolContext
- type.is_primitive = True
- type.name = ctxSymbol.name.text
- elif ctx.typeSymbol().complexTypeSymbol():
- ctxSymbol = ctx.typeSymbol().complexTypeSymbol() # type:TParser.ComplexTypeSymbolContext
- type.is_complex = True
- type.name = ctxSymbol.name.text
- elif ctx.typeSymbol().listTypeSymbol():
- ctxSymbol = ctx.typeSymbol().listTypeSymbol() # type:TParser.ListTypeSymbolContext
- type.is_list = True
- type.name = 'list'
- type.nested = TypeSymbol("", type)
- self.parse_type(ctxSymbol, type.nested)
- elif ctx.typeSymbol().modelTypeSymbol():
- ctxSymbol = ctx.typeSymbol().modelTypeSymbol() # type:TParser.ModelTypeSymbolContext
- type.is_model = True
- type.name = 'model'
- type.nested = TypeSymbol("", type)
- self.parse_type(ctxSymbol, type.nested)
- if not type.module.checkType(type):
- log.warn('Unknown type: {0}. Missing import?'.format(type.name))
-
- def parse_comment(self, ctx, symbol):
- if ctx.comment:
- comment = ctx.comment.text
- symbol.comment = comment
-
- def enterEveryRule(self, ctx):
- log.debug('enter ' + ctx.__class__.__name__)
-
- def exitEveryRule(self, ctx):
- log.debug('exit ' + ctx.__class__.__name__)
-
- def enterModuleSymbol(self, ctx: TParser.ModuleSymbolContext):
- assert self.system
- name = ctx.name.text
- version = ctx.version.text
- self.module = Module(name, self.system)
- self.module.version = version
- contextMap[ctx] = self.module
-
- def exitModuleSymbol(self, ctx: TParser.ModuleSymbolContext):
- pass
-
- def enterInterfaceSymbol(self, ctx: TParser.InterfaceSymbolContext):
- assert self.module
- name = ctx.name.text
- self.interface = Interface(name, self.module)
- self.parse_comment(ctx, self.interface)
- contextMap[ctx] = self.interface
-
- def exitInterfaceSymbol(self, ctx: TParser.InterfaceSymbolContext):
- self.interface = None
-
- def enterStructSymbol(self, ctx: TParser.StructSymbolContext):
- assert self.module
- name = ctx.name.text
- self.struct = Struct(name, self.module)
- self.parse_comment(ctx, self.struct)
- contextMap[ctx] = self.struct
-
- def exitStructSymbol(self, ctx: TParser.StructSymbolContext):
- self.struct = None
-
- def enterEnumSymbol(self, ctx: TParser.EnumSymbolContext):
- assert self.module
- name = ctx.name.text
- # import ipdb; ipdb.set_trace()
- self.enum = Enum(name, self.module)
- self.parse_comment(ctx, self.enum)
- contextMap[ctx] = self.enum
-
- def exitEnumSymbol(self, ctx: TParser.EnumSymbolContext):
- self.enum = None
- self.enumCounter = 0
-
- def enterEnumTypeSymbol(self, ctx: TParser.EnumTypeSymbolContext):
- assert self.enum
- self.enumCounter = 0
- if ctx.isFlag:
- self.enum.is_enum = False
- self.enum.is_flag = True
- self.enumCounter = 1
-
- def exitEnumTypeSymbol(self, ctx: TParser.EnumTypeSymbolContext):
- pass
-
- def enterOperationSymbol(self, ctx: TParser.OperationSymbolContext):
- assert self.interface
- name = ctx.name.text
- is_event = bool(ctx.isEvent)
- self.operation = Operation(name, self.interface, is_event)
- self.parse_comment(ctx, self.operation)
- self.parse_type(ctx, self.operation.type)
- contextMap[ctx] = self.operation
-
- def exitOperationSymbol(self, ctx: TParser.OperationSymbolContext):
- self.operation = None
-
- def enterOperationParameterSymbol(self, ctx: TParser.OperationParameterSymbolContext):
- name = ctx.name.text
- self.parameter = Parameter(name, self.operation)
- contextMap[ctx] = self.parameter
-
- def exitOperationParameterSymbol(self, ctx: TParser.OperationParameterSymbolContext):
- self.parse_type(ctx, self.parameter.type)
-
- def enterPropertySymbol(self, ctx: TParser.PropertySymbolContext):
- assert self.interface
- name = ctx.name.text
- self.property = Property(name, self.interface)
- self.property.is_readonly = bool(ctx.isReadOnly)
- self.parse_comment(ctx, self.property)
- self.parse_type(ctx, self.property.type)
- contextMap[ctx] = self.property
-
- def exitPropertySymbol(self, ctx: TParser.PropertySymbolContext):
- self.property = None
-
- def enterStructFieldSymbol(self, ctx: TParser.StructFieldSymbolContext):
- assert self.struct
- name = ctx.name.text
- self.field = Field(name, self.struct)
- contextMap[ctx] = self.field
-
- def exitStructFieldSymbol(self, ctx: TParser.StructFieldSymbolContext):
- self.parse_type(ctx, self.field.type)
- self.field = None
-
- def enterEnumMemberSymbol(self, ctx: TParser.EnumMemberSymbolContext):
- assert self.enum
- name = ctx.name.text
- self.field = EnumMember(name, self.enum)
- value = self.enumCounter
- if ctx.intSymbol():
- value = int(ctx.intSymbol().value.text, 0)
- self.field.value = value
- contextMap[ctx] = self.field
- # import ipdb; ipdb.set_trace()
- if self.enum.is_flag:
- self.enumCounter <<= 1
- else:
- self.enumCounter += 1
-
- def exitEnumMemberSymbol(self, ctx: TParser.EnumMemberSymbolContext):
- self.field = None
-
- def enterImportSymbol(self, ctx: TParser.ImportSymbolContext):
- assert self.module
- name = ctx.name.text
- version = ctx.version.text
- # import ipdb; ipdb.set_trace()
- self.module._importMap[name] = '{0} {1}'.format(name, version)
-
- def exitImportSymbol(self, ctx: TParser.ImportSymbolContext):
- pass
-
diff --git a/qface/idl/parser/T.g4 b/qface/idl/parser/T.g4
deleted file mode 100644
index 292dd59..0000000
--- a/qface/idl/parser/T.g4
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) Pelagicore AB 2016
-grammar T;
-
-
-documentSymbol
- : headerSymbol definitionSymbol*
- ;
-
-/**
-module name;
-import name;
-*/
-headerSymbol
- : moduleSymbol importSymbol*
- ;
-
-importSymbol
- : 'import' name=IDENTIFIER version=VERSION ';'?
- ;
-
-moduleSymbol
- : comment=DOCCOMMENT? 'module' name=IDENTIFIER version=VERSION ';'?
- ;
-
-definitionSymbol
- : interfaceSymbol
- | structSymbol
- | enumSymbol
- ;
-
-interfaceSymbol
- : comment=DOCCOMMENT? 'interface' name=IDENTIFIER '{' interfaceMemberSymbol* '}'
- ;
-
-interfaceMemberSymbol
- : operationSymbol
- | propertySymbol
- ;
-
-operationSymbol
- : comment=DOCCOMMENT? isEvent='event'? (typeSymbol | 'void') name=IDENTIFIER '(' operationParameterSymbol* ')' ';'?
- ;
-
-propertySymbol
- : comment=DOCCOMMENT? isReadOnly='readonly'? typeSymbol name=IDENTIFIER ';'?
- ;
-
-operationParameterSymbol
- : typeSymbol name=IDENTIFIER ','?
- ;
-
-typeSymbol
- : primitiveTypeSymbol
- | complexTypeSymbol
- | listTypeSymbol
- | modelTypeSymbol
- ;
-
-complexTypeSymbol
- : name=IDENTIFIER
- ;
-
-primitiveTypeSymbol
- : name='bool'
- | name='int'
- | name='real'
- | name='string'
- | name='var'
- ;
-
-listTypeSymbol
- : 'list' '<' valueType=typeSymbol '>'
- ;
-
-modelTypeSymbol
- : 'model' '<' valueType=typeSymbol '>'
- ;
-
-structSymbol
- : comment=DOCCOMMENT? 'struct' name=IDENTIFIER '{' structFieldSymbol* '}'
- ;
-
-structFieldSymbol
- : comment=DOCCOMMENT? typeSymbol name=IDENTIFIER ';'?
- ;
-
-enumSymbol
- : comment=DOCCOMMENT? enumTypeSymbol name=IDENTIFIER '{' enumMemberSymbol* '}'
- ;
-
-enumTypeSymbol
- : isEnum = 'enum'
- | isFlag = 'flag'
- ;
-
-enumMemberSymbol
- : comment=DOCCOMMENT? name=IDENTIFIER ('=' intSymbol)? ','?
- ;
-
-intSymbol
- : value=INTCONSTANT
- | value=HEXCONSTANT
- ;
-
-INTCONSTANT : ('+' | '-')? '0'..'9'+;
-HEXCONSTANT : '0x' ('0'..'9' | 'a'..'f' | 'A'..'F')+;
-IDENTIFIER : [a-zA-Z_][a-zA-Z0-9_\.]*;
-VERSION : [0-9]'.'[0-9];
-DOCCOMMENT : '/*!' .*? '*/';
-WHITESPACE : [ \t\r\n]+ -> skip;
-COMMENT : '//' ~[\r\n]* -> skip;
-MULTICOMM : '/*' .*? '*/' -> skip;
diff --git a/qface/idl/parser/T.tokens b/qface/idl/parser/T.tokens
deleted file mode 100644
index 505f1e4..0000000
--- a/qface/idl/parser/T.tokens
+++ /dev/null
@@ -1,58 +0,0 @@
-T__0=1
-T__1=2
-T__2=3
-T__3=4
-T__4=5
-T__5=6
-T__6=7
-T__7=8
-T__8=9
-T__9=10
-T__10=11
-T__11=12
-T__12=13
-T__13=14
-T__14=15
-T__15=16
-T__16=17
-T__17=18
-T__18=19
-T__19=20
-T__20=21
-T__21=22
-T__22=23
-T__23=24
-T__24=25
-INTCONSTANT=26
-HEXCONSTANT=27
-IDENTIFIER=28
-VERSION=29
-DOCCOMMENT=30
-WHITESPACE=31
-COMMENT=32
-MULTICOMM=33
-'import'=1
-';'=2
-'module'=3
-'interface'=4
-'{'=5
-'}'=6
-'event'=7
-'void'=8
-'('=9
-')'=10
-'readonly'=11
-','=12
-'bool'=13
-'int'=14
-'real'=15
-'string'=16
-'var'=17
-'list'=18
-'<'=19
-'>'=20
-'model'=21
-'struct'=22
-'enum'=23
-'flag'=24
-'='=25
diff --git a/qface/idl/parser/TLexer.py b/qface/idl/parser/TLexer.py
deleted file mode 100644
index 643b680..0000000
--- a/qface/idl/parser/TLexer.py
+++ /dev/null
@@ -1,185 +0,0 @@
-# Generated from T.g4 by ANTLR 4.5.3
-from antlr4 import *
-from io import StringIO
-
-
-def serializedATN():
- with StringIO() as buf:
- buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2#")
- buf.write("\u0100\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7")
- buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r")
- buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23")
- buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30")
- buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36")
- buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\3\2\3\2\3\2\3\2\3")
- buf.write("\2\3\2\3\2\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5")
- buf.write("\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3")
- buf.write("\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\13\3")
- buf.write("\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\16\3")
- buf.write("\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\20\3\20\3\20")
- buf.write("\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22")
- buf.write("\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\25\3\25")
- buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\27")
- buf.write("\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31")
- buf.write("\3\31\3\32\3\32\3\33\5\33\u00ba\n\33\3\33\6\33\u00bd\n")
- buf.write("\33\r\33\16\33\u00be\3\34\3\34\3\34\3\34\6\34\u00c5\n")
- buf.write("\34\r\34\16\34\u00c6\3\35\3\35\7\35\u00cb\n\35\f\35\16")
- buf.write("\35\u00ce\13\35\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37")
- buf.write("\3\37\7\37\u00d9\n\37\f\37\16\37\u00dc\13\37\3\37\3\37")
- buf.write("\3\37\3 \6 \u00e2\n \r \16 \u00e3\3 \3 \3!\3!\3!\3!\7")
- buf.write("!\u00ec\n!\f!\16!\u00ef\13!\3!\3!\3\"\3\"\3\"\3\"\7\"")
- buf.write("\u00f7\n\"\f\"\16\"\u00fa\13\"\3\"\3\"\3\"\3\"\3\"\4\u00da")
- buf.write("\u00f8\2#\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25")
- buf.write("\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+")
- buf.write("\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#\3")
- buf.write("\2\t\4\2--//\5\2\62;CHch\5\2C\\aac|\b\2\60\60\62;C\\^")
- buf.write("^aac|\3\2\62;\5\2\13\f\17\17\"\"\4\2\f\f\17\17\u0107\2")
- buf.write("\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3")
- buf.write("\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2")
- buf.write("\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2")
- buf.write("\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%")
- buf.write("\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2")
- buf.write("\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67")
- buf.write("\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2")
- buf.write("A\3\2\2\2\2C\3\2\2\2\3E\3\2\2\2\5L\3\2\2\2\7N\3\2\2\2")
- buf.write("\tU\3\2\2\2\13_\3\2\2\2\ra\3\2\2\2\17c\3\2\2\2\21i\3\2")
- buf.write("\2\2\23n\3\2\2\2\25p\3\2\2\2\27r\3\2\2\2\31{\3\2\2\2\33")
- buf.write("}\3\2\2\2\35\u0082\3\2\2\2\37\u0086\3\2\2\2!\u008b\3\2")
- buf.write("\2\2#\u0092\3\2\2\2%\u0096\3\2\2\2\'\u009b\3\2\2\2)\u009d")
- buf.write("\3\2\2\2+\u009f\3\2\2\2-\u00a5\3\2\2\2/\u00ac\3\2\2\2")
- buf.write("\61\u00b1\3\2\2\2\63\u00b6\3\2\2\2\65\u00b9\3\2\2\2\67")
- buf.write("\u00c0\3\2\2\29\u00c8\3\2\2\2;\u00cf\3\2\2\2=\u00d3\3")
- buf.write("\2\2\2?\u00e1\3\2\2\2A\u00e7\3\2\2\2C\u00f2\3\2\2\2EF")
- buf.write("\7k\2\2FG\7o\2\2GH\7r\2\2HI\7q\2\2IJ\7t\2\2JK\7v\2\2K")
- buf.write("\4\3\2\2\2LM\7=\2\2M\6\3\2\2\2NO\7o\2\2OP\7q\2\2PQ\7f")
- buf.write("\2\2QR\7w\2\2RS\7n\2\2ST\7g\2\2T\b\3\2\2\2UV\7k\2\2VW")
- buf.write("\7p\2\2WX\7v\2\2XY\7g\2\2YZ\7t\2\2Z[\7h\2\2[\\\7c\2\2")
- buf.write("\\]\7e\2\2]^\7g\2\2^\n\3\2\2\2_`\7}\2\2`\f\3\2\2\2ab\7")
- buf.write("\177\2\2b\16\3\2\2\2cd\7g\2\2de\7x\2\2ef\7g\2\2fg\7p\2")
- buf.write("\2gh\7v\2\2h\20\3\2\2\2ij\7x\2\2jk\7q\2\2kl\7k\2\2lm\7")
- buf.write("f\2\2m\22\3\2\2\2no\7*\2\2o\24\3\2\2\2pq\7+\2\2q\26\3")
- buf.write("\2\2\2rs\7t\2\2st\7g\2\2tu\7c\2\2uv\7f\2\2vw\7q\2\2wx")
- buf.write("\7p\2\2xy\7n\2\2yz\7{\2\2z\30\3\2\2\2{|\7.\2\2|\32\3\2")
- buf.write("\2\2}~\7d\2\2~\177\7q\2\2\177\u0080\7q\2\2\u0080\u0081")
- buf.write("\7n\2\2\u0081\34\3\2\2\2\u0082\u0083\7k\2\2\u0083\u0084")
- buf.write("\7p\2\2\u0084\u0085\7v\2\2\u0085\36\3\2\2\2\u0086\u0087")
- buf.write("\7t\2\2\u0087\u0088\7g\2\2\u0088\u0089\7c\2\2\u0089\u008a")
- buf.write("\7n\2\2\u008a \3\2\2\2\u008b\u008c\7u\2\2\u008c\u008d")
- buf.write("\7v\2\2\u008d\u008e\7t\2\2\u008e\u008f\7k\2\2\u008f\u0090")
- buf.write("\7p\2\2\u0090\u0091\7i\2\2\u0091\"\3\2\2\2\u0092\u0093")
- buf.write("\7x\2\2\u0093\u0094\7c\2\2\u0094\u0095\7t\2\2\u0095$\3")
- buf.write("\2\2\2\u0096\u0097\7n\2\2\u0097\u0098\7k\2\2\u0098\u0099")
- buf.write("\7u\2\2\u0099\u009a\7v\2\2\u009a&\3\2\2\2\u009b\u009c")
- buf.write("\7>\2\2\u009c(\3\2\2\2\u009d\u009e\7@\2\2\u009e*\3\2\2")
- buf.write("\2\u009f\u00a0\7o\2\2\u00a0\u00a1\7q\2\2\u00a1\u00a2\7")
- buf.write("f\2\2\u00a2\u00a3\7g\2\2\u00a3\u00a4\7n\2\2\u00a4,\3\2")
- buf.write("\2\2\u00a5\u00a6\7u\2\2\u00a6\u00a7\7v\2\2\u00a7\u00a8")
- buf.write("\7t\2\2\u00a8\u00a9\7w\2\2\u00a9\u00aa\7e\2\2\u00aa\u00ab")
- buf.write("\7v\2\2\u00ab.\3\2\2\2\u00ac\u00ad\7g\2\2\u00ad\u00ae")
- buf.write("\7p\2\2\u00ae\u00af\7w\2\2\u00af\u00b0\7o\2\2\u00b0\60")
- buf.write("\3\2\2\2\u00b1\u00b2\7h\2\2\u00b2\u00b3\7n\2\2\u00b3\u00b4")
- buf.write("\7c\2\2\u00b4\u00b5\7i\2\2\u00b5\62\3\2\2\2\u00b6\u00b7")
- buf.write("\7?\2\2\u00b7\64\3\2\2\2\u00b8\u00ba\t\2\2\2\u00b9\u00b8")
- buf.write("\3\2\2\2\u00b9\u00ba\3\2\2\2\u00ba\u00bc\3\2\2\2\u00bb")
- buf.write("\u00bd\4\62;\2\u00bc\u00bb\3\2\2\2\u00bd\u00be\3\2\2\2")
- buf.write("\u00be\u00bc\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf\66\3\2")
- buf.write("\2\2\u00c0\u00c1\7\62\2\2\u00c1\u00c2\7z\2\2\u00c2\u00c4")
- buf.write("\3\2\2\2\u00c3\u00c5\t\3\2\2\u00c4\u00c3\3\2\2\2\u00c5")
- buf.write("\u00c6\3\2\2\2\u00c6\u00c4\3\2\2\2\u00c6\u00c7\3\2\2\2")
- buf.write("\u00c78\3\2\2\2\u00c8\u00cc\t\4\2\2\u00c9\u00cb\t\5\2")
- buf.write("\2\u00ca\u00c9\3\2\2\2\u00cb\u00ce\3\2\2\2\u00cc\u00ca")
- buf.write("\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd:\3\2\2\2\u00ce\u00cc")
- buf.write("\3\2\2\2\u00cf\u00d0\t\6\2\2\u00d0\u00d1\7\60\2\2\u00d1")
- buf.write("\u00d2\t\6\2\2\u00d2<\3\2\2\2\u00d3\u00d4\7\61\2\2\u00d4")
- buf.write("\u00d5\7,\2\2\u00d5\u00d6\7#\2\2\u00d6\u00da\3\2\2\2\u00d7")
- buf.write("\u00d9\13\2\2\2\u00d8\u00d7\3\2\2\2\u00d9\u00dc\3\2\2")
- buf.write("\2\u00da\u00db\3\2\2\2\u00da\u00d8\3\2\2\2\u00db\u00dd")
- buf.write("\3\2\2\2\u00dc\u00da\3\2\2\2\u00dd\u00de\7,\2\2\u00de")
- buf.write("\u00df\7\61\2\2\u00df>\3\2\2\2\u00e0\u00e2\t\7\2\2\u00e1")
- buf.write("\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3\u00e1\3\2\2\2")
- buf.write("\u00e3\u00e4\3\2\2\2\u00e4\u00e5\3\2\2\2\u00e5\u00e6\b")
- buf.write(" \2\2\u00e6@\3\2\2\2\u00e7\u00e8\7\61\2\2\u00e8\u00e9")
- buf.write("\7\61\2\2\u00e9\u00ed\3\2\2\2\u00ea\u00ec\n\b\2\2\u00eb")
- buf.write("\u00ea\3\2\2\2\u00ec\u00ef\3\2\2\2\u00ed\u00eb\3\2\2\2")
- buf.write("\u00ed\u00ee\3\2\2\2\u00ee\u00f0\3\2\2\2\u00ef\u00ed\3")
- buf.write("\2\2\2\u00f0\u00f1\b!\2\2\u00f1B\3\2\2\2\u00f2\u00f3\7")
- buf.write("\61\2\2\u00f3\u00f4\7,\2\2\u00f4\u00f8\3\2\2\2\u00f5\u00f7")
- buf.write("\13\2\2\2\u00f6\u00f5\3\2\2\2\u00f7\u00fa\3\2\2\2\u00f8")
- buf.write("\u00f9\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f9\u00fb\3\2\2\2")
- buf.write("\u00fa\u00f8\3\2\2\2\u00fb\u00fc\7,\2\2\u00fc\u00fd\7")
- buf.write("\61\2\2\u00fd\u00fe\3\2\2\2\u00fe\u00ff\b\"\2\2\u00ff")
- buf.write("D\3\2\2\2\13\2\u00b9\u00be\u00c6\u00cc\u00da\u00e3\u00ed")
- buf.write("\u00f8\3\b\2\2")
- return buf.getvalue()
-
-
-class TLexer(Lexer):
-
- atn = ATNDeserializer().deserialize(serializedATN())
-
- decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
-
-
- T__0 = 1
- T__1 = 2
- T__2 = 3
- T__3 = 4
- T__4 = 5
- T__5 = 6
- T__6 = 7
- T__7 = 8
- T__8 = 9
- T__9 = 10
- T__10 = 11
- T__11 = 12
- T__12 = 13
- T__13 = 14
- T__14 = 15
- T__15 = 16
- T__16 = 17
- T__17 = 18
- T__18 = 19
- T__19 = 20
- T__20 = 21
- T__21 = 22
- T__22 = 23
- T__23 = 24
- T__24 = 25
- INTCONSTANT = 26
- HEXCONSTANT = 27
- IDENTIFIER = 28
- VERSION = 29
- DOCCOMMENT = 30
- WHITESPACE = 31
- COMMENT = 32
- MULTICOMM = 33
-
- modeNames = [ "DEFAULT_MODE" ]
-
- literalNames = [ "<INVALID>",
- "'import'", "';'", "'module'", "'interface'", "'{'", "'}'",
- "'event'", "'void'", "'('", "')'", "'readonly'", "','", "'bool'",
- "'int'", "'real'", "'string'", "'var'", "'list'", "'<'", "'>'",
- "'model'", "'struct'", "'enum'", "'flag'", "'='" ]
-
- symbolicNames = [ "<INVALID>",
- "INTCONSTANT", "HEXCONSTANT", "IDENTIFIER", "VERSION", "DOCCOMMENT",
- "WHITESPACE", "COMMENT", "MULTICOMM" ]
-
- ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
- "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13",
- "T__14", "T__15", "T__16", "T__17", "T__18", "T__19",
- "T__20", "T__21", "T__22", "T__23", "T__24", "INTCONSTANT",
- "HEXCONSTANT", "IDENTIFIER", "VERSION", "DOCCOMMENT",
- "WHITESPACE", "COMMENT", "MULTICOMM" ]
-
- grammarFileName = "T.g4"
-
- def __init__(self, input=None):
- super().__init__(input)
- self.checkVersion("4.5.3")
- self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
- self._actions = None
- self._predicates = None
-
-
diff --git a/qface/idl/parser/TLexer.tokens b/qface/idl/parser/TLexer.tokens
deleted file mode 100644
index 505f1e4..0000000
--- a/qface/idl/parser/TLexer.tokens
+++ /dev/null
@@ -1,58 +0,0 @@
-T__0=1
-T__1=2
-T__2=3
-T__3=4
-T__4=5
-T__5=6
-T__6=7
-T__7=8
-T__8=9
-T__9=10
-T__10=11
-T__11=12
-T__12=13
-T__13=14
-T__14=15
-T__15=16
-T__16=17
-T__17=18
-T__18=19
-T__19=20
-T__20=21
-T__21=22
-T__22=23
-T__23=24
-T__24=25
-INTCONSTANT=26
-HEXCONSTANT=27
-IDENTIFIER=28
-VERSION=29
-DOCCOMMENT=30
-WHITESPACE=31
-COMMENT=32
-MULTICOMM=33
-'import'=1
-';'=2
-'module'=3
-'interface'=4
-'{'=5
-'}'=6
-'event'=7
-'void'=8
-'('=9
-')'=10
-'readonly'=11
-','=12
-'bool'=13
-'int'=14
-'real'=15
-'string'=16
-'var'=17
-'list'=18
-'<'=19
-'>'=20
-'model'=21
-'struct'=22
-'enum'=23
-'flag'=24
-'='=25
diff --git a/qface/idl/parser/TListener.py b/qface/idl/parser/TListener.py
deleted file mode 100644
index 10f5a3a..0000000
--- a/qface/idl/parser/TListener.py
+++ /dev/null
@@ -1,199 +0,0 @@
-# Generated from T.g4 by ANTLR 4.5.3
-from antlr4 import *
-if __name__ is not None and "." in __name__:
- from .TParser import TParser
-else:
- from TParser import TParser
-
-# This class defines a complete listener for a parse tree produced by TParser.
-class TListener(ParseTreeListener):
-
- # Enter a parse tree produced by TParser#documentSymbol.
- def enterDocumentSymbol(self, ctx:TParser.DocumentSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#documentSymbol.
- def exitDocumentSymbol(self, ctx:TParser.DocumentSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#headerSymbol.
- def enterHeaderSymbol(self, ctx:TParser.HeaderSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#headerSymbol.
- def exitHeaderSymbol(self, ctx:TParser.HeaderSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#importSymbol.
- def enterImportSymbol(self, ctx:TParser.ImportSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#importSymbol.
- def exitImportSymbol(self, ctx:TParser.ImportSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#moduleSymbol.
- def enterModuleSymbol(self, ctx:TParser.ModuleSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#moduleSymbol.
- def exitModuleSymbol(self, ctx:TParser.ModuleSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#definitionSymbol.
- def enterDefinitionSymbol(self, ctx:TParser.DefinitionSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#definitionSymbol.
- def exitDefinitionSymbol(self, ctx:TParser.DefinitionSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#interfaceSymbol.
- def enterInterfaceSymbol(self, ctx:TParser.InterfaceSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#interfaceSymbol.
- def exitInterfaceSymbol(self, ctx:TParser.InterfaceSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#interfaceMemberSymbol.
- def enterInterfaceMemberSymbol(self, ctx:TParser.InterfaceMemberSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#interfaceMemberSymbol.
- def exitInterfaceMemberSymbol(self, ctx:TParser.InterfaceMemberSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#operationSymbol.
- def enterOperationSymbol(self, ctx:TParser.OperationSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#operationSymbol.
- def exitOperationSymbol(self, ctx:TParser.OperationSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#propertySymbol.
- def enterPropertySymbol(self, ctx:TParser.PropertySymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#propertySymbol.
- def exitPropertySymbol(self, ctx:TParser.PropertySymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#operationParameterSymbol.
- def enterOperationParameterSymbol(self, ctx:TParser.OperationParameterSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#operationParameterSymbol.
- def exitOperationParameterSymbol(self, ctx:TParser.OperationParameterSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#typeSymbol.
- def enterTypeSymbol(self, ctx:TParser.TypeSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#typeSymbol.
- def exitTypeSymbol(self, ctx:TParser.TypeSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#complexTypeSymbol.
- def enterComplexTypeSymbol(self, ctx:TParser.ComplexTypeSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#complexTypeSymbol.
- def exitComplexTypeSymbol(self, ctx:TParser.ComplexTypeSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#primitiveTypeSymbol.
- def enterPrimitiveTypeSymbol(self, ctx:TParser.PrimitiveTypeSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#primitiveTypeSymbol.
- def exitPrimitiveTypeSymbol(self, ctx:TParser.PrimitiveTypeSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#listTypeSymbol.
- def enterListTypeSymbol(self, ctx:TParser.ListTypeSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#listTypeSymbol.
- def exitListTypeSymbol(self, ctx:TParser.ListTypeSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#modelTypeSymbol.
- def enterModelTypeSymbol(self, ctx:TParser.ModelTypeSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#modelTypeSymbol.
- def exitModelTypeSymbol(self, ctx:TParser.ModelTypeSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#structSymbol.
- def enterStructSymbol(self, ctx:TParser.StructSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#structSymbol.
- def exitStructSymbol(self, ctx:TParser.StructSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#structFieldSymbol.
- def enterStructFieldSymbol(self, ctx:TParser.StructFieldSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#structFieldSymbol.
- def exitStructFieldSymbol(self, ctx:TParser.StructFieldSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#enumSymbol.
- def enterEnumSymbol(self, ctx:TParser.EnumSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#enumSymbol.
- def exitEnumSymbol(self, ctx:TParser.EnumSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#enumTypeSymbol.
- def enterEnumTypeSymbol(self, ctx:TParser.EnumTypeSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#enumTypeSymbol.
- def exitEnumTypeSymbol(self, ctx:TParser.EnumTypeSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#enumMemberSymbol.
- def enterEnumMemberSymbol(self, ctx:TParser.EnumMemberSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#enumMemberSymbol.
- def exitEnumMemberSymbol(self, ctx:TParser.EnumMemberSymbolContext):
- pass
-
-
- # Enter a parse tree produced by TParser#intSymbol.
- def enterIntSymbol(self, ctx:TParser.IntSymbolContext):
- pass
-
- # Exit a parse tree produced by TParser#intSymbol.
- def exitIntSymbol(self, ctx:TParser.IntSymbolContext):
- pass
-
-
diff --git a/qface/idl/parser/TParser.py b/qface/idl/parser/TParser.py
deleted file mode 100644
index a1b0c4e..0000000
--- a/qface/idl/parser/TParser.py
+++ /dev/null
@@ -1,1669 +0,0 @@
-# Generated from T.g4 by ANTLR 4.5.3
-# encoding: utf-8
-from antlr4 import *
-from io import StringIO
-
-def serializedATN():
- with StringIO() as buf:
- buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3#")
- buf.write("\u00d7\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
- buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
- buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
- buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\3\2\3\2\7\2/\n\2\f\2\16")
- buf.write("\2\62\13\2\3\3\3\3\7\3\66\n\3\f\3\16\39\13\3\3\4\3\4\3")
- buf.write("\4\3\4\5\4?\n\4\3\5\5\5B\n\5\3\5\3\5\3\5\3\5\5\5H\n\5")
- buf.write("\3\6\3\6\3\6\5\6M\n\6\3\7\5\7P\n\7\3\7\3\7\3\7\3\7\7\7")
- buf.write("V\n\7\f\7\16\7Y\13\7\3\7\3\7\3\b\3\b\5\b_\n\b\3\t\5\t")
- buf.write("b\n\t\3\t\5\te\n\t\3\t\3\t\5\ti\n\t\3\t\3\t\3\t\7\tn\n")
- buf.write("\t\f\t\16\tq\13\t\3\t\3\t\5\tu\n\t\3\n\5\nx\n\n\3\n\5")
- buf.write("\n{\n\n\3\n\3\n\3\n\5\n\u0080\n\n\3\13\3\13\3\13\5\13")
- buf.write("\u0085\n\13\3\f\3\f\3\f\3\f\5\f\u008b\n\f\3\r\3\r\3\16")
- buf.write("\3\16\3\16\3\16\3\16\5\16\u0094\n\16\3\17\3\17\3\17\3")
- buf.write("\17\3\17\3\20\3\20\3\20\3\20\3\20\3\21\5\21\u00a1\n\21")
- buf.write("\3\21\3\21\3\21\3\21\7\21\u00a7\n\21\f\21\16\21\u00aa")
- buf.write("\13\21\3\21\3\21\3\22\5\22\u00af\n\22\3\22\3\22\3\22\5")
- buf.write("\22\u00b4\n\22\3\23\5\23\u00b7\n\23\3\23\3\23\3\23\3\23")
- buf.write("\7\23\u00bd\n\23\f\23\16\23\u00c0\13\23\3\23\3\23\3\24")
- buf.write("\3\24\5\24\u00c6\n\24\3\25\5\25\u00c9\n\25\3\25\3\25\3")
- buf.write("\25\5\25\u00ce\n\25\3\25\5\25\u00d1\n\25\3\26\3\26\5\26")
- buf.write("\u00d5\n\26\3\26\2\2\27\2\4\6\b\n\f\16\20\22\24\26\30")
- buf.write("\32\34\36 \"$&(*\2\2\u00e6\2,\3\2\2\2\4\63\3\2\2\2\6:")
- buf.write("\3\2\2\2\bA\3\2\2\2\nL\3\2\2\2\fO\3\2\2\2\16^\3\2\2\2")
- buf.write("\20a\3\2\2\2\22w\3\2\2\2\24\u0081\3\2\2\2\26\u008a\3\2")
- buf.write("\2\2\30\u008c\3\2\2\2\32\u0093\3\2\2\2\34\u0095\3\2\2")
- buf.write("\2\36\u009a\3\2\2\2 \u00a0\3\2\2\2\"\u00ae\3\2\2\2$\u00b6")
- buf.write("\3\2\2\2&\u00c5\3\2\2\2(\u00c8\3\2\2\2*\u00d4\3\2\2\2")
- buf.write(",\60\5\4\3\2-/\5\n\6\2.-\3\2\2\2/\62\3\2\2\2\60.\3\2\2")
- buf.write("\2\60\61\3\2\2\2\61\3\3\2\2\2\62\60\3\2\2\2\63\67\5\b")
- buf.write("\5\2\64\66\5\6\4\2\65\64\3\2\2\2\669\3\2\2\2\67\65\3\2")
- buf.write("\2\2\678\3\2\2\28\5\3\2\2\29\67\3\2\2\2:;\7\3\2\2;<\7")
- buf.write("\36\2\2<>\7\37\2\2=?\7\4\2\2>=\3\2\2\2>?\3\2\2\2?\7\3")
- buf.write("\2\2\2@B\7 \2\2A@\3\2\2\2AB\3\2\2\2BC\3\2\2\2CD\7\5\2")
- buf.write("\2DE\7\36\2\2EG\7\37\2\2FH\7\4\2\2GF\3\2\2\2GH\3\2\2\2")
- buf.write("H\t\3\2\2\2IM\5\f\7\2JM\5 \21\2KM\5$\23\2LI\3\2\2\2LJ")
- buf.write("\3\2\2\2LK\3\2\2\2M\13\3\2\2\2NP\7 \2\2ON\3\2\2\2OP\3")
- buf.write("\2\2\2PQ\3\2\2\2QR\7\6\2\2RS\7\36\2\2SW\7\7\2\2TV\5\16")
- buf.write("\b\2UT\3\2\2\2VY\3\2\2\2WU\3\2\2\2WX\3\2\2\2XZ\3\2\2\2")
- buf.write("YW\3\2\2\2Z[\7\b\2\2[\r\3\2\2\2\\_\5\20\t\2]_\5\22\n\2")
- buf.write("^\\\3\2\2\2^]\3\2\2\2_\17\3\2\2\2`b\7 \2\2a`\3\2\2\2a")
- buf.write("b\3\2\2\2bd\3\2\2\2ce\7\t\2\2dc\3\2\2\2de\3\2\2\2eh\3")
- buf.write("\2\2\2fi\5\26\f\2gi\7\n\2\2hf\3\2\2\2hg\3\2\2\2ij\3\2")
- buf.write("\2\2jk\7\36\2\2ko\7\13\2\2ln\5\24\13\2ml\3\2\2\2nq\3\2")
- buf.write("\2\2om\3\2\2\2op\3\2\2\2pr\3\2\2\2qo\3\2\2\2rt\7\f\2\2")
- buf.write("su\7\4\2\2ts\3\2\2\2tu\3\2\2\2u\21\3\2\2\2vx\7 \2\2wv")
- buf.write("\3\2\2\2wx\3\2\2\2xz\3\2\2\2y{\7\r\2\2zy\3\2\2\2z{\3\2")
- buf.write("\2\2{|\3\2\2\2|}\5\26\f\2}\177\7\36\2\2~\u0080\7\4\2\2")
- buf.write("\177~\3\2\2\2\177\u0080\3\2\2\2\u0080\23\3\2\2\2\u0081")
- buf.write("\u0082\5\26\f\2\u0082\u0084\7\36\2\2\u0083\u0085\7\16")
- buf.write("\2\2\u0084\u0083\3\2\2\2\u0084\u0085\3\2\2\2\u0085\25")
- buf.write("\3\2\2\2\u0086\u008b\5\32\16\2\u0087\u008b\5\30\r\2\u0088")
- buf.write("\u008b\5\34\17\2\u0089\u008b\5\36\20\2\u008a\u0086\3\2")
- buf.write("\2\2\u008a\u0087\3\2\2\2\u008a\u0088\3\2\2\2\u008a\u0089")
- buf.write("\3\2\2\2\u008b\27\3\2\2\2\u008c\u008d\7\36\2\2\u008d\31")
- buf.write("\3\2\2\2\u008e\u0094\7\17\2\2\u008f\u0094\7\20\2\2\u0090")
- buf.write("\u0094\7\21\2\2\u0091\u0094\7\22\2\2\u0092\u0094\7\23")
- buf.write("\2\2\u0093\u008e\3\2\2\2\u0093\u008f\3\2\2\2\u0093\u0090")
- buf.write("\3\2\2\2\u0093\u0091\3\2\2\2\u0093\u0092\3\2\2\2\u0094")
- buf.write("\33\3\2\2\2\u0095\u0096\7\24\2\2\u0096\u0097\7\25\2\2")
- buf.write("\u0097\u0098\5\26\f\2\u0098\u0099\7\26\2\2\u0099\35\3")
- buf.write("\2\2\2\u009a\u009b\7\27\2\2\u009b\u009c\7\25\2\2\u009c")
- buf.write("\u009d\5\26\f\2\u009d\u009e\7\26\2\2\u009e\37\3\2\2\2")
- buf.write("\u009f\u00a1\7 \2\2\u00a0\u009f\3\2\2\2\u00a0\u00a1\3")
- buf.write("\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\u00a3\7\30\2\2\u00a3")
- buf.write("\u00a4\7\36\2\2\u00a4\u00a8\7\7\2\2\u00a5\u00a7\5\"\22")
- buf.write("\2\u00a6\u00a5\3\2\2\2\u00a7\u00aa\3\2\2\2\u00a8\u00a6")
- buf.write("\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9\u00ab\3\2\2\2\u00aa")
- buf.write("\u00a8\3\2\2\2\u00ab\u00ac\7\b\2\2\u00ac!\3\2\2\2\u00ad")
- buf.write("\u00af\7 \2\2\u00ae\u00ad\3\2\2\2\u00ae\u00af\3\2\2\2")
- buf.write("\u00af\u00b0\3\2\2\2\u00b0\u00b1\5\26\f\2\u00b1\u00b3")
- buf.write("\7\36\2\2\u00b2\u00b4\7\4\2\2\u00b3\u00b2\3\2\2\2\u00b3")
- buf.write("\u00b4\3\2\2\2\u00b4#\3\2\2\2\u00b5\u00b7\7 \2\2\u00b6")
- buf.write("\u00b5\3\2\2\2\u00b6\u00b7\3\2\2\2\u00b7\u00b8\3\2\2\2")
- buf.write("\u00b8\u00b9\5&\24\2\u00b9\u00ba\7\36\2\2\u00ba\u00be")
- buf.write("\7\7\2\2\u00bb\u00bd\5(\25\2\u00bc\u00bb\3\2\2\2\u00bd")
- buf.write("\u00c0\3\2\2\2\u00be\u00bc\3\2\2\2\u00be\u00bf\3\2\2\2")
- buf.write("\u00bf\u00c1\3\2\2\2\u00c0\u00be\3\2\2\2\u00c1\u00c2\7")
- buf.write("\b\2\2\u00c2%\3\2\2\2\u00c3\u00c6\7\31\2\2\u00c4\u00c6")
- buf.write("\7\32\2\2\u00c5\u00c3\3\2\2\2\u00c5\u00c4\3\2\2\2\u00c6")
- buf.write("\'\3\2\2\2\u00c7\u00c9\7 \2\2\u00c8\u00c7\3\2\2\2\u00c8")
- buf.write("\u00c9\3\2\2\2\u00c9\u00ca\3\2\2\2\u00ca\u00cd\7\36\2")
- buf.write("\2\u00cb\u00cc\7\33\2\2\u00cc\u00ce\5*\26\2\u00cd\u00cb")
- buf.write("\3\2\2\2\u00cd\u00ce\3\2\2\2\u00ce\u00d0\3\2\2\2\u00cf")
- buf.write("\u00d1\7\16\2\2\u00d0\u00cf\3\2\2\2\u00d0\u00d1\3\2\2")
- buf.write("\2\u00d1)\3\2\2\2\u00d2\u00d5\7\34\2\2\u00d3\u00d5\7\35")
- buf.write("\2\2\u00d4\u00d2\3\2\2\2\u00d4\u00d3\3\2\2\2\u00d5+\3")
- buf.write("\2\2\2!\60\67>AGLOW^adhotwz\177\u0084\u008a\u0093\u00a0")
- buf.write("\u00a8\u00ae\u00b3\u00b6\u00be\u00c5\u00c8\u00cd\u00d0")
- buf.write("\u00d4")
- return buf.getvalue()
-
-
-class TParser ( Parser ):
-
- grammarFileName = "T.g4"
-
- atn = ATNDeserializer().deserialize(serializedATN())
-
- decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
-
- sharedContextCache = PredictionContextCache()
-
- literalNames = [ "<INVALID>", "'import'", "';'", "'module'", "'interface'",
- "'{'", "'}'", "'event'", "'void'", "'('", "')'", "'readonly'",
- "','", "'bool'", "'int'", "'real'", "'string'", "'var'",
- "'list'", "'<'", "'>'", "'model'", "'struct'", "'enum'",
- "'flag'", "'='" ]
-
- symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
- "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
- "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
- "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
- "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
- "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
- "<INVALID>", "<INVALID>", "INTCONSTANT", "HEXCONSTANT",
- "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE",
- "COMMENT", "MULTICOMM" ]
-
- RULE_documentSymbol = 0
- RULE_headerSymbol = 1
- RULE_importSymbol = 2
- RULE_moduleSymbol = 3
- RULE_definitionSymbol = 4
- RULE_interfaceSymbol = 5
- RULE_interfaceMemberSymbol = 6
- RULE_operationSymbol = 7
- RULE_propertySymbol = 8
- RULE_operationParameterSymbol = 9
- RULE_typeSymbol = 10
- RULE_complexTypeSymbol = 11
- RULE_primitiveTypeSymbol = 12
- RULE_listTypeSymbol = 13
- RULE_modelTypeSymbol = 14
- RULE_structSymbol = 15
- RULE_structFieldSymbol = 16
- RULE_enumSymbol = 17
- RULE_enumTypeSymbol = 18
- RULE_enumMemberSymbol = 19
- RULE_intSymbol = 20
-
- ruleNames = [ "documentSymbol", "headerSymbol", "importSymbol", "moduleSymbol",
- "definitionSymbol", "interfaceSymbol", "interfaceMemberSymbol",
- "operationSymbol", "propertySymbol", "operationParameterSymbol",
- "typeSymbol", "complexTypeSymbol", "primitiveTypeSymbol",
- "listTypeSymbol", "modelTypeSymbol", "structSymbol",
- "structFieldSymbol", "enumSymbol", "enumTypeSymbol",
- "enumMemberSymbol", "intSymbol" ]
-
- EOF = Token.EOF
- T__0=1
- T__1=2
- T__2=3
- T__3=4
- T__4=5
- T__5=6
- T__6=7
- T__7=8
- T__8=9
- T__9=10
- T__10=11
- T__11=12
- T__12=13
- T__13=14
- T__14=15
- T__15=16
- T__16=17
- T__17=18
- T__18=19
- T__19=20
- T__20=21
- T__21=22
- T__22=23
- T__23=24
- T__24=25
- INTCONSTANT=26
- HEXCONSTANT=27
- IDENTIFIER=28
- VERSION=29
- DOCCOMMENT=30
- WHITESPACE=31
- COMMENT=32
- MULTICOMM=33
-
- def __init__(self, input:TokenStream):
- super().__init__(input)
- self.checkVersion("4.5.3")
- self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
- self._predicates = None
-
-
-
- class DocumentSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
-
- def headerSymbol(self):
- return self.getTypedRuleContext(TParser.HeaderSymbolContext,0)
-
-
- def definitionSymbol(self, i:int=None):
- if i is None:
- return self.getTypedRuleContexts(TParser.DefinitionSymbolContext)
- else:
- return self.getTypedRuleContext(TParser.DefinitionSymbolContext,i)
-
-
- def getRuleIndex(self):
- return TParser.RULE_documentSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterDocumentSymbol" ):
- listener.enterDocumentSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitDocumentSymbol" ):
- listener.exitDocumentSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitDocumentSymbol" ):
- return visitor.visitDocumentSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def documentSymbol(self):
-
- localctx = TParser.DocumentSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 0, self.RULE_documentSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 42
- self.headerSymbol()
- self.state = 46
- self._errHandler.sync(self)
- _la = self._input.LA(1)
- while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__3) | (1 << TParser.T__21) | (1 << TParser.T__22) | (1 << TParser.T__23) | (1 << TParser.DOCCOMMENT))) != 0):
- self.state = 43
- self.definitionSymbol()
- self.state = 48
- self._errHandler.sync(self)
- _la = self._input.LA(1)
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class HeaderSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
-
- def moduleSymbol(self):
- return self.getTypedRuleContext(TParser.ModuleSymbolContext,0)
-
-
- def importSymbol(self, i:int=None):
- if i is None:
- return self.getTypedRuleContexts(TParser.ImportSymbolContext)
- else:
- return self.getTypedRuleContext(TParser.ImportSymbolContext,i)
-
-
- def getRuleIndex(self):
- return TParser.RULE_headerSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterHeaderSymbol" ):
- listener.enterHeaderSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitHeaderSymbol" ):
- listener.exitHeaderSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitHeaderSymbol" ):
- return visitor.visitHeaderSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def headerSymbol(self):
-
- localctx = TParser.HeaderSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 2, self.RULE_headerSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 49
- self.moduleSymbol()
- self.state = 53
- self._errHandler.sync(self)
- _la = self._input.LA(1)
- while _la==TParser.T__0:
- self.state = 50
- self.importSymbol()
- self.state = 55
- self._errHandler.sync(self)
- _la = self._input.LA(1)
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class ImportSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.name = None # Token
- self.version = None # Token
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def VERSION(self):
- return self.getToken(TParser.VERSION, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_importSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterImportSymbol" ):
- listener.enterImportSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitImportSymbol" ):
- listener.exitImportSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitImportSymbol" ):
- return visitor.visitImportSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def importSymbol(self):
-
- localctx = TParser.ImportSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 4, self.RULE_importSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 56
- self.match(TParser.T__0)
- self.state = 57
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 58
- localctx.version = self.match(TParser.VERSION)
- self.state = 60
- _la = self._input.LA(1)
- if _la==TParser.T__1:
- self.state = 59
- self.match(TParser.T__1)
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class ModuleSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.name = None # Token
- self.version = None # Token
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def VERSION(self):
- return self.getToken(TParser.VERSION, 0)
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_moduleSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterModuleSymbol" ):
- listener.enterModuleSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitModuleSymbol" ):
- listener.exitModuleSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitModuleSymbol" ):
- return visitor.visitModuleSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def moduleSymbol(self):
-
- localctx = TParser.ModuleSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 6, self.RULE_moduleSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 63
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 62
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 65
- self.match(TParser.T__2)
- self.state = 66
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 67
- localctx.version = self.match(TParser.VERSION)
- self.state = 69
- _la = self._input.LA(1)
- if _la==TParser.T__1:
- self.state = 68
- self.match(TParser.T__1)
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class DefinitionSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
-
- def interfaceSymbol(self):
- return self.getTypedRuleContext(TParser.InterfaceSymbolContext,0)
-
-
- def structSymbol(self):
- return self.getTypedRuleContext(TParser.StructSymbolContext,0)
-
-
- def enumSymbol(self):
- return self.getTypedRuleContext(TParser.EnumSymbolContext,0)
-
-
- def getRuleIndex(self):
- return TParser.RULE_definitionSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterDefinitionSymbol" ):
- listener.enterDefinitionSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitDefinitionSymbol" ):
- listener.exitDefinitionSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitDefinitionSymbol" ):
- return visitor.visitDefinitionSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def definitionSymbol(self):
-
- localctx = TParser.DefinitionSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 8, self.RULE_definitionSymbol)
- try:
- self.state = 74
- self._errHandler.sync(self);
- la_ = self._interp.adaptivePredict(self._input,5,self._ctx)
- if la_ == 1:
- self.enterOuterAlt(localctx, 1)
- self.state = 71
- self.interfaceSymbol()
- pass
-
- elif la_ == 2:
- self.enterOuterAlt(localctx, 2)
- self.state = 72
- self.structSymbol()
- pass
-
- elif la_ == 3:
- self.enterOuterAlt(localctx, 3)
- self.state = 73
- self.enumSymbol()
- pass
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class InterfaceSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.name = None # Token
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def interfaceMemberSymbol(self, i:int=None):
- if i is None:
- return self.getTypedRuleContexts(TParser.InterfaceMemberSymbolContext)
- else:
- return self.getTypedRuleContext(TParser.InterfaceMemberSymbolContext,i)
-
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_interfaceSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterInterfaceSymbol" ):
- listener.enterInterfaceSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitInterfaceSymbol" ):
- listener.exitInterfaceSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitInterfaceSymbol" ):
- return visitor.visitInterfaceSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def interfaceSymbol(self):
-
- localctx = TParser.InterfaceSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 10, self.RULE_interfaceSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 77
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 76
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 79
- self.match(TParser.T__3)
- self.state = 80
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 81
- self.match(TParser.T__4)
- self.state = 85
- self._errHandler.sync(self)
- _la = self._input.LA(1)
- while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__6) | (1 << TParser.T__7) | (1 << TParser.T__10) | (1 << TParser.T__12) | (1 << TParser.T__13) | (1 << TParser.T__14) | (1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__20) | (1 << TParser.IDENTIFIER) | (1 << TParser.DOCCOMMENT))) != 0):
- self.state = 82
- self.interfaceMemberSymbol()
- self.state = 87
- self._errHandler.sync(self)
- _la = self._input.LA(1)
-
- self.state = 88
- self.match(TParser.T__5)
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class InterfaceMemberSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
-
- def operationSymbol(self):
- return self.getTypedRuleContext(TParser.OperationSymbolContext,0)
-
-
- def propertySymbol(self):
- return self.getTypedRuleContext(TParser.PropertySymbolContext,0)
-
-
- def getRuleIndex(self):
- return TParser.RULE_interfaceMemberSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterInterfaceMemberSymbol" ):
- listener.enterInterfaceMemberSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitInterfaceMemberSymbol" ):
- listener.exitInterfaceMemberSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitInterfaceMemberSymbol" ):
- return visitor.visitInterfaceMemberSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def interfaceMemberSymbol(self):
-
- localctx = TParser.InterfaceMemberSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 12, self.RULE_interfaceMemberSymbol)
- try:
- self.state = 92
- self._errHandler.sync(self);
- la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
- if la_ == 1:
- self.enterOuterAlt(localctx, 1)
- self.state = 90
- self.operationSymbol()
- pass
-
- elif la_ == 2:
- self.enterOuterAlt(localctx, 2)
- self.state = 91
- self.propertySymbol()
- pass
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class OperationSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.isEvent = None # Token
- self.name = None # Token
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def typeSymbol(self):
- return self.getTypedRuleContext(TParser.TypeSymbolContext,0)
-
-
- def operationParameterSymbol(self, i:int=None):
- if i is None:
- return self.getTypedRuleContexts(TParser.OperationParameterSymbolContext)
- else:
- return self.getTypedRuleContext(TParser.OperationParameterSymbolContext,i)
-
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_operationSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterOperationSymbol" ):
- listener.enterOperationSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitOperationSymbol" ):
- listener.exitOperationSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitOperationSymbol" ):
- return visitor.visitOperationSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def operationSymbol(self):
-
- localctx = TParser.OperationSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 14, self.RULE_operationSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 95
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 94
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 98
- _la = self._input.LA(1)
- if _la==TParser.T__6:
- self.state = 97
- localctx.isEvent = self.match(TParser.T__6)
-
-
- self.state = 102
- token = self._input.LA(1)
- if token in [TParser.T__12, TParser.T__13, TParser.T__14, TParser.T__15, TParser.T__16, TParser.T__17, TParser.T__20, TParser.IDENTIFIER]:
- self.state = 100
- self.typeSymbol()
-
- elif token in [TParser.T__7]:
- self.state = 101
- self.match(TParser.T__7)
-
- else:
- raise NoViableAltException(self)
-
- self.state = 104
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 105
- self.match(TParser.T__8)
- self.state = 109
- self._errHandler.sync(self)
- _la = self._input.LA(1)
- while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__12) | (1 << TParser.T__13) | (1 << TParser.T__14) | (1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__20) | (1 << TParser.IDENTIFIER))) != 0):
- self.state = 106
- self.operationParameterSymbol()
- self.state = 111
- self._errHandler.sync(self)
- _la = self._input.LA(1)
-
- self.state = 112
- self.match(TParser.T__9)
- self.state = 114
- _la = self._input.LA(1)
- if _la==TParser.T__1:
- self.state = 113
- self.match(TParser.T__1)
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class PropertySymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.isReadOnly = None # Token
- self.name = None # Token
-
- def typeSymbol(self):
- return self.getTypedRuleContext(TParser.TypeSymbolContext,0)
-
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_propertySymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterPropertySymbol" ):
- listener.enterPropertySymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitPropertySymbol" ):
- listener.exitPropertySymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitPropertySymbol" ):
- return visitor.visitPropertySymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def propertySymbol(self):
-
- localctx = TParser.PropertySymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 16, self.RULE_propertySymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 117
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 116
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 120
- _la = self._input.LA(1)
- if _la==TParser.T__10:
- self.state = 119
- localctx.isReadOnly = self.match(TParser.T__10)
-
-
- self.state = 122
- self.typeSymbol()
- self.state = 123
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 125
- _la = self._input.LA(1)
- if _la==TParser.T__1:
- self.state = 124
- self.match(TParser.T__1)
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class OperationParameterSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.name = None # Token
-
- def typeSymbol(self):
- return self.getTypedRuleContext(TParser.TypeSymbolContext,0)
-
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_operationParameterSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterOperationParameterSymbol" ):
- listener.enterOperationParameterSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitOperationParameterSymbol" ):
- listener.exitOperationParameterSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitOperationParameterSymbol" ):
- return visitor.visitOperationParameterSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def operationParameterSymbol(self):
-
- localctx = TParser.OperationParameterSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 18, self.RULE_operationParameterSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 127
- self.typeSymbol()
- self.state = 128
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 130
- _la = self._input.LA(1)
- if _la==TParser.T__11:
- self.state = 129
- self.match(TParser.T__11)
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class TypeSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
-
- def primitiveTypeSymbol(self):
- return self.getTypedRuleContext(TParser.PrimitiveTypeSymbolContext,0)
-
-
- def complexTypeSymbol(self):
- return self.getTypedRuleContext(TParser.ComplexTypeSymbolContext,0)
-
-
- def listTypeSymbol(self):
- return self.getTypedRuleContext(TParser.ListTypeSymbolContext,0)
-
-
- def modelTypeSymbol(self):
- return self.getTypedRuleContext(TParser.ModelTypeSymbolContext,0)
-
-
- def getRuleIndex(self):
- return TParser.RULE_typeSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterTypeSymbol" ):
- listener.enterTypeSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitTypeSymbol" ):
- listener.exitTypeSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitTypeSymbol" ):
- return visitor.visitTypeSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def typeSymbol(self):
-
- localctx = TParser.TypeSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 20, self.RULE_typeSymbol)
- try:
- self.state = 136
- token = self._input.LA(1)
- if token in [TParser.T__12, TParser.T__13, TParser.T__14, TParser.T__15, TParser.T__16]:
- self.enterOuterAlt(localctx, 1)
- self.state = 132
- self.primitiveTypeSymbol()
-
- elif token in [TParser.IDENTIFIER]:
- self.enterOuterAlt(localctx, 2)
- self.state = 133
- self.complexTypeSymbol()
-
- elif token in [TParser.T__17]:
- self.enterOuterAlt(localctx, 3)
- self.state = 134
- self.listTypeSymbol()
-
- elif token in [TParser.T__20]:
- self.enterOuterAlt(localctx, 4)
- self.state = 135
- self.modelTypeSymbol()
-
- else:
- raise NoViableAltException(self)
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class ComplexTypeSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.name = None # Token
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_complexTypeSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterComplexTypeSymbol" ):
- listener.enterComplexTypeSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitComplexTypeSymbol" ):
- listener.exitComplexTypeSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitComplexTypeSymbol" ):
- return visitor.visitComplexTypeSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def complexTypeSymbol(self):
-
- localctx = TParser.ComplexTypeSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 22, self.RULE_complexTypeSymbol)
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 138
- localctx.name = self.match(TParser.IDENTIFIER)
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class PrimitiveTypeSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.name = None # Token
-
-
- def getRuleIndex(self):
- return TParser.RULE_primitiveTypeSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterPrimitiveTypeSymbol" ):
- listener.enterPrimitiveTypeSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitPrimitiveTypeSymbol" ):
- listener.exitPrimitiveTypeSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitPrimitiveTypeSymbol" ):
- return visitor.visitPrimitiveTypeSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def primitiveTypeSymbol(self):
-
- localctx = TParser.PrimitiveTypeSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 24, self.RULE_primitiveTypeSymbol)
- try:
- self.state = 145
- token = self._input.LA(1)
- if token in [TParser.T__12]:
- self.enterOuterAlt(localctx, 1)
- self.state = 140
- localctx.name = self.match(TParser.T__12)
-
- elif token in [TParser.T__13]:
- self.enterOuterAlt(localctx, 2)
- self.state = 141
- localctx.name = self.match(TParser.T__13)
-
- elif token in [TParser.T__14]:
- self.enterOuterAlt(localctx, 3)
- self.state = 142
- localctx.name = self.match(TParser.T__14)
-
- elif token in [TParser.T__15]:
- self.enterOuterAlt(localctx, 4)
- self.state = 143
- localctx.name = self.match(TParser.T__15)
-
- elif token in [TParser.T__16]:
- self.enterOuterAlt(localctx, 5)
- self.state = 144
- localctx.name = self.match(TParser.T__16)
-
- else:
- raise NoViableAltException(self)
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class ListTypeSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.valueType = None # TypeSymbolContext
-
- def typeSymbol(self):
- return self.getTypedRuleContext(TParser.TypeSymbolContext,0)
-
-
- def getRuleIndex(self):
- return TParser.RULE_listTypeSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterListTypeSymbol" ):
- listener.enterListTypeSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitListTypeSymbol" ):
- listener.exitListTypeSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitListTypeSymbol" ):
- return visitor.visitListTypeSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def listTypeSymbol(self):
-
- localctx = TParser.ListTypeSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 26, self.RULE_listTypeSymbol)
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 147
- self.match(TParser.T__17)
- self.state = 148
- self.match(TParser.T__18)
- self.state = 149
- localctx.valueType = self.typeSymbol()
- self.state = 150
- self.match(TParser.T__19)
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class ModelTypeSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.valueType = None # TypeSymbolContext
-
- def typeSymbol(self):
- return self.getTypedRuleContext(TParser.TypeSymbolContext,0)
-
-
- def getRuleIndex(self):
- return TParser.RULE_modelTypeSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterModelTypeSymbol" ):
- listener.enterModelTypeSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitModelTypeSymbol" ):
- listener.exitModelTypeSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitModelTypeSymbol" ):
- return visitor.visitModelTypeSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def modelTypeSymbol(self):
-
- localctx = TParser.ModelTypeSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 28, self.RULE_modelTypeSymbol)
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 152
- self.match(TParser.T__20)
- self.state = 153
- self.match(TParser.T__18)
- self.state = 154
- localctx.valueType = self.typeSymbol()
- self.state = 155
- self.match(TParser.T__19)
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class StructSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.name = None # Token
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def structFieldSymbol(self, i:int=None):
- if i is None:
- return self.getTypedRuleContexts(TParser.StructFieldSymbolContext)
- else:
- return self.getTypedRuleContext(TParser.StructFieldSymbolContext,i)
-
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_structSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterStructSymbol" ):
- listener.enterStructSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitStructSymbol" ):
- listener.exitStructSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitStructSymbol" ):
- return visitor.visitStructSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def structSymbol(self):
-
- localctx = TParser.StructSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 30, self.RULE_structSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 158
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 157
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 160
- self.match(TParser.T__21)
- self.state = 161
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 162
- self.match(TParser.T__4)
- self.state = 166
- self._errHandler.sync(self)
- _la = self._input.LA(1)
- while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__12) | (1 << TParser.T__13) | (1 << TParser.T__14) | (1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__20) | (1 << TParser.IDENTIFIER) | (1 << TParser.DOCCOMMENT))) != 0):
- self.state = 163
- self.structFieldSymbol()
- self.state = 168
- self._errHandler.sync(self)
- _la = self._input.LA(1)
-
- self.state = 169
- self.match(TParser.T__5)
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class StructFieldSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.name = None # Token
-
- def typeSymbol(self):
- return self.getTypedRuleContext(TParser.TypeSymbolContext,0)
-
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_structFieldSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterStructFieldSymbol" ):
- listener.enterStructFieldSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitStructFieldSymbol" ):
- listener.exitStructFieldSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitStructFieldSymbol" ):
- return visitor.visitStructFieldSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def structFieldSymbol(self):
-
- localctx = TParser.StructFieldSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 32, self.RULE_structFieldSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 172
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 171
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 174
- self.typeSymbol()
- self.state = 175
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 177
- _la = self._input.LA(1)
- if _la==TParser.T__1:
- self.state = 176
- self.match(TParser.T__1)
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class EnumSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.name = None # Token
-
- def enumTypeSymbol(self):
- return self.getTypedRuleContext(TParser.EnumTypeSymbolContext,0)
-
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def enumMemberSymbol(self, i:int=None):
- if i is None:
- return self.getTypedRuleContexts(TParser.EnumMemberSymbolContext)
- else:
- return self.getTypedRuleContext(TParser.EnumMemberSymbolContext,i)
-
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_enumSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterEnumSymbol" ):
- listener.enterEnumSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitEnumSymbol" ):
- listener.exitEnumSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitEnumSymbol" ):
- return visitor.visitEnumSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def enumSymbol(self):
-
- localctx = TParser.EnumSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 34, self.RULE_enumSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 180
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 179
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 182
- self.enumTypeSymbol()
- self.state = 183
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 184
- self.match(TParser.T__4)
- self.state = 188
- self._errHandler.sync(self)
- _la = self._input.LA(1)
- while _la==TParser.IDENTIFIER or _la==TParser.DOCCOMMENT:
- self.state = 185
- self.enumMemberSymbol()
- self.state = 190
- self._errHandler.sync(self)
- _la = self._input.LA(1)
-
- self.state = 191
- self.match(TParser.T__5)
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class EnumTypeSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.isEnum = None # Token
- self.isFlag = None # Token
-
-
- def getRuleIndex(self):
- return TParser.RULE_enumTypeSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterEnumTypeSymbol" ):
- listener.enterEnumTypeSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitEnumTypeSymbol" ):
- listener.exitEnumTypeSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitEnumTypeSymbol" ):
- return visitor.visitEnumTypeSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def enumTypeSymbol(self):
-
- localctx = TParser.EnumTypeSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 36, self.RULE_enumTypeSymbol)
- try:
- self.state = 195
- token = self._input.LA(1)
- if token in [TParser.T__22]:
- self.enterOuterAlt(localctx, 1)
- self.state = 193
- localctx.isEnum = self.match(TParser.T__22)
-
- elif token in [TParser.T__23]:
- self.enterOuterAlt(localctx, 2)
- self.state = 194
- localctx.isFlag = self.match(TParser.T__23)
-
- else:
- raise NoViableAltException(self)
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class EnumMemberSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.comment = None # Token
- self.name = None # Token
-
- def IDENTIFIER(self):
- return self.getToken(TParser.IDENTIFIER, 0)
-
- def intSymbol(self):
- return self.getTypedRuleContext(TParser.IntSymbolContext,0)
-
-
- def DOCCOMMENT(self):
- return self.getToken(TParser.DOCCOMMENT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_enumMemberSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterEnumMemberSymbol" ):
- listener.enterEnumMemberSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitEnumMemberSymbol" ):
- listener.exitEnumMemberSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitEnumMemberSymbol" ):
- return visitor.visitEnumMemberSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def enumMemberSymbol(self):
-
- localctx = TParser.EnumMemberSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 38, self.RULE_enumMemberSymbol)
- self._la = 0 # Token type
- try:
- self.enterOuterAlt(localctx, 1)
- self.state = 198
- _la = self._input.LA(1)
- if _la==TParser.DOCCOMMENT:
- self.state = 197
- localctx.comment = self.match(TParser.DOCCOMMENT)
-
-
- self.state = 200
- localctx.name = self.match(TParser.IDENTIFIER)
- self.state = 203
- _la = self._input.LA(1)
- if _la==TParser.T__24:
- self.state = 201
- self.match(TParser.T__24)
- self.state = 202
- self.intSymbol()
-
-
- self.state = 206
- _la = self._input.LA(1)
- if _la==TParser.T__11:
- self.state = 205
- self.match(TParser.T__11)
-
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
- class IntSymbolContext(ParserRuleContext):
-
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
- super().__init__(parent, invokingState)
- self.parser = parser
- self.value = None # Token
-
- def INTCONSTANT(self):
- return self.getToken(TParser.INTCONSTANT, 0)
-
- def HEXCONSTANT(self):
- return self.getToken(TParser.HEXCONSTANT, 0)
-
- def getRuleIndex(self):
- return TParser.RULE_intSymbol
-
- def enterRule(self, listener:ParseTreeListener):
- if hasattr( listener, "enterIntSymbol" ):
- listener.enterIntSymbol(self)
-
- def exitRule(self, listener:ParseTreeListener):
- if hasattr( listener, "exitIntSymbol" ):
- listener.exitIntSymbol(self)
-
- def accept(self, visitor:ParseTreeVisitor):
- if hasattr( visitor, "visitIntSymbol" ):
- return visitor.visitIntSymbol(self)
- else:
- return visitor.visitChildren(self)
-
-
-
-
- def intSymbol(self):
-
- localctx = TParser.IntSymbolContext(self, self._ctx, self.state)
- self.enterRule(localctx, 40, self.RULE_intSymbol)
- try:
- self.state = 210
- token = self._input.LA(1)
- if token in [TParser.INTCONSTANT]:
- self.enterOuterAlt(localctx, 1)
- self.state = 208
- localctx.value = self.match(TParser.INTCONSTANT)
-
- elif token in [TParser.HEXCONSTANT]:
- self.enterOuterAlt(localctx, 2)
- self.state = 209
- localctx.value = self.match(TParser.HEXCONSTANT)
-
- else:
- raise NoViableAltException(self)
-
- except RecognitionException as re:
- localctx.exception = re
- self._errHandler.reportError(self, re)
- self._errHandler.recover(self, re)
- finally:
- self.exitRule()
- return localctx
-
-
-
-
-
diff --git a/qface/idl/parser/TVisitor.py b/qface/idl/parser/TVisitor.py
deleted file mode 100644
index dee7f69..0000000
--- a/qface/idl/parser/TVisitor.py
+++ /dev/null
@@ -1,118 +0,0 @@
-# Generated from T.g4 by ANTLR 4.5.3
-from antlr4 import *
-if __name__ is not None and "." in __name__:
- from .TParser import TParser
-else:
- from TParser import TParser
-
-# This class defines a complete generic visitor for a parse tree produced by TParser.
-
-class TVisitor(ParseTreeVisitor):
-
- # Visit a parse tree produced by TParser#documentSymbol.
- def visitDocumentSymbol(self, ctx:TParser.DocumentSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#headerSymbol.
- def visitHeaderSymbol(self, ctx:TParser.HeaderSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#importSymbol.
- def visitImportSymbol(self, ctx:TParser.ImportSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#moduleSymbol.
- def visitModuleSymbol(self, ctx:TParser.ModuleSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#definitionSymbol.
- def visitDefinitionSymbol(self, ctx:TParser.DefinitionSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#interfaceSymbol.
- def visitInterfaceSymbol(self, ctx:TParser.InterfaceSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#interfaceMemberSymbol.
- def visitInterfaceMemberSymbol(self, ctx:TParser.InterfaceMemberSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#operationSymbol.
- def visitOperationSymbol(self, ctx:TParser.OperationSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#propertySymbol.
- def visitPropertySymbol(self, ctx:TParser.PropertySymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#operationParameterSymbol.
- def visitOperationParameterSymbol(self, ctx:TParser.OperationParameterSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#typeSymbol.
- def visitTypeSymbol(self, ctx:TParser.TypeSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#complexTypeSymbol.
- def visitComplexTypeSymbol(self, ctx:TParser.ComplexTypeSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#primitiveTypeSymbol.
- def visitPrimitiveTypeSymbol(self, ctx:TParser.PrimitiveTypeSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#listTypeSymbol.
- def visitListTypeSymbol(self, ctx:TParser.ListTypeSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#modelTypeSymbol.
- def visitModelTypeSymbol(self, ctx:TParser.ModelTypeSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#structSymbol.
- def visitStructSymbol(self, ctx:TParser.StructSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#structFieldSymbol.
- def visitStructFieldSymbol(self, ctx:TParser.StructFieldSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#enumSymbol.
- def visitEnumSymbol(self, ctx:TParser.EnumSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#enumTypeSymbol.
- def visitEnumTypeSymbol(self, ctx:TParser.EnumTypeSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#enumMemberSymbol.
- def visitEnumMemberSymbol(self, ctx:TParser.EnumMemberSymbolContext):
- return self.visitChildren(ctx)
-
-
- # Visit a parse tree produced by TParser#intSymbol.
- def visitIntSymbol(self, ctx:TParser.IntSymbolContext):
- return self.visitChildren(ctx)
-
-
-
-del TParser \ No newline at end of file
diff --git a/qface/idl/parser/__init__.py b/qface/idl/parser/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/qface/idl/parser/__init__.py
+++ /dev/null
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index d41297e..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-antlr4-python3-runtime
-jinja2
-click
-path.py
-watchdog
-pyyaml
-pytest
-ipdb
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 5719308..0000000
--- a/setup.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from setuptools import setup
-
-setup(
- name='qface',
- version='1.0',
- py_modules=['qface'],
- install_requires=[
- 'antlr4-python3-runtime',
- 'jinja2',
- 'click',
- 'path.py',
- 'watchdog',
- 'pyyaml',
- 'pytest',
- 'ipdb'
- ],
- entry_points='''
- [console_scripts]
- qface=cli:cli
- ''',
-)
diff --git a/tests/in/com.pelagicore.ivi.climate.qdl b/tests/in/com.pelagicore.ivi.climate.qdl
deleted file mode 100644
index 6414bb5..0000000
--- a/tests/in/com.pelagicore.ivi.climate.qdl
+++ /dev/null
@@ -1,111 +0,0 @@
-module com.pelagicore.ivi.climate 1.0;
-
-/*!
- * The ClimateControl provides a QML interface to the climate control
- * of the vehicle.
- */
-interface ClimateControl {
- /*!
- * Value is true if the air conditioning is enabled.
- */
- bool airConditioning;
- /*!
- * value holds the airflow directions
- */
- AirflowDirections airflowDirections;
- /*!
- * value is true if the heater is enabled.
- */
- bool heater;
- /*!
- * value holds the fan speed level, where the level can be between
- * minimumValue(off) to maximumValue (strongest).
- */
- int fanSpeedLevel;
- /*!
- * value holds the steering wheel heater level, where the level can
- * be between minimumValue(off) to maximumValue (warmest).
- */
- int steeringWheelHeater;
- /*!
- * value holds the target temperature of the zone expressed
- * in centigrades, where the temperature can be between
- * minimumValue(coolest) to maximumValue (warmest).
- */
- int targetTemperature;
- /*!
- * value holds the seat cooler level, where the level can be
- * between minimumValue(off) to maximumValue (coolest).
- */
- int seatCooler;
- /*!
- * value holds the seat heater level, where the level can be between
- * minimumValue(off) to maximumValue (warmest).
- */
- int seatHeater;
- /*!
- * value holds the outside temperature of the zone expressed in
- * centigrades, where the temperature can be between
- * minimumValue(coolest) to maximumValue (warmest).
- */
- int outsideTemperature;
- /*!
- * value is true if the zone synchronization is enabled.
- *
- * Which zones and properties are synchronized is controlled
- * by the backend implementing it.
- */
- bool zoneSynchronization;
- /*!
- * value is true if defrost is enabled. Usually that means that the fans
- * are on the highest level to remove ice from the windshield.
- */
- bool defrost;
- /*!
- * value holds the recirculation mode
- */
- RecirculationMode recirculationMode;
- /*!
- * value is true if the recirculation is currently running.
- */
- bool recirculation;
- /*!
- * value holds the sensitivity level of the recirculation
- * system when the recirculationMode is set to AutoRecirculation,
- * where the level can be between minimumValue(least sensitive)
- * to maximumValue(most sensitive).
- */
- int recirculationSensitivityLevel;
- /*!
- * value holds the climate mode
- */
- ClimateMode climateMode;
- /*!
- * value holds the intensity level of the fan when the climateMode
- * is set to AutoClimate, where the level can be between
- * minimumValue(least intensity) to maximumValue(most intensity).
- */
- int automaticClimateFanIntensityLevel;
-}
-
-flag AirflowDirection {
- Windshield = 1,
- Dashboard = 2,
- Floor = 4
-}
-
-enum RecirculationMode {
- RecirculationOff = 0x0,
- RecirculationOn = 0x1,
- AutoRecirculation = 0x2
-}
-
-enum ClimateMode {
- ClimateOff = 0x0,
- ClimateOn = 0x1,
- AutoClimate = 0x2
-}
-
-interface Extra {
-
-}
diff --git a/tests/in/com.pelagicore.ivi.tuner.qdl b/tests/in/com.pelagicore.ivi.tuner.qdl
deleted file mode 100644
index d6b742b..0000000
--- a/tests/in/com.pelagicore.ivi.tuner.qdl
+++ /dev/null
@@ -1,54 +0,0 @@
-module com.pelagicore.ivi.tuner 1.0;
-
-/*! Service Tuner */
-interface Tuner {
- /*! property currentStation */
- readonly Station currentStation;
- /*! operation nextStation */
- void nextStation();
- /*! operation previousStation */
- void previousStation();
- /*! operation updateCurrentStation */
- void updateCurrentStation(int stationId);
-
- list<int> primitiveList;
- list<Station> complexList;
- model<int> primitiveModel;
- model<Station> complexModel;
-}
-
-/*! enum State */
-enum State {
- /*! value State.Null */
- Null=0,
- /*! value State.Loading */
- Loading=1,
- /*! value State.Ready */
- Ready=2,
- /*! value State.Error */
- Error=3
-}
-
-/*! enum Waveband */
-enum Waveband {
- /*! value Waveband.FM */
- FM=0,
- /*! value Waveband.AM */
- AM=1
-}
-
-flag Features {
- Mono = 0x1,
- Stereo = 0x2,
-}
-
-/*! struct Station */
-struct Station {
- /*! member stationId */
- int stationId;
- /*! member name */
- string name;
-}
-
-
-
diff --git a/tests/in/com.pelagicore.one.qdl b/tests/in/com.pelagicore.one.qdl
deleted file mode 100644
index 9203d29..0000000
--- a/tests/in/com.pelagicore.one.qdl
+++ /dev/null
@@ -1,19 +0,0 @@
-module com.pelagicore.one 1.0;
-
-interface OneService {
- StringStruct message;
- list<StringStruct> messageList;
- model<StringStruct> messageModel;
- StringStruct echo(StringStruct message);
- event void echoMessage(StringStruct mnessage);
-
-}
-
-struct StringStruct {
- string text;
- NestedStruct nested;
-}
-
-struct NestedStruct {
- string value;
-}
diff --git a/tests/in/com.pelagicore.test.qdl b/tests/in/com.pelagicore.test.qdl
deleted file mode 100644
index 77687ef..0000000
--- a/tests/in/com.pelagicore.test.qdl
+++ /dev/null
@@ -1,44 +0,0 @@
-module com.pelagicore.test 1.0;
-
-import common 1.0;
-
-interface ContactService {
- State state;
- int intValue;
- readonly string stringValue;
- bool boolValue;
- real realValue;
- var varValue;
- Contact currentContact;
- common.Date today;
- example.Date tomorrow;
-
- void addContact(Contact contact);
- void removeContact(Contact contact);
- void updateContact(Contact contact);
-
- list<Contact> contactList;
- model<Contact> contactModel;
-}
-
-enum State {
- Null,
- Loading,
- Ready,
- Failure
-}
-
-flag Phase {
- PhaseOne,
- PhaseTwo,
- PhaseThree
-}
-
-/*!
- * The contact information
- */
-struct Contact {
- string name;
- int age;
- bool isMarried;
-}
diff --git a/tests/test_climate.py b/tests/test_climate.py
deleted file mode 100644
index 287b36a..0000000
--- a/tests/test_climate.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from qface.generator import FileSystem
-import logging
-import logging.config
-from pathlib import Path
-
-# logging.config.fileConfig('logging.ini')
-logging.basicConfig()
-
-log = logging.getLogger(__name__)
-
-inputPath = Path('tests/in')
-log.debug('input path folder: {0}'.format(inputPath.absolute()))
-
-
-def load_system():
- path = inputPath / 'com.pelagicore.ivi.climate.qdl'
- return FileSystem.parse_document(path)
-
-
-def test_interface():
- system = load_system()
- interface = system.lookup('com.pelagicore.ivi.climate.ClimateControl')
- assert interface.name == 'ClimateControl'
-
diff --git a/tests/test_generator.py b/tests/test_generator.py
deleted file mode 100644
index b37f0c9..0000000
--- a/tests/test_generator.py
+++ /dev/null
@@ -1,40 +0,0 @@
-from qface.generator import FileSystem, Generator
-import logging
-import logging.config
-from pathlib import Path
-
-# logging.config.fileConfig('logging.ini')
-logging.basicConfig()
-
-log = logging.getLogger(__name__)
-
-inputPath = Path('tests/in')
-log.debug('input path folder: {0}'.format(inputPath.absolute()))
-
-
-def loadSystem():
- path = inputPath / 'com.pelagicore.ivi.tuner.qdl'
- return FileSystem.parse_document(path)
-
-
-def test_gen_module():
- system = loadSystem()
- gen = Generator(searchpath='tests/templates')
- template = "{{module}}"
- module = system.lookup('com.pelagicore.ivi.tuner')
- text = gen.apply(template, {"module": module})
- assert text == 'com.pelagicore.ivi.tuner'
-
-
-def test_gen_interface():
- system = loadSystem()
- gen = Generator(searchpath='tests/templates')
- template = """
- {%- for interface in module.interfaces -%}
- {{interface}}
- {%- endfor -%}
- """
- module = system.lookup('com.pelagicore.ivi.tuner')
- text = gen.apply(template, {"module": module})
- assert text == 'Tuner'
-
diff --git a/tests/test_lookup.py b/tests/test_lookup.py
deleted file mode 100644
index d775dea..0000000
--- a/tests/test_lookup.py
+++ /dev/null
@@ -1,37 +0,0 @@
-from qface.idl.domain import System
-from qface.generator import FileSystem
-import logging
-import logging.config
-from pathlib import Path
-
-# logging.config.fileConfig('logging.ini')
-logging.basicConfig()
-
-log = logging.getLogger(__name__)
-
-inputPath = Path('tests/in')
-log.debug('input path folder: {0}'.format(inputPath.absolute()))
-
-
-def loadTuner():
- path = inputPath / 'com.pelagicore.ivi.tuner.qdl'
- return FileSystem.parse_document(path)
-
-
-def test_lookup():
- system = loadTuner()
- # lookup module
- module = system.lookup('com.pelagicore.ivi.tuner')
- assert module is module.lookup('com.pelagicore.ivi.tuner')
- # lookup service
- service = system.lookup('com.pelagicore.ivi.tuner.Tuner')
- assert service is module.lookup('Tuner')
-
- # lookup struct
- struct = system.lookup('com.pelagicore.ivi.tuner.Station')
- assert struct is module.lookup('Station')
-
- # lookup enum
- enum = system.lookup('com.pelagicore.ivi.tuner.Waveband')
- assert enum is module.lookup('Waveband')
-
diff --git a/tests/test_parser.py b/tests/test_parser.py
deleted file mode 100644
index 31beea2..0000000
--- a/tests/test_parser.py
+++ /dev/null
@@ -1,142 +0,0 @@
-from qface.idl.domain import System
-from qface.generator import FileSystem
-import logging
-import logging.config
-from pathlib import Path
-
-# logging.config.fileConfig('logging.ini')
-logging.basicConfig()
-
-log = logging.getLogger(__name__)
-
-inputPath = Path('tests/in')
-log.debug('input path folder: {0}'.format(inputPath.absolute()))
-
-
-def loadTuner():
- path = inputPath / 'com.pelagicore.ivi.tuner.qdl'
- return FileSystem.parse_document(path)
-
-
-def loadTest():
- path = inputPath / 'com.pelagicore.test.qdl'
- return FileSystem.parse_document(path)
-
-
-def test_parse():
- log.debug('test parse')
- names = FileSystem.find_files(inputPath, '*.qdl')
- # import pdb; pdb.set_trace()
- system = System()
- for name in names:
- log.debug('name: {0}'.format(name))
- FileSystem.parse_document(name, system)
-
-
-def test_module():
- system = loadTuner()
- assert len(system.modules) == 1
- module = system.lookup('com.pelagicore.ivi.tuner')
- assert module in system.modules
-
-
-def test_interface():
- system = loadTuner()
- module = system.lookup('com.pelagicore.ivi.tuner')
- interface = system.lookup('com.pelagicore.ivi.tuner.Tuner')
- assert interface in module.interfaces
- assert interface.comment == '/*! Service Tuner */'
-
-
-def test_property():
- system = loadTuner()
- interface = system.lookup('com.pelagicore.ivi.tuner.Tuner')
- module = system.lookup('com.pelagicore.ivi.tuner')
- property = interface._propertyMap['currentStation']
- assert property.type.name == 'Station'
- assert property.module == module
- assert property.type.qualified_name == 'com.pelagicore.ivi.tuner.Station'
- assert property.is_readonly
- assert property.comment == '/*! property currentStation */'
-
-
-def test_struct():
- system = loadTuner()
- module = system.lookup('com.pelagicore.ivi.tuner')
- symbol = system.lookup('com.pelagicore.ivi.tuner.Station')
- assert symbol.name == 'Station'
- assert symbol.module == module
- assert symbol.qualified_name == 'com.pelagicore.ivi.tuner.Station'
- assert symbol.comment == '/*! struct Station */'
-
-
-def test_enum():
- system = loadTuner()
- definition = system.lookup('com.pelagicore.ivi.tuner.Waveband')
- module = system.lookup('com.pelagicore.ivi.tuner')
- symbol = system.lookup('com.pelagicore.ivi.tuner.Waveband')
- assert definition == symbol
- assert symbol.name == 'Waveband'
- assert symbol.module == module
- assert symbol.qualified_name == 'com.pelagicore.ivi.tuner.Waveband'
- assert symbol.comment == '/*! enum Waveband */'
- assert symbol.is_enum
-
-
-def test_enum_counter():
- system = loadTest()
- enum = system.lookup('com.pelagicore.test.State')
- assert enum
- # import ipdb; ipdb.set_trace()
- assert enum._memberMap['Null'].value is 0
- assert enum._memberMap['Failure'].value is 3
-
-def test_flag_counter():
- system = loadTest()
- flag = system.lookup('com.pelagicore.test.Phase')
- assert flag
- # import ipdb; ipdb.set_trace()
- assert flag._memberMap['PhaseOne'].value is 1
- assert flag._memberMap['PhaseTwo'].value is 2
- assert flag._memberMap['PhaseThree'].value is 4
-
-def test_flag():
- system = loadTuner()
- symbol = system.lookup('com.pelagicore.ivi.tuner.Features')
- assert symbol.is_flag
-
-
-def test_list():
- system = loadTuner()
- interface = system.lookup('com.pelagicore.ivi.tuner.Tuner')
- property = interface._propertyMap['primitiveList']
- assert property.type.name == 'list'
- assert property.type.is_list is True
- assert property.type.nested.is_primitive
- assert property.type.nested.name == 'int'
-
- property = interface._propertyMap['complexList']
- assert property.type.name == 'list'
- assert property.type.is_list is True
- assert property.type.nested.is_complex
- assert property.type.nested.name == 'Station'
-
-
-def test_model():
- system = loadTuner()
- interface = system.lookup('com.pelagicore.ivi.tuner.Tuner')
- property = interface._propertyMap['primitiveModel']
- assert property.type.name == 'model'
- assert property.type.is_model is True
- assert property.type.nested.is_primitive
- assert property.type.nested.name == 'int'
-
- property = interface._propertyMap['complexModel']
- assert property.type.name == 'model'
- assert property.type.is_model is True
- assert property.type.nested.is_complex
- assert property.type.nested.name == 'Station'
-
-
-
-
diff --git a/tests/test_validation.py b/tests/test_validation.py
deleted file mode 100644
index 98fa949..0000000
--- a/tests/test_validation.py
+++ /dev/null
@@ -1,64 +0,0 @@
-from qface.idl.domain import System
-from qface.generator import FileSystem
-import logging
-import logging.config
-from pathlib import Path
-
-# logging.config.fileConfig('logging.ini')
-logging.basicConfig()
-
-log = logging.getLogger(__name__)
-
-inputPath = Path('tests/in')
-log.debug('input path folder: {0}'.format(inputPath.absolute()))
-
-
-def loadOne():
- path = inputPath / 'com.pelagicore.one.qdl'
- return FileSystem.parse_document(path)
-
-
-def test_resolve():
- system = loadOne()
- module = system.lookup('com.pelagicore.one')
- assert module
- service = module.lookup('OneService')
- assert service
- operation = service._operationMap['echo']
- assert operation
- struct = module.lookup('StringStruct')
- assert struct
- assert operation.type.reference is struct
-
- parameter = operation._parameterMap['message']
- assert parameter
- assert parameter.type.reference is struct
-
- property = service._propertyMap['message']
- assert property
-
- assert property.type.reference is struct
-
-
-def test_resolve_nested():
- system = loadOne()
- module = system.lookup('com.pelagicore.one')
- assert module
- struct = module.lookup('com.pelagicore.one.StringStruct')
- nested = module.lookup('com.pelagicore.one.NestedStruct')
- assert struct and nested
- member = struct._fieldMap['nested']
- assert member
- assert member.type.reference is nested
-
- service = module.lookup('com.pelagicore.one.OneService')
- assert service
- listProperty = service._propertyMap['messageList']
- assert listProperty
- assert listProperty.type.nested.reference is struct
-
- modelProperty = service._propertyMap['messageModel']
- assert modelProperty
- assert modelProperty.type.nested.reference is struct
-
-